Mercurial > hg > truffle
annotate graal/com.oracle.graal.lir/src/com/oracle/graal/lir/gen/LIRGenerator.java @ 16092:51ba6c521922
Refactor LIRGeneratorTool methods.
author | Roland Schatz <roland.schatz@oracle.com> |
---|---|
date | Fri, 13 Jun 2014 11:08:16 +0200 |
parents | b38191cd1665 |
children | c0b8d395368b |
rev | line source |
---|---|
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
1 /* |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2009, 2012, Oracle and/or its affiliates. All rights reserved. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
4 * |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
8 * |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
14 * |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
18 * |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
21 * questions. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
22 */ |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
23 package com.oracle.graal.lir.gen; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
24 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
25 import static com.oracle.graal.api.code.ValueUtil.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
26 import static com.oracle.graal.api.meta.Value.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
27 import static com.oracle.graal.lir.LIRValueUtil.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
28 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
29 import java.util.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
30 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
31 import com.oracle.graal.api.code.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
32 import com.oracle.graal.api.meta.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
33 import com.oracle.graal.asm.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
34 import com.oracle.graal.compiler.common.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
35 import com.oracle.graal.compiler.common.calc.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
36 import com.oracle.graal.compiler.common.cfg.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
37 import com.oracle.graal.compiler.common.spi.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
38 import com.oracle.graal.compiler.common.type.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
39 import com.oracle.graal.debug.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
40 import com.oracle.graal.lir.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
41 import com.oracle.graal.lir.StandardOp.BlockEndOp; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
42 import com.oracle.graal.lir.StandardOp.LabelOp; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
43 import com.oracle.graal.options.*; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
44 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
45 /** |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
46 * This class traverses the HIR instructions and generates LIR instructions from them. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
47 */ |
15331
71cdf5518dab
Use LIRGeneratorTool in NodeLIRBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15330
diff
changeset
|
48 public abstract class LIRGenerator implements LIRGeneratorTool, PlatformKindTool { |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
49 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
50 public static class Options { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
51 // @formatter:off |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
52 @Option(help = "Print HIR along side LIR as the latter is generated") |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
53 public static final OptionValue<Boolean> PrintIRWithLIR = new OptionValue<>(false); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
54 @Option(help = "The trace level for the LIR generator") |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
55 public static final OptionValue<Integer> TraceLIRGeneratorLevel = new OptionValue<>(0); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
56 // @formatter:on |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
57 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
58 |
15304
e189f0fbe0c9
Rename LIRProviders to CodeGenProviders.
Josef Eisl <josef.eisl@jku.at>
parents:
15301
diff
changeset
|
59 private final CodeGenProviders providers; |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
60 private final CallingConvention cc; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
61 |
15330
cc0dde80d6df
Remove traceLevel and printIRWithLIR members from LIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15308
diff
changeset
|
62 private AbstractBlock<?> currentBlock; |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
63 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
64 private LIRGenerationResult res; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
65 |
15304
e189f0fbe0c9
Rename LIRProviders to CodeGenProviders.
Josef Eisl <josef.eisl@jku.at>
parents:
15301
diff
changeset
|
66 public LIRGenerator(CodeGenProviders providers, CallingConvention cc, LIRGenerationResult res) { |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
67 this.res = res; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
68 this.providers = providers; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
69 this.cc = cc; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
70 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
71 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
72 /** |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
73 * Returns true if the redundant move elimination optimization should be done after register |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
74 * allocation. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
75 */ |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
76 public boolean canEliminateRedundantMoves() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
77 return true; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
78 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
79 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
80 @Override |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
81 public TargetDescription target() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
82 return getCodeCache().getTarget(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
83 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
84 |
15304
e189f0fbe0c9
Rename LIRProviders to CodeGenProviders.
Josef Eisl <josef.eisl@jku.at>
parents:
15301
diff
changeset
|
85 public CodeGenProviders getProviders() { |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
86 return providers; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
87 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
88 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
89 @Override |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
90 public MetaAccessProvider getMetaAccess() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
91 return providers.getMetaAccess(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
92 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
93 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
94 @Override |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
95 public CodeCacheProvider getCodeCache() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
96 return providers.getCodeCache(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
97 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
98 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
99 @Override |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
100 public ForeignCallsProvider getForeignCalls() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
101 return providers.getForeignCalls(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
102 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
103 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
104 /** |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
105 * Creates a new {@linkplain Variable variable}. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
106 * |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
107 * @param platformKind The kind of the new variable. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
108 * @return a new variable |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
109 */ |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
110 @Override |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
111 public Variable newVariable(PlatformKind platformKind) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
112 return new Variable(platformKind, res.getLIR().nextVariable()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
113 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
114 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
115 @Override |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
116 public RegisterAttributes attributes(Register register) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
117 return res.getFrameMap().registerConfig.getAttributesMap()[register.number]; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
118 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
119 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
120 @Override |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
121 public abstract Variable emitMove(Value input); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
122 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
123 public AllocatableValue asAllocatable(Value value) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
124 if (isAllocatableValue(value)) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
125 return asAllocatableValue(value); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
126 } else { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
127 return emitMove(value); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
128 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
129 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
130 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
131 public Variable load(Value value) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
132 if (!isVariable(value)) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
133 return emitMove(value); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
134 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
135 return (Variable) value; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
136 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
137 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
138 public Value loadNonConst(Value value) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
139 if (isConstant(value) && !canInlineConstant((Constant) value)) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
140 return emitMove(value); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
141 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
142 return value; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
143 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
144 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
145 /** |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
146 * Determines if only oop maps are required for the code generated from the LIR. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
147 */ |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
148 public boolean needOnlyOopMaps() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
149 return false; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
150 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
151 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
152 /** |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
153 * Gets the ABI specific operand used to return a value of a given kind from a method. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
154 * |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
155 * @param kind the kind of value being returned |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
156 * @return the operand representing the ABI defined location used return a value of kind |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
157 * {@code kind} |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
158 */ |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
159 public AllocatableValue resultOperandFor(Kind kind) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
160 if (kind == Kind.Void) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
161 return ILLEGAL; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
162 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
163 return res.getFrameMap().registerConfig.getReturnRegister(kind).asValue(kind); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
164 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
165 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
166 public void append(LIRInstruction op) { |
15330
cc0dde80d6df
Remove traceLevel and printIRWithLIR members from LIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15308
diff
changeset
|
167 if (Options.PrintIRWithLIR.getValue() && !TTY.isSuppressed()) { |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
168 TTY.println(op.toStringWithIdPrefix()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
169 TTY.println(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
170 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
171 assert LIRVerifier.verify(op); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
172 res.getLIR().getLIRforBlock(currentBlock).add(op); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
173 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
174 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
175 public boolean hasBlockEnd(AbstractBlock<?> block) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
176 List<LIRInstruction> ops = getResult().getLIR().getLIRforBlock(block); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
177 if (ops.size() == 0) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
178 return false; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
179 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
180 return ops.get(ops.size() - 1) instanceof BlockEndOp; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
181 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
182 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
183 public final void doBlockStart(AbstractBlock<?> block) { |
15330
cc0dde80d6df
Remove traceLevel and printIRWithLIR members from LIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15308
diff
changeset
|
184 if (Options.PrintIRWithLIR.getValue()) { |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
185 TTY.print(block.toString()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
186 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
187 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
188 currentBlock = block; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
189 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
190 // set up the list of LIR instructions |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
191 assert res.getLIR().getLIRforBlock(block) == null : "LIR list already computed for this block"; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
192 res.getLIR().setLIRforBlock(block, new ArrayList<LIRInstruction>()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
193 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
194 append(new LabelOp(new Label(block.getId()), block.isAligned())); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
195 |
15330
cc0dde80d6df
Remove traceLevel and printIRWithLIR members from LIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15308
diff
changeset
|
196 if (Options.TraceLIRGeneratorLevel.getValue() >= 1) { |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
197 TTY.println("BEGIN Generating LIR for block B" + block.getId()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
198 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
199 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
200 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
201 public final void doBlockEnd(AbstractBlock<?> block) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
202 |
15330
cc0dde80d6df
Remove traceLevel and printIRWithLIR members from LIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15308
diff
changeset
|
203 if (Options.TraceLIRGeneratorLevel.getValue() >= 1) { |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
204 TTY.println("END Generating LIR for block B" + block.getId()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
205 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
206 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
207 currentBlock = null; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
208 |
15330
cc0dde80d6df
Remove traceLevel and printIRWithLIR members from LIRGenerator.
Josef Eisl <josef.eisl@jku.at>
parents:
15308
diff
changeset
|
209 if (Options.PrintIRWithLIR.getValue()) { |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
210 TTY.println(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
211 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
212 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
213 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
214 public void emitIncomingValues(Value[] params) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
215 ((LabelOp) res.getLIR().getLIRforBlock(currentBlock).get(0)).setIncomingValues(params); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
216 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
217 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
218 public abstract void emitJump(LabelRef label); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
219 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
220 public abstract void emitCompareBranch(PlatformKind cmpKind, Value left, Value right, Condition cond, boolean unorderedIsTrue, LabelRef trueDestination, LabelRef falseDestination, |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
221 double trueDestinationProbability); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
222 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
223 public abstract void emitOverflowCheckBranch(LabelRef overflow, LabelRef noOverflow, double overflowProbability); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
224 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
225 public abstract void emitIntegerTestBranch(Value left, Value right, LabelRef trueDestination, LabelRef falseDestination, double trueSuccessorProbability); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
226 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
227 public abstract Variable emitConditionalMove(PlatformKind cmpKind, Value leftVal, Value right, Condition cond, boolean unorderedIsTrue, Value trueValue, Value falseValue); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
228 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
229 public abstract Variable emitIntegerTestMove(Value leftVal, Value right, Value trueValue, Value falseValue); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
230 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
231 protected abstract void emitForeignCall(ForeignCallLinkage linkage, Value result, Value[] arguments, Value[] temps, LIRFrameState info); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
232 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
233 public static AllocatableValue toStackKind(AllocatableValue value) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
234 if (value.getKind().getStackKind() != value.getKind()) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
235 // We only have stack-kinds in the LIR, so convert the operand kind for values from the |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
236 // calling convention. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
237 if (isRegister(value)) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
238 return asRegister(value).asValue(value.getKind().getStackKind()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
239 } else if (isStackSlot(value)) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
240 return StackSlot.get(value.getKind().getStackKind(), asStackSlot(value).getRawOffset(), asStackSlot(value).getRawAddFrameSize()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
241 } else { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
242 throw GraalInternalError.shouldNotReachHere(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
243 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
244 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
245 return value; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
246 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
247 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
248 @Override |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15297
diff
changeset
|
249 public Variable emitForeignCall(ForeignCallLinkage linkage, LIRFrameState frameState, Value... args) { |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
250 LIRFrameState state = null; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
251 if (linkage.canDeoptimize()) { |
15301
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15297
diff
changeset
|
252 if (frameState != null) { |
468b2428c403
Change DeoptimizingNode and Access to LIRFrameState in *LIRGenerator*.
Josef Eisl <josef.eisl@jku.at>
parents:
15297
diff
changeset
|
253 state = frameState; |
15297
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
254 } else { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
255 assert needOnlyOopMaps(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
256 state = new LIRFrameState(null, null, null); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
257 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
258 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
259 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
260 // move the arguments into the correct location |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
261 CallingConvention linkageCc = linkage.getOutgoingCallingConvention(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
262 res.getFrameMap().callsMethod(linkageCc); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
263 assert linkageCc.getArgumentCount() == args.length : "argument count mismatch"; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
264 Value[] argLocations = new Value[args.length]; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
265 for (int i = 0; i < args.length; i++) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
266 Value arg = args[i]; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
267 AllocatableValue loc = linkageCc.getArgument(i); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
268 emitMove(loc, arg); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
269 argLocations[i] = loc; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
270 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
271 res.setForeignCall(true); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
272 emitForeignCall(linkage, linkageCc.getReturn(), argLocations, linkage.getTemporaries(), state); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
273 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
274 if (isLegal(linkageCc.getReturn())) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
275 return emitMove(linkageCc.getReturn()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
276 } else { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
277 return null; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
278 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
279 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
280 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
281 public void emitStrategySwitch(Constant[] keyConstants, double[] keyProbabilities, LabelRef[] keyTargets, LabelRef defaultTarget, Variable value) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
282 int keyCount = keyConstants.length; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
283 SwitchStrategy strategy = SwitchStrategy.getBestStrategy(keyProbabilities, keyConstants, keyTargets); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
284 long valueRange = keyConstants[keyCount - 1].asLong() - keyConstants[0].asLong() + 1; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
285 double tableSwitchDensity = keyCount / (double) valueRange; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
286 /* |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
287 * This heuristic tries to find a compromise between the effort for the best switch strategy |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
288 * and the density of a tableswitch. If the effort for the strategy is at least 4, then a |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
289 * tableswitch is preferred if better than a certain value that starts at 0.5 and lowers |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
290 * gradually with additional effort. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
291 */ |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
292 if (strategy.getAverageEffort() < 4 || tableSwitchDensity < (1 / Math.sqrt(strategy.getAverageEffort()))) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
293 emitStrategySwitch(strategy, value, keyTargets, defaultTarget); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
294 } else { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
295 int minValue = keyConstants[0].asInt(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
296 assert valueRange < Integer.MAX_VALUE; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
297 LabelRef[] targets = new LabelRef[(int) valueRange]; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
298 for (int i = 0; i < valueRange; i++) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
299 targets[i] = defaultTarget; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
300 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
301 for (int i = 0; i < keyCount; i++) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
302 targets[keyConstants[i].asInt() - minValue] = keyTargets[i]; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
303 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
304 emitTableSwitch(minValue, defaultTarget, targets, value); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
305 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
306 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
307 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
308 public abstract void emitStrategySwitch(SwitchStrategy strategy, Variable key, LabelRef[] keyTargets, LabelRef defaultTarget); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
309 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
310 protected abstract void emitTableSwitch(int lowKey, LabelRef defaultTarget, LabelRef[] targets, Value key); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
311 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
312 public CallingConvention getCallingConvention() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
313 return cc; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
314 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
315 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
316 @Override |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
317 public void beforeRegisterAllocation() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
318 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
319 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
320 /** |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
321 * Gets a garbage value for a given kind. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
322 */ |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
323 protected Constant zapValueForKind(PlatformKind kind) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
324 long dead = 0xDEADDEADDEADDEADL; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
325 switch ((Kind) kind) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
326 case Boolean: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
327 return Constant.FALSE; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
328 case Byte: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
329 return Constant.forByte((byte) dead); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
330 case Char: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
331 return Constant.forChar((char) dead); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
332 case Short: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
333 return Constant.forShort((short) dead); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
334 case Int: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
335 return Constant.forInt((int) dead); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
336 case Double: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
337 return Constant.forDouble(Double.longBitsToDouble(dead)); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
338 case Float: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
339 return Constant.forFloat(Float.intBitsToFloat((int) dead)); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
340 case Long: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
341 return Constant.forLong(dead); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
342 case Object: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
343 return Constant.NULL_OBJECT; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
344 default: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
345 throw new IllegalArgumentException(kind.toString()); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
346 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
347 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
348 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
349 /** |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
350 * Default implementation: Return the Java stack kind for each stamp. |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
351 */ |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
352 public PlatformKind getPlatformKind(Stamp stamp) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
353 return stamp.getPlatformKind(this); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
354 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
355 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
356 public PlatformKind getIntegerKind(int bits) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
357 if (bits <= 8) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
358 return Kind.Byte; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
359 } else if (bits <= 16) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
360 return Kind.Short; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
361 } else if (bits <= 32) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
362 return Kind.Int; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
363 } else { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
364 assert bits <= 64; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
365 return Kind.Long; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
366 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
367 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
368 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
369 public PlatformKind getFloatingKind(int bits) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
370 switch (bits) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
371 case 32: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
372 return Kind.Float; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
373 case 64: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
374 return Kind.Double; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
375 default: |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
376 throw GraalInternalError.shouldNotReachHere(); |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
377 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
378 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
379 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
380 public PlatformKind getObjectKind() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
381 return Kind.Object; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
382 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
383 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
384 public AbstractBlock<?> getCurrentBlock() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
385 return currentBlock; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
386 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
387 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
388 void setCurrentBlock(AbstractBlock<?> block) { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
389 currentBlock = block; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
390 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
391 |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
392 public LIRGenerationResult getResult() { |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
393 return res; |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
394 } |
3a6151ed5a25
Move LIRGenerator to graal.lir (errors).
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
395 } |