Skip to content

Commit

Permalink
Add nqp::p6invokehandler.
Browse files Browse the repository at this point in the history
Hides away a Parrot specific detail. Cleans up one place in Actions,
but the debugger is the main beneficiary.
  • Loading branch information
jnthn committed Oct 3, 2013
1 parent 454984b commit eb07bd1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/Perl6/Actions.nqp
Expand Up @@ -5826,10 +5826,7 @@ class Perl6::Actions is HLL::Actions does STDActions {
# as argument and returns the result. The install the handler.
%*HANDLERS{$type} := QAST::Stmts.new(
:node($/),
QAST::VM.new(
:parrot(QAST::VM.new( :pirop('perl6_invoke_catchhandler__vPP'), $handler, $ex )),
:jvm(QAST::Op.new( :op('call'), $handler, $ex ))
),
QAST::Op.new( :op('p6invokehandler'), $handler, $ex ),
QAST::Var.new( :scope('lexical'), :name('Nil') )
);
}
Expand Down
3 changes: 3 additions & 0 deletions src/vm/jvm/Perl6/Ops.nqp
Expand Up @@ -154,6 +154,9 @@ my $p6bool := -> $qastcomp, $op {
};
$ops.add_hll_op('perl6', 'p6bool', $p6bool);
$ops.map_classlib_hll_op('perl6', 'p6scalarfromdesc', $TYPE_P6OPS, 'p6scalarfromdesc', [$RT_OBJ], $RT_OBJ, :tc);
$ops.add_hll_op('perl6', 'p6invokehandler', -> $qastcomp, $op {
$qastcomp.as_jast(QAST::Op.new( :op('call'), $op[0], $op[1] ));
});

$ops.add_hll_op('perl6', 'p6invokeflat', -> $qastcomp, $op {
$op[1].flat(1);
Expand Down
1 change: 1 addition & 0 deletions src/vm/parrot/Perl6/Ops.nqp
Expand Up @@ -69,6 +69,7 @@ $ops.add_hll_op('perl6', 'p6staticouter', -> $qastcomp, $op {
))
});
$ops.add_hll_pirop_mapping('perl6', 'p6scalarfromdesc', 'p6scalarfromdesc', 'PP', :inlinable(1));
$ops.add_hll_pirop_mapping('perl6', 'p6invokehandler', 'perl6_invoke_catchhandler', 'vPP');

# Make some of them also available from NQP land, since we use them in the
# metamodel and bootstrap.
Expand Down

0 comments on commit eb07bd1

Please sign in to comment.