# HG changeset patch # User Christian Haeubl # Date 1328550708 28800 # Node ID b7ec250cd29cd14cb028451bdbe7d2c38260fb61 # Parent 11a4af4a6621d2de508b10cac6b2b29aebb1a458 fixes after merge diff -r 11a4af4a6621 -r b7ec250cd29c graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/ri/HotSpotMethodData.java --- 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; diff -r 11a4af4a6621 -r b7ec250cd29c graal/com.oracle.max.graal.hotspot/src/com/oracle/max/graal/hotspot/snippets/ArrayCopySnippets.java --- 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; diff -r 11a4af4a6621 -r b7ec250cd29c graal/com.oracle.max.graal.java/src/com/oracle/max/graal/java/GraphBuilderPhase.java --- 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; }