# HG changeset patch # User Doug Simon # Date 1347551104 -7200 # Node ID d44835610b527ec78090e59a19bc03f0e5fc37c9 # Parent abeeb57b655df22261a98f2db393c15e0d620e2c# Parent c61ce6bac1df702d876216e8fcde99745b61a2e9 Merge. diff -r abeeb57b655d -r d44835610b52 graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ea/PartialEscapeAnalysisPhase.java --- a/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ea/PartialEscapeAnalysisPhase.java Thu Sep 13 17:43:18 2012 +0200 +++ b/graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/phases/ea/PartialEscapeAnalysisPhase.java Thu Sep 13 17:45:04 2012 +0200 @@ -599,6 +599,9 @@ if (index < 0 || index >= arrayObj.fieldState.length) { // out of bounds or not constant replaceWithMaterialized(array, x, state, arrayObj); + if (valueObj != null) { + replaceWithMaterialized(value, x, state, valueObj); + } } else { arrayObj.fieldState[index] = value; if (changeGraph) { @@ -731,6 +734,11 @@ } } }); + for (ObjectState obj : state.states()) { + if (obj.lockCount > 0) { + virtual.add(obj); + } + } ArrayDeque queue = new ArrayDeque<>(virtual); while (!queue.isEmpty()) { diff -r abeeb57b655d -r d44835610b52 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Thu Sep 13 17:43:18 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod.java Thu Sep 13 17:45:04 2012 +0200 @@ -279,7 +279,15 @@ return canBeInlined; } + /** + * Returns the offset of this method into the v-table. + * If the holder is not initialized, returns -1 + * @return the offset of this method into the v-table + */ public int vtableEntryOffset() { + if (!holder.isInitialized()) { + return -1; + } return HotSpotGraalRuntime.getInstance().getCompilerToVM().JavaMethod_vtableEntryOffset(this); } diff -r abeeb57b655d -r d44835610b52 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Thu Sep 13 17:43:18 2012 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotRuntime.java Thu Sep 13 17:45:04 2012 +0200 @@ -258,7 +258,7 @@ // We use LocationNode.ANY_LOCATION for the reads that access the vtable entry and the compiled code entry // as HotSpot does not guarantee they are final values. int vtableEntryOffset = hsMethod.vtableEntryOffset(); - assert vtableEntryOffset != 0; + assert vtableEntryOffset > 0; SafeReadNode hub = safeReadHub(graph, receiver, StructuredGraph.INVALID_GRAPH_ID); Kind wordKind = graalRuntime.getTarget().wordKind; Stamp nonNullWordStamp = StampFactory.forWord(wordKind, true); diff -r abeeb57b655d -r d44835610b52 src/share/vm/graal/graalCompilerToVM.cpp --- a/src/share/vm/graal/graalCompilerToVM.cpp Thu Sep 13 17:43:18 2012 +0200 +++ b/src/share/vm/graal/graalCompilerToVM.cpp Thu Sep 13 17:45:04 2012 +0200 @@ -865,6 +865,7 @@ methodOop method = getMethodFromHotSpotMethod(hotspot_method); assert(!instanceKlass::cast(method->method_holder())->is_interface(), "vtableEntryOffset cannot be called for interface methods"); + assert(instanceKlass::cast(method->method_holder())->is_linked(), "vtableEntryOffset cannot be called is holder is not linked"); // get entry offset in words int vtable_entry_offset = instanceKlass::vtable_start_offset() + method->vtable_index() * vtableEntry::size();