changeset 7117:0fc0d52013b4

Merge
author Gilles Duboscq <duboscq@ssw.jku.at>
date Thu, 15 Nov 2012 14:21:50 +0100
parents 67f9855dec62 (diff) e83ee37dae40 (current diff)
children e33a0f52e2d9
files
diffstat 10 files changed, 34 insertions(+), 41 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TypeCheckHints.java	Tue Nov 13 14:41:19 2012 +0100
+++ b/graal/com.oracle.graal.api.code/src/com/oracle/graal/api/code/TypeCheckHints.java	Thu Nov 15 14:21:50 2012 +0100
@@ -104,7 +104,16 @@
         }
     }
 
+    /**
+     * Determines if a given type can have subtypes. This analysis is purely static; no
+     * assumptions are made.
+     *
+     * @return true if {@code type} has no subtype(s)
+     */
     public static boolean isFinalClass(ResolvedJavaType type) {
-        return Modifier.isFinal(type.getModifiers()) || (type.isArrayClass() && Modifier.isFinal(type.getComponentType().getModifiers()));
+        if (type.isArrayClass()) {
+            return isFinalClass(type.getComponentType());
+        }
+        return Modifier.isFinal(type.getModifiers());
     }
 }
--- a/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java	Tue Nov 13 14:41:19 2012 +0100
+++ b/graal/com.oracle.graal.api.meta/src/com/oracle/graal/api/meta/ResolvedJavaType.java	Thu Nov 15 14:21:50 2012 +0100
@@ -106,6 +106,7 @@
     /**
      * Returns the Java language modifiers for this type, as an integer. The {@link Modifier} class should be used to
      * decode the modifiers. Only the flags specified in the JVM specification will be included in the returned mask.
+     * This method is identical to {@link Class#getModifiers()} in terms of the value return for this type.
      */
     int getModifiers();
 
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java	Tue Nov 13 14:41:19 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaType.java	Thu Nov 15 14:21:50 2012 +0100
@@ -62,7 +62,7 @@
 
     @Override
     public int getModifiers() {
-        return accessFlags;
+        return javaMirror.getModifiers();
     }
 
     @Override
@@ -84,7 +84,7 @@
     @Override
     public ResolvedJavaType findUniqueConcreteSubtype() {
         if (isArrayClass()) {
-            return Modifier.isFinal(getComponentType().getModifiers()) ? this : null;
+            return getComponentType().findUniqueConcreteSubtype() != null ? this : null;
         } else {
             ResolvedJavaType subtype = (ResolvedJavaType) HotSpotGraalRuntime.getInstance().getCompilerToVM().getUniqueConcreteSubtype(this);
             assert subtype == null || !subtype.isInterface();
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Tue Nov 13 14:41:19 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java	Thu Nov 15 14:21:50 2012 +0100
@@ -511,9 +511,6 @@
             assert load.kind() != Kind.Illegal;
             IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, load.loadKind(), load.displacement(), load.offset(), graph, false);
             ReadNode memoryRead = graph.add(new ReadNode(load.object(), location, load.stamp()));
-            if (load.object().kind().isObject()) {
-                memoryRead.dependencies().add(tool.createNullCheckGuard(load.object(), StructuredGraph.INVALID_GRAPH_ID));
-            }
             graph.replaceFixedWithFixed(load, memoryRead);
         } else if (n instanceof UnsafeStoreNode) {
             UnsafeStoreNode store = (UnsafeStoreNode) n;
--- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java	Tue Nov 13 14:41:19 2012 +0100
+++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/snippets/MonitorSnippets.java	Thu Nov 15 14:21:50 2012 +0100
@@ -74,9 +74,13 @@
     public static final boolean CHECK_BALANCED_MONITORS = Boolean.getBoolean("graal.monitors.checkBalanced");
 
     @Snippet
-    public static void monitorenter(@Parameter("object") Object object, @ConstantParameter("trace") boolean trace) {
+    public static void monitorenter(@Parameter("object") Object object, @ConstantParameter("checkNull") boolean checkNull, @ConstantParameter("trace") boolean trace) {
         verifyOop(object);
 
+        if (checkNull && object == null) {
+            DeoptimizeNode.deopt(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.NullCheckException);
+        }
+
         // Load the mark word - this includes a null-check on object
         final Word mark = loadWordFromObject(object, markOffset());
 
@@ -397,7 +401,7 @@
 
         public Templates(CodeCacheProvider runtime, boolean useFastLocking) {
             super(runtime, MonitorSnippets.class);
-            monitorenter = snippet("monitorenter", Object.class, boolean.class);
+            monitorenter = snippet("monitorenter", Object.class, boolean.class, boolean.class);
             monitorexit = snippet("monitorexit", Object.class, boolean.class);
             monitorenterStub = snippet("monitorenterStub", Object.class, boolean.class, boolean.class);
             monitorexitStub = snippet("monitorexitStub", Object.class, boolean.class);
@@ -418,7 +422,7 @@
             ResolvedJavaMethod method = eliminated ? monitorenterEliminated : useFastLocking ? monitorenter : monitorenterStub;
             boolean checkNull = !monitorenterNode.object().stamp().nonNull();
             Key key = new Key(method);
-            if (method == monitorenterStub) {
+            if (method != monitorenterEliminated) {
                 key.add("checkNull", checkNull);
             }
             if (!eliminated) {
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Tue Nov 13 14:41:19 2012 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/ReadNode.java	Thu Nov 15 14:21:50 2012 +0100
@@ -22,7 +22,6 @@
  */
 package com.oracle.graal.nodes.extended;
 
-import com.oracle.graal.api.code.*;
 import com.oracle.graal.api.meta.*;
 import com.oracle.graal.graph.*;
 import com.oracle.graal.nodes.*;
@@ -32,7 +31,7 @@
 /**
  * Reads an {@linkplain AccessNode accessed} value.
  */
-public final class ReadNode extends AccessNode implements Node.IterableNodeType, LIRLowerable, Simplifiable/*, Canonicalizable*/ {
+public final class ReadNode extends AccessNode implements Node.IterableNodeType, LIRLowerable /*, Canonicalizable*/ {
 
     public ReadNode(ValueNode object, ValueNode location, Stamp stamp) {
         super(object, location, stamp);
@@ -66,18 +65,6 @@
         return (ValueNode) read;
     }
 
-    @Override
-    public void simplify(SimplifierTool tool) {
-        if (object().isConstant() && object().asConstant().isNull()) {
-            FixedNode successor = next();
-            tool.deleteBranch(successor);
-            if (isAlive()) {
-                replaceAtPredecessor(graph().add(new DeoptimizeNode(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.NullCheckException)));
-                safeDelete();
-            }
-        }
-    }
-
     private ReadNode(ValueNode object, ValueNode location) {
         this(object, location, StampFactory.forNodeIntrinsic());
     }
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Tue Nov 13 14:41:19 2012 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeLoadNode.java	Thu Nov 15 14:21:50 2012 +0100
@@ -29,6 +29,7 @@
 
 /**
  * Load of a value from a location specified as an offset relative to an object.
+ * No null check is performed before the load.
  */
 public class UnsafeLoadNode extends FixedWithNextNode implements Lowerable {
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java	Tue Nov 13 14:41:19 2012 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/UnsafeStoreNode.java	Thu Nov 15 14:21:50 2012 +0100
@@ -29,6 +29,7 @@
 
 /**
  * Store of a value at a location specified as an offset relative to an object.
+ * No null check is performed before the store.
  */
 public class UnsafeStoreNode extends FixedWithNextNode implements StateSplit, Lowerable {
 
--- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java	Tue Nov 13 14:41:19 2012 +0100
+++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/WriteNode.java	Thu Nov 15 14:21:50 2012 +0100
@@ -22,8 +22,6 @@
  */
 package com.oracle.graal.nodes.extended;
 
-import com.oracle.graal.api.code.*;
-import com.oracle.graal.api.meta.*;
 import com.oracle.graal.nodes.*;
 import com.oracle.graal.nodes.spi.*;
 import com.oracle.graal.nodes.type.*;
@@ -32,7 +30,7 @@
 /**
  * Writes a given {@linkplain #value() value} a {@linkplain AccessNode memory location}.
  */
-public final class WriteNode extends AccessNode implements StateSplit, LIRLowerable, Simplifiable {
+public final class WriteNode extends AccessNode implements StateSplit, LIRLowerable {
     @Input private ValueNode value;
     @Input(notDataflow = true) private FrameState stateAfter;
 
@@ -64,18 +62,6 @@
         gen.emitStore(gen.makeAddress(location(), object()), gen.operand(value()), getNullCheck());
     }
 
-    @Override
-    public void simplify(SimplifierTool tool) {
-        if (object().isConstant() && object().asConstant().isNull()) {
-            FixedNode successor = next();
-            tool.deleteBranch(successor);
-            if (isAlive()) {
-                replaceAtPredecessor(graph().add(new DeoptimizeNode(DeoptimizationAction.InvalidateReprofile, DeoptimizationReason.NullCheckException)));
-                safeDelete();
-            }
-        }
-    }
-
     @NodeIntrinsic
     public static native void writeMemory(Object object, Object value, Object location);
 }
--- a/mx/commands.py	Tue Nov 13 14:41:19 2012 +0100
+++ b/mx/commands.py	Thu Nov 15 14:21:50 2012 +0100
@@ -541,8 +541,10 @@
                 return
         else:
             cpus = multiprocessing.cpu_count()
+            runCmd = [mx.gmake_cmd()]
             if build == 'debug':
                 build = 'jvmg'
+            runCmd.append(build + buildSuffix) 
             env = os.environ
             env.setdefault('ARCH_DATA_MODEL', '64')
             env.setdefault('LANG', 'C')
@@ -554,8 +556,13 @@
                 cCompilerVersion = subprocess.Popen('CC -V', stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True).stderr.readlines()[0]
                 if cCompilerVersion.startswith('CC: Sun C++') :
                     compilerRev = cCompilerVersion.split(' ')[3]
-                    env.setdefault('ENFORCE_COMPILER_REV', compilerRev);
-                    env.setdefault('ENFORCE_CC_COMPILER_REV', compilerRev);
+                    env.setdefault('ENFORCE_COMPILER_REV', compilerRev)
+                    env.setdefault('ENFORCE_CC_COMPILER_REV', compilerRev)
+                    if build == 'jvmg':
+                        # I want ALL the symbols when I'm debugging on Solaris
+                        # Some Makefile variable are overloaded by environment variable so we need to explicitely
+                        # pass them down in the command line. This one is an example of that.
+                        runCmd.append('STRIP_POLICY=no_strip')
             # This removes the need to unzip the *.diz files before debugging in gdb
             env.setdefault('ZIP_DEBUGINFO_FILES', '0')
 
@@ -563,7 +570,7 @@
             env.pop('LD_LIBRARY_PATH', None)
             env.pop('CLASSPATH', None)
 
-            mx.run([mx.gmake_cmd(), build + buildSuffix], cwd=join(_graal_home, 'make'), err=filterXusage)
+            mx.run(runCmd, cwd=join(_graal_home, 'make'), err=filterXusage)
 
         jvmCfg = _vmCfgInJdk(jdk)
         found = False