Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update closure clone fixup code-gen.
  • Loading branch information
jnthn committed Jul 14, 2012
1 parent 0d56787 commit e506623
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/QPerl6/Ops.pm
Expand Up @@ -38,6 +38,7 @@ $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');
$ops.add_hll_pirop_mapping('perl6', 'p6assoccode', 'perl6_associate_sub_code_object', 'vPP');

# Boxing and unboxing configuration.
QAST::Operations.add_hll_box('perl6', 'i', -> $qastcomp, $post {
Expand Down
14 changes: 7 additions & 7 deletions src/QPerl6/World.pm
Expand Up @@ -731,19 +731,19 @@ class QPerl6::World is HLL::World {
# If we clone the stub, then we must remember to do a fixup
# of it also.
pir::setprop__vPsP($stub, 'CLONE_CALLBACK', sub ($orig, $clone) {
my $tmp := $fixups.unique('tmp_block_fixup');
self.add_object($clone);
nqp::die("not yet updated for QAST");
$fixups.push(QAST::Stmts.new(
$fixups.push(QAST::Stmt.new(
QAST::Op.new(
:op('bind'),
PAST::Var.new( :name('$P0'), :scope('register') ),
QAST::Var.new( :name($tmp), :scope('local'), :decl('var') ),
QAST::Op.new( :op('clone'), QAST::BVal.new( :value($code_past) ) )
),
self.set_attribute($clone, $code_type, '$!do',
PAST::Var.new( :name('$P0'), :scope('register') )),
PAST::Op.new(
:pirop('perl6_associate_sub_code_object vPP'),
PAST::Var.new( :name('$P0'), :scope('register') ),
QAST::Var.new( :name($tmp), :scope('local') )),
QAST::Op.new(
:op('p6assoccode'),
QAST::Var.new( :name($tmp), :scope('local') ),
QAST::WVal.new( :value($clone) )
)));
});
Expand Down

0 comments on commit e506623

Please sign in to comment.