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: 26a96be0577c
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7381eb90e47d
Choose a head ref
  • 4 commits
  • 6 files changed
  • 1 contributor

Commits on Oct 10, 2014

  1. Copy the full SHA
    9d954e0 View commit details
  2. Copy the full SHA
    4864d4d View commit details
  3. Copy the full SHA
    a34440e View commit details
  4. Copy the full SHA
    7381eb9 View commit details
Original file line number Diff line number Diff line change
@@ -1424,7 +1424,7 @@ public RubyArray methods(RubyObject self, @SuppressWarnings("unused") UndefinedP

}

@CoreMethod(names = "raise", isModuleMethod = true, needsSelf = false, minArgs = 1, maxArgs = 2)
@CoreMethod(names = "raise", isModuleMethod = true, needsSelf = false, minArgs = 0, maxArgs = 2)
public abstract static class RaiseNode extends CoreMethodNode {

@Child protected DispatchHeadNode initialize;
@@ -1439,6 +1439,13 @@ public RaiseNode(RaiseNode prev) {
initialize = prev.initialize;
}

@Specialization
public Object raise(VirtualFrame frame, UndefinedPlaceholder undefined1, @SuppressWarnings("unused") UndefinedPlaceholder undefined2) {
notDesignedForCompilation();

return raise(frame, getContext().getCoreLibrary().getRuntimeErrorClass(), getContext().makeString("re-raised - don't have the current exception yet!"));
}

@Specialization
public Object raise(VirtualFrame frame, RubyString message, @SuppressWarnings("unused") UndefinedPlaceholder undefined) {
notDesignedForCompilation();
Original file line number Diff line number Diff line change
@@ -24,6 +24,7 @@
import org.jruby.truffle.runtime.core.RubyBasicObject;
import org.jruby.truffle.runtime.core.RubyException;
import org.jruby.truffle.runtime.core.RubyHash;
import org.jruby.util.cli.Options;

public class ExceptionTranslatingNode extends RubyNode {

@@ -122,6 +123,10 @@ public RubyBasicObject translate(Throwable throwable) {
throwable.printStackTrace();
}

if (Options.TRUFFLE_PANIC_ON_JAVA_ASSERT.load() && throwable instanceof AssertionError) {
panic(throwable.toString());
}

return getContext().getCoreLibrary().internalError(throwable.getClass().getSimpleName(), this);
}

Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ public void executeVoid(VirtualFrame frame) {

if (!checkArity(given)) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().argumentError(given, arity.getMaximum(), this));
throw new RaiseException(getContext().getCoreLibrary().argumentError(given, arity.getMinimum(), this));
}
}

Original file line number Diff line number Diff line change
@@ -30,8 +30,11 @@

public class GeneralSuperReCallNode extends AbstractGeneralSuperCallNode {

public GeneralSuperReCallNode(RubyContext context, SourceSection sourceSection, String name) {
private final boolean inBlock;

public GeneralSuperReCallNode(RubyContext context, SourceSection sourceSection, String name, boolean inBlock) {
super(context, sourceSection, name);
this.inBlock = inBlock;
}

@ExplodeLoop
@@ -42,9 +45,15 @@ public final Object execute(VirtualFrame frame) {
lookup();
}

// Call the method
final Object[] superArguments;

if (inBlock) {
superArguments = RubyArguments.getDeclarationFrame(frame.getArguments()).getArguments();
} else {
superArguments = frame.getArguments();
}

return callNode.call(frame, frame.getArguments());
return callNode.call(frame, superArguments);
}

}
Original file line number Diff line number Diff line change
@@ -218,7 +218,12 @@ public RubyNode visitSuperNode(org.jruby.ast.SuperNode node) {
public RubyNode visitZSuperNode(org.jruby.ast.ZSuperNode node) {
final SourceSection sourceSection = translate(node.getPosition());

return new GeneralSuperReCallNode(context, sourceSection, environment.getNamedMethodName());
if (environment.isBlock()) {
// We need the declaration frame to get the arguments to use
environment.setNeedsDeclarationFrame();
}

return new GeneralSuperReCallNode(context, sourceSection, environment.getNamedMethodName(), environment.isBlock());
}

@Override
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -152,6 +152,7 @@ public class Options {
public static final Option<Boolean> TRUFFLE_LOAD_PRINT = bool(TRUFFLE, "truffle.load.print", false, "Print the name of files as they're loaded.");
public static final Option<Boolean> TRUFFLE_DEBUG_ENABLE_ASSERT_CONSTANT = bool(TRUFFLE, "truffle.debug.enable_assert_constant", false, "Enable special 'truffle_assert_constant' form.");
public static final Option<Boolean> TRUFFLE_CALL_FORCE_SPLIT_INLINE_MISSING = bool(TRUFFLE, "truffle.call.force_split_inline_missing", true, "Force splitting/inlining of a method missing call.");
public static final Option<Boolean> TRUFFLE_PANIC_ON_JAVA_ASSERT = bool(TRUFFLE, "truffle.debug.panic_on_java_assert", false, "Panic as soon as a Java assertion failure is found.");

public static final Option<Boolean> NATIVE_ENABLED = bool(NATIVE, "native.enabled", true, "Enable/disable native code, including POSIX features and C exts.");
public static final Option<Boolean> NATIVE_VERBOSE = bool(NATIVE, "native.verbose", false, "Enable verbose logging of native extension loading.");