< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot/src/org/graalvm/compiler/hotspot/gc/shared/CardTableBarrierSet.java

Print this page

        

*** 24,33 **** --- 24,34 ---- package org.graalvm.compiler.hotspot.gc.shared; import org.graalvm.compiler.debug.GraalError; + import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.nodes.StructuredGraph; import org.graalvm.compiler.nodes.ValueNode; import org.graalvm.compiler.nodes.extended.ArrayRangeWrite; import org.graalvm.compiler.nodes.java.AbstractCompareAndSwapNode; import org.graalvm.compiler.nodes.java.LoweredAtomicReadAndWriteNode;
*** 38,63 **** import org.graalvm.compiler.nodes.memory.address.AddressNode; import org.graalvm.compiler.nodes.type.StampTool; public class CardTableBarrierSet extends BarrierSet { @Override public void addReadNodeBarriers(ReadNode node, StructuredGraph graph) { ! assert node.getBarrierType() == HeapAccess.BarrierType.NONE : "Non precise read barrier has been attached to read node."; } @Override public void addWriteNodeBarriers(WriteNode node, StructuredGraph graph) { HeapAccess.BarrierType barrierType = node.getBarrierType(); switch (barrierType) { case NONE: // nothing to do break; ! case IMPRECISE: ! case PRECISE: ! boolean precise = barrierType == HeapAccess.BarrierType.PRECISE; ! addSerialPostWriteBarrier(node, node.getAddress(), node.value(), precise, graph); break; default: throw new GraalError("unexpected barrier type: " + barrierType); } } --- 39,72 ---- import org.graalvm.compiler.nodes.memory.address.AddressNode; import org.graalvm.compiler.nodes.type.StampTool; public class CardTableBarrierSet extends BarrierSet { + public CardTableBarrierSet(GraalHotSpotVMConfig vmConfig) { + super(vmConfig); + } + @Override public void addReadNodeBarriers(ReadNode node, StructuredGraph graph) { ! // Nothing to do here. } @Override public void addWriteNodeBarriers(WriteNode node, StructuredGraph graph) { HeapAccess.BarrierType barrierType = node.getBarrierType(); switch (barrierType) { case NONE: // nothing to do break; ! case FIELD: ! case ARRAY: ! case UNKNOWN: ! boolean precise = barrierType != HeapAccess.BarrierType.FIELD; ! boolean init = node.getLocationIdentity().isInit(); ! if (!init || !getVMConfig().useDeferredInitBarriers) { ! addSerialPostWriteBarrier(node, node.getAddress(), node.value(), precise, graph); ! } break; default: throw new GraalError("unexpected barrier type: " + barrierType); } }
*** 67,79 **** HeapAccess.BarrierType barrierType = node.getBarrierType(); switch (barrierType) { case NONE: // nothing to do break; ! case IMPRECISE: ! case PRECISE: ! boolean precise = barrierType == HeapAccess.BarrierType.PRECISE; addSerialPostWriteBarrier(node, node.getAddress(), node.getNewValue(), precise, graph); break; default: throw new GraalError("unexpected barrier type: " + barrierType); } --- 76,89 ---- HeapAccess.BarrierType barrierType = node.getBarrierType(); switch (barrierType) { case NONE: // nothing to do break; ! case FIELD: ! case ARRAY: ! case UNKNOWN: ! boolean precise = barrierType != HeapAccess.BarrierType.FIELD; addSerialPostWriteBarrier(node, node.getAddress(), node.getNewValue(), precise, graph); break; default: throw new GraalError("unexpected barrier type: " + barrierType); }
*** 84,96 **** HeapAccess.BarrierType barrierType = node.getBarrierType(); switch (barrierType) { case NONE: // nothing to do break; ! case IMPRECISE: ! case PRECISE: ! boolean precise = barrierType == HeapAccess.BarrierType.PRECISE; addSerialPostWriteBarrier(node, node.getAddress(), node.getNewValue(), precise, graph); break; default: throw new GraalError("unexpected barrier type: " + barrierType); } --- 94,107 ---- HeapAccess.BarrierType barrierType = node.getBarrierType(); switch (barrierType) { case NONE: // nothing to do break; ! case FIELD: ! case ARRAY: ! case UNKNOWN: ! boolean precise = barrierType != HeapAccess.BarrierType.FIELD; addSerialPostWriteBarrier(node, node.getAddress(), node.getNewValue(), precise, graph); break; default: throw new GraalError("unexpected barrier type: " + barrierType); }
< prev index next >