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: 5f717bd67690
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2c10c1e6e940
Choose a head ref
  • 2 commits
  • 3 files changed
  • 1 contributor

Commits on Oct 29, 2014

  1. Copy the full SHA
    68ee23e View commit details
  2. Copy the full SHA
    2c10c1e View commit details
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
@@ -3141,7 +3141,7 @@ private void buildRescueBodyInternal(IRScope s, RescueBodyNode rescueBodyNode, V
// of StandardError. I am ignoring this for now and treating this as undefined behavior.
//
// SSS FIXME: Create a 'StandardError' operand type to eliminate this.
Variable v = addResultInstr(s, new InheritanceSearchConstInstr(s.createTemporaryVariable(), s.getCurrentModuleVariable(), "StandardError", false));
Variable v = addResultInstr(s, new InheritanceSearchConstInstr(s.createTemporaryVariable(), s.getCurrentModuleVariable(), "StandardError", false));
outputExceptionCheck(s, v, exc, caughtLabel);
}

2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/IREvalScript.java
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ public List<IRClosure> getEndBlocks() {
return endBlocks;
}

public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, DynamicScope evalScope, Block block, String backtraceName) {
public IRubyObject call(ThreadContext context, IRubyObject self, RubyModule clazz, Block block, String backtraceName) {
if (IRRuntimeHelpers.isDebug()) {
LOG.info("Graph:\n" + cfg().toStringGraph());
LOG.info("CFG:\n" + cfg().toStringInstrs());
25 changes: 11 additions & 14 deletions core/src/main/java/org/jruby/ir/interpreter/Interpreter.java
Original file line number Diff line number Diff line change
@@ -84,9 +84,6 @@ public static IRubyObject interpretCommonEval(Ruby runtime, String file, int lin
StaticScope ss = rootNode.getStaticScope();
IRScope containingIRScope = getEvalContainerScope(ss);
IREvalScript evalScript = IRBuilder.createIRBuilder(runtime, runtime.getIRManager()).buildEvalRoot(ss, containingIRScope, file, lineNumber, rootNode, evalType);
// ClosureInterpreterContext never retrieved as an operand in this context.
// So, self operand is not required here.
// Passing null to force early crasher if ever used differently.
BeginEndInterpreterContext ic = (BeginEndInterpreterContext) evalScript.prepareForInterpretation();
ThreadContext context = runtime.getCurrentContext();

@@ -106,7 +103,7 @@ public static IRubyObject interpretCommonEval(Ruby runtime, String file, int lin
s.growIfNeeded();

runBeginEndBlocks(evalScript.getBeginBlocks(), context, self, ss, null); // FIXME: No temp vars yet right?
rv = evalScript.call(context, self, evalScript.getStaticScope().getModule(), s, block, backtraceName);
rv = evalScript.call(context, self, evalScript.getStaticScope().getModule(), block, backtraceName);
} finally {
runEndBlocks(ic.getEndBlocks(), context, self, ss, null); // FIXME: No temp vars right?
s.clearEvalType();
@@ -722,11 +719,15 @@ public static IRubyObject INTERPRET_METHOD(ThreadContext context, InterpretedIRM
* @return An IRubyObject result from the evaluation
*/
public static IRubyObject evalSimple(ThreadContext context, IRubyObject self, RubyString src, String file, int lineNumber, EvalType evalType) {
Ruby runtime = context.runtime;

if (runtime.getInstanceConfig().getCompileMode() == RubyInstanceConfig.CompileMode.TRUFFLE) {
throw new UnsupportedOperationException();
}

// this is ensured by the caller
assert file != null;

Ruby runtime = context.runtime;

// no binding, just eval in "current" frame (caller's frame)
RubyString source = src.convertToString();

@@ -736,10 +737,6 @@ public static IRubyObject evalSimple(ThreadContext context, IRubyObject self, Ru
try {
Node node = runtime.parseEval(source.getByteList(), file, evalScope, lineNumber);

if (runtime.getInstanceConfig().getCompileMode() == RubyInstanceConfig.CompileMode.TRUFFLE) {
throw new UnsupportedOperationException();
}

// SSS FIXME: AST interpreter passed both a runtime (which comes from the source string)
// and the thread-context rather than fetch one from the other. Why is that?
return Interpreter.interpretSimpleEval(runtime, file, lineNumber, "(eval)", node, self, evalType);
@@ -766,6 +763,10 @@ public static IRubyObject evalSimple(ThreadContext context, IRubyObject self, Ru
*/
public static IRubyObject evalWithBinding(ThreadContext context, IRubyObject self, IRubyObject src, Binding binding) {
Ruby runtime = context.runtime;
if (runtime.getInstanceConfig().getCompileMode() == RubyInstanceConfig.CompileMode.TRUFFLE) {
throw new UnsupportedOperationException();
}

DynamicScope evalScope;

// in 1.9, eval scopes are local to the binding
@@ -782,10 +783,6 @@ public static IRubyObject evalWithBinding(ThreadContext context, IRubyObject sel
Node node = runtime.parseEval(source.getByteList(), binding.getFile(), evalScope, binding.getLine());
Block block = binding.getFrame().getBlock();

if (runtime.getInstanceConfig().getCompileMode() == RubyInstanceConfig.CompileMode.TRUFFLE) {
throw new UnsupportedOperationException();
}

// SSS FIXME: AST interpreter passed both a runtime (which comes from the source string)
// and the thread-context rather than fetch one from the other. Why is that?
return Interpreter.interpretBindingEval(runtime, binding.getFile(), binding.getLine(), binding.getMethod(), node, self, block);