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

Commits on Apr 1, 2016

  1. Copy the full SHA
    b447965 View commit details
  2. Add tags for failing specs

    eregon committed Apr 1, 2016
    Copy the full SHA
    1ef4f7a View commit details
  3. [Truffle] Fix Graal option translation in jruby_eclipse.

    * And show full command with -d.
    eregon committed Apr 1, 2016
    Copy the full SHA
    c4113bc View commit details
  4. [Truffle] Remove CallNodeWrapperNode in CallBlockNode.

    * It is no longer needed by Truffle.
    eregon committed Apr 1, 2016
    Copy the full SHA
    54ead23 View commit details
2 changes: 2 additions & 0 deletions spec/tags/ruby/core/thread/abort_on_exception_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fails:Thread#abort_on_exception= when enabled and the thread dies due to an exception causes the main thread to raise the exception raised in the thread
fails:Thread.abort_on_exception= when enabled and a non-main thread dies due to an exception causes the main thread to raise the exception raised in the thread
6 changes: 5 additions & 1 deletion tool/jruby_eclipse
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@ ARGV.each { |arg|
when /^-J-G:-/
java_flags << "-D#{GRAAL_OPTIONS_PREFIX}#{$'}=false"
when /^-J-G:/
java_flags << "-D#{GRAAL_OPTIONS_PREFIX}.#{$'}"
java_flags << "-D#{GRAAL_OPTIONS_PREFIX}#{$'}"
when /^-J/
java_flags << arg[2..-1]
when /^-Xtruffle./
@@ -86,4 +86,8 @@ args += java_flags
args << "org.jruby.Main"
args += rest

if args.include?('-d')
puts args.join(' ')
end

exec(*args)
Original file line number Diff line number Diff line change
@@ -136,6 +136,7 @@ public class CoreLibrary {
private final DynamicObject exceptionClass;
private final DynamicObject falseClass;
private final DynamicObject fiberClass;
private final DynamicObjectFactory fiberFactory;
private final DynamicObject fixnumClass;
private final DynamicObject floatClass;
private final DynamicObject floatDomainErrorClass;
@@ -415,7 +416,8 @@ public CoreLibrary(RubyContext context) {
Layouts.CLASS.setInstanceFactoryUnsafe(encodingClass, Layouts.ENCODING.createEncodingShape(encodingClass, encodingClass));
falseClass = defineClass("FalseClass");
fiberClass = defineClass("Fiber");
Layouts.CLASS.setInstanceFactoryUnsafe(fiberClass, Layouts.FIBER.createFiberShape(fiberClass, fiberClass));
fiberFactory = Layouts.FIBER.createFiberShape(fiberClass, fiberClass);
Layouts.CLASS.setInstanceFactoryUnsafe(fiberClass, fiberFactory);
defineModule("FileTest");
hashClass = defineClass("Hash");
hashFactory = Layouts.HASH.createHashShape(hashClass, hashClass);
@@ -1460,6 +1462,10 @@ public DynamicObject getFiberClass() {
return fiberClass;
}

public DynamicObjectFactory getFiberFactory() {
return fiberFactory;
}

public DynamicObject getFixnumClass() {
return fixnumClass;
}
Original file line number Diff line number Diff line change
@@ -16,6 +16,7 @@
import com.oracle.truffle.api.nodes.ControlFlowException;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.object.DynamicObjectFactory;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.core.CoreClass;
@@ -35,25 +36,24 @@
import org.jruby.truffle.language.control.RaiseException;
import org.jruby.truffle.language.control.ReturnException;
import org.jruby.truffle.language.methods.UnsupportedOperationBehavior;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.LinkedBlockingQueue;

@CoreClass(name = "Fiber")
public abstract class FiberNodes {

public static DynamicObject createFiber(DynamicObject thread, DynamicObject rubyClass, String name) {
return createFiber(thread, rubyClass, name, false);
public static DynamicObject createFiber(DynamicObject thread, DynamicObjectFactory factory, String name) {
return createFiber(thread, factory, name, false);
}

public static DynamicObject createRootFiber(RubyContext context, DynamicObject thread) {
return createFiber(thread, context.getCoreLibrary().getFiberClass(), "root Fiber for Thread", true);
return createFiber(thread, context.getCoreLibrary().getFiberFactory(), "root Fiber for Thread", true);
}

private static DynamicObject createFiber(DynamicObject thread, DynamicObject rubyClass, String name, boolean isRootFiber) {
private static DynamicObject createFiber(DynamicObject thread, DynamicObjectFactory factory, String name, boolean isRootFiber) {
assert RubyGuards.isRubyThread(thread);
return Layouts.FIBER.createFiber(
Layouts.CLASS.getInstanceFactory(rubyClass),
factory,
isRootFiber,
new CountDownLatch(1),
new LinkedBlockingQueue<FiberMessage>(2),
@@ -387,10 +387,12 @@ public AllocateNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@TruffleBoundary
@Specialization
public DynamicObject allocate(DynamicObject rubyClass) {
DynamicObject parent = getContext().getThreadManager().getCurrentThread();
return createFiber(parent, rubyClass, null);
DynamicObjectFactory factory = Layouts.CLASS.getInstanceFactory(rubyClass);
return createFiber(parent, factory, null);
}

}
Original file line number Diff line number Diff line change
@@ -18,7 +18,6 @@
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.DirectCallNode;
import com.oracle.truffle.api.nodes.IndirectCallNode;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObject;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
@@ -35,16 +34,6 @@
})
public abstract class CallBlockNode extends RubyNode {

// Allowing the child to be Node.replace()'d.

static class CallNodeWrapperNode extends Node {
@Child DirectCallNode child;

public CallNodeWrapperNode(DirectCallNode child) {
this.child = insert(child);
}
}

private final DeclarationContext declarationContext;

public CallBlockNode(RubyContext context, SourceSection sourceSection, DeclarationContext declarationContext) {
@@ -65,9 +54,9 @@ protected Object callBlockCached(
Object blockArgument,
Object[] arguments,
@Cached("getBlockCallTarget(block)") CallTarget cachedCallTarget,
@Cached("createBlockCallNode(cachedCallTarget)") CallNodeWrapperNode callNode) {
@Cached("createBlockCallNode(cachedCallTarget)") DirectCallNode callNode) {
final Object[] frameArguments = packArguments(block, self, blockArgument, arguments);
return callNode.child.call(frame, frameArguments);
return callNode.call(frame, frameArguments);
}

@Specialization(contains = "callBlockCached")
@@ -98,9 +87,8 @@ protected static CallTarget getBlockCallTarget(DynamicObject block) {
return Layouts.PROC.getCallTargetForType(block);
}

protected CallNodeWrapperNode createBlockCallNode(CallTarget callTarget) {
protected DirectCallNode createBlockCallNode(CallTarget callTarget) {
final DirectCallNode callNode = Truffle.getRuntime().createDirectCallNode(callTarget);
final CallNodeWrapperNode callNodeWrapperNode = new CallNodeWrapperNode(callNode);

if (getContext().getOptions().YIELD_ALWAYS_CLONE && callNode.isCallTargetCloningAllowed()) {
callNode.cloneCallTarget();
@@ -110,7 +98,7 @@ protected CallNodeWrapperNode createBlockCallNode(CallTarget callTarget) {
callNode.forceInlining();
}

return callNodeWrapperNode;
return callNode;
}

protected int getCacheLimit() {