changeset 4470:b7ec250cd29c

fixes after merge
author Christian Haeubl <christian.haeubl@oracle.com>
date Mon, 06 Feb 2012 09:51:48 -0800
parents 11a4af4a6621
children 59d3d0b80975
files graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/snippets/ArrayCopySnippets.java graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java
diffstat 3 files changed, 16 insertions(+), 50 deletions(-) [+]
line wrap: on
line diff
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java	Mon Feb 06 09:41:16 2012 -0800
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java	Mon Feb 06 09:51:48 2012 -0800
@@ -22,6 +22,8 @@
  */
 package com.oracle.max.graal.hotspot.ri;
 
+import java.util.*;
+
 import sun.misc.*;
 
 import com.oracle.max.cri.ri.*;
@@ -366,9 +368,7 @@
             if (entries <= 0) {
                 return null;
             } else if (entries < sparseTypes.length) {
-                RiResolvedType[] compactedTypes = new RiResolvedType[entries];
-                System.arraycopy(sparseTypes, 0, compactedTypes, 0, entries);
-                types = compactedTypes;
+                types = Arrays.copyOf(sparseTypes, entries);
                 probabilities = new double[entries];
             } else {
                 types = sparseTypes;
--- a/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/snippets/ArrayCopySnippets.java	Mon Feb 06 09:41:16 2012 -0800
+++ b/graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/snippets/ArrayCopySnippets.java	Mon Feb 06 09:51:48 2012 -0800
@@ -366,7 +366,6 @@
             gen.setResult(this, obj);
         }
     }
-
     private static class DirectStoreNode extends FixedWithNextNode implements LIRLowerable {
         @Input private ValueNode address;
         @Input private ValueNode value;
@@ -395,44 +394,6 @@
             gen.emitStore(new CiAddress(v.kind, gen.operand(address)), v, false);
         }
     }
-    private static class DirectObjectStoreNode extends FixedWithNextNode implements Lowerable {
-        @Input private ValueNode object;
-        @Input private ValueNode value;
-        @Input private ValueNode offset;
-
-        public DirectObjectStoreNode(ValueNode object, ValueNode offset, ValueNode value) {
-            super(StampFactory.illegal());
-            this.object = object;
-            this.value = value;
-            this.offset = offset;
-        }
-
-        @SuppressWarnings("unused")
-        @NodeIntrinsic
-        public static void store(Object obj, long offset, long value) {
-            throw new UnsupportedOperationException();
-        }
-
-        @SuppressWarnings("unused")
-        @NodeIntrinsic
-        public static void store(Object obj, long offset, boolean value) {
-            throw new UnsupportedOperationException();
-        }
-
-        @SuppressWarnings("unused")
-        @NodeIntrinsic
-        public static void store(Object obj, long offset, Object value) {
-            throw new UnsupportedOperationException();
-        }
-
-        @Override
-        public void lower(CiLoweringTool tool) {
-            StructuredGraph graph = (StructuredGraph) this.graph();
-            IndexedLocationNode location = IndexedLocationNode.create(LocationNode.ANY_LOCATION, value.kind(), 0, offset, graph, false);
-            WriteNode write = graph.add(new WriteNode(object, value, location));
-            graph.replaceFixedWithFixed(this, write);
-        }
-    }
 
     private static class DirectObjectStoreNode extends FixedWithNextNode implements Lowerable {
         @Input private ValueNode object;
--- a/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java	Mon Feb 06 09:41:16 2012 -0800
+++ b/graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java	Mon Feb 06 09:51:48 2012 -0800
@@ -698,16 +698,21 @@
             if (uniqueSubtype != null) {
                 return new RiResolvedType[] {uniqueSubtype};
             } else {
-                RiTypeProfile typeProfile = method.typeProfile(bci());
-                if (typeProfile != null && typeProfile.types != null && typeProfile.types.length > 0 && typeProfile.morphism <= maxHints) {
-                    RiResolvedType[] hints = new RiResolvedType[typeProfile.types.length];
-                    int hintCount = 0;
-                    for (RiResolvedType hint : typeProfile.types) {
-                        if (hint.isSubtypeOf(type)) {
-                            hints[hintCount++] = hint;
+                RiTypeProfile typeProfile = profilingInfo.getTypeProfile(bci());
+                if (typeProfile != null) {
+                    double notRecordedTypes = typeProfile.getNotRecordedProbability();
+                    RiResolvedType[] types = typeProfile.getTypes();
+
+                    if (notRecordedTypes == 0 && types != null && types.length > 0 && types.length <= maxHints) {
+                        RiResolvedType[] hints = new RiResolvedType[types.length];
+                        int hintCount = 0;
+                        for (RiResolvedType hint : types) {
+                            if (hint.isSubtypeOf(type)) {
+                                hints[hintCount++] = hint;
+                            }
                         }
+                        return Arrays.copyOf(hints, Math.min(maxHints, hintCount));
                     }
-                    return Arrays.copyOf(hints, Math.min(maxHints, hintCount));
                 }
                 return EMPTY_TYPE_ARRAY;
             }