Mercurial > hg > truffle
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotSuitesProvider.java @ 21526:1da7aef31a08
created com.oracle.graal.hotspot.jvmci package and moved classes destined for future JVMCI module into it (JBS:GRAAL-53)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Tue, 19 May 2015 23:16:07 +0200 |
parents | 0457430979a5 |
children | 93c50cefb9e8 |
rev | line source |
---|---|
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
19778
09dfba3dbfb2
refactored HotSpot graph builder plugins into top level classes
Doug Simon <doug.simon@oracle.com>
parents:
19776
diff
changeset
|
2 * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 package com.oracle.graal.hotspot.meta; |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 |
15259
d90e5c22ba55
Move GraalOptions to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents:
14991
diff
changeset
|
25 import static com.oracle.graal.compiler.common.GraalOptions.*; |
14991
64dcb92ee75a
Truffle: Change signature for Truffle calls from (PackedFrame, Arguments) to (Object[]).
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
13640
diff
changeset
|
26 |
19883
4d33cd6e0c8f
refactored GraphBuilderConfiguration (and its component classes) into a separate project
Doug Simon <doug.simon@oracle.com>
parents:
19882
diff
changeset
|
27 import com.oracle.graal.graphbuilderconf.*; |
4d33cd6e0c8f
refactored GraphBuilderConfiguration (and its component classes) into a separate project
Doug Simon <doug.simon@oracle.com>
parents:
19882
diff
changeset
|
28 import com.oracle.graal.graphbuilderconf.GraphBuilderConfiguration.*; |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 import com.oracle.graal.hotspot.*; |
21526
1da7aef31a08
created com.oracle.graal.hotspot.jvmci package and moved classes destined for future JVMCI module into it (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21287
diff
changeset
|
30 import com.oracle.graal.hotspot.jvmci.*; |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 import com.oracle.graal.hotspot.phases.*; |
13585 | 32 import com.oracle.graal.java.*; |
19231
df89224ee04a
Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents:
19132
diff
changeset
|
33 import com.oracle.graal.lir.phases.*; |
21083
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
34 import com.oracle.graal.nodes.*; |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
35 import com.oracle.graal.nodes.StructuredGraph.*; |
16871
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15909
diff
changeset
|
36 import com.oracle.graal.options.*; |
19196
75cf0899be47
Use serializable interface in DerivedOptionValue.
Roland Schatz <roland.schatz@oracle.com>
parents:
19132
diff
changeset
|
37 import com.oracle.graal.options.DerivedOptionValue.OptionSupplier; |
13585 | 38 import com.oracle.graal.phases.*; |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
39 import com.oracle.graal.phases.tiers.*; |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
40 |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 /** |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
42 * HotSpot implementation of {@link SuitesProvider}. |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
43 */ |
19237
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
44 public class HotSpotSuitesProvider implements SuitesProvider { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
45 |
16871
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15909
diff
changeset
|
46 protected final DerivedOptionValue<Suites> defaultSuites; |
13585 | 47 protected final PhaseSuite<HighTierContext> defaultGraphBuilderSuite; |
19270
292442bed972
Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents:
19237
diff
changeset
|
48 private final DerivedOptionValue<LIRSuites> defaultLIRSuites; |
18525
c538c2c6b7e2
changed most references to HotSpotGraalRuntime to use HotSpotGraalRuntimeProvider instead
Doug Simon <doug.simon@oracle.com>
parents:
18126
diff
changeset
|
49 protected final HotSpotGraalRuntimeProvider runtime; |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
50 |
19237
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
51 private class SuitesSupplier implements OptionSupplier<Suites> { |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
52 |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
53 private static final long serialVersionUID = -3444304453553320390L; |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
54 |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
55 public Suites get() { |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
56 return createSuites(); |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
57 } |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
58 |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
59 } |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
60 |
19270
292442bed972
Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents:
19237
diff
changeset
|
61 private class LIRSuitesSupplier implements OptionSupplier<LIRSuites> { |
19237
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
62 |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
63 private static final long serialVersionUID = -1558586374095874299L; |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
64 |
19270
292442bed972
Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents:
19237
diff
changeset
|
65 public LIRSuites get() { |
292442bed972
Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents:
19237
diff
changeset
|
66 return createLIRSuites(); |
19237
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
67 } |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
68 |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
69 } |
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
70 |
19882
0c29075aeafe
graph builder plugins are created before GraphBuilderConfigurations and the process for deriving plugins from an existing configuration is simplified
Doug Simon <doug.simon@oracle.com>
parents:
19791
diff
changeset
|
71 public HotSpotSuitesProvider(HotSpotGraalRuntimeProvider runtime, Plugins plugins) { |
12431
7080a96be216
rename: graalRuntime -> runtime, getGraalRuntime -> getRuntime
Doug Simon <doug.simon@oracle.com>
parents:
12429
diff
changeset
|
72 this.runtime = runtime; |
19882
0c29075aeafe
graph builder plugins are created before GraphBuilderConfigurations and the process for deriving plugins from an existing configuration is simplified
Doug Simon <doug.simon@oracle.com>
parents:
19791
diff
changeset
|
73 this.defaultGraphBuilderSuite = createGraphBuilderSuite(plugins); |
19237
9c921eb127ba
SuitesProvider: use inner supplier classes.
Josef Eisl <josef.eisl@jku.at>
parents:
19235
diff
changeset
|
74 this.defaultSuites = new DerivedOptionValue<>(new SuitesSupplier()); |
19270
292442bed972
Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents:
19237
diff
changeset
|
75 this.defaultLIRSuites = new DerivedOptionValue<>(new LIRSuitesSupplier()); |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
76 } |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
77 |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
78 public Suites getDefaultSuites() { |
16871
e728b9d4905c
Recompute phase suites when options are changed.
Roland Schatz <roland.schatz@oracle.com>
parents:
15909
diff
changeset
|
79 return defaultSuites.getValue(); |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
80 } |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
81 |
13585 | 82 public PhaseSuite<HighTierContext> getDefaultGraphBuilderSuite() { |
83 return defaultGraphBuilderSuite; | |
84 } | |
85 | |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
86 public Suites createSuites() { |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
87 Suites ret = Suites.createDefaultSuites(); |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
88 |
13378
16d99e9d77ad
Options: rename flag (AOTCompilation -> ImmutableCode)
Bernhard Urban <bernhard.urban@jku.at>
parents:
12431
diff
changeset
|
89 if (ImmutableCode.getValue()) { |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
90 // lowering introduces class constants, therefore it must be after lowering |
20995
59e8737c06fd
Fix bug in LoadJavaMirrorWithKlassPhase.
Roland Schatz <roland.schatz@oracle.com>
parents:
20003
diff
changeset
|
91 ret.getHighTier().appendPhase(new LoadJavaMirrorWithKlassPhase(runtime.getConfig().classMirrorOffset, runtime.getConfig().useCompressedOops ? runtime.getConfig().getOopEncoding() : null)); |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
92 if (VerifyPhases.getValue()) { |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
93 ret.getHighTier().appendPhase(new AheadOfTimeVerificationPhase()); |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
94 } |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
95 } |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
96 |
18531
cdb9c605051a
removed some static accesses to HotSpotGraalRuntime from some tests
Doug Simon <doug.simon@oracle.com>
parents:
18525
diff
changeset
|
97 ret.getMidTier().appendPhase(new WriteBarrierAdditionPhase(runtime.getConfig())); |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
98 if (VerifyPhases.getValue()) { |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
99 ret.getMidTier().appendPhase(new WriteBarrierVerificationPhase()); |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
100 } |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
101 |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
102 return ret; |
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
103 } |
13585 | 104 |
19882
0c29075aeafe
graph builder plugins are created before GraphBuilderConfigurations and the process for deriving plugins from an existing configuration is simplified
Doug Simon <doug.simon@oracle.com>
parents:
19791
diff
changeset
|
105 protected PhaseSuite<HighTierContext> createGraphBuilderSuite(Plugins plugins) { |
13585 | 106 PhaseSuite<HighTierContext> suite = new PhaseSuite<>(); |
19882
0c29075aeafe
graph builder plugins are created before GraphBuilderConfigurations and the process for deriving plugins from an existing configuration is simplified
Doug Simon <doug.simon@oracle.com>
parents:
19791
diff
changeset
|
107 GraphBuilderConfiguration config = GraphBuilderConfiguration.getDefault(plugins); |
17113
583bf03b3e1a
apply CompilerToVM.shouldDebugNonSafepoints() to HotSpot Truffle compilations as well
Doug Simon <doug.simon@oracle.com>
parents:
16871
diff
changeset
|
108 suite.appendPhase(new GraphBuilderPhase(config)); |
21083
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
109 assert appendGraphEncoderTest(suite); |
13585 | 110 return suite; |
111 } | |
17153
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
112 |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
113 /** |
21083
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
114 * When assertions are enabled, we encode and decode every parsed graph, to ensure that the |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
115 * encoding and decoding process work correctly. The decoding performs canonicalization during |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
116 * decoding, so the decoded graph can be different than the encoded graph - we cannot check them |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
117 * for equality here. However, the encoder {@link GraphEncoder#verifyEncoding verifies the |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
118 * encoding itself}, i.e., performs a decoding without canoncialization and checks the graphs |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
119 * for equality. |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
120 */ |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
121 private boolean appendGraphEncoderTest(PhaseSuite<HighTierContext> suite) { |
21287
0457430979a5
explicitly name the phase that verifies graph encoding and decoding
Doug Simon <doug.simon@oracle.com>
parents:
21083
diff
changeset
|
122 suite.appendPhase(new BasePhase<HighTierContext>("VerifyEncodingDecoding") { |
21083
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
123 @Override |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
124 protected void run(StructuredGraph graph, HighTierContext context) { |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
125 EncodedGraph encodedGraph = GraphEncoder.encodeSingleGraph(graph, runtime.getTarget().arch); |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
126 |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
127 SimplifyingGraphDecoder graphDecoder = new SimplifyingGraphDecoder(context.getMetaAccess(), context.getConstantReflection(), context.getStampProvider(), !ImmutableCode.getValue(), |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
128 runtime.getTarget().arch); |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
129 StructuredGraph targetGraph = new StructuredGraph(graph.method(), AllowAssumptions.YES); |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
130 graphDecoder.decode(targetGraph, encodedGraph); |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
131 } |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
132 }); |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
133 return true; |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
134 } |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
135 |
71af9afd7ff6
Test the GraphDecoder by encoding and decoding every graph after parsing; fix bugs found by that testing
Christian Wimmer <christian.wimmer@oracle.com>
parents:
20995
diff
changeset
|
136 /** |
17153
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
137 * Modifies the {@link GraphBuilderConfiguration} to build extra |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
138 * {@linkplain DebugInfoMode#Simple debug info} if the VM |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
139 * {@linkplain CompilerToVM#shouldDebugNonSafepoints() requests} it. |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
140 * |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
141 * @param gbs the current graph builder suite |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
142 * @return a possibly modified graph builder suite |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
143 */ |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
144 public static PhaseSuite<HighTierContext> withSimpleDebugInfoIfRequested(PhaseSuite<HighTierContext> gbs) { |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
145 if (HotSpotGraalRuntime.runtime().getCompilerToVM().shouldDebugNonSafepoints()) { |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
146 PhaseSuite<HighTierContext> newGbs = gbs.copy(); |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
147 GraphBuilderPhase graphBuilderPhase = (GraphBuilderPhase) newGbs.findPhase(GraphBuilderPhase.class).previous(); |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
148 GraphBuilderConfiguration graphBuilderConfig = graphBuilderPhase.getGraphBuilderConfig(); |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
149 GraphBuilderPhase newGraphBuilderPhase = new GraphBuilderPhase(graphBuilderConfig.withDebugInfoMode(DebugInfoMode.Simple)); |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
150 newGbs.findPhase(GraphBuilderPhase.class).set(newGraphBuilderPhase); |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
151 return newGbs; |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
152 } |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
153 return gbs; |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
154 } |
646ddd52d79a
only generate extra debug info if on HotSpot *and* compiling for HotSpot execution
Doug Simon <doug.simon@oracle.com>
parents:
17113
diff
changeset
|
155 |
19270
292442bed972
Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents:
19237
diff
changeset
|
156 public LIRSuites getDefaultLIRSuites() { |
292442bed972
Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents:
19237
diff
changeset
|
157 return defaultLIRSuites.getValue(); |
19231
df89224ee04a
Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents:
19132
diff
changeset
|
158 } |
df89224ee04a
Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents:
19132
diff
changeset
|
159 |
19270
292442bed972
Rename LowLevelSuites to LIRSuites.
Josef Eisl <josef.eisl@jku.at>
parents:
19237
diff
changeset
|
160 public LIRSuites createLIRSuites() { |
20003
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19883
diff
changeset
|
161 LIRSuites suites = Suites.createDefaultLIRSuites(); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19883
diff
changeset
|
162 String profileInstructions = HotSpotBackend.Options.ASMInstructionProfiling.getValue(); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19883
diff
changeset
|
163 if (profileInstructions != null) { |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19883
diff
changeset
|
164 suites.getPostAllocationOptimizationStage().appendPhase(new HotSpotInstructionProfiling(profileInstructions)); |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19883
diff
changeset
|
165 } |
422e60a2f4b9
Implement dynamic instruction counters on assembly level
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
19883
diff
changeset
|
166 return suites; |
19231
df89224ee04a
Add LowLevelSuites to SuitesProvider.
Josef Eisl <josef.eisl@jku.at>
parents:
19132
diff
changeset
|
167 } |
12429
5124eeec1a7b
split HotSpotRuntime into separate provider implementations
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
168 } |