src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Cdiff src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java

Print this page

        

*** 21,38 **** * questions. */ package org.graalvm.compiler.hotspot.test; import java.util.List; ! import org.junit.Assert; ! import org.junit.Test; ! import org.graalvm.compiler.debug.Debug; ! import org.graalvm.compiler.debug.Debug.Scope; ! import org.graalvm.compiler.debug.DebugConfig; ! import org.graalvm.compiler.debug.DebugConfigScope; import org.graalvm.compiler.debug.DebugDumpScope; - import org.graalvm.compiler.debug.internal.DebugScope; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.hotspot.nodes.G1ArrayRangePostWriteBarrier; import org.graalvm.compiler.hotspot.nodes.G1ArrayRangePreWriteBarrier; import org.graalvm.compiler.hotspot.nodes.G1PostWriteBarrier; import org.graalvm.compiler.hotspot.nodes.G1PreWriteBarrier; --- 21,35 ---- * questions. */ package org.graalvm.compiler.hotspot.test; import java.util.List; ! ! import org.graalvm.compiler.debug.DebugCloseable; ! import org.graalvm.compiler.debug.DebugContext; ! import org.graalvm.compiler.debug.DebugContext.Scope; import org.graalvm.compiler.debug.DebugDumpScope; import org.graalvm.compiler.hotspot.GraalHotSpotVMConfig; import org.graalvm.compiler.hotspot.nodes.G1ArrayRangePostWriteBarrier; import org.graalvm.compiler.hotspot.nodes.G1ArrayRangePreWriteBarrier; import org.graalvm.compiler.hotspot.nodes.G1PostWriteBarrier; import org.graalvm.compiler.hotspot.nodes.G1PreWriteBarrier;
*** 62,71 **** --- 59,70 ---- import org.graalvm.compiler.phases.graph.ReentrantNodeIterator.NodeIteratorClosure; import org.graalvm.compiler.phases.tiers.HighTierContext; import org.graalvm.compiler.phases.tiers.MidTierContext; import org.graalvm.util.EconomicMap; import org.graalvm.word.LocationIdentity; + import org.junit.Assert; + import org.junit.Test; import jdk.vm.ci.meta.ResolvedJavaField; /** * The following tests validate the write barrier verification phase. For every tested snippet, an
*** 645,656 **** testPredicate(snippet, noCheck, removedBarrierIndices); } @SuppressWarnings("try") private void testPredicate(final String snippet, final GraphPredicate expectedBarriers, final int... removedBarrierIndices) { ! try (Scope d = Debug.scope("WriteBarrierVerificationTest", new DebugDumpScope(snippet))) { ! final StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES); HighTierContext highTierContext = getDefaultHighTierContext(); new InliningPhase(new CanonicalizerPhase()).apply(graph, highTierContext); MidTierContext midTierContext = new MidTierContext(getProviders(), getTargetProvider(), OptimisticOptimizations.ALL, graph.getProfilingInfo()); --- 644,656 ---- testPredicate(snippet, noCheck, removedBarrierIndices); } @SuppressWarnings("try") private void testPredicate(final String snippet, final GraphPredicate expectedBarriers, final int... removedBarrierIndices) { ! DebugContext debug = getDebugContext(); ! try (DebugCloseable d = debug.disableIntercept(); DebugContext.Scope s = debug.scope("WriteBarrierVerificationTest", new DebugDumpScope(snippet))) { ! final StructuredGraph graph = parseEager(snippet, AllowAssumptions.YES, debug); HighTierContext highTierContext = getDefaultHighTierContext(); new InliningPhase(new CanonicalizerPhase()).apply(graph, highTierContext); MidTierContext midTierContext = new MidTierContext(getProviders(), getTargetProvider(), OptimisticOptimizations.ALL, graph.getProfilingInfo());
*** 723,736 **** protected Boolean afterSplit(AbstractBeginNode node, Boolean oldState) { return false; } }; ! DebugConfig debugConfig = DebugScope.getConfig(); ! DebugConfig fixedConfig = debugConfig == null ? null ! : Debug.fixedConfig(debugConfig.getOptions(), 0, 0, false, false, false, false, false, debugConfig.dumpHandlers(), debugConfig.verifyHandlers(), debugConfig.output()); ! try (DebugConfigScope s = Debug.setConfig(fixedConfig)) { ReentrantNodeIterator.apply(closure, graph.start(), false); new WriteBarrierVerificationPhase(config).apply(graph); } catch (AssertionError error) { /* * Catch assertion, test for expected one and re-throw in order to validate unit --- 723,733 ---- protected Boolean afterSplit(AbstractBeginNode node, Boolean oldState) { return false; } }; ! try (Scope disabled = debug.disable()) { ReentrantNodeIterator.apply(closure, graph.start(), false); new WriteBarrierVerificationPhase(config).apply(graph); } catch (AssertionError error) { /* * Catch assertion, test for expected one and re-throw in order to validate unit
*** 738,746 **** */ Assert.assertTrue(error.getMessage().contains("Write barrier must be present")); throw error; } } catch (Throwable e) { ! throw Debug.handle(e); } } } --- 735,743 ---- */ Assert.assertTrue(error.getMessage().contains("Write barrier must be present")); throw error; } } catch (Throwable e) { ! throw debug.handle(e); } } }
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.hotspot.test/src/org/graalvm/compiler/hotspot/test/WriteBarrierVerificationTest.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File