changeset 13660:d2976008ce63

Merge.
author Chris Seaton <chris.seaton@oracle.com>
date Thu, 16 Jan 2014 21:47:17 +0000
parents 62bfc12dc9e1 (diff) 3730b9979305 (current diff)
children 434b86962d0d
files graal/com.oracle.graal.compiler.ptx.test/src/com/oracle/graal/compiler/ptx/test/PTXTestBase.java graal/com.oracle.graal.hotspot.ptx.test/src/com/oracle/graal/hotspot/ptx/test/PTXLaunchKernelTest.java graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXGraphProducer.java graal/com.oracle.graal.hotspot.ptx/src/com/oracle/graal/hotspot/ptx/PTXLaunchKernelGraphKit.java
diffstat 13 files changed, 29 insertions(+), 103 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/core/KernelNodes.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/core/KernelNodes.java	Thu Jan 16 21:47:17 2014 +0000
@@ -629,13 +629,6 @@
 
         @Specialization(order = 3)
         public Object raise(VirtualFrame frame, RubyClass exceptionClass, RubyString message) {
-            final RubyContext context = getContext();
-
-            if (context.getConfiguration().getPrintRubyExceptions()) {
-                context.implementationMessage("Ruby raise: %s", message);
-                new Exception().printStackTrace();
-            }
-
             final RubyBasicObject exception = exceptionClass.newInstance();
             initialize.dispatch(frame, exception, null, message);
             throw new RaiseException(exception);
--- a/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/literal/HashLiteralNode.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/literal/HashLiteralNode.java	Thu Jan 16 21:47:17 2014 +0000
@@ -41,4 +41,9 @@
         return hash;
     }
 
+    @Override
+    public Object isDefined(VirtualFrame frame) {
+        return getContext().makeString("expression");
+    }
+
 }
--- a/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/methods/CatchNextNode.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/methods/CatchNextNode.java	Thu Jan 16 21:47:17 2014 +0000
@@ -39,4 +39,5 @@
             return e.getResult();
         }
     }
+
 }
--- a/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/methods/MethodDefinitionNode.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.nodes/src/com/oracle/truffle/ruby/nodes/methods/MethodDefinitionNode.java	Thu Jan 16 21:47:17 2014 +0000
@@ -91,4 +91,8 @@
         return name;
     }
 
+    public CallTarget getCallTarget() {
+        return callTarget;
+    }
+
 }
--- a/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/RubyContext.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/RubyContext.java	Thu Jan 16 21:47:17 2014 +0000
@@ -169,10 +169,6 @@
     }
 
     public Object execute(RubyContext context, Source source, RubyParser.ParserContext parserContext, Object self, MaterializedFrame parentFrame) {
-        if (configuration.getPrintExecutedFiles()) {
-            implementationMessage("executing: %s", source.getName());
-        }
-
         try {
             final RubyParserResult parseResult = parser.parse(context, source, parserContext, parentFrame);
             final RubyArguments arguments = new RubyArguments(parentFrame, self, null);
--- a/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/configuration/Configuration.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/configuration/Configuration.java	Thu Jan 16 21:47:17 2014 +0000
@@ -32,11 +32,8 @@
     private final boolean fullObjectSpace;
 
     private final boolean printParseTree;
-    private final boolean printExecutedFiles;
-    private final boolean printSpiltInstanceVariables;
     private final boolean printUninitializedCalls;
     private final boolean printJavaExceptions;
-    private final boolean printRubyExceptions;
 
     private final PrintStream standardOut;
     private final InputReader inputReader;
@@ -58,11 +55,8 @@
         fullObjectSpace = builder.getFullObjectSpace();
 
         printParseTree = builder.getPrintParseTree();
-        printExecutedFiles = builder.getPrintExecutedFiles();
-        printSpiltInstanceVariables = builder.getPrintSpiltInstanceVariables();
         printUninitializedCalls = builder.getPrintUninitializedCalls();
         printJavaExceptions = builder.getPrintJavaExceptions();
-        printRubyExceptions = builder.getPrintRubyExceptions();
 
         standardOut = builder.getStandardOut();
         inputReader = builder.getInputReader();
@@ -108,14 +102,6 @@
         return printParseTree;
     }
 
-    public boolean getPrintExecutedFiles() {
-        return printExecutedFiles;
-    }
-
-    public boolean getPrintSpiltInstanceVariables() {
-        return printSpiltInstanceVariables;
-    }
-
     public boolean getPrintUninitializedCalls() {
         return printUninitializedCalls;
     }
@@ -124,10 +110,6 @@
         return printJavaExceptions;
     }
 
-    public boolean getPrintRubyExceptions() {
-        return printRubyExceptions;
-    }
-
     public PrintStream getStandardOut() {
         return standardOut;
     }
--- a/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/configuration/ConfigurationBuilder.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/configuration/ConfigurationBuilder.java	Thu Jan 16 21:47:17 2014 +0000
@@ -37,11 +37,8 @@
     private boolean fullObjectSpace = false;
 
     private boolean printParseTree = false;
-    private boolean printExecutedFiles = false;
-    private boolean printSpiltInstanceVariables = false;
     private boolean printUninitializedCalls = false;
     private boolean printJavaExceptions = false;
-    private boolean printRubyExceptions = false;
 
     private PrintStream standardOut = System.out;
 
@@ -77,11 +74,8 @@
         fullObjectSpace = configuration.getFullObjectSpace();
 
         printParseTree = configuration.getPrintParseTree();
-        printExecutedFiles = configuration.getPrintExecutedFiles();
-        printSpiltInstanceVariables = configuration.getPrintSpiltInstanceVariables();
         printUninitializedCalls = configuration.getPrintUninitializedCalls();
         printJavaExceptions = configuration.getPrintJavaExceptions();
-        printRubyExceptions = configuration.getPrintRubyExceptions();
 
         standardOut = configuration.getStandardOut();
     }
@@ -169,22 +163,6 @@
         this.printParseTree = printParseTree;
     }
 
-    public boolean getPrintExecutedFiles() {
-        return printExecutedFiles;
-    }
-
-    public void setPrintExecutedFiles(boolean printExecutedFiles) {
-        this.printExecutedFiles = printExecutedFiles;
-    }
-
-    public boolean getPrintSpiltInstanceVariables() {
-        return printSpiltInstanceVariables;
-    }
-
-    public void setPrintSpiltInstanceVariables(boolean printSpiltInstanceVariables) {
-        this.printSpiltInstanceVariables = printSpiltInstanceVariables;
-    }
-
     public boolean getPrintUninitializedCalls() {
         return printUninitializedCalls;
     }
@@ -201,14 +179,6 @@
         this.printJavaExceptions = printJavaExceptions;
     }
 
-    public boolean getPrintRubyExceptions() {
-        return printRubyExceptions;
-    }
-
-    public void setPrintRubyExceptions(boolean printRubyExceptions) {
-        this.printRubyExceptions = printRubyExceptions;
-    }
-
     public PrintStream getStandardOut() {
         return standardOut;
     }
--- a/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/core/RubyClass.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/core/RubyClass.java	Thu Jan 16 21:47:17 2014 +0000
@@ -114,7 +114,7 @@
 
         include(superclass);
 
-        objectLayoutForInstances = new ObjectLayout(getName(), getContext(), superclass.objectLayoutForInstances);
+        objectLayoutForInstances = new ObjectLayout(getName(), superclass.objectLayoutForInstances);
     }
 
     public RubyBasicObject newInstance() {
@@ -157,7 +157,7 @@
     }
 
     private void renewObjectLayoutForInstances() {
-        objectLayoutForInstances = objectLayoutForInstances.renew(getContext(), superclass.objectLayoutForInstances);
+        objectLayoutForInstances = objectLayoutForInstances.renew(superclass.objectLayoutForInstances);
 
         for (RubyClass subClass : subClasses) {
             subClass.renewObjectLayoutForInstances();
--- a/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/objects/ObjectLayout.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/objects/ObjectLayout.java	Thu Jan 16 21:47:17 2014 +0000
@@ -17,7 +17,6 @@
 
 import com.oracle.truffle.api.nodes.*;
 import com.oracle.truffle.api.nodes.NodeUtil.*;
-import com.oracle.truffle.ruby.runtime.*;
 
 /**
  * Maps names of instance variables to storage locations, which are either the offset of a primitive
@@ -49,11 +48,11 @@
         objectStorageLocationsUsed = 0;
     }
 
-    public ObjectLayout(String originHint, RubyContext context, ObjectLayout parent) {
-        this(originHint, context, parent, new HashMap<String, Class>());
+    public ObjectLayout(String originHint, ObjectLayout parent) {
+        this(originHint, parent, new HashMap<String, Class>());
     }
 
-    public ObjectLayout(String originHint, RubyContext context, ObjectLayout parent, Map<String, Class> storageTypes) {
+    public ObjectLayout(String originHint, ObjectLayout parent, Map<String, Class> storageTypes) {
         this.originHint = originHint;
         this.parent = parent;
 
@@ -105,10 +104,6 @@
                     storageLocations.put(entry.getKey(), newStorageLocation);
                     primitiveStorageLocationIndex += primitivesNeeded;
                 } else {
-                    if (canStoreInPrimitive && context.getConfiguration().getPrintSpiltInstanceVariables()) {
-                        context.implementationMessage("instance variable %s of type %s spilt due to lack of space", name, type.getName());
-                    }
-
                     final ObjectStorageLocation newStorageLocation = new ObjectStorageLocation(this, objectStorageLocationIndex);
                     storageLocations.put(entry.getKey(), newStorageLocation);
                     objectStorageLocationIndex++;
@@ -125,25 +120,25 @@
      * comes from the same Ruby class as it did, but it's a new layout because layouts are
      * immutable, so modifications to the superclass yields a new layout.
      */
-    public ObjectLayout renew(RubyContext context, ObjectLayout newParent) {
-        return new ObjectLayout(originHint + ".renewed", context, newParent, getStorageTypes());
+    public ObjectLayout renew(ObjectLayout newParent) {
+        return new ObjectLayout(originHint + ".renewed", newParent, getStorageTypes());
     }
 
     /**
      * Create a new version of this layout but with a new variable.
      */
-    public ObjectLayout withNewVariable(RubyContext context, String name, Class type) {
+    public ObjectLayout withNewVariable(String name, Class type) {
         final Map<String, Class> storageTypes = getStorageTypes();
         storageTypes.put(name, type);
-        return new ObjectLayout(originHint + ".withnew", context, parent, storageTypes);
+        return new ObjectLayout(originHint + ".withnew", parent, storageTypes);
     }
 
     /**
      * Create a new version of this layout but with an existing variable generalized to support any
      * type.
      */
-    public ObjectLayout withGeneralisedVariable(RubyContext context, String name) {
-        return withNewVariable(context, name, Object.class);
+    public ObjectLayout withGeneralisedVariable(String name) {
+        return withNewVariable(name, Object.class);
     }
 
     /**
--- a/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/objects/RubyBasicObject.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/objects/RubyBasicObject.java	Thu Jan 16 21:47:17 2014 +0000
@@ -124,7 +124,7 @@
              * the layout of this object.
              */
 
-            rubyClass.setObjectLayoutForInstances(rubyClass.getObjectLayoutForInstances().withNewVariable(rubyClass.getContext(), name, value.getClass()));
+            rubyClass.setObjectLayoutForInstances(rubyClass.getObjectLayoutForInstances().withNewVariable(name, value.getClass()));
             updateLayout();
 
             storageLocation = objectLayout.findStorageLocation(name);
@@ -140,7 +140,7 @@
              * layout and update the layout of this object.
              */
 
-            rubyClass.setObjectLayoutForInstances(rubyClass.getObjectLayoutForInstances().withGeneralisedVariable(rubyClass.getContext(), name));
+            rubyClass.setObjectLayoutForInstances(rubyClass.getObjectLayoutForInstances().withGeneralisedVariable(name));
             updateLayout();
 
             storageLocation = objectLayout.findStorageLocation(name);
@@ -315,15 +315,13 @@
     }
 
     public void switchToPrivateLayout() {
-        final RubyContext context = getRubyClass().getContext();
-
         final Map<String, Object> instanceVariables = getInstanceVariables();
 
         hasPrivateLayout = true;
         objectLayout = ObjectLayout.EMPTY;
 
         for (Entry<String, Object> entry : instanceVariables.entrySet()) {
-            objectLayout = objectLayout.withNewVariable(context, entry.getKey(), entry.getValue().getClass());
+            objectLayout = objectLayout.withNewVariable(entry.getKey(), entry.getValue().getClass());
         }
 
         setInstanceVariables(instanceVariables);
--- a/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/subsystems/FeatureManager.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.runtime/src/com/oracle/truffle/ruby/runtime/subsystems/FeatureManager.java	Thu Jan 16 21:47:17 2014 +0000
@@ -35,11 +35,6 @@
     public boolean require(String feature) throws IOException {
         // Some features are handled specially
 
-        if (feature.equals("continuation")) {
-            // We always load continuations
-            return true;
-        }
-
         if (feature.equals("stringio")) {
             context.implementationMessage("stringio not yet implemented");
             return true;
--- a/graal/com.oracle.truffle.ruby.shell/src/com/oracle/truffle/ruby/shell/CommandLineParser.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.shell/src/com/oracle/truffle/ruby/shell/CommandLineParser.java	Thu Jan 16 21:47:17 2014 +0000
@@ -217,21 +217,12 @@
                         case "--print-parse-tree":
                             configurationBuilder.setPrintParseTree(true);
                             break;
-                        case "--print-executed-files":
-                            configurationBuilder.setPrintExecutedFiles(true);
-                            break;
-                        case "--print-spilt-instance-variables":
-                            configurationBuilder.setPrintSpiltInstanceVariables(true);
-                            break;
                         case "--print-uninitialized-calls":
                             configurationBuilder.setPrintUninitializedCalls(true);
                             break;
                         case "--print-java-exceptions":
                             configurationBuilder.setPrintJavaExceptions(true);
                             break;
-                        case "--print-ruby-exceptions":
-                            configurationBuilder.setPrintRubyExceptions(true);
-                            break;
                         default:
                             throw new IllegalArgumentException("unknown flag " + arg);
                     }
@@ -337,12 +328,8 @@
         out.println("  --no-intrinsic-method-calls       don't turn method calls into intrinsic nodes");
         out.println("  --no-jline                        don't use JLine");
         out.println("  --print-parse-tree                print the result of parsing");
-        out.println("  --print-executed-files            print the name of files as they are executed");
-        out.println("  --print-missing-intrinsics        print method calls that don't have intrinsic nodes");
-        out.println("  --print-spilt-instance-variables  print each time a native-typed instance variable is spilt to the boxed array");
         out.println("  --print-uninitialized-calls       print each time a method call is uninitialized");
         out.println("  --print-java-exceptions           print Java exception back traces at the point of translating them to Ruby exceptions");
-        out.println("  --print-ruby-exceptions           print the Java exception back traces at the point of raising Ruby exceptions");
         out.println("Relevant environment variables:");
         out.println("  RUBYHOME                          location of the Ruby Truffle installation");
         out.println("  RUBYOPT                           extra command line arguments");
--- a/graal/com.oracle.truffle.ruby.test/src/com/oracle/truffle/ruby/test/core/ContinuationTests.java	Thu Jan 16 20:56:07 2014 +0100
+++ b/graal/com.oracle.truffle.ruby.test/src/com/oracle/truffle/ruby/test/core/ContinuationTests.java	Thu Jan 16 21:47:17 2014 +0000
@@ -20,23 +20,23 @@
 
     @Test
     public void testRequired() {
-        assertPrints("", "require \"continuation\"; callcc { |c| c.call }");
+        assertPrints("", "callcc { |c| c.call }");
     }
 
     @Test
     public void testOneShotGoingUpCallstack() {
-        assertPrints("1\n3\n", "require \"continuation\"; callcc { |c| puts 1; c.call; puts 2 }; puts 3");
+        assertPrints("1\n3\n", "callcc { |c| puts 1; c.call; puts 2 }; puts 3");
     }
 
     @Test
     public void testOneShotGoingUpCallstackReturnValue() {
-        assertPrints("14\n", "require \"continuation\"; puts callcc { |c| c.call 14 }");
+        assertPrints("14\n", "puts callcc { |c| c.call 14 }");
     }
 
     @Test
     public void testNestedOneShotGoingUpCallstack() {
-        assertPrints("1\n2\n4\n5\n", "require \"continuation\"; callcc { |c1| puts 1; callcc { |c2| puts 2; c2.call; puts 3 }; puts 4 }; puts 5");
-        assertPrints("1\n2\n5\n", "require \"continuation\"; callcc { |c1| puts 1; callcc { |c2| puts 2; c1.call; puts 3 }; puts 4 }; puts 5");
+        assertPrints("1\n2\n4\n5\n", "callcc { |c1| puts 1; callcc { |c2| puts 2; c2.call; puts 3 }; puts 4 }; puts 5");
+        assertPrints("1\n2\n5\n", "callcc { |c1| puts 1; callcc { |c2| puts 2; c1.call; puts 3 }; puts 4 }; puts 5");
     }
 
 }