Skip to content

Commit

Permalink
Revert "[Truffle] Remove useless copy constructors in NilClassNodes."
Browse files Browse the repository at this point in the history
This reverts commit 476bd7f.
  • Loading branch information
eregon committed Dec 15, 2014
1 parent 5b768a7 commit 369470c
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/core/NilClassNodes.java
Expand Up @@ -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");
Expand All @@ -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;
Expand All @@ -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);
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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("");
Expand All @@ -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);
Expand All @@ -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));
Expand All @@ -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;
Expand Down

0 comments on commit 369470c

Please sign in to comment.