BasicAMD64Test

Venkatachalam, Vasanth Vasanth.Venkatachalam at amd.com
Wed May 22 13:37:48 PDT 2013


Hi Doug,

After pulling the most recent changes, I get a new error for the same test case. I did not see this error before.

com.oracle.graal.graph.GraalInternalError: java.lang.NullPointerException
	at lir instruction: DEOPT action: InvalidateReprofile reason: BoundsCheckException info [bci:0]
	at com.oracle.graal.lir.LIR.emitOp(LIR.java:172)
	at com.oracle.graal.lir.LIR.emitBlock(LIR.java:161)
	at com.oracle.graal.lir.LIR.emitCode(LIR.java:147)
	at com.oracle.graal.hotspot.amd64.AMD64HotSpotBackend.emitCode(AMD64HotSpotBackend.java:248)
	at com.oracle.graal.compiler.GraalCompiler.emitCode(GraalCompiler.java:228)
	at com.oracle.graal.compiler.GraalCompiler$1$3.run(GraalCompiler.java:88)
	at com.oracle.graal.debug.internal.DebugScope.executeScope(DebugScope.java:179)
	at com.oracle.graal.debug.internal.DebugScope.scope(DebugScope.java:167)
	at com.oracle.graal.debug.Debug.scope(Debug.java:118)
	at com.oracle.graal.debug.Debug.scope(Debug.java:113)
	at com.oracle.graal.compiler.GraalCompiler$1.run(GraalCompiler.java:85)
	at com.oracle.graal.debug.internal.DebugScope.executeScope(DebugScope.java:179)
	at com.oracle.graal.debug.internal.DebugScope.scope(DebugScope.java:167)
	at com.oracle.graal.debug.Debug.scope(Debug.java:118)
	at com.oracle.graal.compiler.GraalCompiler.compileGraph(GraalCompiler.java:69)
	at com.oracle.graal.compiler.amd64.test.BasicAMD64Test.test(BasicAMD64Test.java:257)
	at com.oracle.graal.compiler.amd64.test.BasicAMD64Test.testNBody(BasicAMD64Test.java:149)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:601)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.junit.runners.Suite.runChild(Suite.java:128)
	at org.junit.runners.Suite.runChild(Suite.java:24)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:300)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:136)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:117)
	at org.junit.runner.JUnitCore.runMain(JUnitCore.java:98)
	at org.junit.runner.JUnitCore.runMainAndExit(JUnitCore.java:53)
	at org.junit.runner.JUnitCore.main(JUnitCore.java:45)
Caused by: java.lang.NullPointerException
	at com.oracle.graal.hotspot.meta.HotSpotRuntime.lookupForeignCall(HotSpotRuntime.java:831)
	at com.oracle.graal.hotspot.meta.HotSpotRuntime.lookupForeignCall(HotSpotRuntime.java:93)
	at com.oracle.graal.hotspot.amd64.AMD64DeoptimizeOp.emitCode(AMD64DeoptimizeOp.java:55)
	at com.oracle.graal.lir.amd64.AMD64LIRInstruction.emitCode(AMD64LIRInstruction.java:36)
	at com.oracle.graal.lir.LIR.emitOp(LIR.java:168)
	... 48 more
-----Original Message-----
From: Doug Simon [mailto:doug.simon at oracle.com] 
Sent: Tuesday, May 21, 2013 11:24 AM
To: Venkatachalam, Vasanth
Cc: graal-dev at openjdk.java.net
Subject: Re: BasicAMD64Test

Hi Vasanth,

On May 21, 2013, at 5:43 PM, "Venkatachalam, Vasanth" <Vasanth.Venkatachalam at amd.com> wrote:

> Hi,
> 
> The below test case for the AMD64 backend used to work, but after a recent merge it now fails with the error:
> 
> Java.lang.AssertionError: linkage without and address must be a stub - forgot to register a Stub associated with exceptionHandler(Object,Word) void.
> 
> Can someone explain what we need to do to get this working again?

Recent changes have removed this assertion. Please let me know if you still get this (or a similar) error after pulling the most recent changes.

> Also is there a way we can get the AMD64 backend to display the disassembled generated code?

What is not working with the (commented out) disassembler call in your attached code?

> Also it would be useful if we could write our test cases in one central location and run them in any backend (AMD64, PTX, HSAIL etc) instead of duplicating them into the test directories for each of the backends.

I assume you are talking about non-backend-specific tests. In that case, can't you just create a project similar to com.oracle.graal.compiler.test or com.oracle.graal.hotspot.test? 

-Doug

> BasicAMD64Test.java
> 
> public class BasicAMD64Test extends GraalCompilerTest {
> 
> @Test
>    public void testArray2() {
>        test("testArrayVarSnippet");
>    }
> 
> public static int testArrayVarSnippet(int[] array, int n) {
>        return array[n];
>    }
> 
> private CompilationResult test(String snippet) {
>        StructuredGraph graph = parse(snippet);
>        Debug.dump(graph, "Graph");
>        TargetDescription target = new TargetDescription(new AMD64(4, 1), true, 1, 0, true);
>        AMD64HotSpotBackend amd64Backend = new AMD64HotSpotBackend(new AMD64HotSpotGraalRuntime().getRuntime(), target);
>        PhasePlan phasePlan = new PhasePlan();
>        GraphBuilderPhase graphBuilderPhase = new GraphBuilderPhase(runtime, GraphBuilderConfiguration.getDefault(), OptimisticOptimizations.NONE);
>        phasePlan.addPhase(PhasePosition.AFTER_PARSING, graphBuilderPhase);
>        phasePlan.addPhase(PhasePosition.AFTER_PARSING, new AMD64Phase());
>        new AMD64Phase().apply(graph);
>        CallingConvention cc = getCallingConvention(runtime, Type.JavaCallee, graph.method(), false);
>        CompilationResult result = GraalCompiler.compileGraph(graph, cc, graph.method(), runtime, graalRuntime().getReplacements(), amd64Backend, target, null, phasePlan,
>                        OptimisticOptimizations.NONE, new SpeculationLog());
>        DisassemblerProvider dis = Graal.getRuntime().getCapability(DisassemblerProvider.class);
>        /******
>         * if (dis != null) { String disasm = dis.disassemble(result); }
>         **********/
>        if (true) {
>            String disasm = new AMD64HotSpotGraalRuntime().getRuntime().disassemble(result, null);
>            System.out.println("code for snippet " + snippet + " " + disasm);
>        }
>        return result;
>    }
> 
>    private static class AMD64Phase extends Phase {
> 
>        @Override
>        protected void run(StructuredGraph graph) {
>            for (LocalNode local : graph.getNodes(LocalNode.class)) {
>                if (local.kind() == Kind.Object) {
>                    local.setStamp(StampFactory.declaredNonNull(local.objectStamp().type()));
>                }
>            }
>        }
> 
>    }
> 





More information about the graal-dev mailing list