Mercurial > hg > truffle
changeset 9539:05c523b6633b
Merge.
author | Christian Humer <christian.humer@gmail.com> |
---|---|
date | Fri, 03 May 2013 15:37:08 +0200 |
parents | e6fe35d64b71 (current diff) 63b4cea1ed3f (diff) |
children | 438bde0e12ba |
files | |
diffstat | 1 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/WriteBarrierVerificationTest.java Fri May 03 15:02:56 2013 +0200 +++ b/graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/WriteBarrierVerificationTest.java Fri May 03 15:37:08 2013 +0200 @@ -23,12 +23,14 @@ package com.oracle.graal.compiler.test; import java.util.*; +import java.util.concurrent.*; import org.junit.*; import com.oracle.graal.api.code.*; import com.oracle.graal.api.meta.*; import com.oracle.graal.debug.*; +import com.oracle.graal.debug.internal.*; import com.oracle.graal.hotspot.phases.*; import com.oracle.graal.nodes.*; import com.oracle.graal.nodes.extended.LocationNode.LocationIdentity; @@ -615,9 +617,10 @@ } private void test(final String snippet, final int expectedBarriers, final int... removedBarrierIndices) { - Debug.scope("WriteBarrierVerificationTest", new DebugDumpScope(snippet), new Runnable() { - public void run() { + AssertionError expectedError = Debug.scope("WriteBarrierVerificationTest", new DebugDumpScope(snippet), new Callable<AssertionError>() { + + public AssertionError call() { final StructuredGraph graph = parse(snippet); HighTierContext highTierContext = new HighTierContext(runtime(), new Assumptions(false), replacements); MidTierContext midTierContext = new MidTierContext(runtime(), new Assumptions(false), replacements, runtime().getTarget(), OptimisticOptimizations.ALL); @@ -690,8 +693,10 @@ } }; + DebugConfig config = DebugScope.getConfig(); try { ReentrantNodeIterator.apply(closure, graph.start(), new State(), null); + Debug.setConfig(Debug.fixedConfig(false, false, false, false, config.dumpHandlers(), config.output())); new WriteBarrierVerificationPhase().apply(graph); } catch (AssertionError error) { /* @@ -699,10 +704,15 @@ * test. */ Assert.assertTrue(error.getMessage().equals("Write barrier must be present")); - throw new AssertionError(); + return error; + } finally { + Debug.setConfig(config); } - + return null; } }); + if (expectedError != null) { + throw expectedError; + } } }