Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Start unbusting various phasers a bit.
  • Loading branch information
jnthn committed Jul 14, 2012
1 parent cfbb2fc commit ceade33
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/QPerl6/Ops.pm
Expand Up @@ -34,6 +34,10 @@ $ops.add_hll_pirop_mapping('perl6', 'p6vmcodetoobj', 'perl6_code_object_from_par
$ops.add_hll_pirop_mapping('perl6', 'p6bindassert', 'perl6_assert_bind_ok', '0PP');
$ops.add_hll_pirop_mapping('perl6', 'p6getpackage', 'perl6_get_package_through_who', 'PPs');
$ops.add_hll_pirop_mapping('perl6', 'p6stateinit', 'perl6_state_needs_init', 'I');
$ops.add_hll_pirop_mapping('perl6', 'p6setpre', 'perl6_set_checking_pre', 'v');
$ops.add_hll_pirop_mapping('perl6', 'p6clearpre', 'perl6_clear_checking_pre', 'v');
$ops.add_hll_pirop_mapping('perl6', 'p6takefirstflag', 'perl6_take_block_first_flag', 'i');
$ops.add_hll_pirop_mapping('perl6', 'p6return', 'perl6_returncc', '0P');

# Boxing and unboxing configuration.
QAST::Operations.add_hll_box('perl6', 'i', -> $qastcomp, $post {
Expand Down
10 changes: 5 additions & 5 deletions src/QPerl6/World.pm
Expand Up @@ -829,22 +829,22 @@ class QPerl6::World is HLL::World {
}
my %phasers := nqp::getattr($code, $block_type, '$!phasers');
if nqp::existskey(%phasers, 'PRE') {
$code_past[0].push(PAST::Op.new( :pirop('perl6_set_checking_pre v') ));
$code_past[0].push(QAST::Op.new( :op('p6setpre') ));
$code_past[0].push(run_phasers_code('PRE'));
$code_past[0].push(PAST::Op.new( :pirop('perl6_clear_checking_pre v') ));
$code_past[0].push(QAST::Op.new( :op('p6clearpre') ));
}
if nqp::existskey(%phasers, 'FIRST') {
$code_past[0].push(QAST::Op.new(
:pasttype('if'),
PAST::Op.new( :pirop('perl6_take_block_first_flag i') ),
QAST::Op.new( :op('p6takefirstflag') ),
run_phasers_code('FIRST')));
}
if nqp::existskey(%phasers, 'ENTER') {
$code_past[0].push(run_phasers_code('ENTER'));
}
if nqp::existskey(%phasers, '!LEAVE-ORDER') || nqp::existskey(%phasers, 'POST') {
$code_past[+@($code_past) - 1] := PAST::Op.new(
:pirop('perl6_returncc__0P'),
$code_past[+@($code_past) - 1] := QAST::Op.new(
:op('p6return'),
$code_past[+@($code_past) - 1]);
}
}
Expand Down

0 comments on commit ceade33

Please sign in to comment.