Mercurial > hg > truffle
comparison graal/com.oracle.graal.compiler.test/src/com/oracle/graal/compiler/test/InfopointReasonTest.java @ 19250:8ab925a6f724
made Assumptions be part of a StructuredGraph
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 11 Feb 2015 10:13:08 +0100 |
parents | 66c60942c06c |
children | 313f9a9647e5 |
comparison
equal
deleted
inserted
replaced
19249:ec8402f4e00a | 19250:8ab925a6f724 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 package com.oracle.graal.compiler.test; | 23 package com.oracle.graal.compiler.test; |
24 | 24 |
25 import static com.oracle.graal.api.code.Assumptions.*; | |
25 import static com.oracle.graal.api.code.CodeUtil.*; | 26 import static com.oracle.graal.api.code.CodeUtil.*; |
26 import static com.oracle.graal.compiler.GraalCompiler.*; | 27 import static com.oracle.graal.compiler.GraalCompiler.*; |
28 import static com.oracle.graal.compiler.common.GraalOptions.*; | |
27 import static org.junit.Assert.*; | 29 import static org.junit.Assert.*; |
28 | 30 |
29 import org.junit.*; | 31 import org.junit.*; |
30 | 32 |
31 import com.oracle.graal.api.code.*; | 33 import com.oracle.graal.api.code.*; |
56 } | 58 } |
57 | 59 |
58 @Test | 60 @Test |
59 public void callInfopoints() { | 61 public void callInfopoints() { |
60 final ResolvedJavaMethod method = getResolvedJavaMethod("testMethod"); | 62 final ResolvedJavaMethod method = getResolvedJavaMethod("testMethod"); |
61 final StructuredGraph graph = parseEager(method); | 63 final StructuredGraph graph = parseEager(method, ALLOW_OPTIMISTIC_ASSUMPTIONS); |
62 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); | 64 CallingConvention cc = getCallingConvention(getCodeCache(), Type.JavaCallee, graph.method(), false); |
63 final CompilationResult cr = compileGraph(graph, cc, graph.method(), getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultGraphBuilderSuite(), | 65 final CompilationResult cr = compileGraph(graph, cc, graph.method(), getProviders(), getBackend(), getCodeCache().getTarget(), null, getDefaultGraphBuilderSuite(), |
64 OptimisticOptimizations.ALL, getProfilingInfo(graph), null, getSuites(), getLowLevelSuites(), new CompilationResult(), CompilationResultBuilderFactory.Default); | 66 OptimisticOptimizations.ALL, getProfilingInfo(graph), null, getSuites(), getLowLevelSuites(), new CompilationResult(), CompilationResultBuilderFactory.Default); |
65 for (Infopoint sp : cr.getInfopoints()) { | 67 for (Infopoint sp : cr.getInfopoints()) { |
66 assertNotNull(sp.reason); | 68 assertNotNull(sp.reason); |
71 } | 73 } |
72 | 74 |
73 @Test | 75 @Test |
74 public void lineInfopoints() { | 76 public void lineInfopoints() { |
75 final ResolvedJavaMethod method = getResolvedJavaMethod("testMethod"); | 77 final ResolvedJavaMethod method = getResolvedJavaMethod("testMethod"); |
76 final StructuredGraph graph = parseDebug(method); | 78 final StructuredGraph graph = parseDebug(method, OptAssumptions.getValue()); |
77 int graphLineSPs = 0; | 79 int graphLineSPs = 0; |
78 for (FullInfopointNode ipn : graph.getNodes().filter(FullInfopointNode.class)) { | 80 for (FullInfopointNode ipn : graph.getNodes().filter(FullInfopointNode.class)) { |
79 if (ipn.getReason() == InfopointReason.LINE_NUMBER) { | 81 if (ipn.getReason() == InfopointReason.LINE_NUMBER) { |
80 ++graphLineSPs; | 82 ++graphLineSPs; |
81 } | 83 } |