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

Commits on Oct 6, 2014

  1. Copy the full SHA
    b988911 View commit details
  2. Copy the full SHA
    e5e3c1e View commit details
Original file line number Diff line number Diff line change
@@ -17,6 +17,7 @@
import com.oracle.truffle.api.frame.VirtualFrame;
import org.jruby.truffle.nodes.dispatch.Dispatch;
import org.jruby.truffle.nodes.dispatch.DispatchHeadNode;
import org.jruby.truffle.nodes.yield.YieldDispatchHeadNode;
import org.jruby.truffle.runtime.*;
import org.jruby.truffle.runtime.control.RaiseException;
import org.jruby.truffle.runtime.core.*;
@@ -78,6 +79,26 @@ public boolean equal(Object a, Object b) {

}

@CoreMethod(names = "__id__", needsSelf = true, maxArgs = 0)
public abstract static class IDNode extends CoreMethodNode {

public IDNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

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

@Specialization
public long id(RubyBasicObject object) {
notDesignedForCompilation();

return object.getObjectID();
}

}

@CoreMethod(names = "equal?", minArgs = 1, maxArgs = 1)
public abstract static class ReferenceEqualNode extends CoreMethodNode {

@@ -143,6 +164,41 @@ public NilPlaceholder initiailze() {

}

@CoreMethod(names = "instance_eval", needsBlock = true, maxArgs = 0)
public abstract static class InstanceEvalNode extends CoreMethodNode {

@Child protected YieldDispatchHeadNode yield;

public InstanceEvalNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
yield = new YieldDispatchHeadNode(context);
}

public InstanceEvalNode(InstanceEvalNode prev) {
super(prev);
yield = prev.yield;
}

@Specialization
public Object instanceEval(VirtualFrame frame, RubyBasicObject receiver, RubyProc block) {
notDesignedForCompilation();

if (receiver instanceof RubyFixnum || receiver instanceof RubySymbol) {
throw new RaiseException(getContext().getCoreLibrary().typeError("no class to make alias", this));
}

return yield.dispatchWithModifiedSelf(frame, block, receiver);
}

@Specialization
public Object instanceEval(VirtualFrame frame, Object self, RubyProc block) {
notDesignedForCompilation();

return instanceEval(frame, getContext().getCoreLibrary().box(self), block);
}

}

@CoreMethod(names = "method_missing", needsBlock = true, isSplatted = true)
public abstract static class MethodMissingNode extends CoreMethodNode {

35 changes: 0 additions & 35 deletions core/src/main/java/org/jruby/truffle/nodes/core/ObjectNodes.java
Original file line number Diff line number Diff line change
@@ -492,41 +492,6 @@ public Object initializeDup(VirtualFrame frame, RubyObject self, RubyObject othe

}

@CoreMethod(names = "instance_eval", needsBlock = true, maxArgs = 0)
public abstract static class InstanceEvalNode extends CoreMethodNode {

@Child protected YieldDispatchHeadNode yield;

public InstanceEvalNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
yield = new YieldDispatchHeadNode(context);
}

public InstanceEvalNode(InstanceEvalNode prev) {
super(prev);
yield = prev.yield;
}

@Specialization
public Object instanceEval(VirtualFrame frame, RubyBasicObject receiver, RubyProc block) {
notDesignedForCompilation();

if (receiver instanceof RubyFixnum || receiver instanceof RubySymbol) {
throw new RaiseException(getContext().getCoreLibrary().typeError("no class to make alias", this));
}

return yield.dispatchWithModifiedSelf(frame, block, receiver);
}

@Specialization
public Object instanceEval(VirtualFrame frame, Object self, RubyProc block) {
notDesignedForCompilation();

return instanceEval(frame, getContext().getCoreLibrary().box(self), block);
}

}

@CoreMethod(names = "instance_variable_defined?", minArgs = 1, maxArgs = 1)
public abstract static class InstanceVariableDefinedNode extends CoreMethodNode {

3 changes: 0 additions & 3 deletions spec/truffle/tags/core/basicobject/__id__tags.txt

This file was deleted.