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

Commits on Dec 15, 2014

  1. [Truffle] Remove useless node copy constructors.

    * A couple of them are actually incorrect.
    eregon committed Dec 15, 2014
    Copy the full SHA
    391076d View commit details
  2. Copy the full SHA
    518f9a8 View commit details
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NodeFactory;

import org.jruby.runtime.Visibility;
import org.jruby.truffle.nodes.CoreSourceSection;
import org.jruby.truffle.nodes.RubyNode;
@@ -25,6 +26,7 @@
import org.jruby.truffle.runtime.util.ArrayUtils;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.UndefinedPlaceholder;
import org.jruby.truffle.runtime.control.TruffleFatalException;
import org.jruby.truffle.runtime.core.RubyClass;
import org.jruby.truffle.runtime.core.RubyModule;
import org.jruby.truffle.runtime.methods.Arity;
@@ -164,16 +166,23 @@ private static RubyRootNode makeGenericMethod(RubyContext context, MethodDetails
argumentsNodes.add(new ReadBlockNode(context, sourceSection, UndefinedPlaceholder.INSTANCE));
}

final RubyNode methodNode;
List<List<Class<?>>> signatures = methodDetails.getNodeFactory().getNodeSignatures();
if (signatures.size() < 1 || signatures.get(0).get(2) == RubyNode[].class) {
methodNode = methodDetails.getNodeFactory().createNode(context, sourceSection, argumentsNodes.toArray(new RubyNode[argumentsNodes.size()]));
} else {
Object[] args = new Object[2 + argumentsNodes.size()];
args[0] = context;
args[1] = sourceSection;
System.arraycopy(argumentsNodes.toArray(new RubyNode[argumentsNodes.size()]), 0, args, 2, argumentsNodes.size());
methodNode = methodDetails.getNodeFactory().createNode(args);
RubyNode methodNode = null;
final NodeFactory<?> nodeFactory = methodDetails.getNodeFactory();
List<List<Class<?>>> signatures = nodeFactory.getNodeSignatures();
assert !signatures.isEmpty();

for (List<Class<?>> signature : signatures) {
if (signature.size() >= 1 && signature.get(0) != RubyContext.class && signature.get(0) != nodeFactory.getNodeClass()) {
throw new TruffleFatalException("Copy constructor with wrong type for previous in "+nodeFactory.getNodeClass()+" : "+signature.get(0), null);
} else if (signature.size() >= 3 && signature.get(2) == RubyNode[].class) {
methodNode = methodDetails.getNodeFactory().createNode(context, sourceSection, argumentsNodes.toArray(new RubyNode[argumentsNodes.size()]));
} else {
Object[] args = new Object[2 + argumentsNodes.size()];
args[0] = context;
args[1] = sourceSection;
System.arraycopy(argumentsNodes.toArray(new RubyNode[argumentsNodes.size()]), 0, args, 2, argumentsNodes.size());
methodNode = methodDetails.getNodeFactory().createNode(args);
}
}

final CheckArityNode checkArity = new CheckArityNode(context, sourceSection, arity);
44 changes: 0 additions & 44 deletions core/src/main/java/org/jruby/truffle/nodes/core/ThreadNodes.java
Original file line number Diff line number Diff line change
@@ -34,10 +34,6 @@ public AliveNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public AliveNode(AliveNode prev) {
super(prev);
}

@Specialization
public boolean alive(RubyThread thread) {
return thread.getStatus() != Status.ABORTING && thread.getStatus() != Status.DEAD;
@@ -52,10 +48,6 @@ public CurrentNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public CurrentNode(AliveNode prev) {
super(prev);
}

@Specialization
public RubyThread current() {
notDesignedForCompilation();
@@ -72,10 +64,6 @@ public ExitModuleNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public ExitModuleNode(ExitModuleNode prev) {
super(prev);
}

@Specialization
public RubyNilClass exit() {
throw new ThreadExitException();
@@ -90,10 +78,6 @@ public ExitInstanceNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public ExitInstanceNode(ExitInstanceNode prev) {
super(prev);
}

@Specialization
public RubyNilClass exit() {
throw new ThreadExitException();
@@ -108,10 +92,6 @@ public KillNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public KillNode(KillNode prev) {
super(prev);
}

@Specialization
public RubyThread kill(final RubyThread thread) {
getContext().getSafepointManager().pauseAllThreadsAndExecute(new Consumer<Boolean>() {
@@ -137,10 +117,6 @@ public InitializeNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public InitializeNode(InitializeNode prev) {
super(prev);
}

@Specialization
public RubyNilClass initialize(RubyThread thread, RubyProc block) {
notDesignedForCompilation();
@@ -158,10 +134,6 @@ public JoinNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public JoinNode(JoinNode prev) {
super(prev);
}

@Specialization
public RubyThread join(RubyThread self) {
notDesignedForCompilation();
@@ -179,10 +151,6 @@ public PassNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public PassNode(PassNode prev) {
super(prev);
}

@Specialization
public RubyNilClass pass() {
final RubyThread runningThread = getContext().getThreadManager().leaveGlobalLock();
@@ -252,10 +220,6 @@ public StatusNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public StatusNode(StatusNode prev) {
super(prev);
}

@Specialization
public Object status(RubyThread self) {
notDesignedForCompilation();
@@ -272,10 +236,6 @@ public StopNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public StopNode(StopNode prev) {
super(prev);
}

@Specialization
public boolean stop(RubyThread self) {
notDesignedForCompilation();
@@ -292,10 +252,6 @@ public ValueNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public ValueNode(ValueNode prev) {
super(prev);
}

@Specialization
public Object value(RubyThread self) {
notDesignedForCompilation();
Original file line number Diff line number Diff line change
@@ -27,10 +27,6 @@ public DumpCallStackNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public DumpCallStackNode(FullTreeNode prev) {
super(prev);
}

@Specialization
public RubyNilClass dumpCallStack() {
notDesignedForCompilation();
@@ -51,10 +47,6 @@ public FlushStdoutNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public FlushStdoutNode(PanicNode prev) {
super(prev);
}

@Specialization
public RubyNilClass flush() {
getContext().getRuntime().getOut().flush();
@@ -70,10 +62,6 @@ public FullTreeNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public FullTreeNode(FullTreeNode prev) {
super(prev);
}

@Specialization
public RubyString fullTree() {
notDesignedForCompilation();
@@ -90,10 +78,6 @@ public JavaClassOfNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public JavaClassOfNode(JavaClassOfNode prev) {
super(prev);
}

@Specialization
public RubyString javaClassOf(Object value) {
notDesignedForCompilation();
@@ -110,10 +94,6 @@ public PanicNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public PanicNode(PanicNode prev) {
super(prev);
}

@Specialization
public RubyNilClass doPanic() {
DebugOperations.panic(getContext(), this, null);
@@ -129,10 +109,6 @@ public ParseTreeNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public ParseTreeNode(ParseTreeNode prev) {
super(prev);
}

@Specialization
public Object parseTree() {
notDesignedForCompilation();
@@ -155,10 +131,6 @@ public TreeNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public TreeNode(TreeNode prev) {
super(prev);
}

@Specialization
public RubyString tree() {
notDesignedForCompilation();