Mercurial > hg > truffle
comparison graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java @ 13229:325b4e4efb60
added CompilationResultBuilderFactory to support peep-hole instrumentation of methods as their code is emitted
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 03 Dec 2013 16:33:41 +0100 |
parents | 4568980f7257 |
children | bb35fc7e0d68 |
comparison
equal
deleted
inserted
replaced
13228:4568980f7257 | 13229:325b4e4efb60 |
---|---|
32 import com.oracle.graal.api.code.*; | 32 import com.oracle.graal.api.code.*; |
33 import com.oracle.graal.api.code.CallingConvention.Type; | 33 import com.oracle.graal.api.code.CallingConvention.Type; |
34 import com.oracle.graal.api.code.CompilationResult.Call; | 34 import com.oracle.graal.api.code.CompilationResult.Call; |
35 import com.oracle.graal.api.code.CompilationResult.Infopoint; | 35 import com.oracle.graal.api.code.CompilationResult.Infopoint; |
36 import com.oracle.graal.compiler.*; | 36 import com.oracle.graal.compiler.*; |
37 import com.oracle.graal.lir.asm.*; | |
37 import com.oracle.graal.nodes.*; | 38 import com.oracle.graal.nodes.*; |
38 import com.oracle.graal.phases.*; | 39 import com.oracle.graal.phases.*; |
39 import com.oracle.graal.test.*; | 40 import com.oracle.graal.test.*; |
40 | 41 |
41 /** | 42 /** |
58 public void callInfopoints() { | 59 public void callInfopoints() { |
59 final Method method = getMethod("testMethod"); | 60 final Method method = getMethod("testMethod"); |
60 final StructuredGraph graph = parse(method); | 61 final StructuredGraph graph = parse(method); |
61 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); | 62 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); |
62 final CompilationResult cr = GraalCompiler.compileGraph(graph, cc, graph.method(), getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultPhasePlan(), | 63 final CompilationResult cr = GraalCompiler.compileGraph(graph, cc, graph.method(), getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultPhasePlan(), |
63 OptimisticOptimizations.ALL, new SpeculationLog(), getSuites(), true, new CompilationResult()); | 64 OptimisticOptimizations.ALL, new SpeculationLog(), getSuites(), true, new CompilationResult(), CompilationResultBuilderFactory.Default); |
64 for (Infopoint sp : cr.getInfopoints()) { | 65 for (Infopoint sp : cr.getInfopoints()) { |
65 assertNotNull(sp.reason); | 66 assertNotNull(sp.reason); |
66 if (sp instanceof Call) { | 67 if (sp instanceof Call) { |
67 assertEquals(InfopointReason.CALL, sp.reason); | 68 assertEquals(InfopointReason.CALL, sp.reason); |
68 } | 69 } |
80 } | 81 } |
81 } | 82 } |
82 assertTrue(graphLineSPs > 0); | 83 assertTrue(graphLineSPs > 0); |
83 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); | 84 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); |
84 final CompilationResult cr = GraalCompiler.compileGraph(graph, cc, graph.method(), getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultPhasePlan(true), | 85 final CompilationResult cr = GraalCompiler.compileGraph(graph, cc, graph.method(), getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultPhasePlan(true), |
85 OptimisticOptimizations.ALL, new SpeculationLog(), getSuites(), true, new CompilationResult()); | 86 OptimisticOptimizations.ALL, new SpeculationLog(), getSuites(), true, new CompilationResult(), CompilationResultBuilderFactory.Default); |
86 int lineSPs = 0; | 87 int lineSPs = 0; |
87 for (Infopoint sp : cr.getInfopoints()) { | 88 for (Infopoint sp : cr.getInfopoints()) { |
88 assertNotNull(sp.reason); | 89 assertNotNull(sp.reason); |
89 if (sp.reason == InfopointReason.LINE_NUMBER) { | 90 if (sp.reason == InfopointReason.LINE_NUMBER) { |
90 ++lineSPs; | 91 ++lineSPs; |