Mercurial > hg > truffle
annotate graal/com.oracle.graal.compiler/src/com/oracle/graal/compiler/GraalCompiler.java @ 18187:9619ba4daf4c
Rename Constant to JavaConstant.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Thu, 30 Oct 2014 12:21:07 +0100 |
parents | ef357effbda7 |
children | d1f5e41c3afe |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
18157
diff
changeset
|
2 * Copyright (c) 2009, 2014, 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 |
11504
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
25 import static com.oracle.graal.compiler.GraalCompiler.Options.*; |
11491
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
26 import static com.oracle.graal.compiler.MethodFilter.*; |
15259
d90e5c22ba55
Move GraalOptions to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents:
15192
diff
changeset
|
27 import static com.oracle.graal.compiler.common.GraalOptions.*; |
17065
37d6d174bc40
denote certain applications of DeadCodeEliminationPhase as optional and only run them if -G:-ReduceDCE
Doug Simon <doug.simon@oracle.com>
parents:
16952
diff
changeset
|
28 import static com.oracle.graal.phases.common.DeadCodeEliminationPhase.Optionality.*; |
9864
063a712fe8d8
converted remaining options in GraalOptions to new system (GRAAL-27)
Doug Simon <doug.simon@oracle.com>
parents:
9855
diff
changeset
|
29 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
30 import java.util.*; |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
31 |
6317
3ee3eb48e683
Clean up ComputeLinearScanOrder. Rename to ComputeBlockOrder.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
6316
diff
changeset
|
32 import com.oracle.graal.alloc.*; |
5510
426c605c9d3c
Move cri.ci to api.code.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5507
diff
changeset
|
33 import com.oracle.graal.api.code.*; |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
18157
diff
changeset
|
34 import com.oracle.graal.api.code.CompilationResult.ConstantReference; |
14172
cd22c8dbda4f
Made graph caching compilation local
Doug Simon <doug.simon@oracle.com>
parents:
14148
diff
changeset
|
35 import com.oracle.graal.api.code.CompilationResult.DataPatch; |
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
|
36 import com.oracle.graal.api.meta.*; |
14172
cd22c8dbda4f
Made graph caching compilation local
Doug Simon <doug.simon@oracle.com>
parents:
14148
diff
changeset
|
37 import com.oracle.graal.api.meta.ProfilingInfo.TriState; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
38 import com.oracle.graal.compiler.alloc.*; |
15192
644dfe49c0f4
Move packages com.oracle.graal.cfg to com.oracle.graal.compiler.common.cfg.
Josef Eisl <josef.eisl@jku.at>
parents:
15170
diff
changeset
|
39 import com.oracle.graal.compiler.common.cfg.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
40 import com.oracle.graal.compiler.target.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
41 import com.oracle.graal.debug.*; |
13197
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
42 import com.oracle.graal.debug.Debug.Scope; |
11487
21738e530332
added metrics for timing front-end, back-end and code installation (GRAAL-448)
Doug Simon <doug.simon@oracle.com>
parents:
10937
diff
changeset
|
43 import com.oracle.graal.debug.internal.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
44 import com.oracle.graal.lir.*; |
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
45 import com.oracle.graal.lir.asm.*; |
16952
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
46 import com.oracle.graal.lir.constopt.*; |
15292
a38d791982e1
Move LIRGenerationResult* to graal.lir.
Josef Eisl <josef.eisl@jku.at>
parents:
15259
diff
changeset
|
47 import com.oracle.graal.lir.gen.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
48 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
|
49 import com.oracle.graal.nodes.cfg.*; |
15337
c4be3c1b2d6d
Use NodeLIRBuilderTool instead of NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15333
diff
changeset
|
50 import com.oracle.graal.nodes.spi.*; |
11504
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
51 import com.oracle.graal.options.*; |
6525
2c913b643422
rename packages in graal.phases to match project name
Doug Simon <doug.simon@oracle.com>
parents:
6524
diff
changeset
|
52 import com.oracle.graal.phases.*; |
6526
ee651c726397
split phases out of graal.phases project into graal.phases.common project
Doug Simon <doug.simon@oracle.com>
parents:
6525
diff
changeset
|
53 import com.oracle.graal.phases.common.*; |
6525
2c913b643422
rename packages in graal.phases to match project name
Doug Simon <doug.simon@oracle.com>
parents:
6524
diff
changeset
|
54 import com.oracle.graal.phases.schedule.*; |
9001
94583d9eead8
HighTier phase suite.
Roland Schatz <roland.schatz@oracle.com>
parents:
8983
diff
changeset
|
55 import com.oracle.graal.phases.tiers.*; |
12054
bba234a1670e
grouped provider values/parameters into a Providers object (GRAAL-511)
Doug Simon <doug.simon@oracle.com>
parents:
12052
diff
changeset
|
56 import com.oracle.graal.phases.util.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
57 |
9615
1089d63ef168
removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents:
9614
diff
changeset
|
58 /** |
1089d63ef168
removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents:
9614
diff
changeset
|
59 * 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
|
60 */ |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
61 public class GraalCompiler { |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
62 |
11487
21738e530332
added metrics for timing front-end, back-end and code installation (GRAAL-448)
Doug Simon <doug.simon@oracle.com>
parents:
10937
diff
changeset
|
63 private static final DebugTimer FrontEnd = Debug.timer("FrontEnd"); |
21738e530332
added metrics for timing front-end, back-end and code installation (GRAAL-448)
Doug Simon <doug.simon@oracle.com>
parents:
10937
diff
changeset
|
64 private static final DebugTimer BackEnd = Debug.timer("BackEnd"); |
21738e530332
added metrics for timing front-end, back-end and code installation (GRAAL-448)
Doug Simon <doug.simon@oracle.com>
parents:
10937
diff
changeset
|
65 |
11504
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
66 /** |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
67 * The set of positive filters specified by the {@code -G:IntrinsificationsEnabled} option. To |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
68 * enable a fast path in {@link #shouldIntrinsify(JavaMethod)}, this field is {@code null} when |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
69 * no enabling/disabling filters are specified. |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
70 */ |
11491
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
71 private static final MethodFilter[] positiveIntrinsificationFilter; |
11504
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
72 |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
73 /** |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
74 * The set of negative filters specified by the {@code -G:IntrinsificationsDisabled} option. |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
75 */ |
11491
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
76 private static final MethodFilter[] negativeIntrinsificationFilter; |
11504
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
77 |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
78 static class Options { |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
79 |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
80 // @formatter:off |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
81 /** |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
82 * @see MethodFilter |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
83 */ |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
84 @Option(help = "Pattern for method(s) to which intrinsification (if available) will be applied. " + |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
85 "By default, all available intrinsifications are applied except for methods matched " + |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
86 "by IntrinsificationsDisabled. See MethodFilter class for pattern syntax.") |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
87 public static final OptionValue<String> IntrinsificationsEnabled = new OptionValue<>(null); |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
88 /** |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
89 * @see MethodFilter |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
90 */ |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
91 @Option(help = "Pattern for method(s) to which intrinsification will not be applied. " + |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
92 "See MethodFilter class for pattern syntax.") |
11871
69a527047c40
fix, simplify and enable ObjectClone intrinsification
Lukas Stadler <lukas.stadler@jku.at>
parents:
11833
diff
changeset
|
93 public static final OptionValue<String> IntrinsificationsDisabled = new OptionValue<>(null); |
11504
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
94 // @formatter:on |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
95 |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
96 } |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
97 |
11491
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
98 static { |
11504
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
99 if (IntrinsificationsDisabled.getValue() != null) { |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
100 negativeIntrinsificationFilter = parse(IntrinsificationsDisabled.getValue()); |
11491
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
101 } else { |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
102 negativeIntrinsificationFilter = null; |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
103 } |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
104 |
11504
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
105 if (Options.IntrinsificationsEnabled.getValue() != null) { |
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
106 positiveIntrinsificationFilter = parse(IntrinsificationsEnabled.getValue()); |
11491
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
107 } else if (negativeIntrinsificationFilter != null) { |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
108 positiveIntrinsificationFilter = new MethodFilter[0]; |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
109 } else { |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
110 positiveIntrinsificationFilter = null; |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
111 } |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
112 } |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
113 |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
114 /** |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
115 * Determines if a given method should be intrinsified based on the values of |
11504
be283d587cfc
moved IntrinsificationsEnabled and IntrinsificationsDisabled to new GraalCompiler.Options class
Doug Simon <doug.simon@oracle.com>
parents:
11491
diff
changeset
|
116 * {@link Options#IntrinsificationsEnabled} and {@link Options#IntrinsificationsDisabled}. |
11491
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
117 */ |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
118 public static boolean shouldIntrinsify(JavaMethod method) { |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
119 if (positiveIntrinsificationFilter == null) { |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
120 return true; |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
121 } |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
122 if (positiveIntrinsificationFilter.length == 0 || matches(positiveIntrinsificationFilter, method)) { |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
123 return negativeIntrinsificationFilter == null || !matches(negativeIntrinsificationFilter, method); |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
124 } |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
125 return false; |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
126 } |
a03452edfc4d
made enabling/disabling of intrinsifications extensible (GRAAL-111)
Doug Simon <doug.simon@oracle.com>
parents:
11487
diff
changeset
|
127 |
9615
1089d63ef168
removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents:
9614
diff
changeset
|
128 /** |
1089d63ef168
removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents:
9614
diff
changeset
|
129 * Requests compilation of a given graph. |
14921
88dfaf6448e0
Remove LIRGenerationResult from NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
14888
diff
changeset
|
130 * |
9615
1089d63ef168
removed 'method' parameter from GraalCompiler.compiledMethod() and renamed the latter to 'compileGraph'.
Doug Simon <doug.simon@oracle.com>
parents:
9614
diff
changeset
|
131 * @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
|
132 * @param cc the calling convention for calls to the code compiled for {@code graph} |
15161
2c940b1a48d8
Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15011
diff
changeset
|
133 * @param installedCodeOwner the method the compiled code will be associated with once |
2c940b1a48d8
Convert InstalledCode from an interface into an abstract class.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
15011
diff
changeset
|
134 * installed. This 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
|
135 * @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
|
136 */ |
14142
4eac66a9b87d
Remove reference to graph in LIRGenerator.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14128
diff
changeset
|
137 public static <T extends CompilationResult> T compileGraph(StructuredGraph graph, Object stub, CallingConvention cc, ResolvedJavaMethod installedCodeOwner, Providers providers, Backend backend, |
14172
cd22c8dbda4f
Made graph caching compilation local
Doug Simon <doug.simon@oracle.com>
parents:
14148
diff
changeset
|
138 TargetDescription target, Map<ResolvedJavaMethod, StructuredGraph> cache, PhaseSuite<HighTierContext> graphBuilderSuite, OptimisticOptimizations optimisticOpts, |
cd22c8dbda4f
Made graph caching compilation local
Doug Simon <doug.simon@oracle.com>
parents:
14148
diff
changeset
|
139 ProfilingInfo profilingInfo, SpeculationLog speculationLog, Suites suites, T compilationResult, CompilationResultBuilderFactory factory) { |
13744
d96dbd96bb45
Always copy method substitutions. Add some assertion checking for it.
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
13671
diff
changeset
|
140 assert !graph.isFrozen(); |
14143
8836f566b0bc
Remove withScope parameter on GraalCompiler.compileGraph.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14142
diff
changeset
|
141 try (Scope s0 = Debug.scope("GraalCompiler", graph, providers.getCodeCache())) { |
13228
4568980f7257
removed GraalCompiler.compileGraphNoScope
Doug Simon <doug.simon@oracle.com>
parents:
13227
diff
changeset
|
142 Assumptions assumptions = new Assumptions(OptAssumptions.getValue()); |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
143 SchedulePhase schedule = emitFrontEnd(providers, target, graph, assumptions, cache, graphBuilderSuite, optimisticOpts, profilingInfo, speculationLog, suites); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
144 emitBackEnd(graph, stub, cc, installedCodeOwner, backend, target, compilationResult, factory, assumptions, schedule, null); |
13197
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
145 } catch (Throwable e) { |
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
146 throw Debug.handle(e); |
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
147 } |
12544
c69d0a705553
improved debug scope context when compiling Truffle IR graphs by making a Truffle compilable masquerade as a JavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
12488
diff
changeset
|
148 return compilationResult; |
c69d0a705553
improved debug scope context when compiling Truffle IR graphs by making a Truffle compilable masquerade as a JavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
12488
diff
changeset
|
149 } |
6316
2e25b9c14b84
Temporarily remove experimental register allocators.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5891
diff
changeset
|
150 |
13239 | 151 public static ProfilingInfo getProfilingInfo(StructuredGraph graph) { |
13217
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13197
diff
changeset
|
152 if (graph.method() != null) { |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13197
diff
changeset
|
153 return graph.method().getProfilingInfo(); |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13197
diff
changeset
|
154 } else { |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13197
diff
changeset
|
155 return DefaultProfilingInfo.get(TriState.UNKNOWN); |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13197
diff
changeset
|
156 } |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13197
diff
changeset
|
157 } |
210f58e992a1
Use separate method profile for OSR compilations.
Roland Schatz <roland.schatz@oracle.com>
parents:
13197
diff
changeset
|
158 |
4265
4643ccd37dac
* removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents:
4263
diff
changeset
|
159 /** |
4643ccd37dac
* removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents:
4263
diff
changeset
|
160 * Builds the graph, optimizes it. |
4643ccd37dac
* removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents:
4263
diff
changeset
|
161 */ |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
162 public static SchedulePhase emitFrontEnd(Providers providers, TargetDescription target, StructuredGraph graph, Assumptions assumptions, Map<ResolvedJavaMethod, StructuredGraph> cache, |
14172
cd22c8dbda4f
Made graph caching compilation local
Doug Simon <doug.simon@oracle.com>
parents:
14148
diff
changeset
|
163 PhaseSuite<HighTierContext> graphBuilderSuite, OptimisticOptimizations optimisticOpts, ProfilingInfo profilingInfo, SpeculationLog speculationLog, Suites suites) { |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
164 try (Scope s = Debug.scope("FrontEnd"); TimerCloseable a = FrontEnd.start()) { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
165 if (speculationLog != null) { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
166 speculationLog.collectFailedSpeculations(); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
167 } |
4353
043bec543161
More work on debug framework. Removed concept of GraalContext.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
4352
diff
changeset
|
168 |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
169 HighTierContext highTierContext = new HighTierContext(providers, assumptions, cache, graphBuilderSuite, optimisticOpts); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
170 if (graph.start().next() == null) { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
171 graphBuilderSuite.apply(graph, highTierContext); |
17094
86888df288ec
fixed case of Optionality constants
Doug Simon <doug.simon@oracle.com>
parents:
17065
diff
changeset
|
172 new DeadCodeEliminationPhase(Optional).apply(graph); |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
173 } else { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
174 Debug.dump(graph, "initial state"); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
175 } |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
176 |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
177 suites.getHighTier().apply(graph, highTierContext); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
178 graph.maybeCompress(); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
179 |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
180 MidTierContext midTierContext = new MidTierContext(providers, assumptions, target, optimisticOpts, profilingInfo, speculationLog); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
181 suites.getMidTier().apply(graph, midTierContext); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
182 graph.maybeCompress(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
183 |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
184 LowTierContext lowTierContext = new LowTierContext(providers, assumptions, target); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
185 suites.getLowTier().apply(graph, lowTierContext); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
186 graph.maybeCompress(); |
8600
c423a5fd8ac7
Cull frame states before lowering.
Roland Schatz <roland.schatz@oracle.com>
parents:
8560
diff
changeset
|
187 |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
188 SchedulePhase schedule = new SchedulePhase(); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
189 schedule.apply(graph); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
190 Debug.dump(schedule, "Final HIR schedule"); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
191 return schedule; |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
192 } catch (Throwable e) { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
193 throw Debug.handle(e); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
194 } |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
195 } |
8534
4f33d1871dca
pipeline: canonicalize after ConditionalElimination and EliminatePartiallyRedundantGuards
Bernhard Urban <bernhard.urban@jku.at>
parents:
8506
diff
changeset
|
196 |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
197 public static <T extends CompilationResult> void emitBackEnd(StructuredGraph graph, Object stub, CallingConvention cc, ResolvedJavaMethod installedCodeOwner, Backend backend, |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
198 TargetDescription target, T compilationResult, CompilationResultBuilderFactory factory, Assumptions assumptions, SchedulePhase schedule, RegisterConfig registerConfig) { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
199 try (TimerCloseable a = BackEnd.start()) { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
200 LIRGenerationResult lirGen = null; |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
201 lirGen = emitLIR(backend, target, schedule, graph, stub, cc, registerConfig); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
202 try (Scope s = Debug.scope("CodeGen", lirGen)) { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
203 emitCode(backend, assumptions, lirGen, compilationResult, installedCodeOwner, factory); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
204 } catch (Throwable e) { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
205 throw Debug.handle(e); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
206 } |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
207 } catch (Throwable e) { |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
208 throw Debug.handle(e); |
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
209 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
210 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
211 |
15337
c4be3c1b2d6d
Use NodeLIRBuilderTool instead of NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15333
diff
changeset
|
212 private static void emitBlock(NodeLIRBuilderTool nodeLirGen, LIRGenerationResult lirGenRes, Block b, StructuredGraph graph, BlockMap<List<ScheduledNode>> blockMap) { |
14813
fafbff0eeebf
Removed NodeLIRGenerator again.
Josef Eisl <josef.eisl@jku.at>
parents:
14809
diff
changeset
|
213 if (lirGenRes.getLIR().getLIRforBlock(b) == null) { |
13197
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
214 for (Block pred : b.getPredecessors()) { |
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
215 if (!b.isLoopHeader() || !pred.isLoopEnd()) { |
14841
47e4d2e01c6e
Split LIRGenerator and fix AMD64 backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
216 emitBlock(nodeLirGen, lirGenRes, pred, graph, blockMap); |
13197
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
217 } |
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
218 } |
14841
47e4d2e01c6e
Split LIRGenerator and fix AMD64 backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
219 nodeLirGen.doBlock(b, graph, blockMap); |
13197
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
220 } |
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
221 } |
6316
2e25b9c14b84
Temporarily remove experimental register allocators.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5891
diff
changeset
|
222 |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14921
diff
changeset
|
223 public static LIRGenerationResult emitLIR(Backend backend, TargetDescription target, SchedulePhase schedule, StructuredGraph graph, Object stub, CallingConvention cc, RegisterConfig registerConfig) { |
15537
8117e9cadb48
Use List instead of an array in AbstractControlFlowGraph.
Josef Eisl <josef.eisl@jku.at>
parents:
15470
diff
changeset
|
224 List<Block> blocks = schedule.getCFG().getBlocks(); |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
225 Block startBlock = schedule.getCFG().getStartBlock(); |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
226 assert startBlock != null; |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
227 assert startBlock.getPredecessorCount() == 0; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
228 |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
229 LIR lir = null; |
14786
a6595f1b55b0
Make LIR use AbstractBlock. (errors)
Josef Eisl <josef.eisl@jku.at>
parents:
14148
diff
changeset
|
230 List<Block> codeEmittingOrder = null; |
a6595f1b55b0
Make LIR use AbstractBlock. (errors)
Josef Eisl <josef.eisl@jku.at>
parents:
14148
diff
changeset
|
231 List<Block> linearScanOrder = null; |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
232 try (Scope ds = Debug.scope("MidEnd")) { |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
233 try (Scope s = Debug.scope("ComputeLinearScanOrder")) { |
15537
8117e9cadb48
Use List instead of an array in AbstractControlFlowGraph.
Josef Eisl <josef.eisl@jku.at>
parents:
15470
diff
changeset
|
234 codeEmittingOrder = ComputeBlockOrder.computeCodeEmittingOrder(blocks.size(), startBlock); |
8117e9cadb48
Use List instead of an array in AbstractControlFlowGraph.
Josef Eisl <josef.eisl@jku.at>
parents:
15470
diff
changeset
|
235 linearScanOrder = ComputeBlockOrder.computeLinearScanOrder(blocks.size(), startBlock); |
7370
39a4192ae632
Experiment with new block order for LSRA.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
7348
diff
changeset
|
236 |
14144
8bdebcc53d15
Remove nodesForBlock mapping in LIR data structure.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
14143
diff
changeset
|
237 lir = new LIR(schedule.getCFG(), linearScanOrder, codeEmittingOrder); |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
238 Debug.dump(lir, "After linear scan order"); |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
239 } catch (Throwable e) { |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
240 throw Debug.handle(e); |
4265
4643ccd37dac
* removed CiStatistics
Lukas Stadler <lukas.stadler@jku.at>
parents:
4263
diff
changeset
|
241 } |
13197
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
242 } catch (Throwable e) { |
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
243 throw Debug.handle(e); |
8569b9e047cd
change debug scopes implementation to prevent extra frames related to mechanism being added to call stack
Doug Simon <doug.simon@oracle.com>
parents:
12687
diff
changeset
|
244 } |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
245 try (Scope ds = Debug.scope("BackEnd", lir)) { |
18154
448be95baef8
Add Backend.newFrameMapBuilder().
Josef Eisl <josef.eisl@jku.at>
parents:
18153
diff
changeset
|
246 FrameMapBuilder frameMapBuilder = backend.newFrameMapBuilder(registerConfig); |
18151
04b54406c292
Use FrameMapBuilder in Backend.newLIRGenerationResult().
Josef Eisl <josef.eisl@jku.at>
parents:
18149
diff
changeset
|
247 LIRGenerationResult lirGenRes = backend.newLIRGenerationResult(lir, frameMapBuilder, graph.method(), stub); |
15333
06ecedffb109
Use LIRGeneratorTool in Backend.
Josef Eisl <josef.eisl@jku.at>
parents:
15292
diff
changeset
|
248 LIRGeneratorTool lirGen = backend.newLIRGenerator(cc, lirGenRes); |
15338
5e544920ad9f
Rename Backend.newNodeLIRGenerator to Backend.newNodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15337
diff
changeset
|
249 NodeLIRBuilderTool nodeLirGen = backend.newNodeLIRBuilder(graph, lirGen); |
13842
a02441dcf05f
Do control flow optimizations independent of register allocation.
Roland Schatz <roland.schatz@oracle.com>
parents:
13744
diff
changeset
|
250 |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
251 try (Scope s = Debug.scope("LIRGen", lirGen)) { |
14813
fafbff0eeebf
Removed NodeLIRGenerator again.
Josef Eisl <josef.eisl@jku.at>
parents:
14809
diff
changeset
|
252 for (Block b : linearScanOrder) { |
14841
47e4d2e01c6e
Split LIRGenerator and fix AMD64 backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
253 emitBlock(nodeLirGen, lirGenRes, b, graph, schedule.getBlockToNodesMap()); |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
254 } |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
255 lirGen.beforeRegisterAllocation(); |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
256 |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
257 Debug.dump(lir, "After LIR generation"); |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
258 } catch (Throwable e) { |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
259 throw Debug.handle(e); |
13937
814800074308
Allow disabling of redundant move elimination
Christian Wimmer <christian.wimmer@oracle.com>
parents:
13842
diff
changeset
|
260 } |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
261 |
16952
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
262 if (ConstantLoadOptimization.Options.ConstantLoadOptimization.getValue()) { |
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
263 try (Scope s = Debug.scope("ConstantLoadOptimization", lir)) { |
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
264 ConstantLoadOptimization.optimize(lirGenRes.getLIR(), lirGen); |
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
265 Debug.dump(lir, "After constant load optimization"); |
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
266 } catch (Throwable e) { |
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
267 throw Debug.handle(e); |
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
268 } |
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
269 } |
2451521ed26f
Add ConstantLoadOptimization.
Josef Eisl <josef.eisl@jku.at>
parents:
15838
diff
changeset
|
270 |
14841
47e4d2e01c6e
Split LIRGenerator and fix AMD64 backend.
Josef Eisl <josef.eisl@jku.at>
parents:
14826
diff
changeset
|
271 try (Scope s = Debug.scope("Allocator", nodeLirGen)) { |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
272 if (backend.shouldAllocateRegisters()) { |
18152
ff694c40bdee
LIRGenerationResult: add buildFrameMap() and getFrameMap().
Josef Eisl <josef.eisl@jku.at>
parents:
18151
diff
changeset
|
273 LinearScan.allocate(target, lirGenRes); |
18157
95f8dd398214
Call LIRGenerationResult.buildFrameMap() for targets that do not need register allocation.
Josef Eisl <josef.eisl@jku.at>
parents:
18154
diff
changeset
|
274 } else { |
95f8dd398214
Call LIRGenerationResult.buildFrameMap() for targets that do not need register allocation.
Josef Eisl <josef.eisl@jku.at>
parents:
18154
diff
changeset
|
275 // build frame map for targets that do not allocate registers |
95f8dd398214
Call LIRGenerationResult.buildFrameMap() for targets that do not need register allocation.
Josef Eisl <josef.eisl@jku.at>
parents:
18154
diff
changeset
|
276 lirGenRes.buildFrameMap(); |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
277 } |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
278 } catch (Throwable e) { |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
279 throw Debug.handle(e); |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
280 } |
13842
a02441dcf05f
Do control flow optimizations independent of register allocation.
Roland Schatz <roland.schatz@oracle.com>
parents:
13744
diff
changeset
|
281 |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
282 try (Scope s = Debug.scope("ControlFlowOptimizations")) { |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
283 EdgeMoveOptimizer.optimize(lir); |
14787
6ce74db1c9fb
Use List<T> instead of Iterable<T> in AbstractBlock to (temporary) allow editing.
Josef Eisl <josef.eisl@jku.at>
parents:
14786
diff
changeset
|
284 ControlFlowOptimizer.optimize(lir, codeEmittingOrder); |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
285 if (lirGen.canEliminateRedundantMoves()) { |
18151
04b54406c292
Use FrameMapBuilder in Backend.newLIRGenerationResult().
Josef Eisl <josef.eisl@jku.at>
parents:
18149
diff
changeset
|
286 RedundantMoveElimination.optimize(lir, frameMapBuilder); |
14128
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
287 } |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
288 NullCheckOptimizer.optimize(lir, target.implicitNullCheckLimit); |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
289 |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
290 Debug.dump(lir, "After control flow optimization"); |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
291 } catch (Throwable e) { |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
292 throw Debug.handle(e); |
d2030fa96c22
Compute LinearScanOrder in emitLIR.
Josef Eisl <josef.eisl@jku.at>
parents:
14070
diff
changeset
|
293 } |
14813
fafbff0eeebf
Removed NodeLIRGenerator again.
Josef Eisl <josef.eisl@jku.at>
parents:
14809
diff
changeset
|
294 return lirGenRes; |
13842
a02441dcf05f
Do control flow optimizations independent of register allocation.
Roland Schatz <roland.schatz@oracle.com>
parents:
13744
diff
changeset
|
295 } catch (Throwable e) { |
a02441dcf05f
Do control flow optimizations independent of register allocation.
Roland Schatz <roland.schatz@oracle.com>
parents:
13744
diff
changeset
|
296 throw Debug.handle(e); |
a02441dcf05f
Do control flow optimizations independent of register allocation.
Roland Schatz <roland.schatz@oracle.com>
parents:
13744
diff
changeset
|
297 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
298 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
299 |
14809
73774616a6b3
Decoupled LIRGenerator and LIRGenerationResult.
Josef Eisl <josef.eisl@jku.at>
parents:
14806
diff
changeset
|
300 public static void emitCode(Backend backend, Assumptions assumptions, LIRGenerationResult lirGenRes, CompilationResult compilationResult, ResolvedJavaMethod installedCodeOwner, |
13229
325b4e4efb60
added CompilationResultBuilderFactory to support peep-hole instrumentation of methods as their code is emitted
Doug Simon <doug.simon@oracle.com>
parents:
13228
diff
changeset
|
301 CompilationResultBuilderFactory factory) { |
18152
ff694c40bdee
LIRGenerationResult: add buildFrameMap() and getFrameMap().
Josef Eisl <josef.eisl@jku.at>
parents:
18151
diff
changeset
|
302 FrameMap frameMap = lirGenRes.getFrameMap(); |
18148
aed00dc20923
Pass FrameMap to Backend.newCompilationResultBuilder().
Josef Eisl <josef.eisl@jku.at>
parents:
17126
diff
changeset
|
303 CompilationResultBuilder crb = backend.newCompilationResultBuilder(lirGenRes, frameMap, compilationResult, factory); |
14809
73774616a6b3
Decoupled LIRGenerator and LIRGenerationResult.
Josef Eisl <josef.eisl@jku.at>
parents:
14806
diff
changeset
|
304 backend.emitCode(crb, lirGenRes.getLIR(), installedCodeOwner); |
13227
1a66453f73db
renamed TargetMethodAssembler to CompilationResultBuilder
Doug Simon <doug.simon@oracle.com>
parents:
13226
diff
changeset
|
305 crb.finish(); |
7064
8d16b9b2c51e
first part of refactoring the InliningPhase
Christian Haeubl <haeubl@ssw.jku.at>
parents:
7063
diff
changeset
|
306 if (!assumptions.isEmpty()) { |
13224
7086a2fe7370
renamed TargetMethodAssembler.finishTargetMethod to finalize and made its return type void
Doug Simon <doug.simon@oracle.com>
parents:
13197
diff
changeset
|
307 compilationResult.setAssumptions(assumptions); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
308 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
309 |
13226
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
310 if (Debug.isMeterEnabled()) { |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
18157
diff
changeset
|
311 List<DataPatch> ldp = compilationResult.getDataPatches(); |
14616
aa7bcf1fa423
expanded Debug API to avoid any allocation for timer and metric creation if debugging is disabled
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
312 Kind[] kindValues = Kind.values(); |
aa7bcf1fa423
expanded Debug API to avoid any allocation for timer and metric creation if debugging is disabled
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
313 DebugMetric[] dms = new DebugMetric[kindValues.length]; |
13226
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
314 for (int i = 0; i < dms.length; i++) { |
14616
aa7bcf1fa423
expanded Debug API to avoid any allocation for timer and metric creation if debugging is disabled
Doug Simon <doug.simon@oracle.com>
parents:
14595
diff
changeset
|
315 dms[i] = Debug.metric("DataPatches-%s", kindValues[i]); |
13226
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
316 } |
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
317 |
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
318 for (DataPatch dp : ldp) { |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
18157
diff
changeset
|
319 Kind kind = Kind.Illegal; |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
18157
diff
changeset
|
320 if (dp.reference instanceof ConstantReference) { |
18186
ef357effbda7
Backout of changeset 9a804ec7f707 (converted Constant and Value to be interfaces).
Roland Schatz <roland.schatz@oracle.com>
parents:
18176
diff
changeset
|
321 VMConstant constant = ((ConstantReference) dp.reference).getConstant(); |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18186
diff
changeset
|
322 kind = ((JavaConstant) constant).getKind(); |
18176
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
18157
diff
changeset
|
323 } |
c2270ad35f57
Better construction of data section and data patches.
Roland Schatz <roland.schatz@oracle.com>
parents:
18157
diff
changeset
|
324 dms[kind.ordinal()].add(1); |
13226
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
325 } |
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
326 |
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
327 Debug.metric("CompilationResults").increment(); |
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
328 Debug.metric("CodeBytesEmitted").add(compilationResult.getTargetCodeSize()); |
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
329 Debug.metric("InfopointsEmitted").add(compilationResult.getInfopoints().size()); |
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
330 Debug.metric("DataPatches").add(ldp.size()); |
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
331 Debug.metric("ExceptionHandlersEmitted").add(compilationResult.getExceptionHandlers().size()); |
0b4d38339708
moved CompilationResult metric updating out from TargetMethodAssembler.finish()
Doug Simon <doug.simon@oracle.com>
parents:
13225
diff
changeset
|
332 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
333 |
12472
85d03b72f269
added support disassembling during CodeGen
Doug Simon <doug.simon@oracle.com>
parents:
12362
diff
changeset
|
334 if (Debug.isLogEnabled()) { |
13224
7086a2fe7370
renamed TargetMethodAssembler.finishTargetMethod to finalize and made its return type void
Doug Simon <doug.simon@oracle.com>
parents:
13197
diff
changeset
|
335 Debug.log("%s", backend.getProviders().getCodeCache().disassemble(compilationResult, null)); |
12472
85d03b72f269
added support disassembling during CodeGen
Doug Simon <doug.simon@oracle.com>
parents:
12362
diff
changeset
|
336 } |
85d03b72f269
added support disassembling during CodeGen
Doug Simon <doug.simon@oracle.com>
parents:
12362
diff
changeset
|
337 |
13224
7086a2fe7370
renamed TargetMethodAssembler.finishTargetMethod to finalize and made its return type void
Doug Simon <doug.simon@oracle.com>
parents:
13197
diff
changeset
|
338 Debug.dump(compilationResult, "After code generation"); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
339 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
340 } |