use of org.graalvm.compiler.phases.common.CanonicalizerPhase in project graal by oracle.
the class NodePropertiesTest method testFieldStore.
@Test
public void testFieldStore() {
StructuredGraph g1 = parseForCompile(getResolvedJavaMethod("fieldStore"));
HighTierContext htc = getDefaultHighTierContext();
new CanonicalizerPhase().apply(g1, htc);
GraphCostPhase gc1 = new GraphCostPhase();
gc1.apply(g1, htc);
Assert.assertEquals(15, gc1.finalCycles, 25);
}
use of org.graalvm.compiler.phases.common.CanonicalizerPhase in project graal by oracle.
the class NodePropertiesTest method testFieldLoad.
@Test
public void testFieldLoad() {
StructuredGraph g1 = parseForCompile(getResolvedJavaMethod("fieldLoad"));
HighTierContext htc = getDefaultHighTierContext();
new CanonicalizerPhase().apply(g1, htc);
GraphCostPhase gc1 = new GraphCostPhase();
gc1.apply(g1, htc);
Assert.assertEquals(15, gc1.finalCycles, 25);
}
use of org.graalvm.compiler.phases.common.CanonicalizerPhase in project graal by oracle.
the class NodePropertiesTest method testArrayStore.
@Test
public void testArrayStore() {
StructuredGraph g1 = parseForCompile(getResolvedJavaMethod("arrayStoreTest"));
HighTierContext htc = getDefaultHighTierContext();
new CanonicalizerPhase().apply(g1, htc);
GraphCostPhase gc1 = new GraphCostPhase();
gc1.apply(g1, htc);
Assert.assertEquals(15, gc1.finalCycles, 25);
}
use of org.graalvm.compiler.phases.common.CanonicalizerPhase in project graal by oracle.
the class NodePropertiesTest method testCanonicalizationExample.
@Test
public void testCanonicalizationExample() {
HighTierContext htc = getDefaultHighTierContext();
ImprovementSavingCanonicalizer c1 = new ImprovementSavingCanonicalizer();
StructuredGraph g1 = parseForCompile(getResolvedJavaMethod("test1Snippet"));
new CanonicalizerPhase(c1).apply(g1, htc);
ImprovementSavingCanonicalizer c2 = new ImprovementSavingCanonicalizer();
StructuredGraph g2 = parseForCompile(getResolvedJavaMethod("test2Snippet"));
new CanonicalizerPhase(c2).apply(g2, htc);
Assert.assertEquals(0, c1.savedCycles);
Assert.assertEquals(0, c2.savedCycles);
}
use of org.graalvm.compiler.phases.common.CanonicalizerPhase in project graal by oracle.
the class NodePropertiesTest method testExpectUntrusted.
@Test
public void testExpectUntrusted() {
StructuredGraph g1 = parseForCompile(getResolvedJavaMethod("untrused01"));
HighTierContext htc = getDefaultHighTierContext();
new CanonicalizerPhase().apply(g1, htc);
GraphCostPhase gc1 = new GraphCostPhase();
gc1.apply(g1, htc);
}
Aggregations