Skip to content

Commit

Permalink
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -2271,7 +2271,7 @@ public Operand buildEnsureInternal(Node ensureBodyNode, Node ensurerNode) {

// Emit code to conditionally restore $!
Variable ret = createTemporaryVariable();
addInstr(new RuntimeHelperCall(ret, RESTORE_PERLY_EXC, new Operand[]{exc, savedGlobalException} ));
addInstr(new RuntimeHelperCall(ret, RESTORE_EXCEPTION_VAR, new Operand[]{exc, savedGlobalException} ));

// Now emit the ensure body's stashed instructions
if (ensurerNode != null) {
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ public enum Methods {
HANDLE_PROPAGATE_BREAK, HANDLE_NONLOCAL_RETURN, HANDLE_BREAK_AND_RETURNS_IN_LAMBDA,
IS_DEFINED_BACKREF, IS_DEFINED_NTH_REF, IS_DEFINED_GLOBAL, IS_DEFINED_INSTANCE_VAR,
IS_DEFINED_CLASS_VAR, IS_DEFINED_SUPER, IS_DEFINED_METHOD, IS_DEFINED_CALL,
IS_DEFINED_CONSTANT_OR_METHOD, MERGE_KWARGS, RESTORE_PERLY_EXC;
IS_DEFINED_CONSTANT_OR_METHOD, MERGE_KWARGS, RESTORE_EXCEPTION_VAR;

public static Methods fromOrdinal(int value) {
return value < 0 || value >= values().length ? null : values()[value];
@@ -128,7 +128,7 @@ public IRubyObject callHelper(ThreadContext context, StaticScope currScope, Dyna
case MERGE_KWARGS:
return IRRuntimeHelpers.mergeKeywordArguments(context, (IRubyObject) arg1,
(IRubyObject) getArgs()[1].retrieve(context, self, currScope, currDynScope, temp));
case RESTORE_PERLY_EXC:
case RESTORE_EXCEPTION_VAR:
Object exc = getArgs()[0].retrieve(context, self, currScope, currDynScope, temp);
// SSS FIXME: These are non-local control-flow exit scenarios that just
// happen to use exceptions for exiting scopes and we should
Original file line number Diff line number Diff line change
@@ -727,7 +727,7 @@ public static IRubyObject mergeKeywordArguments(ThreadContext context, IRubyObje
}

@JIT
public static IRubyObject restorePerlyExc(ThreadContext context, IRubyObject exc, IRubyObject savedExc) {
public static IRubyObject restoreExceptionVar(ThreadContext context, IRubyObject exc, IRubyObject savedExc) {
if (exc instanceof IRReturnJump || exc instanceof IRBreakJump) {
context.runtime.getGlobalVariables().set("$!", savedExc);
}
4 changes: 2 additions & 2 deletions core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
Original file line number Diff line number Diff line change
@@ -1700,11 +1700,11 @@ public void RuntimeHelperCall(RuntimeHelperCall runtimehelpercall) {
jvmAdapter().invokestatic(p(IRRuntimeHelpers.class), "mergeKeywordArguments", sig(IRubyObject.class, ThreadContext.class, IRubyObject.class, IRubyObject.class));
jvmStoreLocal(runtimehelpercall.getResult());
break;
case RESTORE_PERLY_EXC:
case RESTORE_EXCEPTION_VAR:
jvmMethod().loadContext();
visit(runtimehelpercall.getArgs()[0]);
visit(runtimehelpercall.getArgs()[1]);
jvmAdapter().invokestatic(p(IRRuntimeHelpers.class), "restorePerlyExc", sig(IRubyObject.class, ThreadContext.class, IRubyObject.class, IRubyObject.class));
jvmAdapter().invokestatic(p(IRRuntimeHelpers.class), "restoreExceptionVar", sig(IRubyObject.class, ThreadContext.class, IRubyObject.class, IRubyObject.class));
jvmStoreLocal(runtimehelpercall.getResult());
break;
default:

0 comments on commit bbc88e5

Please sign in to comment.