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

Commits on Mar 22, 2016

  1. Copy the full SHA
    c29964a View commit details
  2. Copy the full SHA
    9c434de View commit details
  3. [Truffle] SIZE can also be shared between all factories, even if they…

    … return false for HAS_SIZE.
    chrisseaton committed Mar 22, 2016
    Copy the full SHA
    a01aac6 View commit details
  4. Copy the full SHA
    5507f92 View commit details
  5. Copy the full SHA
    8a5fc9b View commit details
  6. Copy the full SHA
    9160bbc View commit details
  7. Copy the full SHA
    4e0ae33 View commit details
  8. Copy the full SHA
    3d65d8b View commit details
  9. Copy the full SHA
    0cac42e View commit details
  10. Copy the full SHA
    558d63d View commit details
  11. Copy the full SHA
    b67ebf5 View commit details
  12. Copy the full SHA
    c5aaf60 View commit details
  13. Copy the full SHA
    0f2906c View commit details
  14. [Truffle] Use the foreign access DSL.

    Just use the existing nodes in a sloppy way for now.
    chrisseaton committed Mar 22, 2016
    Copy the full SHA
    ce897e7 View commit details
Showing with 503 additions and 220 deletions.
  1. +1 −0 truffle/pom.rb
  2. +1 −0 truffle/pom.xml
  3. +0 −42 truffle/src/main/java/org/jruby/truffle/core/MethodForeignAccessFactory.java
  4. +0 −42 truffle/src/main/java/org/jruby/truffle/core/array/ArrayForeignAccessFactory.java
  5. +0 −42 truffle/src/main/java/org/jruby/truffle/core/hash/HashForeignAccessFactory.java
  6. +0 −60 truffle/src/main/java/org/jruby/truffle/core/string/StringForeignAccessFactory.java
  7. +43 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignExecuteNode.java
  8. +48 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignGetSizeNode.java
  9. +28 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignHasSizeNode.java
  10. +44 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignInvokeNode.java
  11. +32 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignIsBoxedNode.java
  12. +32 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignIsExecutableNode.java
  13. +43 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignIsNullNode.java
  14. +47 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignReadNode.java
  15. +32 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignUnboxNode.java
  16. +44 −0 truffle/src/main/java/org/jruby/truffle/interop/ForeignWriteNode.java
  17. +37 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropHasSize.java
  18. +29 −0 truffle/src/main/java/org/jruby/truffle/interop/InteropIsExecutable.java
  19. +8 −1 truffle/src/main/java/org/jruby/truffle/interop/InteropStringUnboxNode.java
  20. +7 −3 truffle/src/main/java/org/jruby/truffle/interop/ResolvedInteropExecuteAfterReadNode.java
  21. +15 −9 ...e/{core/basicobject/BasicObjectForeignAccessFactory.java → interop/RubyForeignAccessFactory.java}
  22. +6 −0 truffle/src/main/java/org/jruby/truffle/interop/UnresolvedInteropReadNode.java
  23. +6 −21 truffle/src/main/java/org/jruby/truffle/language/RubyObjectType.java
1 change: 1 addition & 0 deletions truffle/pom.rb
Original file line number Diff line number Diff line change
@@ -45,6 +45,7 @@
:phase => 'compile',
'annotationProcessors' => [ 'org.jruby.truffle.om.dsl.processor.OMProcessor',
'com.oracle.truffle.dsl.processor.TruffleProcessor',
'com.oracle.truffle.dsl.processor.InteropProcessor',
'com.oracle.truffle.dsl.processor.verify.VerifyTruffleProcessor',
'com.oracle.truffle.dsl.processor.LanguageRegistrationProcessor' ],
'generatedSourcesDirectory' => 'target/generated-sources',
1 change: 1 addition & 0 deletions truffle/pom.xml
Original file line number Diff line number Diff line change
@@ -119,6 +119,7 @@ DO NOT MODIFIY - GENERATED CODE
<annotationProcessors>
<annotationProcessor>org.jruby.truffle.om.dsl.processor.OMProcessor</annotationProcessor>
<annotationProcessor>com.oracle.truffle.dsl.processor.TruffleProcessor</annotationProcessor>
<annotationProcessor>com.oracle.truffle.dsl.processor.InteropProcessor</annotationProcessor>
<annotationProcessor>com.oracle.truffle.dsl.processor.verify.VerifyTruffleProcessor</annotationProcessor>
<annotationProcessor>com.oracle.truffle.dsl.processor.LanguageRegistrationProcessor</annotationProcessor>
</annotationProcessors>

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,43 @@
/*
* 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.CompilerDirectives;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.interop.AcceptMessage;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObject;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.RubyLanguage;
import org.jruby.truffle.language.RubyObjectType;

@AcceptMessage(value = "EXECUTE", receiverType = RubyObjectType.class, language = RubyLanguage.class)
public final class ForeignExecuteNode extends ForeignExecuteBaseNode {

@Child private Node findContextNode;
@Child private InteropExecute interopNode;

@Override
public Object access(VirtualFrame frame, DynamicObject object, Object[] args) {
return getInteropNode().execute(frame);
}

private InteropExecute getInteropNode() {
if (interopNode == null) {
CompilerDirectives.transferToInterpreter();
findContextNode = insert(RubyLanguage.INSTANCE.unprotectedCreateFindContextNode());
final RubyContext context = RubyLanguage.INSTANCE.unprotectedFindContext(findContextNode);
interopNode = insert(new InteropExecute(context, null));
}

return interopNode;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* 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.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.interop.AcceptMessage;
import com.oracle.truffle.api.interop.ForeignAccess;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObject;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.RubyLanguage;
import org.jruby.truffle.language.RubyObjectType;
import org.jruby.truffle.language.dispatch.DispatchAction;
import org.jruby.truffle.language.dispatch.DispatchHeadNode;
import org.jruby.truffle.language.dispatch.MissingBehavior;

@AcceptMessage(value = "GET_SIZE", receiverType = RubyObjectType.class, language = RubyLanguage.class)
public final class ForeignGetSizeNode extends ForeignGetSizeBaseNode {

@Child private Node findContextNode;
@Child private DispatchHeadNode dispatchNode;

@Override
public Object access(VirtualFrame frame, DynamicObject object) {
return getDispatchNode().dispatch(frame, object, "size", null, new Object[] {});
}

private DispatchHeadNode getDispatchNode() {
if (dispatchNode == null) {
CompilerDirectives.transferToInterpreter();
findContextNode = insert(RubyLanguage.INSTANCE.unprotectedCreateFindContextNode());
final RubyContext context = RubyLanguage.INSTANCE.unprotectedFindContext(findContextNode);
dispatchNode = insert(new DispatchHeadNode(context, true, MissingBehavior.CALL_METHOD_MISSING, DispatchAction.CALL_METHOD));
}

return dispatchNode;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* 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.AcceptMessage;
import com.oracle.truffle.api.object.DynamicObject;
import org.jruby.truffle.RubyLanguage;
import org.jruby.truffle.core.string.StringOperations;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyObjectType;

@AcceptMessage(value = "HAS_SIZE", receiverType = RubyObjectType.class, language = RubyLanguage.class)
public final class ForeignHasSizeNode extends ForeignHasSizeBaseNode {

@Override
public Object access(VirtualFrame frame, DynamicObject object) {
return RubyGuards.isRubyArray(object) || RubyGuards.isRubyHash(object) || RubyGuards.isRubyString(object);
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* 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.CompilerDirectives;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.interop.AcceptMessage;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.object.DynamicObject;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.RubyLanguage;
import org.jruby.truffle.language.RubyNode;
import org.jruby.truffle.language.RubyObjectType;

@AcceptMessage(value = "INVOKE", receiverType = RubyObjectType.class, language = RubyLanguage.class)
public final class ForeignInvokeNode extends ForeignInvokeBaseNode {

@Child private Node findContextNode;
@Child private RubyNode interopNode;

@Override
public Object access(VirtualFrame frame, DynamicObject object, String name, Object[] args) {
return getInteropNode().execute(frame);
}

private RubyNode getInteropNode() {
if (interopNode == null) {
CompilerDirectives.transferToInterpreter();
findContextNode = insert(RubyLanguage.INSTANCE.unprotectedCreateFindContextNode());
final RubyContext context = RubyLanguage.INSTANCE.unprotectedFindContext(findContextNode);
interopNode = insert(new UnresolvedInteropExecuteAfterReadNode(context, null, 0));
}

return interopNode;
}

}
Loading