changeset 5151:5717fc2be01c

Merge
author Christian Haeubl <christian.haeubl@oracle.com>
date Thu, 22 Mar 2012 19:06:04 -0700
parents fdd9dd4508fa eeb2ca1bf3a9
children cfdb3c24bd6c ae72dd38eeb1
files
diffstat 6 files changed, 29 insertions(+), 17 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java	Thu Mar 22 18:54:02 2012 -0700
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalOptions.java	Thu Mar 22 19:06:04 2012 -0700
@@ -117,11 +117,10 @@
     public static String Time                                = null;
     public static String Log                                 = null;
     public static String MethodFilter                        = null;
+    public static boolean DumpOnError                        = ____;
 
     // Ideal graph visualizer output settings
-    public static boolean PlotOnError                        = ____;
     public static int     PlotLevel                          = 3;
-    public static boolean PlotSnippets                       = ____;
     public static int     PrintIdealGraphLevel               = 0;
     public static boolean PrintIdealGraphFile                = ____;
     public static String  PrintIdealGraphAddress             = "127.0.0.1";
--- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ComputeProbabilityPhase.java	Thu Mar 22 18:54:02 2012 -0700
+++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ComputeProbabilityPhase.java	Thu Mar 22 19:06:04 2012 -0700
@@ -145,13 +145,11 @@
                     }
                     backEdgeProb += le.probability() * factor;
                 }
-                double d = backEdgeProb;
+                double d = loopBegin.probability() - backEdgeProb;
                 if (d < EPSILON) {
                     d = EPSILON;
-                } else if (d > loopBegin.probability() - EPSILON) {
-                    d = loopBegin.probability() - EPSILON;
                 }
-                loopFrequency = loopBegin.probability() / (loopBegin.probability() - d);
+                loopFrequency = loopBegin.probability() / d;
                 loopBegin.setLoopFrequency(loopFrequency);
             }
             return loopFrequency;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java	Thu Mar 22 18:54:02 2012 -0700
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/HotSpotDebugConfig.java	Thu Mar 22 19:06:04 2012 -0700
@@ -143,7 +143,7 @@
         Debug.log(String.format("Exception occured in scope: %s", Debug.currentScope()));
         for (Object o : Debug.context()) {
             Debug.log("Context obj %s", o);
-            if (o instanceof Graph) {
+            if (o instanceof Graph && GraalOptions.DumpOnError) {
                 Graph graph = (Graph) o;
                 Debug.log("Found graph in context: ", graph);
                 Debug.dump(o, "Exception graph");
--- a/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Mar 22 18:54:02 2012 -0700
+++ b/graal/com.oracle.graal.java/src/com/oracle/graal/java/GraphBuilderPhase.java	Thu Mar 22 19:06:04 2012 -0700
@@ -27,7 +27,6 @@
 
 import java.lang.reflect.*;
 import java.util.*;
-import java.util.concurrent.atomic.*;
 
 import com.oracle.graal.compiler.*;
 import com.oracle.graal.compiler.phases.*;
@@ -1139,9 +1138,19 @@
                 prob[i] = 1.0d / numberOfCases;
             }
         }
+        assert allPositive(prob);
         return prob;
     }
 
+    private static boolean allPositive(double[] a) {
+        for (double d : a) {
+            if (d < 0) {
+                return false;
+            }
+        }
+        return true;
+    }
+
     private void genLookupswitch() {
         int bci = bci();
         ValueNode value = frameState.ipop();
--- a/mx/sanitycheck.py	Thu Mar 22 18:54:02 2012 -0700
+++ b/mx/sanitycheck.py	Thu Mar 22 19:06:04 2012 -0700
@@ -116,7 +116,7 @@
     if skipKitValidation:
         opts += ['-ikv']
     
-    return Test("SPECjvm2008", "SPECjvm2008", ['-jar', 'SPECjvm2008.jar'] + opts + benchArgs, [success], [error], [matcher], vmOpts=['-Xms3g'], defaultCwd=specjvm2008)
+    return Test("SPECjvm2008", "SPECjvm2008", ['-jar', 'SPECjvm2008.jar'] + opts + benchArgs, [success], [error], [matcher], vmOpts=['-Xms3g', '-XX:+UseSerialGC'], defaultCwd=specjvm2008)
 
 def getDacapos(level=SanityCheckLevel.Normal, gateBuildLevel=None, dacapoArgs=[]):
     checks = []
@@ -146,7 +146,7 @@
     
     dacapoMatcher = Matcher(dacapoTime, {'const:name' : 'benchmark', 'const:score' : 'time'})
     
-    return Test("DaCapo-" + name, "DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms2g', '-XX:MaxPermSize=256m'])
+    return Test("DaCapo-" + name, "DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms2g', '-XX:MaxPermSize=256m', '-XX:+UseSerialGC'])
 
 def getScalaDacapos(level=SanityCheckLevel.Normal, gateBuildLevel=None, dacapoArgs=[]):
     checks = []
@@ -176,21 +176,21 @@
     
     dacapoMatcher = Matcher(dacapoTime, {'const:name' : 'benchmark', 'const:score' : 'time'})
     
-    return Test("Scala-DaCapo-" + name, "Scala-DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms2g', '-XX:MaxPermSize=256m'])
+    return Test("Scala-DaCapo-" + name, "Scala-DaCapo", ['-jar', dacapo, name, '-n', str(n), ] + dacapoArgs, [dacapoSuccess], [dacapoFail], [dacapoMatcher], ['-Xms2g', '-XX:MaxPermSize=256m', '-XX:+UseSerialGC'])
 
 def getBootstraps():
     time = re.compile(r"Bootstrapping Graal\.+ in (?P<time>[0-9]+) ms")
     scoreMatcher = Matcher(time, {'const:name' : 'const:BootstrapTime', 'const:score' : 'time'})
     tests = []
-    tests.append(Test("Bootstrap", "Bootstrap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcher]))
-    tests.append(Test("Bootstrap-bigHeap", "Bootstrap-bigHeap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcher], vmOpts=['-Xms2g']))
+    tests.append(Test("Bootstrap", "Bootstrap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcher], ingoreVms=['client', 'server']))
+    tests.append(Test("Bootstrap-bigHeap", "Bootstrap-bigHeap", ['-version'], successREs=[time], scoreMatchers=[scoreMatcher], vmOpts=['-Xms2g'], ingoreVms=['client', 'server']))
     return tests
 
 """
 Encapsulates a single program that is a sanity test and/or a benchmark.
 """
 class Test:
-    def __init__(self, name, group, cmd, successREs=[], failureREs=[], scoreMatchers=[], vmOpts=[], defaultCwd=None):
+    def __init__(self, name, group, cmd, successREs=[], failureREs=[], scoreMatchers=[], vmOpts=[], defaultCwd=None, ingoreVms=[]):
         self.name = name
         self.group = group
         self.successREs = successREs
@@ -199,6 +199,8 @@
         self.vmOpts = vmOpts
         self.cmd = cmd
         self.defaultCwd = defaultCwd
+        self.ingoreVms = ingoreVms;
+        
         
     def __str__(self):
         return self.name
@@ -207,6 +209,8 @@
         """
         Run this program as a sanity test.
         """
+        if (vm in self.ingoreVms):
+            return True;
         if cwd is None:
             cwd = self.defaultCwd
         parser = OutputParser(nonZeroIsFatal = False)
@@ -246,6 +250,8 @@
         """
         Run this program as a benchmark.
         """
+        if (vm in self.ingoreVms):
+            return {};
         if cwd is None:
             cwd = self.defaultCwd
         parser = OutputParser(nonZeroIsFatal = False)
--- a/src/share/vm/graal/graalCodeInstaller.cpp	Thu Mar 22 18:54:02 2012 -0700
+++ b/src/share/vm/graal/graalCodeInstaller.cpp	Thu Mar 22 19:06:04 2012 -0700
@@ -202,11 +202,11 @@
       if (isLongArray && cur_second == NULL) {
         // we're trying to put ints into a long array... this isn't really valid, but it's used for some optimizations.
         // add an int 0 constant
-#ifdef BIG_ENDIAN
+#ifdef VM_LITTLE_ENDIAN
+        cur_second = new ConstantIntValue(0);
+#else
         cur_second = value;
         value = new ConstantIntValue(0);
-#else
-        cur_second = new ConstantIntValue(0);
 #endif
       }