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

Commits on Mar 22, 2016

  1. Revert "[Truffle] Remove old interop stuff."

    This reverts commit 5f82cf2.
    chrisseaton committed Mar 22, 2016
    Copy the full SHA
    e481f0f View commit details
  2. Copy the full SHA
    635e1b6 View commit details
  3. Revert "[Truffle] Use the foreign access DSL."

    This reverts commit ce897e7.
    chrisseaton committed Mar 22, 2016
    Copy the full SHA
    b088a32 View commit details
Showing with 383 additions and 345 deletions.
  1. +24 −0 truffle/src/main/java/org/jruby/truffle/interop/AbstractExecuteMethodNode.java
  2. +5 −2 truffle/src/main/java/org/jruby/truffle/interop/ExecuteMethodNode.java
  3. +0 −43 truffle/src/main/java/org/jruby/truffle/interop/ForeignExecuteNode.java
  4. +0 −48 truffle/src/main/java/org/jruby/truffle/interop/ForeignGetSizeNode.java
  5. +0 −44 truffle/src/main/java/org/jruby/truffle/interop/ForeignInvokeNode.java
  6. +0 −43 truffle/src/main/java/org/jruby/truffle/interop/ForeignIsNullNode.java
  7. +0 −47 truffle/src/main/java/org/jruby/truffle/interop/ForeignReadNode.java
  8. +0 −32 truffle/src/main/java/org/jruby/truffle/interop/ForeignUnboxNode.java
  9. +0 −44 truffle/src/main/java/org/jruby/truffle/interop/ForeignWriteNode.java
  10. +30 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropArgumentNode.java
  11. +47 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropArgumentsNode.java
  12. +33 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropGetSizeProperty.java
  13. +37 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropHasSize.java
  14. +10 −9 truffle/src/main/java/org/jruby/truffle/interop/{ForeignHasSizeNode.java → InteropIsExecutable.java}
  15. +27 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropIsNull.java
  16. +11 −11 ...rc/main/java/org/jruby/truffle/interop/{ForeignIsExecutableNode.java → InteropStringIsBoxed.java}
  17. +16 −11 ...e/src/main/java/org/jruby/truffle/interop/{ForeignIsBoxedNode.java → InteropStringUnboxNode.java}
  18. +5 −5 truffle/src/main/java/org/jruby/truffle/interop/ResolvedInteropExecuteAfterReadNode.java
  19. +99 −0 truffle/src/main/java/org/jruby/truffle/interop/RubyForeignAccessFactory.java
  20. +36 −0 truffle/src/main/java/org/jruby/truffle/interop/RubyInteropRootNode.java
  21. +3 −6 truffle/src/main/java/org/jruby/truffle/language/RubyObjectType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
* Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General Public License version 2.1
*/
package org.jruby.truffle.interop;

import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyNode;

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

public abstract Object executeWithTarget(VirtualFrame frame, Object method);
}
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@
import java.util.List;

@NodeChild(value="method", type = RubyNode.class)
public abstract class ExecuteMethodNode extends RubyNode {
public abstract class ExecuteMethodNode extends AbstractExecuteMethodNode {
@Child private IndirectCallNode callNode;
public ExecuteMethodNode(RubyContext context,
SourceSection sourceSection) {
@@ -74,6 +74,10 @@ protected Object doCall(VirtualFrame frame, DynamicObject method) {
return callNode.call(frame, internalMethod.getCallTarget(), RubyArguments.pack(null, null, internalMethod, DeclarationContext.METHOD, null, Layouts.METHOD.getReceiver(method), null, args));
}

protected InternalMethod getMethodFromProc(DynamicObject proc) {
return Layouts.PROC.getMethod(proc);
}

protected CallTarget getCallTarget(DynamicObject proc) {
return Layouts.PROC.getCallTargetForType(proc);
}
@@ -82,5 +86,4 @@ protected InternalMethod getMethod(DynamicObject method) {
return Layouts.METHOD.getMethod(method);
}

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

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) 2013, 2016 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General Public License version 2.1
*/
package org.jruby.truffle.interop;

import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.interop.ForeignAccess;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.language.RubyNode;

public class InteropArgumentNode extends RubyNode {
private final int index;

public InteropArgumentNode(RubyContext context, SourceSection sourceSection, int index) {
super(context, sourceSection);
this.index = index;
}

public Object execute(VirtualFrame frame) {
return ForeignAccess.getArguments(frame).get(index);
}

}
Loading