Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
A couple of ops for special code object marks.
Will eliminate most of the remaining setprop usages.
  • Loading branch information
jnthn committed Feb 24, 2013
1 parent dc851e8 commit ad81875
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/QAST/Operations.nqp
Expand Up @@ -1749,6 +1749,28 @@ QAST::Operations.add_core_op('setstaticlex', -> $qastcomp, $op {
});
QAST::Operations.add_core_pirop_mapping('freshcoderef', 'nqp_fresh_stub', 'PP');
QAST::Operations.add_core_pirop_mapping('replacecoderef', 'assign', '0PP');
QAST::Operations.add_core_op('markcodestatic', -> $qastcomp, $op {
if +@($op) != 1 {
nqp::die('markcodestatic requires one operand');
}
my $ops := PIRT::Ops.new();
my $code := $qastcomp.coerce($qastcomp.as_post($op[0]), 'P');
$ops.push($code);
$ops.push_pirop('setprop', $code, "'STATIC_CODE_REF'", $code);
$ops.result($code);
$ops
});
QAST::Operations.add_core_op('markcodestub', -> $qastcomp, $op {
if +@($op) != 1 {
nqp::die('markcodestatic requires one operand');
}
my $ops := PIRT::Ops.new();
my $code := $qastcomp.coerce($qastcomp.as_post($op[0]), 'P');
$ops.push($code);
$ops.push_pirop('setprop', $code, "'COMPILER_STUB'", $code);
$ops.result($code);
$ops
});

# serialization context related opcodes
QAST::Operations.add_core_pirop_mapping('sha1', 'nqp_sha1', 'Ss');
Expand Down

0 comments on commit ad81875

Please sign in to comment.