# HG changeset patch # User Roland Schatz # Date 1430219302 -7200 # Node ID a5faa9aafc8031075ef187bf8f136331731c4659 # Parent bbc6a4347faf06d51ee037e1f9e246d256ad4dfe Make the G1PostWriteBarrier snippet kill only private locations. diff -r bbc6a4347faf -r a5faa9aafc80 graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/G1PostWriteBarrier.java --- a/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/G1PostWriteBarrier.java Mon Apr 27 20:01:10 2015 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/nodes/G1PostWriteBarrier.java Tue Apr 28 13:08:22 2015 +0200 @@ -22,14 +22,13 @@ */ package com.oracle.graal.hotspot.nodes; -import com.oracle.graal.api.meta.*; import com.oracle.graal.graph.*; import com.oracle.graal.nodeinfo.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.*; @NodeInfo -public class G1PostWriteBarrier extends WriteBarrier implements MemoryCheckpoint.Single { +public class G1PostWriteBarrier extends WriteBarrier { public static final NodeClass TYPE = NodeClass.create(G1PostWriteBarrier.class); protected final boolean alwaysNull; @@ -46,8 +45,4 @@ public boolean alwaysNull() { return alwaysNull; } - - public LocationIdentity getLocationIdentity() { - return LocationIdentity.any(); - } } diff -r bbc6a4347faf -r a5faa9aafc80 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 Mon Apr 27 20:01:10 2015 -0700 +++ b/graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/replacements/WriteBarrierSnippets.java Tue Apr 28 13:08:22 2015 +0200 @@ -212,13 +212,13 @@ // If the written value is not null continue with the barrier addition. if (probability(FREQUENT_PROBABILITY, writtenValue.notEqual(0))) { - byte cardByte = cardAddress.readByte(0); + byte cardByte = cardAddress.readByte(0, GC_CARD_LOCATION); g1EffectiveAfterNullPostWriteBarrierCounter.inc(); // If the card is already dirty, (hence already enqueued) skip the insertion. if (probability(NOT_FREQUENT_PROBABILITY, cardByte != g1YoungCardValue())) { - MembarNode.memoryBarrier(STORE_LOAD); - byte cardByteReload = cardAddress.readByte(0); + MembarNode.memoryBarrier(STORE_LOAD, GC_CARD_LOCATION); + byte cardByteReload = cardAddress.readByte(0, GC_CARD_LOCATION); if (probability(NOT_FREQUENT_PROBABILITY, cardByteReload != dirtyCardValue())) { log(trace, "[%d] G1-Post Thread: %p Card: %p \n", gcCycle, thread.rawValue(), Word.unsigned(cardByte).rawValue()); cardAddress.writeByte(0, (byte) 0, GC_CARD_LOCATION); @@ -298,11 +298,11 @@ while (count-- > 0) { Word cardAddress = Word.unsigned((start + cardStart) + count); - byte cardByte = cardAddress.readByte(0); + byte cardByte = cardAddress.readByte(0, GC_CARD_LOCATION); // If the card is already dirty, (hence already enqueued) skip the insertion. if (probability(NOT_FREQUENT_PROBABILITY, cardByte != g1YoungCardValue())) { - MembarNode.memoryBarrier(STORE_LOAD); - byte cardByteReload = cardAddress.readByte(0); + MembarNode.memoryBarrier(STORE_LOAD, GC_CARD_LOCATION); + byte cardByteReload = cardAddress.readByte(0, GC_CARD_LOCATION); if (probability(NOT_FREQUENT_PROBABILITY, cardByteReload != dirtyCardValue())) { cardAddress.writeByte(0, (byte) 0, GC_CARD_LOCATION); // If the thread local card queue is full, issue a native call which will diff -r bbc6a4347faf -r a5faa9aafc80 graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java --- a/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java Mon Apr 27 20:01:10 2015 -0700 +++ b/graal/com.oracle.graal.nodes/src/com/oracle/graal/nodes/extended/MembarNode.java Tue Apr 28 13:08:22 2015 +0200 @@ -37,15 +37,21 @@ public static final NodeClass TYPE = NodeClass.create(MembarNode.class); protected final int barriers; + protected final LocationIdentity location; public MembarNode(int barriers) { + this(barriers, LocationIdentity.any()); + } + + public MembarNode(int barriers, LocationIdentity location) { super(TYPE, StampFactory.forVoid()); this.barriers = barriers; + this.location = location; } @Override public LocationIdentity getLocationIdentity() { - return LocationIdentity.any(); + return location; } @Override @@ -55,4 +61,7 @@ @NodeIntrinsic public static native void memoryBarrier(@ConstantNodeParameter int barriers); + + @NodeIntrinsic + public static native void memoryBarrier(@ConstantNodeParameter int barriers, @ConstantNodeParameter LocationIdentity location); }