Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move CallFrame creation inside invokee.
This gets invokeInternal down to doing nothing once it settles on a
method handle to invoke; everything else is inside the method.
  • Loading branch information
jnthn committed Mar 2, 2013
1 parent d0c8319 commit 1359b26
Show file tree
Hide file tree
Showing 3 changed files with 261 additions and 200 deletions.
6 changes: 5 additions & 1 deletion lib/QAST/JASTCompiler.nqp
Expand Up @@ -2650,8 +2650,12 @@ class QAST::CompilerJAST {
# Emit prelude. This populates the cf (callframe) field as well as having
# locals for the argument buffers for easy/fast access later on.
$*JMETH.add_local('cf', $TYPE_CF);
$*JMETH.append(JAST::Instruction.new( :op('new'), $TYPE_CF ));
$*JMETH.append(JAST::Instruction.new( :op('dup') ));
$*JMETH.append(JAST::Instruction.new( :op('aload_1') ));
$*JMETH.append(JAST::Instruction.new( :op('getfield'), $TYPE_TC, 'curFrame', $TYPE_CF ));
$*JMETH.append(JAST::Instruction.new( :op('aload'), 'cr' ));
$*JMETH.append(JAST::Instruction.new( :op('invokespecial'), $TYPE_CF, '<init>',
'Void', $TYPE_TC, $TYPE_CR ));
if $*MAX_ARGS_O {
$*JMETH.add_local('oArgs', "[$TYPE_SMO");
$*JMETH.append(JAST::Instruction.new( :op('dup') ));
Expand Down
3 changes: 0 additions & 3 deletions src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -1260,9 +1260,6 @@ private static void invokeInternal(ThreadContext tc, SixModelObject invokee, Cal
cr = (CodeRef)is.InvocationHandler;
}

// Create a new call frame.
CallFrame cf = new CallFrame(tc, cr);

try {
// Do the invocation.
cr.staticInfo.mh.invokeExact(tc, cr, csd);
Expand Down

0 comments on commit 1359b26

Please sign in to comment.