Skip to content

Commit

Permalink
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ public IRubyObject interpret(ThreadContext context, Block block, IRubyObject sel

StaticScope currScope = interpreterContext.getStaticScope();
DynamicScope currDynScope = context.getCurrentScope();
Block.Type blockType = block == null ? null : block.type;

// Init profiling this scope
boolean debug = IRRuntimeHelpers.isDebug();
@@ -68,7 +69,7 @@ public IRubyObject interpret(ThreadContext context, Block block, IRubyObject sel
case NONLOCAL_RETURN: {
NonlocalReturnInstr ri = (NonlocalReturnInstr)instr;
IRubyObject rv = (IRubyObject)retrieveOp(ri.getReturnValue(), context, self, currDynScope, currScope, temp);
return IRRuntimeHelpers.initiateNonLocalReturn(context, currDynScope, block.type, rv);
return IRRuntimeHelpers.initiateNonLocalReturn(context, currDynScope, blockType, rv);
}
case LINE_NUM:
context.setLine(((LineNumberInstr) instr).lineNumber);
@@ -182,7 +183,7 @@ public IRubyObject interpret(ThreadContext context, Block block, IRubyObject sel
case RUNTIME_HELPER: { // NO INTERP
RuntimeHelperCall rhc = (RuntimeHelperCall)instr;
setResult(temp, currDynScope, rhc.getResult(),
rhc.callHelper(context, currScope, currDynScope, self, temp, block.type));
rhc.callHelper(context, currScope, currDynScope, self, temp, blockType));
break;
}
case GET_FIELD: { // NO INTERP
Original file line number Diff line number Diff line change
@@ -337,8 +337,8 @@ protected static void processCall(ThreadContext context, Instr instr, Operation
protected static void processBookKeepingOp(ThreadContext context, Block block, Instr instr, Operation operation,
String name, IRubyObject[] args, IRubyObject self, Block blockArg, RubyModule implClass,
DynamicScope currDynScope, Object[] temp, StaticScope currScope) {
Frame f;
Block.Type blockType = block == null ? null : block.type;
Frame f;
switch(operation) {
case LABEL:
break;
@@ -393,6 +393,7 @@ protected static void processBookKeepingOp(ThreadContext context, Block block, I
protected static IRubyObject processReturnOp(ThreadContext context, Block block, Instr instr, Operation operation,
DynamicScope currDynScope, Object[] temp, IRubyObject self,
StaticScope currScope) {
Block.Type blockType = block == null ? null : block.type;
switch(operation) {
// --------- Return flavored instructions --------
case RETURN: {
@@ -406,12 +407,12 @@ protected static IRubyObject processReturnOp(ThreadContext context, Block block,
// This assumes that scopes with break instr. have a frame / dynamic scope
// pushed so that we can get to its static scope. For-loops now always have
// a dyn-scope pushed onto stack which makes this work in all scenarios.
return IRRuntimeHelpers.initiateBreak(context, currDynScope, rv, block.type);
return IRRuntimeHelpers.initiateBreak(context, currDynScope, rv, blockType);
}
case NONLOCAL_RETURN: {
NonlocalReturnInstr ri = (NonlocalReturnInstr)instr;
IRubyObject rv = (IRubyObject)retrieveOp(ri.getReturnValue(), context, self, currDynScope, currScope, temp);
return IRRuntimeHelpers.initiateNonLocalReturn(context, currDynScope, block.type, rv);
return IRRuntimeHelpers.initiateNonLocalReturn(context, currDynScope, blockType, rv);
}
}
return null;

0 comments on commit 4754c09

Please sign in to comment.