# HG changeset patch # User Bernhard Urban # Date 1380031687 -7200 # Node ID f6eb4866d558775a8a023a5813694caa0a5ae314 # Parent 4e2be0ab31a9c1c4ff2b6e497be57c702406f7f2 G1 Barriers: don't use ANY_LOCATION diff -r 4e2be0ab31a9 -r f6eb4866d558 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Tue Sep 24 14:11:38 2013 +0200 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Tue Sep 24 16:08:07 2013 +0200 @@ -63,6 +63,8 @@ "Number of G1 effective Ref Field Read Barriers"); private static final LocationIdentity GC_CARD_LOCATION = new NamedLocationIdentity("GC-Card"); + private static final LocationIdentity GC_LOG_LOCATION = new NamedLocationIdentity("GC-Log"); + private static final LocationIdentity GC_INDEX_LOCATION = new NamedLocationIdentity("GC-Index"); @Snippet public static void serialWriteBarrier(Object object, Object location, @ConstantParameter boolean usePrecise, @ConstantParameter boolean alwaysNull) { @@ -161,8 +163,8 @@ Word nextIndex = indexValue.subtract(wordSize()); Word logAddress = bufferAddress.add(nextIndex); // Log the object to be marked as well as update the SATB's buffer next index. - logAddress.writeWord(0, previousOop); - indexAddress.writeWord(0, nextIndex); + logAddress.writeWord(0, previousOop, GC_LOG_LOCATION); + indexAddress.writeWord(0, nextIndex, GC_INDEX_LOCATION); } else { g1PreBarrierStub(G1WBPRECALL, previousOop.toObject()); } @@ -223,7 +225,7 @@ if (probability(LIKELY_PROBABILITY, cardByte != (byte) 0)) { g1EffectivePostWriteBarrierCounter.inc(); log(trace, "[%d] G1-Post Thread: %p Card: %p \n", gcCycle, thread.rawValue(), Word.unsigned(cardByte).rawValue()); - cardAddress.writeByte(0, (byte) 0); + cardAddress.writeByte(0, (byte) 0, GC_CARD_LOCATION); // If the thread local card queue is full, issue a native call which will // initialize a new one and add the card entry. if (probability(FREQUENT_PROBABILITY, indexValue.notEqual(0))) { @@ -231,8 +233,8 @@ Word logAddress = bufferAddress.add(nextIndex); // Log the object to be scanned as well as update // the card queue's next index. - logAddress.writeWord(0, cardAddress); - indexAddress.writeWord(0, nextIndex); + logAddress.writeWord(0, cardAddress, GC_LOG_LOCATION); + indexAddress.writeWord(0, nextIndex, GC_INDEX_LOCATION); } else { g1PostBarrierStub(G1WBPOSTCALL, cardAddress); } @@ -266,8 +268,8 @@ indexValue = indexValue - wordSize(); Word logAddress = bufferAddress.add(Word.unsigned(indexValue)); // Log the object to be marked as well as update the SATB's buffer next index. - logAddress.writeWord(0, oop); - indexAddress.writeWord(0, Word.unsigned(indexValue)); + logAddress.writeWord(0, oop, GC_LOG_LOCATION); + indexAddress.writeWord(0, Word.unsigned(indexValue), GC_INDEX_LOCATION); } else { g1PreBarrierStub(G1WBPRECALL, oop.toObject()); } @@ -300,7 +302,7 @@ byte cardByte = cardAddress.readByte(0); // If the card is already dirty, (hence already enqueued) skip the insertion. if (cardByte != (byte) 0) { - cardAddress.writeByte(0, (byte) 0); + cardAddress.writeByte(0, (byte) 0, GC_CARD_LOCATION); // If the thread local card queue is full, issue a native call which will // initialize a new one and add the card entry. if (indexValue != 0) { @@ -308,8 +310,8 @@ Word logAddress = bufferAddress.add(Word.unsigned(indexValue)); // Log the object to be scanned as well as update // the card queue's next index. - logAddress.writeWord(0, cardAddress); - indexAddress.writeWord(0, Word.unsigned(indexValue)); + logAddress.writeWord(0, cardAddress, GC_LOG_LOCATION); + indexAddress.writeWord(0, Word.unsigned(indexValue), GC_INDEX_LOCATION); } else { g1PostBarrierStub(G1WBPOSTCALL, cardAddress); }