Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.baseline/src/com/oracle/graal/baseline/BaselineBytecodeParser.java @ 16490:cac0a7d1c325
moved profileToString(ProfilingInfo info, ResolvedJavaMethod method, String sep) from MetaUtil to be a default method in ProfilingInfo
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Thu, 10 Jul 2014 23:56:39 +0200 |
parents | 10c12d09a8d2 |
children | b61b88c9c103 |
rev | line source |
---|---|
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
1 /* |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
2 * Copyright (c) 2014, 2014, Oracle and/or its affiliates. All rights reserved. |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
4 * |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
8 * |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
13 * accompanied this code). |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
14 * |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
18 * |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
21 * questions. |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
22 */ |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
23 package com.oracle.graal.baseline; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
24 |
15259
d90e5c22ba55
Move GraalOptions to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents:
15200
diff
changeset
|
25 import static com.oracle.graal.compiler.common.GraalOptions.*; |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
26 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
27 import java.util.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
28 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
29 import com.oracle.graal.alloc.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
30 import com.oracle.graal.api.code.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
31 import com.oracle.graal.api.meta.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
32 import com.oracle.graal.api.meta.ResolvedJavaType.Representation; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
33 import com.oracle.graal.bytecode.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
34 import com.oracle.graal.compiler.alloc.*; |
15193
96bb07a5d667
Spit up and move GraalInternalError.
Josef Eisl <josef.eisl@jku.at>
parents:
15192
diff
changeset
|
35 import com.oracle.graal.compiler.common.*; |
15200
97eed257999b
Move Condition to graal.compiler.common.
Josef Eisl <josef.eisl@jku.at>
parents:
15193
diff
changeset
|
36 import com.oracle.graal.compiler.common.calc.*; |
15192
644dfe49c0f4
Move packages com.oracle.graal.cfg to com.oracle.graal.compiler.common.cfg.
Josef Eisl <josef.eisl@jku.at>
parents:
15157
diff
changeset
|
37 import com.oracle.graal.compiler.common.cfg.*; |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
38 import com.oracle.graal.compiler.gen.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
39 import com.oracle.graal.compiler.target.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
40 import com.oracle.graal.debug.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
41 import com.oracle.graal.debug.Debug.Scope; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
42 import com.oracle.graal.java.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
43 import com.oracle.graal.java.BciBlockMapping.BciBlock; |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
44 import com.oracle.graal.java.BciBlockMapping.LocalLiveness; |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
45 import com.oracle.graal.lir.*; |
15157
f4e31f06b019
Create com.oracle.graal.cfg project and move CFG related files.
Josef Eisl <josef.eisl@jku.at>
parents:
15128
diff
changeset
|
46 import com.oracle.graal.lir.StandardOp.BlockEndOp; |
15292
a38d791982e1
Move LIRGenerationResult* to graal.lir.
Josef Eisl <josef.eisl@jku.at>
parents:
15267
diff
changeset
|
47 import com.oracle.graal.lir.gen.*; |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
48 import com.oracle.graal.phases.*; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
49 |
15306
7e0563f0d249
Rename LIRFrameStateBuilder to BaselineFrameStateBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15305
diff
changeset
|
50 public class BaselineBytecodeParser extends AbstractBytecodeParser<Value, BaselineFrameStateBuilder> implements BytecodeParserTool { |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
51 private Backend backend; |
15333
06ecedffb109
Use LIRGeneratorTool in Backend.
Josef Eisl <josef.eisl@jku.at>
parents:
15306
diff
changeset
|
52 protected LIRGeneratorTool gen; |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
53 private LIRGenerationResult lirGenRes; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
54 private BytecodeLIRBuilder lirBuilder; |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
55 @SuppressWarnings("unused") private BciBlock[] loopHeaders; |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
56 private LocalLiveness liveness; |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
57 private BciBlockBitMap blockVisited; |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
58 |
15127
dc774fe9d0e0
BaselineCompiler: use PhiResolver.
Josef Eisl <josef.eisl@jku.at>
parents:
15112
diff
changeset
|
59 private static class BciBlockBitMap { |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
60 BitSet bitSet; |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
61 |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
62 public BciBlockBitMap(BciBlockMapping blockMap) { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
63 bitSet = new BitSet(blockMap.blocks.size()); |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
64 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
65 |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
66 public boolean get(BciBlock block) { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
67 return bitSet.get(block.getId()); |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
68 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
69 |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
70 public void set(BciBlock block) { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
71 bitSet.set(block.getId()); |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
72 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
73 } |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
74 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
75 public BaselineBytecodeParser(MetaAccessProvider metaAccess, ResolvedJavaMethod method, GraphBuilderConfiguration graphBuilderConfig, OptimisticOptimizations optimisticOpts, |
15306
7e0563f0d249
Rename LIRFrameStateBuilder to BaselineFrameStateBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15305
diff
changeset
|
76 BaselineFrameStateBuilder frameState, BytecodeStream stream, ProfilingInfo profilingInfo, ConstantPool constantPool, int entryBCI, Backend backend) { |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
77 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
78 super(metaAccess, method, graphBuilderConfig, optimisticOpts, frameState, stream, profilingInfo, constantPool, entryBCI); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
79 this.backend = backend; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
80 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
81 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
82 public LIRGenerationResult getLIRGenerationResult() { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
83 return lirGenRes; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
84 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
85 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
86 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
87 protected void build() { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
88 if (PrintProfilingInformation.getValue()) { |
16480
10c12d09a8d2
moved format(String format, JavaMethod method) from MetaUtil to be a default method in JavaMethod
Doug Simon <doug.simon@oracle.com>
parents:
16094
diff
changeset
|
89 TTY.println("Profiling info for " + method.format("%H.%n(%p)")); |
16490
cac0a7d1c325
moved profileToString(ProfilingInfo info, ResolvedJavaMethod method, String sep) from MetaUtil to be a default method in ProfilingInfo
Doug Simon <doug.simon@oracle.com>
parents:
16480
diff
changeset
|
90 TTY.println(MetaUtil.indent(profilingInfo.toString(method, CodeUtil.NEW_LINE), " ")); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
91 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
92 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
93 try (Indent indent = Debug.logAndIndent("build graph for %s", method)) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
94 |
15542
e46312e7ac27
BaselineBytecodeParser: add BciBlockMapping debug scope.
Josef Eisl <josef.eisl@jku.at>
parents:
15538
diff
changeset
|
95 BciBlockMapping blockMap; |
e46312e7ac27
BaselineBytecodeParser: add BciBlockMapping debug scope.
Josef Eisl <josef.eisl@jku.at>
parents:
15538
diff
changeset
|
96 try (Scope ds = Debug.scope("BciBlockMapping")) { |
e46312e7ac27
BaselineBytecodeParser: add BciBlockMapping debug scope.
Josef Eisl <josef.eisl@jku.at>
parents:
15538
diff
changeset
|
97 // compute the block map, setup exception handlers and get the entrypoint(s) |
e46312e7ac27
BaselineBytecodeParser: add BciBlockMapping debug scope.
Josef Eisl <josef.eisl@jku.at>
parents:
15538
diff
changeset
|
98 blockMap = BciBlockMapping.create(method); |
e46312e7ac27
BaselineBytecodeParser: add BciBlockMapping debug scope.
Josef Eisl <josef.eisl@jku.at>
parents:
15538
diff
changeset
|
99 } catch (Throwable e) { |
e46312e7ac27
BaselineBytecodeParser: add BciBlockMapping debug scope.
Josef Eisl <josef.eisl@jku.at>
parents:
15538
diff
changeset
|
100 throw Debug.handle(e); |
e46312e7ac27
BaselineBytecodeParser: add BciBlockMapping debug scope.
Josef Eisl <josef.eisl@jku.at>
parents:
15538
diff
changeset
|
101 } |
e46312e7ac27
BaselineBytecodeParser: add BciBlockMapping debug scope.
Josef Eisl <josef.eisl@jku.at>
parents:
15538
diff
changeset
|
102 |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
103 loopHeaders = blockMap.loopHeaders; |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
104 liveness = blockMap.liveness; |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
105 blockVisited = new BciBlockBitMap(blockMap); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
106 // add predecessors |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
107 for (BciBlock block : blockMap.blocks) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
108 for (BciBlock successor : block.getSuccessors()) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
109 successor.getPredecessors().add(block); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
110 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
111 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
112 |
15267
98d45600222c
Add ResolvedJavaMethod.isSynchronized
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15259
diff
changeset
|
113 if (method.isSynchronized()) { |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
114 throw GraalInternalError.unimplemented("Handle synchronized methods"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
115 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
116 |
15306
7e0563f0d249
Rename LIRFrameStateBuilder to BaselineFrameStateBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15305
diff
changeset
|
117 frameState = new BaselineFrameStateBuilder(method); |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
118 frameState.clearNonLiveLocals(blockMap.startBlock, liveness, true); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
119 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
120 currentBlock = blockMap.startBlock; |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
121 blockMap.startBlock.entryState = frameState; |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
122 if (blockMap.startBlock.isLoopHeader) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
123 throw GraalInternalError.unimplemented("Handle start block as loop header"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
124 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
125 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
126 // add loops ? how do we add looks when we haven't parsed the bytecode? |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
127 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
128 // create the control flow graph |
15538
9398d53c15b4
Add BaselineControlFlowGraph.compute() factory.
Josef Eisl <josef.eisl@jku.at>
parents:
15470
diff
changeset
|
129 BaselineControlFlowGraph cfg = BaselineControlFlowGraph.compute(blockMap); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
130 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
131 // create the LIR |
15470
c55f44b3c5e5
remove NodesToDoubles, refactoring of node probability and inlining relevance computation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15333
diff
changeset
|
132 List<? extends AbstractBlock<?>> linearScanOrder = ComputeBlockOrder.computeLinearScanOrder(blockMap.blocks.size(), blockMap.startBlock); |
c55f44b3c5e5
remove NodesToDoubles, refactoring of node probability and inlining relevance computation
Lukas Stadler <lukas.stadler@oracle.com>
parents:
15333
diff
changeset
|
133 List<? extends AbstractBlock<?>> codeEmittingOrder = ComputeBlockOrder.computeCodeEmittingOrder(blockMap.blocks.size(), blockMap.startBlock); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
134 LIR lir = new LIR(cfg, linearScanOrder, codeEmittingOrder); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
135 |
15011
c8e575742f36
allow compilation with custom RegisterConfig
Lukas Stadler <lukas.stadler@oracle.com>
parents:
14973
diff
changeset
|
136 FrameMap frameMap = backend.newFrameMap(null); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
137 TargetDescription target = backend.getTarget(); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
138 CallingConvention cc = CodeUtil.getCallingConvention(backend.getProviders().getCodeCache(), CallingConvention.Type.JavaCallee, method, false); |
15837
6fe57ff3f02c
Rename methods to have consistent names, allow subclasses of bytecode parsers
Christian Wimmer <christian.wimmer@oracle.com>
parents:
15561
diff
changeset
|
139 this.lirGenRes = backend.newLIRGenerationResult(lir, frameMap, method, null); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
140 this.gen = backend.newLIRGenerator(cc, lirGenRes); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
141 this.lirBuilder = backend.newBytecodeLIRBuilder(gen, this); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
142 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
143 try (Scope ds = Debug.scope("BackEnd", lir)) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
144 try (Scope s = Debug.scope("LIRGen", gen)) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
145 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
146 // possibly add all the arguments to slots in the local variable array |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
147 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
148 for (BciBlock block : blockMap.blocks) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
149 emitBlock(block); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
150 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
151 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
152 gen.beforeRegisterAllocation(); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
153 Debug.dump(lir, "After LIR generation"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
154 } catch (Throwable e) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
155 throw Debug.handle(e); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
156 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
157 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
158 try (Scope s = Debug.scope("Allocator")) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
159 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
160 if (backend.shouldAllocateRegisters()) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
161 new LinearScan(target, lir, frameMap).allocate(); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
162 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
163 } catch (Throwable e) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
164 throw Debug.handle(e); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
165 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
166 } catch (Throwable e) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
167 throw Debug.handle(e); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
168 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
169 } catch (Throwable e) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
170 throw Debug.handle(e); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
171 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
172 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
173 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
174 private void emitBlock(BciBlock b) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
175 if (lirGenRes.getLIR().getLIRforBlock(b) == null) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
176 for (BciBlock pred : b.getPredecessors()) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
177 if (!b.isLoopHeader() || !pred.isLoopEnd()) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
178 emitBlock(pred); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
179 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
180 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
181 processBlock(b); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
182 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
183 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
184 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
185 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
186 protected void handleUnresolvedLoadConstant(JavaType type) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
187 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
188 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
189 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
190 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
191 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
192 protected void handleUnresolvedCheckCast(JavaType type, Value object) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
193 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
194 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
195 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
196 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
197 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
198 protected void handleUnresolvedInstanceOf(JavaType type, Value object) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
199 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
200 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
201 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
202 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
203 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
204 protected void handleUnresolvedNewInstance(JavaType type) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
205 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
206 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
207 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
208 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
209 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
210 protected void handleUnresolvedNewObjectArray(JavaType type, Value length) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
211 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
212 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
213 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
214 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
215 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
216 protected void handleUnresolvedNewMultiArray(JavaType type, List<Value> dims) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
217 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
218 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
219 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
220 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
221 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
222 protected void handleUnresolvedLoadField(JavaField field, Value receiver) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
223 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
224 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
225 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
226 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
227 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
228 protected void handleUnresolvedStoreField(JavaField field, Value value, Value receiver) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
229 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
230 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
231 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
232 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
233 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
234 protected void handleUnresolvedExceptionType(Representation representation, JavaType type) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
235 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
236 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
237 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
238 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
239 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
240 protected Value genLoadIndexed(Value index, Value array, Kind kind) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
241 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
242 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
243 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
244 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
245 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
246 protected Value genStoreIndexed(Value array, Value index, Kind kind, Value value) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
247 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
248 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
249 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
250 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
251 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
252 protected Value genIntegerAdd(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
253 return gen.emitAdd(x, y); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
254 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
255 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
256 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
257 protected Value genIntegerSub(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
258 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
259 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
260 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
261 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
262 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
263 protected Value genIntegerMul(Kind kind, Value x, Value y) { |
15110
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
264 return gen.emitMul(x, y); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
265 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
266 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
267 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
268 protected Value genFloatAdd(Kind kind, Value x, Value y, boolean isStrictFP) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
269 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
270 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
271 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
272 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
273 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
274 protected Value genFloatSub(Kind kind, Value x, Value y, boolean isStrictFP) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
275 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
276 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
277 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
278 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
279 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
280 protected Value genFloatMul(Kind kind, Value x, Value y, boolean isStrictFP) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
281 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
282 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
283 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
284 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
285 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
286 protected Value genFloatDiv(Kind kind, Value x, Value y, boolean isStrictFP) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
287 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
288 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
289 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
290 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
291 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
292 protected Value genFloatRem(Kind kind, Value x, Value y, boolean isStrictFP) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
293 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
294 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
295 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
296 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
297 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
298 protected Value genIntegerDiv(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
299 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
300 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
301 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
302 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
303 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
304 protected Value genIntegerRem(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
305 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
306 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
307 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
308 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
309 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
310 protected Value genNegateOp(Value x) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
311 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
312 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
313 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
314 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
315 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
316 protected Value genLeftShift(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
317 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
318 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
319 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
320 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
321 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
322 protected Value genRightShift(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
323 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
324 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
325 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
326 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
327 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
328 protected Value genUnsignedRightShift(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
329 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
330 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
331 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
332 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
333 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
334 protected Value genAnd(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
335 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
336 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
337 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
338 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
339 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
340 protected Value genOr(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
341 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
342 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
343 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
344 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
345 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
346 protected Value genXor(Kind kind, Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
347 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
348 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
349 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
350 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
351 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
352 protected Value genNormalizeCompare(Value x, Value y, boolean isUnorderedLess) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
353 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
354 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
355 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
356 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
357 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
358 protected Value genFloatConvert(FloatConvert op, Value input) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
359 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
360 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
361 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
362 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
363 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
364 protected Value genNarrow(Value input, int bitCount) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
365 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
366 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
367 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
368 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
369 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
370 protected Value genSignExtend(Value input, int bitCount) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
371 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
372 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
373 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
374 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
375 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
376 protected Value genZeroExtend(Value input, int bitCount) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
377 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
378 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
379 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
380 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
381 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
382 protected Value genObjectEquals(Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
383 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
384 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
385 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
386 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
387 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
388 protected Value genIntegerEquals(Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
389 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
390 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
391 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
392 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
393 @Override |
14948
bc72e5ed9752
AbstractBytecodeParser: rename ifNode to genIf.
Josef Eisl <josef.eisl@jku.at>
parents:
14947
diff
changeset
|
394 protected void genIf(Value x, Condition cond, Value y) { |
14947
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
395 assert currentBlock.getSuccessors().size() == 2; |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
396 BciBlock trueBlock = currentBlock.getSuccessors().get(0); |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
397 BciBlock falseBlock = currentBlock.getSuccessors().get(1); |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
398 if (trueBlock == falseBlock) { |
15030
e098038093d5
AbstractBytecodeParser: move createTarget to GraphBuilderPhase.
Josef Eisl <josef.eisl@jku.at>
parents:
15029
diff
changeset
|
399 genGoto(); |
14947
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
400 return; |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
401 } |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
402 |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
403 double probability = profilingInfo.getBranchTakenProbability(bci()); |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
404 if (probability < 0) { |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
405 assert probability == -1 : "invalid probability"; |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
406 Debug.log("missing probability in %s at bci %d", method, bci()); |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
407 probability = 0.5; |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
408 } |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
409 |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
410 if (!optimisticOpts.removeNeverExecutedCode()) { |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
411 if (probability == 0) { |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
412 probability = 0.0000001; |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
413 } else if (probability == 1) { |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
414 probability = 0.999999; |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
415 } |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
416 } |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
417 |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
418 LabelRef trueDestination = getSuccessor(0); |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
419 LabelRef falseDestination = getSuccessor(1); |
14947
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
420 |
14971
63bc517c3543
BaselineCompiler: implement genIf.
Josef Eisl <josef.eisl@jku.at>
parents:
14962
diff
changeset
|
421 gen.emitCompareBranch(x.getKind(), x, y, cond, false, trueDestination, falseDestination, probability); |
14947
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
422 } |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
423 |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
424 @Override |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
425 protected Value genIntegerLessThan(Value x, Value y) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
426 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
427 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
428 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
429 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
430 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
431 protected Value genUnique(Value x) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
432 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
433 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
434 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
435 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
436 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
437 protected void genThrow() { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
438 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
439 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
440 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
441 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
442 @Override |
15837
6fe57ff3f02c
Rename methods to have consistent names, allow subclasses of bytecode parsers
Christian Wimmer <christian.wimmer@oracle.com>
parents:
15561
diff
changeset
|
443 protected Value createCheckCast(ResolvedJavaType type, Value object, JavaTypeProfile profileForTypeCheck, boolean b) { |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
444 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
445 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
446 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
447 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
448 @Override |
15837
6fe57ff3f02c
Rename methods to have consistent names, allow subclasses of bytecode parsers
Christian Wimmer <christian.wimmer@oracle.com>
parents:
15561
diff
changeset
|
449 protected Value createInstanceOf(ResolvedJavaType type, Value object, JavaTypeProfile profileForTypeCheck) { |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
450 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
451 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
452 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
453 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
454 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
455 protected Value genConditional(Value x) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
456 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
457 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
458 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
459 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
460 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
461 protected Value createNewInstance(ResolvedJavaType type, boolean fillContents) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
462 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
463 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
464 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
465 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
466 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
467 protected Value createNewArray(ResolvedJavaType elementType, Value length, boolean fillContents) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
468 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
469 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
470 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
471 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
472 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
473 protected Value createNewMultiArray(ResolvedJavaType type, List<Value> dims) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
474 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
475 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
476 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
477 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
478 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
479 protected Value genLoadField(Value receiver, ResolvedJavaField field) { |
15561
0fc035104370
Baseline: add support for getstatic.
Josef Eisl <josef.eisl@jku.at>
parents:
15559
diff
changeset
|
480 if (field.isStatic()) { |
0fc035104370
Baseline: add support for getstatic.
Josef Eisl <josef.eisl@jku.at>
parents:
15559
diff
changeset
|
481 Value classRef = lirBuilder.getClassConstant(field.getDeclaringClass()); |
0fc035104370
Baseline: add support for getstatic.
Josef Eisl <josef.eisl@jku.at>
parents:
15559
diff
changeset
|
482 long displacement = lirBuilder.getFieldOffset(field); |
0fc035104370
Baseline: add support for getstatic.
Josef Eisl <josef.eisl@jku.at>
parents:
15559
diff
changeset
|
483 Value address = gen.emitAddress(classRef, displacement, Value.ILLEGAL, 0); |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
15837
diff
changeset
|
484 LIRKind readKind = backend.getTarget().getLIRKind(field.getKind()); |
15561
0fc035104370
Baseline: add support for getstatic.
Josef Eisl <josef.eisl@jku.at>
parents:
15559
diff
changeset
|
485 LIRFrameState state = createFrameState(frameState); |
0fc035104370
Baseline: add support for getstatic.
Josef Eisl <josef.eisl@jku.at>
parents:
15559
diff
changeset
|
486 return gen.emitLoad(readKind, address, state); |
0fc035104370
Baseline: add support for getstatic.
Josef Eisl <josef.eisl@jku.at>
parents:
15559
diff
changeset
|
487 } |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
488 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
489 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
490 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
491 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
492 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
493 protected void emitNullCheck(Value receiver) { |
15559
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
494 gen.emitNullCheck(receiver, createFrameState(frameState)); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
495 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
496 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
497 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
498 protected void emitBoundsCheck(Value index, Value length) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
499 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
500 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
501 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
502 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
503 @Override |
15557
8a66b661ed49
BaselineBytecodeParser: initial genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15542
diff
changeset
|
504 protected Value genArrayLength(Value array) { |
8a66b661ed49
BaselineBytecodeParser: initial genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15542
diff
changeset
|
505 emitNullCheck(array); |
8a66b661ed49
BaselineBytecodeParser: initial genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15542
diff
changeset
|
506 long displacement = lirBuilder.getArrayLengthOffset(); |
8a66b661ed49
BaselineBytecodeParser: initial genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15542
diff
changeset
|
507 Value address = gen.emitAddress(array, displacement, Value.ILLEGAL, 0); |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
15837
diff
changeset
|
508 LIRKind readKind = backend.getTarget().getLIRKind(Kind.Int); |
15559
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
509 LIRFrameState state = createFrameState(frameState); |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
510 return gen.emitLoad(readKind, address, state); |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
511 } |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
512 |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
513 private LIRFrameState createFrameState(BaselineFrameStateBuilder state) { |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
514 LabelRef exceptionEdge = null; |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
515 BytecodeFrame caller = null; |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
516 boolean duringCall = false; |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
517 int numLocals = state.localsSize(); |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
518 int numStack = state.stackSize(); |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
519 int numLocks = state.lockDepth(); |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
520 Value[] values = new Value[numLocals + numStack + numLocks]; |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
521 |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
522 for (int i = 0; i < numLocals; i++) { |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
523 values[i] = state.localAt(i); |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
524 } |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
525 |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
526 for (int i = 0; i < numStack; i++) { |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
527 values[numLocals + i] = state.stackAt(i); |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
528 } |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
529 |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
530 for (int i = 0; i < numStack; i++) { |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
531 values[numLocals + numStack + i] = state.lockAt(i); |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
532 } |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
533 |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
534 BytecodeFrame frame = new BytecodeFrame(caller, method, bci(), state.rethrowException(), duringCall, values, numLocals, numStack, numLocks); |
9440ab398f49
BaselineCompiler: implement genArrayLength().
Josef Eisl <josef.eisl@jku.at>
parents:
15557
diff
changeset
|
535 return new LIRFrameState(frame, null, exceptionEdge); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
536 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
537 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
538 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
539 protected Value genStoreField(Value receiver, ResolvedJavaField field, Value value) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
540 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
541 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
542 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
543 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
544 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
545 protected void genInvokeStatic(JavaMethod target) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
546 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
547 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
548 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
549 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
550 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
551 protected void genInvokeInterface(JavaMethod target) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
552 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
553 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
554 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
555 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
556 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
557 protected void genInvokeDynamic(JavaMethod target) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
558 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
559 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
560 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
561 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
562 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
563 protected void genInvokeVirtual(JavaMethod target) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
564 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
565 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
566 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
567 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
568 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
569 protected void genInvokeSpecial(JavaMethod target) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
570 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
571 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
572 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
573 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
574 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
575 protected void genReturn(Value x) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
576 gen.emitReturn(x); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
577 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
578 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
579 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
580 protected Value genMonitorEnter(Value x) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
581 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
582 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
583 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
584 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
585 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
586 protected Value genMonitorExit(Value x, Value returnValue) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
587 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
588 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
589 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
590 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
591 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
592 protected void genJsr(int dest) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
593 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
594 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
595 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
596 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
597 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
598 protected void genRet(int localIndex) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
599 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
600 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
601 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
602 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
603 @Override |
15028
7ee9decb2784
AbstractBytecodeParser: rework genIntegerSwitch.
Josef Eisl <josef.eisl@jku.at>
parents:
15027
diff
changeset
|
604 protected void genIntegerSwitch(Value value, ArrayList<BciBlock> actualSuccessors, int[] keys, double[] keyProbabilities, int[] keySuccessors) { |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
605 // TODO Auto-generated method stub |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
606 throw GraalInternalError.unimplemented("Auto-generated method stub"); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
607 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
608 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
609 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
610 protected Value appendConstant(Constant constant) { |
14947
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
611 if (gen.canInlineConstant(constant)) { |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
612 return constant; |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
613 } |
3825cf50cc5a
AbstractBytecodeParser: make ifNode abstract.
Josef Eisl <josef.eisl@jku.at>
parents:
14927
diff
changeset
|
614 return gen.emitMove(constant); |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
615 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
616 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
617 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
618 protected Value append(Value v) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
619 return v; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
620 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
621 |
15110
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
622 private void createTarget(BciBlock block) { |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
623 assert block != null && frameState != null; |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
624 assert !block.isExceptionEntry || frameState.stackSize() == 1; |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
625 |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
626 if (!blockVisited.get(block)) { |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
627 /* |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
628 * This is the first time we see this block as a branch target. Create and return a |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
629 * placeholder that later can be replaced with a MergeNode when we see this block again. |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
630 */ |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
631 blockVisited.set(block); |
15110
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
632 if (block.getPredecessorCount() > 1) { |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
633 /* |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
634 * If there are more than one predecessors we have to ensure that we are not passing |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
635 * constants to the new framestate otherwise we will get interfacing problems. |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
636 */ |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
637 moveConstantsToVariables(); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
638 } |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
639 block.entryState = frameState.copy(); |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
640 block.entryState.clearNonLiveLocals(block, liveness, true); |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
641 |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
642 Debug.log("createTarget %s: first visit", block); |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
643 return; |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
644 } |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
645 |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
646 // We already saw this block before, so we have to merge states. |
15306
7e0563f0d249
Rename LIRFrameStateBuilder to BaselineFrameStateBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15305
diff
changeset
|
647 if (!((BaselineFrameStateBuilder) block.entryState).isCompatibleWith(frameState)) { |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
648 throw new BailoutException("stacks do not match; bytecodes would not verify"); |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
649 } |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
650 |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
651 if (block.isLoopHeader) { |
15112
257ec29335cf
BaselineCompiler: add basic loop support.
Josef Eisl <josef.eisl@jku.at>
parents:
15110
diff
changeset
|
652 assert currentBlock == null || currentBlock.getId() >= block.getId() : "must be backward branch"; |
15110
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
653 if (currentBlock != null && currentBlock.numNormalSuccessors() == 1) { |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
654 // this is the only successor of the current block so we can adjust |
15306
7e0563f0d249
Rename LIRFrameStateBuilder to BaselineFrameStateBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15305
diff
changeset
|
655 adaptFramestate((BaselineFrameStateBuilder) block.entryState); |
15110
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
656 return; |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
657 } |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
658 GraalInternalError.unimplemented("Loops not yet supported"); |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
659 } |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
660 assert currentBlock == null || currentBlock.getId() < block.getId() : "must not be backward branch"; |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
661 |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
662 /* |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
663 * This is the second time we see this block. Create the actual MergeNode and the End Node |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
664 * for the already existing edge. For simplicity, we leave the placeholder in the graph and |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
665 * just append the new nodes after the placeholder. |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
666 */ |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
667 if (currentBlock != null && currentBlock.numNormalSuccessors() == 1) { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
668 // this is the only successor of the current block so we can adjust |
15306
7e0563f0d249
Rename LIRFrameStateBuilder to BaselineFrameStateBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15305
diff
changeset
|
669 adaptFramestate((BaselineFrameStateBuilder) block.entryState); |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
670 return; |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
671 } |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
672 GraalInternalError.unimplemented("second block visit not yet implemented"); |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
673 |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
674 // merge frame states e.g. block.entryState.merge(mergeNode, target.state); |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
675 |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
676 Debug.log("createTarget %s: merging state", block); |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
677 } |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
678 |
15110
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
679 private void moveConstantsToVariables() { |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
680 Debug.log("moveConstantsToVariables: framestate before: %s", frameState); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
681 for (int i = 0; i < frameState.stackSize(); i++) { |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
682 Value src = frameState.stackAt(i); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
683 if (src instanceof Constant) { |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
15837
diff
changeset
|
684 AllocatableValue dst = gen.newVariable(src.getLIRKind()); |
15110
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
685 gen.emitMove(dst, src); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
686 frameState.storeStack(i, dst); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
687 Debug.log("introduce new variabe %s for stackslot %d (end of block %s", dst, i, currentBlock); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
688 } |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
689 } |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
690 for (int i = 0; i < frameState.localsSize(); i++) { |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
691 Value src = frameState.localAt(i); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
692 if (src instanceof Constant) { |
16094
c0b8d395368b
Introduce LIRKind to accurately track oop references in backend.
Roland Schatz <roland.schatz@oracle.com>
parents:
15837
diff
changeset
|
693 AllocatableValue dst = gen.newVariable(src.getLIRKind()); |
15110
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
694 gen.emitMove(dst, src); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
695 frameState.storeLocal(i, dst); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
696 Debug.log("introduce new variabe %s for local %d (end of block %s", dst, i, currentBlock); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
697 } |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
698 } |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
699 Debug.log("moveConstantsToVariables: framestate after: %s", frameState); |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
700 } |
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
701 |
15127
dc774fe9d0e0
BaselineCompiler: use PhiResolver.
Josef Eisl <josef.eisl@jku.at>
parents:
15112
diff
changeset
|
702 private static void adaptValues(Value dst, Value src, PhiResolver resolver) { |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
703 if (dst == null) { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
704 return; |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
705 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
706 assert src != null : "Source is null but Destination is not!"; |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
707 |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
708 if (!dst.equals(src)) { |
15127
dc774fe9d0e0
BaselineCompiler: use PhiResolver.
Josef Eisl <josef.eisl@jku.at>
parents:
15112
diff
changeset
|
709 resolver.move(dst, src); |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
710 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
711 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
712 |
15306
7e0563f0d249
Rename LIRFrameStateBuilder to BaselineFrameStateBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15305
diff
changeset
|
713 private void adaptFramestate(BaselineFrameStateBuilder other) { |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
714 assert frameState.isCompatibleWith(other) : "framestates not compatible!"; |
15127
dc774fe9d0e0
BaselineCompiler: use PhiResolver.
Josef Eisl <josef.eisl@jku.at>
parents:
15112
diff
changeset
|
715 PhiResolver resolver = new PhiResolver(gen); |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
716 for (int i = 0; i < frameState.stackSize(); i++) { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
717 Value src = frameState.stackAt(i); |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
718 Value dst = other.stackAt(i); |
15127
dc774fe9d0e0
BaselineCompiler: use PhiResolver.
Josef Eisl <josef.eisl@jku.at>
parents:
15112
diff
changeset
|
719 adaptValues(dst, src, resolver); |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
720 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
721 for (int i = 0; i < frameState.localsSize(); i++) { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
722 Value src = frameState.localAt(i); |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
723 Value dst = other.localAt(i); |
15127
dc774fe9d0e0
BaselineCompiler: use PhiResolver.
Josef Eisl <josef.eisl@jku.at>
parents:
15112
diff
changeset
|
724 adaptValues(dst, src, resolver); |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
725 } |
15127
dc774fe9d0e0
BaselineCompiler: use PhiResolver.
Josef Eisl <josef.eisl@jku.at>
parents:
15112
diff
changeset
|
726 resolver.dispose(); |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
727 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
728 |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
729 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
730 protected void processBlock(BciBlock block) { |
15306
7e0563f0d249
Rename LIRFrameStateBuilder to BaselineFrameStateBuilder.
Josef Eisl <josef.eisl@jku.at>
parents:
15305
diff
changeset
|
731 frameState = (BaselineFrameStateBuilder) block.entryState; |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
732 setCurrentFrameState(frameState); |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
733 currentBlock = block; |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
734 iterateBytecodesForBlock(block); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
735 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
736 |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
737 private boolean isBlockEnd() { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
738 List<LIRInstruction> l = gen.getResult().getLIR().getLIRforBlock(currentBlock); |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
739 if (l.isEmpty()) { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
740 return false; |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
741 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
742 return l.get(l.size() - 1) instanceof BlockEndOp; |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
743 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
744 |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
745 @Override |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
746 protected void iterateBytecodesForBlock(BciBlock block) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
747 gen.doBlockStart(block); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
748 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
749 if (block == gen.getResult().getLIR().getControlFlowGraph().getStartBlock()) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
750 assert block.getPredecessorCount() == 0; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
751 lirBuilder.emitPrologue(method); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
752 } else { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
753 assert block.getPredecessorCount() > 0; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
754 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
755 |
15128
d0e2d565176f
BaselineCompiler: copy frame state builder at loop headers.
Josef Eisl <josef.eisl@jku.at>
parents:
15127
diff
changeset
|
756 if (block.isLoopHeader) { |
d0e2d565176f
BaselineCompiler: copy frame state builder at loop headers.
Josef Eisl <josef.eisl@jku.at>
parents:
15127
diff
changeset
|
757 /* |
d0e2d565176f
BaselineCompiler: copy frame state builder at loop headers.
Josef Eisl <josef.eisl@jku.at>
parents:
15127
diff
changeset
|
758 * We need to preserve the frame state builder of the loop header so that we can merge |
d0e2d565176f
BaselineCompiler: copy frame state builder at loop headers.
Josef Eisl <josef.eisl@jku.at>
parents:
15127
diff
changeset
|
759 * values for phi functions, so make a copy of it. |
d0e2d565176f
BaselineCompiler: copy frame state builder at loop headers.
Josef Eisl <josef.eisl@jku.at>
parents:
15127
diff
changeset
|
760 */ |
d0e2d565176f
BaselineCompiler: copy frame state builder at loop headers.
Josef Eisl <josef.eisl@jku.at>
parents:
15127
diff
changeset
|
761 block.entryState = frameState.copy(); |
d0e2d565176f
BaselineCompiler: copy frame state builder at loop headers.
Josef Eisl <josef.eisl@jku.at>
parents:
15127
diff
changeset
|
762 |
d0e2d565176f
BaselineCompiler: copy frame state builder at loop headers.
Josef Eisl <josef.eisl@jku.at>
parents:
15127
diff
changeset
|
763 } |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
764 int endBCI = stream.endBCI(); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
765 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
766 stream.setBCI(block.startBci); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
767 int bci = block.startBci; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
768 BytecodesParsed.add(block.endBci - bci); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
769 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
770 while (bci < endBCI) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
771 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
772 // read the opcode |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
773 int opcode = stream.currentBC(); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
774 // traceState(); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
775 traceInstruction(bci, opcode, bci == block.startBci); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
776 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
777 processBytecode(bci, opcode); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
778 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
779 stream.next(); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
780 bci = stream.currentBCI(); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
781 |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
782 if (isBlockEnd()) { |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
783 break; |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
784 } |
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
785 |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
786 if (bci < endBCI) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
787 if (bci > block.endBci) { |
15026 | 788 if (block.numNormalSuccessors() == 1) { |
789 assert !block.getSuccessor(0).isExceptionEntry; | |
790 // we fell through to the next block, add a goto and break | |
15030
e098038093d5
AbstractBytecodeParser: move createTarget to GraphBuilderPhase.
Josef Eisl <josef.eisl@jku.at>
parents:
15029
diff
changeset
|
791 genGoto(); |
15026 | 792 } |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
793 break; |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
794 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
795 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
796 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
797 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
798 assert LIR.verifyBlock(gen.getResult().getLIR(), block); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
799 gen.doBlockEnd(block); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
800 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
801 |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
802 public void storeLocal(int i, Value x) { |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
803 frameState.storeLocal(i, x); |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
804 } |
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
805 |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
806 LabelRef getSuccessor(int index) { |
15110
ca92d97bb0d6
BaselineCompiler: do not pass constants to blocks with multiple predecessors.
Josef Eisl <josef.eisl@jku.at>
parents:
15107
diff
changeset
|
807 createTarget(currentBlock.getSuccessor(index)); |
15034
136d1f3f1371
BaselineCompiler: implement framestate merge.
Josef Eisl <josef.eisl@jku.at>
parents:
15033
diff
changeset
|
808 return LabelRef.forSuccessor(lirGenRes.getLIR(), currentBlock, index); |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
809 } |
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
810 |
15030
e098038093d5
AbstractBytecodeParser: move createTarget to GraphBuilderPhase.
Josef Eisl <josef.eisl@jku.at>
parents:
15029
diff
changeset
|
811 @Override |
e098038093d5
AbstractBytecodeParser: move createTarget to GraphBuilderPhase.
Josef Eisl <josef.eisl@jku.at>
parents:
15029
diff
changeset
|
812 protected void genGoto() { |
15033
c6cf3474351c
BaselineBytecodeParser: add createTarget.
Josef Eisl <josef.eisl@jku.at>
parents:
15030
diff
changeset
|
813 gen.emitJump(getSuccessor(0)); |
15030
e098038093d5
AbstractBytecodeParser: move createTarget to GraphBuilderPhase.
Josef Eisl <josef.eisl@jku.at>
parents:
15029
diff
changeset
|
814 } |
e098038093d5
AbstractBytecodeParser: move createTarget to GraphBuilderPhase.
Josef Eisl <josef.eisl@jku.at>
parents:
15029
diff
changeset
|
815 |
14927
93de07975ea9
Create dedicated BaselineBytecodeParser, BytecodeLIRBuilder and amd64 specialization.
Josef Eisl <josef.eisl@jku.at>
parents:
diff
changeset
|
816 } |