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

Commits on Dec 15, 2014

  1. Revert "[Truffle] Remove useless node copy constructors."

    This reverts commit 391076d.
    eregon committed Dec 15, 2014
    Copy the full SHA
    3d843d1 View commit details
  2. Copy the full SHA
    5b768a7 View commit details
  3. Copy the full SHA
    369470c View commit details
36 changes: 36 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/core/NilClassNodes.java
Original file line number Diff line number Diff line change
@@ -25,6 +25,10 @@ public InspectNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public RubyString inspect() {
return getContext().makeString("nil");
@@ -38,6 +42,10 @@ public NilNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public boolean nil() {
return true;
@@ -51,6 +59,10 @@ public ToANode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public RubyArray toA() {
return new RubyArray(getContext().getCoreLibrary().getArrayClass(), null, 0);
@@ -64,6 +76,10 @@ public ToINode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public int toI() {
return 0;
@@ -77,6 +93,10 @@ public ToFNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public double toF() {
return 0.0f;
@@ -90,6 +110,10 @@ public ToSNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public RubyString toS() {
return getContext().makeString("");
@@ -103,6 +127,10 @@ public ToHNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public RubyHash toH() {
return new RubyHash(getContext().getCoreLibrary().getHashClass(), null, getContext().getCoreLibrary().getNilObject(), null, 0);
@@ -116,6 +144,10 @@ public DupNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public RubyString dup() {
throw new RaiseException(getContext().getCoreLibrary().typeError("can't dup NilClass", this));
@@ -129,6 +161,10 @@ public AndNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public boolean and(Object other) {
return false;
44 changes: 44 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/core/ThreadNodes.java
Original file line number Diff line number Diff line change
@@ -34,6 +34,10 @@ 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;
@@ -48,6 +52,10 @@ public CurrentNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

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

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

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

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

@Specialization
public RubyNilClass exit() {
throw new ThreadExitException();
@@ -92,6 +108,10 @@ 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>() {
@@ -117,6 +137,10 @@ public InitializeNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

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

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

@Specialization
public RubyThread join(RubyThread self) {
notDesignedForCompilation();
@@ -151,6 +179,10 @@ 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();
@@ -220,6 +252,10 @@ public StatusNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

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

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

@Specialization
public boolean stop(RubyThread self) {
notDesignedForCompilation();
@@ -252,6 +292,10 @@ 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,6 +27,10 @@ public DumpCallStackNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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