Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Further gutting of invokeInternal.
  • Loading branch information
jnthn committed Mar 2, 2013
1 parent 22ac999 commit ccb441b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
9 changes: 9 additions & 0 deletions src/org/perl6/nqp/runtime/CallFrame.java
Expand Up @@ -147,5 +147,14 @@ public CallFrame(ThreadContext tc, CodeRef cr) {
this.nArg = new double[sci.nMaxArgs];
if (sci.sMaxArgs > 0)
this.sArg = new String[sci.sMaxArgs];

// Current call frame becomes this new one.
tc.curFrame = this;
}

// Does work needed to leave this callframe.
public void leave() {
this.codeRef.staticInfo.priorInvocation = this;
this.tc.curFrame = this.caller;
}
}
7 changes: 1 addition & 6 deletions src/org/perl6/nqp/runtime/Ops.java
Expand Up @@ -1282,9 +1282,6 @@ private static void invokeInternal(ThreadContext tc, SixModelObject invokee, Cal
CallFrame cf = new CallFrame(tc, cr);
cf.callSite = csd;

// Current call frame becomes this new one.
tc.curFrame = cf;

try {
// Do the invocation.
cr.staticInfo.mh.invokeExact(tc);
Expand All @@ -1299,9 +1296,7 @@ private static void invokeInternal(ThreadContext tc, SixModelObject invokee, Cal
ExceptionHandling.dieInternal(tc, e.getMessage());
}
finally {
// Set curFrame back to caller.
cr.staticInfo.priorInvocation = cf;
tc.curFrame = cf.caller;
cf.leave();
}
}
public static SixModelObject invokewithcapture(SixModelObject invokee, SixModelObject capture, ThreadContext tc) throws Exception {
Expand Down

0 comments on commit ccb441b

Please sign in to comment.