222 Commits

Author SHA1 Message Date
Paul "LeoNerd" Evans
63119ccaf3 Added __CLASS__ keyword, which yields the runtime class name of the invoking instance 2023-08-02 13:38:25 +01:00
Paul "LeoNerd" Evans
054ceeebc7 Accept field VAR = EXPR on field vars
Allows non-constant expressions with side effects. Evaluated during the
constructor of each instance.
2023-02-10 14:38:44 +00:00
Paul "LeoNerd" Evans
99b497aa90 Initial attack at basic 'class' feature
Adds a new experimental warning, feature, keywords and enough parsing to
implement basic classes with an empty `new` constructor method.

Inject a $self lexical into method bodies; populate it with the object instance, suitably shifted
Creates a new OP_METHSTART opcode to perform method setup
Define an aux flag to remark which stashes are classes

Basic implementation of fields.

Basic anonymous methods.
2023-02-10 12:07:02 +00:00
Paul "LeoNerd" Evans
abf1aa2b09 Define OP_HELEMEXISTSOR, a handy LOGOP shortcut for HELEM existence tests
This op is constructed using an OP_HELEM as the op_first and any scalar
expression as the op_other.

It is roughly equivalent to the following perl code:

  exists $hv{$key} ? $hv{$key} : OTHER

except that the HV and the KEY expression are evaluated only once, and
only one hv_* function is invoked to both test and obtain the value. It
is therefore smaller and more efficient.

Likewise, adding the OPpHELEMEXISTSOR_DELETE flag turns it into the
equivalent of

  exists $hv{$key} ? delete $hv{$key} : OTHER
2022-12-19 17:27:55 +00:00
Richard Leach
8b4768d1bc version bump to squash 2022-10-24 23:21:17 +01:00
Richard Leach
10a5c91382 OP_EMPTYAVHV - optimized empty ANONLIST/ANONHASH
This commit introduces a new OP to replace cases of OP_ANONLIST and
OP_ANONHASH where there are zero elements, which is very common in
Perl code.

As an example, `my $x = {}` is currently implemented like this:
    ...
    6     <2> sassign vKS/2 ->7
    4        <@> anonhash sK* ->5
    3           <0> pushmark s ->4
    5        <0> padsv[$x:1,2] sRM*/LVINTRO ->6

The pushmark serves no meaningful purpose when there are zero
elements and the anonhash, besides undoing the pushmark,
performs work that is unnecessary for this special case.

The peephole optimizer, which also checks for applicability of a
related TARGMY optimization, transforms this example into:
    ...
    -     <1> ex-sassign vKS/2 ->4
    3        <@> emptyavhv[$x:1,2] vK*/LVINTRO,ANONHASH,TARGMY ->4
    -           <0> ex-pushmark s ->3
    -        <0> ex-padsv sRM*/LVINTRO ->-
2022-10-24 23:21:17 +01:00
Yves Orton
a372c2a516 ext/lib - bump module versions on Opcode.pm, APItest and Deparse 2022-09-08 10:21:31 +02:00
Richard Leach
aafefcb901 OP_AELEMFASTLEX_STORE - combined sassign/aelemfast_lex
This commit introduces a new OP to replace simple cases of OP_SASSIGN
and OP_AELEMFAST_LEX. (Similar concept to GH #19943)

For example, `my @ary; $ary[0] = "boo"` is currently implemented as:
    7     <2> sassign vKS/2 ->8
    5        <$> const[PV "boo"] s ->6
    -        <1> ex-aelem sKRM*/2 ->7
    6           <0> aelemfast_lex[@ary:1,2] sRM ->7
    -           <0> ex-const s ->-

But now will be turned into:
    6     <1> aelemfastlex_store[@ary:1,2] vKS ->7
    5        <$> const(PV "boo") s ->6
    -        <1> ex-aelem sKRM*/2 ->6
    -           <0> ex-aelemfast_lex sRM ->6
    -           <0> ex-const s ->-

This is intended to be a transparent performance optimization.
It should be applicable for RHS optrees of varying complexity.
2022-09-07 20:27:27 +01:00
Richard Leach
9fdd7fc479 Implement OP_PADSV_STORE - combined sassign/padsv OP
This commit introduces a new OP to replace simple cases
of OP_SASSIGN and OP_PADSV.

For example, 'my $x = 1' is currently implemented as:

1  <;> nextstate(main 1 -e:1) v:{
2  <$> const(IV 1) s
3  <0> padsv[$x:1,2] sRM*/LVINTRO
4  <2> sassign vKS/2

But now will be turned into:

1  <;> nextstate(main 1 -e:1) v:{
2  <$> const(IV 1) s
3  <1> padsv_store[$x:1,2] vKMS/LVINTRO

This intended to be a transparent performance optimization.
It should be applicable for RHS optrees of varying complexity.
2022-08-17 11:19:10 +01:00
James Raspass
a02b8151f9 Add builtin::is_tainted
Also tweak the implementation of the other two boolean builtins (is_bool
& is_weak) to be slightly more efficient.
2022-07-05 11:17:31 +10:00
Nicholas Clark
a2440b84a0 Opcode.xs now uses PL_op_name and PL_op_desc directly
This removes the last core use of the trivial accessor functions
get_op_names() and get_op_descs().
2022-06-08 07:34:26 -06:00
Nicholas Clark
e6567a72c7 opset_len in Opcode.xs is a constant, so should be a static const
We can also remove many dMY_CXT declarations, as they are no longer needed
(and generate a now unused variable in threaded builds, hence compiler
warnings).

Previously it was part of the module's my_cxt_t, because it was a value
calculated from the interpreter variable PL_maxo. But PL_maxo itself is *not*
a variable - it was converted to a #define in Aug 2016 by commit
8d89205aa6324e7d:

    Remove PL_maxo

    We have an interpreter variable using memory, PL_maxo, which is
    defined to be the same as MAXO, a #defined constant.  As far as I can
    tell, it is never used in lvalue context, in core or on CPAN, except
    for the initialisation in intrpvar.h.

    It can simply be removed and replaced with a macro defined as equiva-
    lent to MAXO.

    It was added in this commit:

    commit 84ea024ac9cdf20f21223e686dddea82d5eceb4f
    Author: Perl 5 Porters <perl5-porters.nicoh.com>
    Date:   Tue Jan 2 23:21:55 1996 +0000

        perl 5.002beta1h patch: perl.h

        5.002beta1 attempted some memory optimizations, but unfortunately
        they can result in a memory leak problem.  This can be
        avoided by #define STRANGE_MALLOC.  I do that here until
        consensus is reached on a better strategy for handling the
        memory optimizations.

        Include maxo for the maximum number of operations (needed
        for the Safe extension).

    But apparently it is not needed for the Safe extension (tests pass
    without it).

What the author of that commit didn't realise was that Opcode had been split
out from Safe - the code in question is in this module not Safe.
2022-06-08 07:34:26 -06:00
Paul "LeoNerd" Evans
5a94615fd1 Rename is{bool,weak} to is_{bool,weak} 2022-03-07 16:44:11 +00:00
James Raspass
17a8df7077 Add ceil & floor to builtin 2022-01-24 00:35:51 +00:00
Paul "LeoNerd" Evans
d2817bd771 Add builtin::blessed, refaddr and reftype 2021-12-08 00:05:10 +00:00
Paul "LeoNerd" Evans
6ac93b496c Add builtin:: funcs for handling weakrefs
Also, ensure that B::Deparse understands the OA_TARGMY optimisation of
OP_ISBOOL
2021-12-04 11:39:22 +00:00
Paul "LeoNerd" Evans
852c1a8467 Direct optree implementations of builtin:: functions
Turn builtin::true/false into OP_CONSTs

Add a dedicated OP_ISBOOL, make an efficient op version of builtin::isbool()
2021-12-01 22:03:37 +00:00
Paul "LeoNerd" Evans
f79e2ff95f Create defer syntax and OP_PUSHDEFER opcode
Adds syntax `defer { BLOCK }` to create a deferred block; code that is
deferred until the scope exits. This syntax is guarded by

  use feature 'defer';

Adds a new opcode, `OP_PUSHDEFER`, which is a LOGOP whose `op_other` field
gives the start of an optree to be deferred until scope exit. That op
pointer will be stored on the save stack and invoked as part of scope
unwind.

Included is support for `B::Deparse` to deparse the optree back into
syntax.
2021-08-25 13:52:09 +01:00
Nicholas Clark
25c7a49abd Before filling the lookup hash for opcode names, pre-expand it.
We know the size needed (about 400 entries), so doing this saves several
automatic resizes when populating it.
2021-08-21 07:30:01 +00:00
Karl Williamson
0c10ec5137 Opcode: Save a '&' instr by casting to U8 2021-07-30 06:11:46 -06:00
Max Maischein
c108140682 Remove inheritance from Exporter in ext/ modules
Inheriting from Exporter adds several subroutines that are not really
needed by these modules.

The remaining uses of inheritance from Exporter are:

re.pm - this uses export_to_level(), which really, really wants
the inheritance

# Conflicts:
#	ext/File-Find/lib/File/Find.pm
#	ext/File-Glob/Glob.pm
#	ext/GDBM_File/GDBM_File.pm
#	ext/Opcode/Opcode.pm
#	ext/Pod-Html/lib/Pod/Html.pm
2021-06-25 09:59:01 -04:00
Paul "LeoNerd" Evans
eb7e169eaa Rename G_ARRAY to G_LIST; provide back-compat when not(PERL_CORE) 2021-06-02 00:29:54 +01:00
Paul "LeoNerd" Evans
383bf72f37 A totally new optree structure for try/catch involving three new optypes 2021-02-14 13:40:50 +00:00
Paul "LeoNerd" Evans
a1325b902d Initial attempt at feature 'try'
* Add feature, experimental warning, keyword
 * Basic parsing
 * Basic implementation as optree fragment

See also
  https://github.com/Perl/perl5/issues/18504
2021-02-04 14:20:53 +00:00
David Mitchell
1380c4f3b8 Opcode.xs: fix compiler warning
In some debugging code it was doing a SAVEDESTRUCTOR()
to do a warn() on scope exit, but it should have used the nocontext
version of warn().
2020-12-01 11:07:59 +00:00
John Lightsey
c150e7c040 Make security warnings in the Safe and Opcode modules more direct.
The current "no warranty" text warning against the use of Safe or
Opcode for "security purposes" is somewhat ambiguous. These modules
are not effective sandboxing mechanisms for evaluating untrusted
perl code and should not be used in that manner.

Safe and Opcode are, at best, hardening measures that could be used
in combination with operating system level sandboxing of the perl
interpreter.
2020-09-10 16:33:43 -05:00
Zefram
95b7e3a36a Eliminate build-time warning
Compiling with gcc7, for example, generated a '-Woverflow' warning with
text 'overflow in implicit constant conversion'.

For: https://github.com/Perl/perl5/issues/17664
2020-03-30 01:48:38 +00:00
Zefram
02b85d3dab chained comparisons 2020-03-12 22:34:26 -06:00
Paul "LeoNerd" Evans
813e85a03d Add the isa operator
Adds a new infix operator named `isa`, with the semantics that

  $x isa SomeClass

is true if and only if `$x` is a blessed object reference that is either
`SomeClass` directly, or includes the class somewhere in its @ISA
hierarchy. It is false without warning or error for non-references or
non-blessed references.

This operator respects `->isa` method overloading, and is intended to
replace boilerplate code such as

  use Scalar::Util 'blessed';

  blessed($x) and $x->isa("SomeClass")
2019-12-09 23:19:05 +00:00
Dagfinn Ilmari Mannsåker
06cc5386dd Fix "it it" typos
And regen affected files
2019-07-04 11:37:42 +01:00
Zefram
7896dde748 revert smartmatch to 5.27.6 behaviour
The pumpking has determined that the CPAN breakage caused by changing
smartmatch [perl #132594] is too great for the smartmatch changes to
stay in for 5.28.

This reverts most of the merge in commit
da4e040f42421764ef069371d77c008e6b801f45.  All core behaviour and
documentation is reverted.  The removal of use of smartmatch from a couple
of tests (that aren't testing smartmatch) remains.  Customisation of
a couple of CPAN modules to make them portable across smartmatch types
remains.  A small bugfix in scope.c also remains.
2017-12-29 12:39:31 +00:00
Zefram
15e4ac9a42 internally change "when" to "whereso"
The names of ops, context types, functions, etc., all change in accordance
with the change of keyword.
2017-12-05 22:30:50 +00:00
Zefram
16ea2c1905 merge leavegiven op type into leaveloop
The leaveloop op type can already do the whole job, with leavegiven being
a near duplicate of it.  Replace all uses of leavegiven with leaveloop.
2017-12-05 21:24:19 +00:00
Zefram
97b4caa610 remove useless "break" mechanism 2017-11-29 20:19:20 +00:00
David Mitchell
e839e6ed99 Add OP_MULTICONCAT op
Allow multiple OP_CONCAT, OP_CONST ops, plus optionally an OP_SASSIGN
or OP_STRINGIFY, to be combined into a single OP_MULTICONCAT op, which can
make things a *lot* faster: 4x or more.

In more detail: it will optimise into a single OP_MULTICONCAT, most
expressions of the form

    LHS RHS

where LHS is one of

    (empty)
    my $lexical =
    $lexical    =
    $lexical   .=
    expression  =
    expression .=

and RHS is one of

    (A . B . C . ...)            where A,B,C etc are expressions and/or
                                 string constants

    "aAbBc..."                   where a,A,b,B etc are expressions and/or
                                 string constants

    sprintf "..%s..%s..", A,B,.. where the format is a constant string
                                 containing only '%s' and '%%' elements,
                                 and A,B, etc are scalar expressions (so
                                 only a fixed, compile-time-known number of
                                 args: no arrays or list context function
                                 calls etc)

It doesn't optimise other forms, such as

    ($a . $b) . ($c. $d)

    ((($a .= $b) .= $c) .= $d);

(although sub-parts of those expressions might be converted to an
OP_MULTICONCAT). This is partly because it would be hard to maintain the
correct ordering of tie or overload calls.

The compiler uses heuristics to determine when to convert: in general,
expressions involving a single OP_CONCAT aren't converted, unless some
other saving can be made, for example if an OP_CONST can be eliminated, or
in the presence of 'my $x = .. ' which OP_MULTICONCAT can apply
OPpTARGET_MY to, but OP_CONST can't.

The multiconcat op is of type UNOP_AUX, with the op_aux structure directly
holding a pointer to a single constant char* string plus a list of segment
lengths. So for

    "a=$a b=$b\n";

the constant string is "a= b=\n", and the segment lengths are (2,3,1).
If the constant string has different non-utf8 and utf8 representations
(such as "\x80") then both variants are pre-computed and stored in the aux
struct, along with two sets of segment lengths.

For all the above LHS types, any SASSIGN op is optimised away. For a LHS
of '$lex=', '$lex.=' or 'my $lex=', the PADSV is optimised away too.

For example where $a and $b are lexical vars, this statement:

    my $c = "a=$a, b=$b\n";

formerly compiled to

    const[PV "a="] s
    padsv[$a:1,3] s
    concat[t4] sK/2
    const[PV ", b="] s
    concat[t5] sKS/2
    padsv[$b:1,3] s
    concat[t6] sKS/2
    const[PV "\n"] s
    concat[t7] sKS/2
    padsv[$c:2,3] sRM*/LVINTRO
    sassign vKS/2

and now compiles to:

    padsv[$a:1,3] s
    padsv[$b:1,3] s
    multiconcat("a=, b=\n",2,4,1)[$c:2,3] vK/LVINTRO,TARGMY,STRINGIFY

In terms of how much faster it is, this code:

    my $a = "the quick brown fox jumps over the lazy dog";
    my $b = "to be, or not to be; sorry, what was the question again?";

    for my $i (1..10_000_000) {
        my $c = "a=$a, b=$b\n";
    }

runs 2.7 times faster, and if you throw utf8 mixtures in it gets even
better. This loop runs 4 times faster:

    my $s;
    my $a = "ab\x{100}cde";
    my $b = "fghij";
    my $c = "\x{101}klmn";

    for my $i (1..10_000_000) {
        $s = "\x{100}wxyz";
        $s .= "foo=$a bar=$b baz=$c";
    }

The main ways in which OP_MULTICONCAT gains its speed are:

* any OP_CONSTs are eliminated, and the constant bits (already in the
  right encoding) are copied directly from the constant string attached to
  the op's aux structure.

* It optimises away any SASSIGN op, and possibly a PADSV op on the LHS, in
  all cases; OP_CONCAT only did this in very limited circumstances.

* Because it has a holistic view of the entire concatenation expression,
  it can do the whole thing in one efficient go, rather than creating and
  copying intermediate results. pp_multiconcat() goes to considerable
  efforts to avoid inefficiencies. For example it will only SvGROW() the
  target once, and to the exact size needed, no matter what mix of utf8
  and non-utf8 appear on the LHS and RHS.  It never allocates any
  temporary SVs except possibly in the case of tie or overloading.

* It does all its own appending and utf8 handling rather than calling
  out to functions like sv_catsv().

* It's very good at handling the LHS appearing on the RHS; for example in

    $x = "abcd";
    $x = "-$x-$x-";

  It will do roughly the equivalent of the following (where targ is $x);

    SvPV_force(targ);
    SvGROW(targ, 11);
    p = SvPVX(targ);
    Move(p,   p+1,  4, char);
    Copy("-", p,    1, char);
    Copy("-", p+5,  1, char);
    Copy(p+1, p+6,  4, char);
    Copy("-", p+10, 1, char);
    SvCUR(targ) = 11;
    p[11] = '\0';

  Formerly, pp_concat would have used multiple PADTMPs or temporary SVs to
  handle situations like that.

The code is quite big; both S_maybe_multiconcat() and pp_multiconcat()
(the main compile-time and runtime parts of the implementation) are over
700 lines each. It turns out that when you combine multiple ops, the
number of edge cases grows exponentially ;-)
2017-10-31 15:31:26 +00:00
Lukas Mai
2362b21b14 Opcode: check invariant at compile time 2017-07-16 11:57:35 +02:00
Dagfinn Ilmari Mannsåker
07e4dd7aad Change hv_fetch(…, "…", …, …) to hv_fetchs(…, "…", …)
The dual-life dists all use Devel::PPPort, so they can use this function
even though it was only added in 5.10.
2016-11-12 12:06:43 +01:00
David Mitchell
5012eebe55 make OP_SPLIT a PMOP, and eliminate OP_PUSHRE
Most ops that execute a regex, such as match and subst, are of type PMOP.
A PMOP allows the actual regex to be attached directly to that op, due
to its extra fields.

OP_SPLIT is different; it is just a plain LISTOP, but it always has an
OP_PUSHRE as its first child, which *is* a PMOP and which has the regex
attached.

At runtime, pp_pushre()'s only job is to push itself (i.e. the current
PL_op) onto the stack. Later pp_split() pops this to get access to the
regex it wants to execute.

This is a bit unpleasant, because we're pushing an OP* onto the stack,
which is supposed to be an array of SV*'s. As a bit of a hack, on
DEBUGGING builds we push a PVLV with the PL_op address embedded instead,
but this still isn't very satisfactory.

Now that regexes are first-class SVs, we could push a REGEXP onto the
stack rather than PL_op. However, there is an optimisation of @array =
split which eliminates the assign and embeds the array's GV/padix directly
in the PUSHRE op. So split still needs access to that op. But the pushre
op will always be splitop->op_first anyway, so one possibility is to just
skip executing the pushre altogether, and make pp_split just directly
access op_first instead to get the regex and @array info.

But if we're doing that, then why not just go the full hog and make
OP_SPLIT into a PMOP, and eliminate the OP_PUSHRE op entirely: with the
data that was spread across the two ops now combined into just the one
split op.

That is exactly what this commit does.

For a simple compile-time pattern like  split(/foo/, $s, 1), the optree
looks like:

    before:
        <@> split[t2] lK
           </> pushre(/"foo"/) s/RTIME
           <0> padsv[$s:1,2] s
           <$> const(IV 1) s

    after:
        </> split(/"foo"/)[t2] lK/RTIME
           <0> padsv[$s:1,2] s
           <$> const[IV 1] s

while for a run-time expression like split(/$pat/, $s, 1),

    before:
        <@> split[t3] lK
           </> pushre() sK/RTIME
              <|> regcomp(other->8) sK
                 <0> padsv[$pat:2,3] s
           <0> padsv[$s:1,3] s
           <$> const(IV 1)s

    after:
        </> split()[t3] lK/RTIME
           <|> regcomp(other->8) sK
              <0> padsv[$pat:2,3] s
           <0> padsv[$s:1,3] s
           <$> const[IV 1] s

This makes the code faster and simpler.

At the same time, two new private flags have been added for OP_SPLIT -
OPpSPLIT_ASSIGN and OPpSPLIT_LEX - which make it explicit that the
assign op has been optimised away, and if so, whether the array is
lexical.

Also, deparsing of split has been improved, to the extent that

    perl TEST -deparse op/split.t

now passes.

Also, a couple of panic messages in pp_split() have been replaced with
asserts().
2016-10-04 11:18:40 +01:00
David Mitchell
8432384f70 silence warning in Opcode.xs
Opcode.xs:71:21: warning: overflow in implicit constant conversion [-Woverflow]
     bitmap[len-1] = (PL_maxo & 0x07) ? ~(0xFF << (PL_maxo & 0x07)) : 0xFF;

This was due to to PL_maxo being converted from a var into a const value
in a previous commit.
2016-08-15 08:55:06 +01:00
David Mitchell
4fa06845e7 add OP_ARGELEM, OP_ARGDEFELEM, OP_ARGCHECK ops
Currently subroutine signature parsing emits many small discrete ops
to implement arg handling. This commit replaces them with a couple of ops
per signature element, plus an initial signature check op.

These new ops are added to the OP tree during parsing, so will be visible
to hooks called up to and including peephole optimisation. It is intended
soon that the peephole optimiser will take these per-element ops, and
replace them with a single OP_SIGNATURE op which handles the whole
signature in a single go. So normally these ops wont actually get executed
much. But adding these intermediate-level ops gives three advantages:

1) it allows the parser to efficiently generate subtrees containing
   individual signature elements, which can't be done if only OP_SIGNATURE
   or discrete ops are available;
2) prior to optimisation, it provides a simple and straightforward
   representation of the signature;
3) hooks can mess with the signature OP subtree in ways that make it
   no longer possible to optimise into an OP_SIGNATURE, but which can
   still be executed, deparsed etc (if less efficiently).

This code:

    use feature "signatures";
    sub f($a, $, $b = 1, @c)  {$a}

under 'perl -MO=Concise,f' now gives:

    d  <1> leavesub[1 ref] K/REFC,1 ->(end)
    -     <@> lineseq KP ->d
    1        <;> nextstate(main 84 foo:6) v:%,469762048 ->2
    2        <+> argcheck(3,1,@) v ->3
    3        <;> nextstate(main 81 foo:6) v:%,469762048 ->4
    4        <+> argelem(0)[$a:81,84] v/SV ->5
    5        <;> nextstate(main 82 foo:6) v:%,469762048 ->6
    8        <+> argelem(2)[$b:82,84] vKS/SV ->9
    6           <|> argdefelem(other->7)[2] sK ->8
    7              <$> const(IV 1) s ->8
    9        <;> nextstate(main 83 foo:6) v:%,469762048 ->a
    a        <+> argelem(3)[@c:83,84] v/AV ->b
    -        <;> ex-nextstate(main 84 foo:6) v:%,469762048 ->b
    b        <;> nextstate(main 84 foo:6) v:%,469762048 ->c
    c        <0> padsv[$a:81,84] s ->d

The argcheck(3,1,@) op knows the number of positional params (3), the
number of optional params (1), and whether it has an array / hash slurpy
element at the end. This op is responsible for checking that @_ contains
the right number of args.

A simple argelem(0)[$a] op does the equivalent of 'my $a = $_[0]'.
Similarly, argelem(3)[@c] is equivalent to 'my @c = @_[3..$#_]'.
If it has a child, it gets its arg from the stack rather than using $_[N].
Currently the only used child is the logop argdefelem.

argdefelem(other->7)[2] is equivalent to '@_ > 2 ? $_[2] : other'.

[ These ops currently assume that the lexical var being introduced
is undef/empty and non-magival etc. This is an incorrect assumption and
is fixed in a few commits' time ]
2016-08-03 20:54:40 +01:00
Father Chrysostomos
81477935a7 Increase $Opcode::VERSION to 1.35 2016-05-20 22:13:42 -07:00
Father Chrysostomos
881018827f Add avhvswitch op
&CORE::keys() et al. will use this to switch between keys and akeys
depending on the argument type.
2016-05-20 22:13:42 -07:00
David Mitchell
b5134c56ad Opcode.xs: silence compiler warning
Opcode.xs: In function ‘opmask_addlocal’:
../../perl.h:6473:12: warning: unused variable ‘my_cxtp’ [-Wunused-variable]
  my_cxt_t *my_cxtp = (my_cxt_t *)PL_my_cxt_list[MY_CXT_INDEX]
            ^

Without debugging enabled, opcode_debug becomes a constant, so
dMY_CXT isn't needed in opmask_addlocal().

Make the enabling of debugging based on a macro (OPCODE_DEBUG)
rather then on '#if 0', then use that accordingly.
2015-11-24 12:38:15 +00:00
Aaron Crane
262309092c Delete experimental autoderef feature 2015-07-13 14:08:34 +01:00
Father Chrysostomos
5d01050abc Add string- and number-specific bitop types
and also implement the pp functions, though nothing compiles to
these ops yet.
2015-01-31 22:03:50 -08:00
Tony Cook
00fdeebdcb bump $Opcode::VERSION to 1.32 2015-01-29 10:29:05 +11:00
Daniel Dragan
c5abc2c9ea comment out dead code in Opcode::
opcode_debug has never had an API to turn it on/set it to non-0 since
Opcode::'s initial commit 6badd1a5d1 in 5.003001. Making opcode_debug a
constant allows the CC to constant fold away the code, the warn string
literals, and makes the my_cxt_t struct slightly smaller. Dont remove the
code entirely since someone might find it useful one day.
2015-01-29 10:21:28 +11:00
Father Chrysostomos
b77472f98f Add :const anon sub attribute 2015-01-19 20:34:04 -08:00
Father Chrysostomos
1d81070ca1 Increase $Opcode::VERSION to 1.31 2014-12-21 07:09:06 -08:00
Father Chrysostomos
be6d3c1596 Use GIMME_V in Opcode
GIMME_V is a simpler macro that results in smaller machine code.
2014-12-21 07:06:13 -08:00