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

Commits on Sep 12, 2015

  1. Copy the full SHA
    31e716e View commit details
  2. Merge branch 'master' into truffle-head

    Conflicts:
    	truffle/src/main/java/org/jruby/truffle/runtime/core/BasicForeignAccessFactory.java
    	truffle/src/main/java/org/jruby/truffle/runtime/core/HashForeignAccessFactory.java
    chrisseaton committed Sep 12, 2015
    Copy the full SHA
    d181f4b View commit details
  3. Copy the full SHA
    26985d0 View commit details
Original file line number Diff line number Diff line change
@@ -316,7 +316,7 @@ public Object export(VirtualFrame frame, DynamicObject name, TruffleObject objec
}

protected static String rubyStringToString(DynamicObject rubyString) {
return rubyString.toString();
return rubyString.toString();
}
}

Original file line number Diff line number Diff line change
@@ -55,11 +55,11 @@ private void initializeNodes(RubyContext context, int arity) {
if (name.equals("[]")) {
directArray = Message.READ.createNode();
} else if (name.equals("[]=")) {
directArray = Message.WRITE.createNode();
directArray = Message.WRITE.createNode();
} else if (name.endsWith("=") && arity == 1) {
directField = Message.WRITE.createNode();
} else if (name.endsWith("nil?")) {
nullCheck = Message.IS_NULL.createNode();
nullCheck = Message.IS_NULL.createNode();
} else {
access = Message.createInvoke(arity + 1).createNode();
}
Original file line number Diff line number Diff line change
@@ -98,61 +98,61 @@ public static RubyNode createStringUnbox(RubyContext context, final SourceSectio

private static class InteropExecute extends InteropNode {
@Child private ExecuteMethodNode execute;
public InteropExecute(RubyContext context, SourceSection sourceSection) {
public InteropExecute(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
this.execute = InteropNodeFactory.ExecuteMethodNodeGen.create(context, sourceSection, null);
}

@Override
public Object execute(VirtualFrame frame) {
Object result = execute.executeWithTarget(frame, ForeignAccess.getReceiver(frame));
Object result = execute.executeWithTarget(frame, ForeignAccess.getReceiver(frame));
return result;
}
}

protected static abstract class AbstractExecuteMethodNode extends InteropNode {
public AbstractExecuteMethodNode(RubyContext context,
SourceSection sourceSection) {
super(context, sourceSection);
}
public AbstractExecuteMethodNode(RubyContext context,
SourceSection sourceSection) {
super(context, sourceSection);
}

public abstract Object executeWithTarget(VirtualFrame frame, Object method);
public abstract Object executeWithTarget(VirtualFrame frame, Object method);
}

@NodeChild(value="method", type = InteropNode.class)
protected static abstract class ExecuteMethodNode extends AbstractExecuteMethodNode {
@Child private IndirectCallNode callNode;
public ExecuteMethodNode(RubyContext context,
SourceSection sourceSection) {
super(context, sourceSection);
callNode = Truffle.getRuntime().createIndirectCallNode();
}
@Child private IndirectCallNode callNode;
public ExecuteMethodNode(RubyContext context,
SourceSection sourceSection) {
super(context, sourceSection);
callNode = Truffle.getRuntime().createIndirectCallNode();
}

@Specialization(guards = {"isRubyMethod(method)", "method == cachedMethod"})
protected Object doCall(VirtualFrame frame, DynamicObject method,
@Specialization(guards = {"isRubyMethod(method)", "method == cachedMethod"})
protected Object doCall(VirtualFrame frame, DynamicObject method,
@Cached("method") DynamicObject cachedMethod,
@Cached("getMethod(cachedMethod)") InternalMethod internalMethod,
@Cached("create(getMethod(cachedMethod).getCallTarget())") DirectCallNode callNode) {
final List<Object> faArgs = ForeignAccess.getArguments(frame);
// skip first argument; it's the receiver but a RubyMethod knows its receiver
Object[] args = faArgs.subList(1, faArgs.size()).toArray();
return callNode.call(frame, RubyArguments.pack(internalMethod, internalMethod.getDeclarationFrame(), Layouts.METHOD.getReceiver(cachedMethod), null, args));
}
@Specialization(guards = "isRubyMethod(method)")
protected Object doCall(VirtualFrame frame, DynamicObject method) {
final InternalMethod internalMethod = Layouts.METHOD.getMethod(method);
// skip first argument; it's the receiver but a RubyMethod knows its receiver
Object[] args = faArgs.subList(1, faArgs.size()).toArray();
return callNode.call(frame, RubyArguments.pack(internalMethod, internalMethod.getDeclarationFrame(), Layouts.METHOD.getReceiver(cachedMethod), null, args));
}
@Specialization(guards = "isRubyMethod(method)")
protected Object doCall(VirtualFrame frame, DynamicObject method) {
final InternalMethod internalMethod = Layouts.METHOD.getMethod(method);
final List<Object> faArgs = ForeignAccess.getArguments(frame);
// skip first argument; it's the receiver but a RubyMethod knows its receiver
Object[] args = faArgs.subList(1, faArgs.size()).toArray();
// skip first argument; it's the receiver but a RubyMethod knows its receiver
Object[] args = faArgs.subList(1, faArgs.size()).toArray();
return callNode.call(frame, internalMethod.getCallTarget(), RubyArguments.pack(
internalMethod,
internalMethod.getDeclarationFrame(),
Layouts.METHOD.getReceiver(method),
null,
args));
}
}

protected InternalMethod getMethod(DynamicObject method) {
return Layouts.METHOD.getMethod(method);