changeset 18899:8e8b4a6a85f5

Merge.
author Doug Simon <doug.simon@oracle.com>
date Wed, 21 Jan 2015 19:01:13 +0100
parents d199e643f23b (diff) 886621ee9bdb (current diff)
children 7e500c20208c
files mxtool/mx.py
diffstat 5 files changed, 49 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java	Wed Jan 21 15:44:30 2015 +0100
+++ b/graal/com.oracle.graal.compiler.common/src/com/oracle/graal/compiler/common/type/ArithmeticOpTable.java	Wed Jan 21 19:01:13 2015 +0100
@@ -172,7 +172,7 @@
         this.floatConvert = new FloatConvertOp[FloatConvert.values().length];
         floatConvert.forEach(op -> this.floatConvert[op.getFloatConvert().ordinal()] = op);
 
-        this.hash = Objects.hash(neg, add, sub, mul, div, rem, not, and, or, xor, shl, shr, ushr, abs, sqrt, zeroExtend, signExtend, narrow, floatConvert);
+        this.hash = Objects.hash(neg, add, sub, mul, div, rem, not, and, or, xor, shl, shr, ushr, abs, sqrt, zeroExtend, signExtend, narrow);
     }
 
     @Override
--- a/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Fingerprint.java	Wed Jan 21 15:44:30 2015 +0100
+++ b/graal/com.oracle.graal.debug/src/com/oracle/graal/debug/Fingerprint.java	Wed Jan 21 19:01:13 2015 +0100
@@ -30,7 +30,7 @@
  */
 public class Fingerprint implements AutoCloseable {
 
-    private static final String ENABLED_PROPERTY_NAME = "graal.fingerprint";
+    public static final String ENABLED_PROPERTY_NAME = "graal.fingerprint";
 
     /**
      * Determines whether fingerprinting is enabled. This is set by the
@@ -54,11 +54,24 @@
     /**
      * Creates an object to verify execution matches a given fingerprint.
      *
+     * @param toVerifyAgainst the fingerprint events to verify against
+     */
+    public Fingerprint(List<String> toVerifyAgainst) {
+        this.events = toVerifyAgainst;
+        index = 0;
+    }
+
+    /**
+     * Creates an object to verify execution matches a given fingerprint.
+     *
      * @param toVerifyAgainst the fingerprint to verify against
      */
     public Fingerprint(Fingerprint toVerifyAgainst) {
-        this.events = toVerifyAgainst.events;
-        index = 0;
+        this(toVerifyAgainst.events);
+    }
+
+    public Collection<String> getEvents() {
+        return Collections.unmodifiableCollection(events);
     }
 
     /**
--- a/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java	Wed Jan 21 15:44:30 2015 +0100
+++ b/graal/com.oracle.graal.graph/src/com/oracle/graal/graph/Graph.java	Wed Jan 21 19:01:13 2015 +0100
@@ -758,12 +758,6 @@
     @SuppressWarnings("unused")
     private void postDeserialization() {
         recomputeIterableNodeLists();
-
-        // CacheEntry.hashCode() is not stable across VM executions so
-        // the cachedLeafNodes map needs to be re-created.
-        HashMap<CacheEntry, Node> entries = new LinkedHashMap<>(cachedLeafNodes);
-        cachedLeafNodes.clear();
-        cachedLeafNodes.putAll(entries);
     }
 
     /**
--- a/graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalJUnitCore.java	Wed Jan 21 15:44:30 2015 +0100
+++ b/graal/com.oracle.graal.test/src/com/oracle/graal/test/GraalJUnitCore.java	Wed Jan 21 19:01:13 2015 +0100
@@ -23,6 +23,7 @@
 package com.oracle.graal.test;
 
 import java.io.*;
+import java.nio.file.*;
 import java.util.*;
 
 import junit.runner.*;
@@ -167,6 +168,23 @@
     }
 
     /**
+     * Gets the command line for the current process.
+     *
+     * @return the command line arguments for the current process or {@code null} if they are not
+     *         available
+     */
+    public static List<String> getProcessCommandLine() {
+        String processArgsFile = System.getenv().get("MX_SUBPROCESS_COMMAND_FILE");
+        if (processArgsFile != null) {
+            try {
+                return Files.readAllLines(new File(processArgsFile).toPath());
+            } catch (IOException e) {
+            }
+        }
+        return null;
+    }
+
+    /**
      * Expand any arguments starting with @ and return the resulting argument array.
      *
      * @param args
--- a/mxtool/mx.py	Wed Jan 21 15:44:30 2015 +0100
+++ b/mxtool/mx.py	Wed Jan 21 19:01:13 2015 +0100
@@ -1875,7 +1875,19 @@
         assert isinstance(arg, types.StringTypes), 'argument is not a string: ' + str(arg)
 
     if env is None:
-        env = os.environ
+        env = os.environ.copy()
+
+    # Ideally the command line could be communicated directly in an environment
+    # variable. However, since environment variables share the same resource
+    # space as the command line itself (on Unix at least), this would cause the
+    # limit to be exceeded too easily.  
+    _, subprocessCommandFile = tempfile.mkstemp(suffix='', prefix='mx_subprocess_command.')
+    with open(subprocessCommandFile, 'w') as fp:
+        for arg in args:
+            # TODO: handle newlines in args once there's a use case
+            assert '\n' not in arg
+            print >> fp, arg
+    env['MX_SUBPROCESS_COMMAND_FILE'] = subprocessCommandFile
 
     if _opts.verbose:
         if _opts.very_verbose:
@@ -1937,6 +1949,7 @@
         abort(1)
     finally:
         _removeSubprocess(sub)
+        os.remove(subprocessCommandFile)
 
     if retcode and nonZeroIsFatal:
         if _opts.verbose: