115 } |
115 } |
116 |
116 |
117 private void test(String name, int expectedInits, int expectedResolves, int expectedLoads) { |
117 private void test(String name, int expectedInits, int expectedResolves, int expectedLoads) { |
118 StructuredGraph graph = parseEager(name, AllowAssumptions.NO, new OptionValues(getInitialOptions(), GraalOptions.GeneratePIC, true)); |
118 StructuredGraph graph = parseEager(name, AllowAssumptions.NO, new OptionValues(getInitialOptions(), GraalOptions.GeneratePIC, true)); |
119 HighTierContext highTierContext = getDefaultHighTierContext(); |
119 HighTierContext highTierContext = getDefaultHighTierContext(); |
120 CanonicalizerPhase canonicalizer = new CanonicalizerPhase(); |
120 CanonicalizerPhase canonicalizer = createCanonicalizerPhase(); |
121 new EliminateRedundantInitializationPhase().apply(graph, highTierContext); |
121 new EliminateRedundantInitializationPhase().apply(graph, highTierContext); |
122 new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.HIGH_TIER).apply(graph, highTierContext); |
122 new LoweringPhase(canonicalizer, LoweringTool.StandardLoweringStage.HIGH_TIER).apply(graph, highTierContext); |
123 new LoadJavaMirrorWithKlassPhase(config).apply(graph, highTierContext); |
123 new LoadJavaMirrorWithKlassPhase(config).apply(graph, highTierContext); |
124 new ReplaceConstantNodesPhase(false).apply(graph, highTierContext); |
124 new ReplaceConstantNodesPhase(false).apply(graph, highTierContext); |
125 Assert.assertEquals(expectedInits, graph.getNodes().filter(InitializeKlassNode.class).count()); |
125 Assert.assertEquals(expectedInits, graph.getNodes().filter(InitializeKlassNode.class).count()); |