Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 8855b9860acb
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: f317fea29802
Choose a head ref
  • 2 commits
  • 2 files changed
  • 1 contributor

Commits on Feb 21, 2016

  1. Copy the full SHA
    f328222 View commit details
  2. Copy the full SHA
    f317fea View commit details
Showing with 9 additions and 10 deletions.
  1. +1 −0 core/src/main/java/org/jruby/ir/persistence/IRReaderStream.java
  2. +8 −10 core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
Original file line number Diff line number Diff line change
@@ -275,6 +275,7 @@ public Instr decodeInstr() {
case RESCUE_EQQ: return RescueEQQInstr.decode(this);
case RESTORE_ERROR_INFO: return RestoreErrorInfoInstr.decode(this);
case RETURN: return ReturnInstr.decode(this);
case RETURN_OR_RETHROW_SAVED_EXC: return ReturnOrRethrowSavedExcInstr.decode(this);
case RUNTIME_HELPER: return RuntimeHelperCall.decode(this);
case SEARCH_CONST: return SearchConstInstr.decode(this);
case SET_CAPTURED_VAR: return SetCapturedVarInstr.decode(this);
18 changes: 8 additions & 10 deletions core/src/main/java/org/jruby/ir/runtime/IRRuntimeHelpers.java
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ public static IRubyObject handleBreakAndReturnsInLambdas(ThreadContext context,
return ((IRWrappedLambdaReturnValue)exc).returnValue;
} else if ((exc instanceof IRBreakJump) && inNonMethodBodyLambda(scope, blockType)) {
// We just unwound all the way up because of a non-local break
context.setSavedExceptionInLambda(IRException.BREAK_LocalJumpError.getException(context.getRuntime()));
context.setSavedExceptionInLambda(IRException.BREAK_LocalJumpError.getException(context.runtime));
return null;
} else if (exc instanceof IRReturnJump && (blockType == null || inLambda(blockType))) {
try {
@@ -247,7 +247,7 @@ public static IRubyObject handlePropagatedBreak(ThreadContext context, DynamicSc
IRScopeType scopeType = scope.getScopeType();
if (!scopeType.isClosureType()) {
// Error -- breaks can only be initiated in closures
throw IRException.BREAK_LocalJumpError.getException(context.getRuntime());
throw IRException.BREAK_LocalJumpError.getException(context.runtime);
} else {
bj.breakInEval = false;
throw bj;
@@ -311,7 +311,7 @@ public static IRubyObject undefMethod(ThreadContext context, Object nameArg, Dyn

module.undef(context, name);

return context.runtime.getNil();
return context.nil;
}

public static double unboxFloat(IRubyObject val) {
@@ -702,7 +702,7 @@ protected static void checkSuperDisabledOrOutOfMethod(ThreadContext context, Rub
if (methodName == null || !methodName.equals("")) {
throw context.runtime.newNameError("superclass method '" + methodName + "' disabled", methodName);
} else {
throw context.runtime.newNoMethodError("super called outside of method", null, context.runtime.getNil());
throw context.runtime.newNoMethodError("super called outside of method", null, context.nil);
}
}
}
@@ -904,7 +904,7 @@ public static IRubyObject receiveKeywordArg(ThreadContext context, IRubyObject[]

if (keywordArguments == null) return UndefinedValue.UNDEFINED;

RubySymbol keywordName = context.getRuntime().newSymbol(argName);
RubySymbol keywordName = context.runtime.newSymbol(argName);

if (keywordArguments.fastARef(keywordName) == null) return UndefinedValue.UNDEFINED;

@@ -916,7 +916,7 @@ public static IRubyObject receiveKeywordArg(ThreadContext context, IRubyObject[]
public static IRubyObject receiveKeywordRestArg(ThreadContext context, IRubyObject[] args, int required, boolean keywordArgumentSupplied) {
RubyHash keywordArguments = extractKwargsHash(args, required, keywordArgumentSupplied);

return keywordArguments == null ? RubyHash.newSmallHash(context.getRuntime()) : keywordArguments;
return keywordArguments == null ? RubyHash.newSmallHash(context.runtime) : keywordArguments;
}

public static IRubyObject setCapturedVar(ThreadContext context, IRubyObject matchRes, String varName) {
@@ -1114,8 +1114,7 @@ public static RubyHash dupKwargsHashAndPopulateFromArray(ThreadContext context,

@JIT
public static IRubyObject searchConst(ThreadContext context, StaticScope staticScope, String constName, boolean noPrivateConsts) {
Ruby runtime = context.getRuntime();
RubyModule object = runtime.getObject();
RubyModule object = context.runtime.getObject();
IRubyObject constant = (staticScope == null) ? object.getConstant(constName) : staticScope.getConstantInner(constName);

// Inheritance lookup
@@ -1136,12 +1135,11 @@ public static IRubyObject searchConst(ThreadContext context, StaticScope staticS

@JIT
public static IRubyObject inheritedSearchConst(ThreadContext context, IRubyObject cmVal, String constName, boolean noPrivateConsts) {
Ruby runtime = context.runtime;
RubyModule module;
if (cmVal instanceof RubyModule) {
module = (RubyModule) cmVal;
} else {
throw runtime.newTypeError(cmVal + " is not a type/class");
throw context.runtime.newTypeError(cmVal + " is not a type/class");
}

IRubyObject constant = noPrivateConsts ? module.getConstantFromNoConstMissing(constName, false) : module.getConstantNoConstMissing(constName);