annotate graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java @ 9788:1bd67c5bdab8

VerifyUsageWithEquals: allow to pass a class to the phase and add Register-class as a phase
author Bernhard Urban <bernhard.urban@jku.at>
date Tue, 21 May 2013 18:03:24 +0200
parents 9530c8b1bd07
children 716664350f87
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
1 /*
4281
62cb0e636094 Copyright fixes
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4278
diff changeset
2 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved.
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
4 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
5 * This code is free software; you can redistribute it and/or modify it
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
6 * under the terms of the GNU General Public License version 2 only, as
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
7 * published by the Free Software Foundation.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
8 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
9 * This code is distributed in the hope that it will be useful, but WITHOUT
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
12 * version 2 for more details (a copy is included in the LICENSE file that
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
13 * accompanied this code).
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
14 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
15 * You should have received a copy of the GNU General Public License version
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
16 * 2 along with this work; if not, write to the Free Software Foundation,
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
18 *
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
20 * or visit www.oracle.com if you need additional information or have any
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
21 * questions.
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
22 */
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
23 package com.oracle.graal.compiler;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
24
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
25 import java.util.*;
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
26 import java.util.concurrent.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
27
6317
3ee3eb48e683 Clean up ComputeLinearScanOrder. Rename to ComputeBlockOrder.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 6316
diff changeset
28 import com.oracle.graal.alloc.*;
5510
426c605c9d3c Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5507
diff changeset
29 import com.oracle.graal.api.code.*;
9621
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
30 import com.oracle.graal.api.meta.*;
5060
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
31 import com.oracle.graal.compiler.alloc.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
32 import com.oracle.graal.compiler.gen.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
33 import com.oracle.graal.compiler.target.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
34 import com.oracle.graal.debug.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
35 import com.oracle.graal.lir.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
36 import com.oracle.graal.lir.asm.*;
4ed4295ce15f Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5059
diff changeset
37 import com.oracle.graal.nodes.*;
6529
2e96dc4eb8e2 renamed package: com.oracle.graal.lir.cfg -> com.oracle.graal.nodes.cfg
Doug Simon <doug.simon@oracle.com>
parents: 6526
diff changeset
38 import com.oracle.graal.nodes.cfg.*;
5720
46ad94a0574a moved everything from com.oracle.graal.nodes.cri into com.oracle.graal.nodes.spi
Doug Simon <doug.simon@oracle.com>
parents: 5718
diff changeset
39 import com.oracle.graal.nodes.spi.*;
9238
8f01fe16e473 refactorings and cleanups for the removal of FixedNode.probability
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9234
diff changeset
40 import com.oracle.graal.nodes.util.*;
6525
2c913b643422 rename packages in graal.phases to match project name
Doug Simon <doug.simon@oracle.com>
parents: 6524
diff changeset
41 import com.oracle.graal.phases.*;
6650
ea38da80dd29 refactor PEA into separate classes
Lukas Stadler <lukas.stadler@jku.at>
parents: 6587
diff changeset
42 import com.oracle.graal.phases.PhasePlan.PhasePosition;
6526
ee651c726397 split phases out of graal.phases project into graal.phases.common project
Doug Simon <doug.simon@oracle.com>
parents: 6525
diff changeset
43 import com.oracle.graal.phases.common.*;
9238
8f01fe16e473 refactorings and cleanups for the removal of FixedNode.probability
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9234
diff changeset
44 import com.oracle.graal.phases.graph.*;
6525
2c913b643422 rename packages in graal.phases to match project name
Doug Simon <doug.simon@oracle.com>
parents: 6524
diff changeset
45 import com.oracle.graal.phases.schedule.*;
9001
94583d9eead8 HighTier phase suite.
Roland Schatz <roland.schatz@oracle.com>
parents: 8983
diff changeset
46 import com.oracle.graal.phases.tiers.*;
9641
5e8299154973 verification: add VerifyPhase. check if a `Value' object is used in an ObjectEqualsNode
Bernhard Urban <bernhard.urban@jku.at>
parents: 9621
diff changeset
47 import com.oracle.graal.phases.verify.*;
6524
a206e077ffc8 rename packages in graal.virtual to match project name
Doug Simon <doug.simon@oracle.com>
parents: 6523
diff changeset
48 import com.oracle.graal.virtual.phases.ea.*;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
49
9615
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
50 /**
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
51 * Static methods for orchestrating the compilation of a {@linkplain StructuredGraph graph}.
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
52 */
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
53 public class GraalCompiler {
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
54
9615
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
55 /**
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
56 * Requests compilation of a given graph.
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
57 *
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
58 * @param graph the graph to be compiled
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
59 * @param cc the calling convention for calls to the code compiled for {@code graph}
9621
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
60 * @param installedCodeOwner the method the compiled code will be
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
61 * {@linkplain InstalledCode#getMethod() associated} with once installed. This
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
62 * argument can be null.
9615
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
63 * @return the result of the compilation
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
64 */
9621
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
65 public static CompilationResult compileGraph(final StructuredGraph graph, final CallingConvention cc, final ResolvedJavaMethod installedCodeOwner, final GraalCodeCacheProvider runtime,
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
66 final Replacements replacements, final Backend backend, final TargetDescription target, final GraphCache cache, final PhasePlan plan, final OptimisticOptimizations optimisticOpts,
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
67 final SpeculationLog speculationLog) {
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
68 final CompilationResult compilationResult = new CompilationResult();
9615
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
69 Debug.scope("GraalCompiler", new Object[]{graph, runtime}, new Runnable() {
6316
2e25b9c14b84 Temporarily remove experimental register allocators.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5891
diff changeset
70
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
71 public void run() {
7064
8d16b9b2c51e first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7063
diff changeset
72 final Assumptions assumptions = new Assumptions(GraalOptions.OptAssumptions);
4613
09402dddc51e Make the graph object always available in context (helps debugging problems during LIRGen)
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 4525
diff changeset
73 final LIR lir = Debug.scope("FrontEnd", new Callable<LIR>() {
6316
2e25b9c14b84 Temporarily remove experimental register allocators.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5891
diff changeset
74
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4353
diff changeset
75 public LIR call() {
8636
ac4dbfecec8f passed a Replacements object to inlining utility methods that need one instead of the GraalRuntime API
Doug Simon <doug.simon@oracle.com>
parents: 8622
diff changeset
76 return emitHIR(runtime, target, graph, replacements, assumptions, cache, plan, optimisticOpts, speculationLog);
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
77 }
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4353
diff changeset
78 });
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
79 final LIRGenerator lirGen = Debug.scope("BackEnd", lir, new Callable<LIRGenerator>() {
6316
2e25b9c14b84 Temporarily remove experimental register allocators.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5891
diff changeset
80
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
81 public LIRGenerator call() {
9614
59ec6eb8612e removed LinearScan.method field
Doug Simon <doug.simon@oracle.com>
parents: 9613
diff changeset
82 return emitLIR(backend, target, lir, graph, cc);
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
83 }
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4353
diff changeset
84 });
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
85 Debug.scope("CodeGen", lirGen, new Runnable() {
6316
2e25b9c14b84 Temporarily remove experimental register allocators.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5891
diff changeset
86
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
87 public void run() {
9621
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
88 emitCode(backend, getLeafGraphIdArray(graph), assumptions, lirGen, compilationResult, installedCodeOwner);
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
89 }
7660
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
90
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4353
diff changeset
91 });
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
92 }
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
93 });
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
94
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
95 return compilationResult;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
96 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
97
7660
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
98 private static long[] getLeafGraphIdArray(StructuredGraph graph) {
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
99 long[] leafGraphIdArray = new long[graph.getLeafGraphIds().size() + 1];
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
100 int i = 0;
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
101 leafGraphIdArray[i++] = graph.graphId();
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
102 for (long id : graph.getLeafGraphIds()) {
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
103 leafGraphIdArray[i++] = id;
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
104 }
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
105 return leafGraphIdArray;
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
106 }
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
107
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
108 /**
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
109 * Builds the graph, optimizes it.
7835
72971ec0d7ae Remove usage of GraalCompiler.target field.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7827
diff changeset
110 *
7836
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
111 * @param runtime
a202f72872a4 Remove usage of left-over fields in GraalCompiler.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7835
diff changeset
112 *
7835
72971ec0d7ae Remove usage of GraalCompiler.target field.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7827
diff changeset
113 * @param target
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
114 */
9234
b9cf7d0b598e removal of FixedNode.probability (draft)
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9186
diff changeset
115 public static LIR emitHIR(GraalCodeCacheProvider runtime, TargetDescription target, final StructuredGraph graph, Replacements replacements, Assumptions assumptions, GraphCache cache,
b9cf7d0b598e removal of FixedNode.probability (draft)
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9186
diff changeset
116 PhasePlan plan, OptimisticOptimizations optimisticOpts, final SpeculationLog speculationLog) {
8217
dce9cefed571 Draft speculation log.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8207
diff changeset
117
dce9cefed571 Draft speculation log.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8207
diff changeset
118 if (speculationLog != null) {
dce9cefed571 Draft speculation log.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8207
diff changeset
119 speculationLog.snapshot();
dce9cefed571 Draft speculation log.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8207
diff changeset
120 }
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
121
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
122 if (graph.start().next() == null) {
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
123 plan.runPhases(PhasePosition.AFTER_PARSING, graph);
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
124 new DeadCodeEliminationPhase().apply(graph);
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
125 } else {
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
126 Debug.dump(graph, "initial state");
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
127 }
9788
1bd67c5bdab8 VerifyUsageWithEquals: allow to pass a class to the phase
Bernhard Urban <bernhard.urban@jku.at>
parents: 9708
diff changeset
128 new VerifyUsageWithEquals(runtime, Value.class).apply(graph);
1bd67c5bdab8 VerifyUsageWithEquals: allow to pass a class to the phase
Bernhard Urban <bernhard.urban@jku.at>
parents: 9708
diff changeset
129 new VerifyUsageWithEquals(runtime, Register.class).apply(graph);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
130
5099
e35e2aa5ebad Run the canonicalizer early
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5085
diff changeset
131 if (GraalOptions.OptCanonicalizer) {
9049
6d376d09880b Make CanonicalizerPhase reentrant.
Roland Schatz <roland.schatz@oracle.com>
parents: 9001
diff changeset
132 new CanonicalizerPhase.Instance(runtime, assumptions).apply(graph);
5099
e35e2aa5ebad Run the canonicalizer early
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5085
diff changeset
133 }
e35e2aa5ebad Run the canonicalizer early
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5085
diff changeset
134
9265
bff0abdbc8b6 Restructure phase context hierarchy.
Roland Schatz <roland.schatz@oracle.com>
parents: 9264
diff changeset
135 HighTierContext highTierContext = new HighTierContext(runtime, assumptions, replacements);
9050
b393a023dd4e Make PartialEscapeAnalysisPhase reentrant.
Roland Schatz <roland.schatz@oracle.com>
parents: 9049
diff changeset
136
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
137 if (GraalOptions.Inline && !plan.isPhaseDisabled(InliningPhase.class)) {
8548
51d5999900e2 simple iterative inlining, simple read elimination in PEA
Lukas Stadler <lukas.stadler@jku.at>
parents: 8506
diff changeset
138 if (GraalOptions.IterativeInlining) {
9050
b393a023dd4e Make PartialEscapeAnalysisPhase reentrant.
Roland Schatz <roland.schatz@oracle.com>
parents: 9049
diff changeset
139 new IterativeInliningPhase(replacements, cache, plan, optimisticOpts, GraalOptions.OptEarlyReadElimination).apply(graph, highTierContext);
8548
51d5999900e2 simple iterative inlining, simple read elimination in PEA
Lukas Stadler <lukas.stadler@jku.at>
parents: 8506
diff changeset
140 } else {
8636
ac4dbfecec8f passed a Replacements object to inlining utility methods that need one instead of the GraalRuntime API
Doug Simon <doug.simon@oracle.com>
parents: 8622
diff changeset
141 new InliningPhase(runtime, null, replacements, assumptions, cache, plan, optimisticOpts).apply(graph);
8559
af0c1352f969 more work on read elimination
Lukas Stadler <lukas.stadler@jku.at>
parents: 8548
diff changeset
142 new DeadCodeEliminationPhase().apply(graph);
5864
59f209dd356b Be more precise on the set of node that are canonicalized in IterativeCheckCastElimination
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5859
diff changeset
143
8559
af0c1352f969 more work on read elimination
Lukas Stadler <lukas.stadler@jku.at>
parents: 8548
diff changeset
144 if (GraalOptions.ConditionalElimination && GraalOptions.OptCanonicalizer) {
9049
6d376d09880b Make CanonicalizerPhase reentrant.
Roland Schatz <roland.schatz@oracle.com>
parents: 9001
diff changeset
145 new CanonicalizerPhase.Instance(runtime, assumptions).apply(graph);
9136
2cfdde003076 Make IterativeConditionalEliminationPhase reentrant.
Roland Schatz <roland.schatz@oracle.com>
parents: 9122
diff changeset
146 new IterativeConditionalEliminationPhase().apply(graph, highTierContext);
8559
af0c1352f969 more work on read elimination
Lukas Stadler <lukas.stadler@jku.at>
parents: 8548
diff changeset
147 }
5204
0a53ed842cb8 Reordering and adjustments to phases
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 5177
diff changeset
148 }
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
149 }
9530
2777aafe689b TypeProfileProxy: remove profile proxies after inlining logic
Bernhard Urban <bernhard.urban@jku.at>
parents: 9511
diff changeset
150 TypeProfileProxyNode.cleanFromGraph(graph);
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
151
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
152 plan.runPhases(PhasePosition.HIGH_LEVEL, graph);
9142
e178e4598f85 Remove public fields.
Roland Schatz <roland.schatz@oracle.com>
parents: 9137
diff changeset
153 Suites.DEFAULT.getHighTier().apply(graph, highTierContext);
8600
c423a5fd8ac7 Cull frame states before lowering.
Roland Schatz <roland.schatz@oracle.com>
parents: 8560
diff changeset
154
9511
715f82d1f695 Enable the loop safepoint elimination.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 9450
diff changeset
155 MidTierContext midTierContext = new MidTierContext(runtime, assumptions, replacements, target, optimisticOpts);
9142
e178e4598f85 Remove public fields.
Roland Schatz <roland.schatz@oracle.com>
parents: 9137
diff changeset
156 Suites.DEFAULT.getMidTier().apply(graph, midTierContext);
8534
4f33d1871dca pipeline: canonicalize after ConditionalElimination and EliminatePartiallyRedundantGuards
Bernhard Urban <bernhard.urban@jku.at>
parents: 8506
diff changeset
157
8935
81ef56feff1b Move write barriers' addition to a separate stage after lowering
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8896
diff changeset
158 plan.runPhases(PhasePosition.LOW_LEVEL, graph);
81ef56feff1b Move write barriers' addition to a separate stage after lowering
Christos Kotselidis <christos.kotselidis@oracle.com>
parents: 8896
diff changeset
159
9511
715f82d1f695 Enable the loop safepoint elimination.
Gilles Duboscq <duboscq@ssw.jku.at>
parents: 9450
diff changeset
160 LowTierContext lowTierContext = new LowTierContext(runtime, assumptions, replacements, target);
9264
3df022b2eebe LowTier phase suite.
Roland Schatz <roland.schatz@oracle.com>
parents: 9251
diff changeset
161 Suites.DEFAULT.getLowTier().apply(graph, lowTierContext);
9706
f44d7e24cebd Fixes for the merge and inlining cleanups.
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9704
diff changeset
162 InliningPhase.storeStatisticsAfterLowTier(graph);
9264
3df022b2eebe LowTier phase suite.
Roland Schatz <roland.schatz@oracle.com>
parents: 9251
diff changeset
163
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4421
diff changeset
164 final SchedulePhase schedule = new SchedulePhase();
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
165 schedule.apply(graph);
4522
cf13124efdd9 Restructure phi functions in LIR; Re-enabled C1Visualizer output
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4477
diff changeset
166 Debug.dump(schedule, "final schedule");
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
167
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4421
diff changeset
168 final Block[] blocks = schedule.getCFG().getBlocks();
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4421
diff changeset
169 final Block startBlock = schedule.getCFG().getStartBlock();
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
170 assert startBlock != null;
7497
0f8c6dbf68be Code clean up and documentation for ComputeBlockOrder class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7493
diff changeset
171 assert startBlock.getPredecessorCount() == 0;
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
172
5013
25a46490146e Use context instead of individual dump calls to pass helper objects to CFG printer
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4648
diff changeset
173 return Debug.scope("ComputeLinearScanOrder", new Callable<LIR>() {
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
174
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
175 @Override
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
176 public LIR call() {
9238
8f01fe16e473 refactorings and cleanups for the removal of FixedNode.probability
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9234
diff changeset
177 NodesToDoubles nodeProbabilities = new ComputeProbabilityClosure(graph).apply();
9234
b9cf7d0b598e removal of FixedNode.probability (draft)
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9186
diff changeset
178 List<Block> codeEmittingOrder = ComputeBlockOrder.computeCodeEmittingOrder(blocks.length, startBlock, nodeProbabilities);
b9cf7d0b598e removal of FixedNode.probability (draft)
Christian Haeubl <haeubl@ssw.jku.at>
parents: 9186
diff changeset
179 List<Block> linearScanOrder = ComputeBlockOrder.computeLinearScanOrder(blocks.length, startBlock, nodeProbabilities);
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
180
8217
dce9cefed571 Draft speculation log.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 8207
diff changeset
181 LIR lir = new LIR(schedule.getCFG(), schedule.getBlockToNodesMap(), linearScanOrder, codeEmittingOrder, speculationLog);
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
182 Debug.dump(lir, "After linear scan order");
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
183 return lir;
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
184
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
185 }
4353
043bec543161 More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4352
diff changeset
186 });
7307
dc3e86fd3be1 Introduce cutomization capability for canonicalizer.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7246
diff changeset
187
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
188 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
189
9614
59ec6eb8612e removed LinearScan.method field
Doug Simon <doug.simon@oracle.com>
parents: 9613
diff changeset
190 public static LIRGenerator emitLIR(Backend backend, final TargetDescription target, final LIR lir, StructuredGraph graph, CallingConvention cc) {
7838
a063308816d9 Complete first PTX unit test.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7837
diff changeset
191 final FrameMap frameMap = backend.newFrameMap();
9613
0c17815817a4 removed LIRGenerator.method field
Doug Simon <doug.simon@oracle.com>
parents: 9612
diff changeset
192 final LIRGenerator lirGen = backend.newLIRGenerator(graph, frameMap, cc, lir);
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
193
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
194 Debug.scope("LIRGen", lirGen, new Runnable() {
6316
2e25b9c14b84 Temporarily remove experimental register allocators.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5891
diff changeset
195
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4353
diff changeset
196 public void run() {
4435
57cb8ec5f6bb Restructure block and control flow graph data structures
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4421
diff changeset
197 for (Block b : lir.linearScanOrder()) {
7370
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
198 emitBlock(b);
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
199 }
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
200
4522
cf13124efdd9 Restructure phi functions in LIR; Re-enabled C1Visualizer output
Christian Wimmer <Christian.Wimmer@Oracle.com>
parents: 4477
diff changeset
201 Debug.dump(lir, "After LIR generation");
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
202 }
7370
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
203
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
204 private void emitBlock(Block b) {
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
205 if (lir.lir(b) == null) {
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
206 for (Block pred : b.getPredecessors()) {
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
207 if (!b.isLoopHeader() || !pred.isLoopEnd()) {
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
208 emitBlock(pred);
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
209 }
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
210 }
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
211 lirGen.doBlock(b);
7370
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
212 }
39a4192ae632 Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 7348
diff changeset
213 }
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4353
diff changeset
214 });
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
215
8282
59744882ddeb moved logic for reserving a special area/slot in a frame (e.g., for use during deoptimization) out of FrameMap and into platform specific backend class
Doug Simon <doug.simon@oracle.com>
parents: 8281
diff changeset
216 lirGen.beforeRegisterAllocation();
59744882ddeb moved logic for reserving a special area/slot in a frame (e.g., for use during deoptimization) out of FrameMap and into platform specific backend class
Doug Simon <doug.simon@oracle.com>
parents: 8281
diff changeset
217
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4353
diff changeset
218 Debug.scope("Allocator", new Runnable() {
6316
2e25b9c14b84 Temporarily remove experimental register allocators.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 5891
diff changeset
219
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4353
diff changeset
220 public void run() {
9614
59ec6eb8612e removed LinearScan.method field
Doug Simon <doug.simon@oracle.com>
parents: 9613
diff changeset
221 new LinearScan(target, lir, lirGen, frameMap).allocate();
4265
4643ccd37dac * removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents: 4263
diff changeset
222 }
4357
719ac1d92a52 More work on debug framework.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents: 4353
diff changeset
223 });
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
224 return lirGen;
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
225 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
226
9621
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
227 public static void emitCode(Backend backend, long[] leafGraphIds, Assumptions assumptions, LIRGenerator lirGen, CompilationResult compilationResult, ResolvedJavaMethod installedCodeOwner) {
8281
8fde1be81b2d LIRGenerator is transmitted across backend passes instead of just the LIR so that backend-specific, per-compilation information can be attached to the backend-specific LIRGenerator object
Doug Simon <doug.simon@oracle.com>
parents: 8271
diff changeset
228 TargetMethodAssembler tasm = backend.newAssembler(lirGen, compilationResult);
9621
e97dc9bbfedc introduced installedCodeOwner parameter of type ResolvedJavaMethod to GraalCompiler.compileGraph to properly distinguish the source method of a graph from the method under which the code compiled for the graph will be installed
Doug Simon <doug.simon@oracle.com>
parents: 9615
diff changeset
229 backend.emitCode(tasm, lirGen, installedCodeOwner);
9615
1089d63ef168 removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents: 9614
diff changeset
230 CompilationResult result = tasm.finishTargetMethod(lirGen.getGraph());
7064
8d16b9b2c51e first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents: 7063
diff changeset
231 if (!assumptions.isEmpty()) {
7660
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
232 result.setAssumptions(assumptions);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
233 }
7660
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
234 result.setLeafGraphIds(leafGraphIds);
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
235
7660
0b646334c5f7 keep track of leafGraphIds only at the StructuredGraph level (see GRAAL-60)
Lukas Stadler <lukas.stadler@jku.at>
parents: 7539
diff changeset
236 Debug.dump(result, "After code generation");
3733
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
237 }
e233f5660da4 Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff changeset
238 }