Mercurial > hg > graal-jvmci-8
annotate graal/com.oracle.graal.hotspot/src/com/oracle/graal/hotspot/meta/HotSpotConstantPool.java @ 13261:0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
author | twisti |
---|---|
date | Sun, 08 Dec 2013 13:27:52 -0800 |
parents | b16fb0b7479b |
children | 361acb279104 |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
2 * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
4 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
8 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
14 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
18 * |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
21 * questions. |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
22 */ |
5548
8872bc0eebdf
Renaming hotspot.ri => hotspot.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5541
diff
changeset
|
23 package com.oracle.graal.hotspot.meta; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12431
diff
changeset
|
25 import static com.oracle.graal.graph.UnsafeAccess.*; |
9289
261a43921c5e
rename: HotSpotGraalRuntime.getInstance() -> graalRuntime()
Doug Simon <doug.simon@oracle.com>
parents:
9108
diff
changeset
|
26 import static com.oracle.graal.hotspot.HotSpotGraalRuntime.*; |
261a43921c5e
rename: HotSpotGraalRuntime.getInstance() -> graalRuntime()
Doug Simon <doug.simon@oracle.com>
parents:
9108
diff
changeset
|
27 |
5507
dc71b06d09f8
Moving classes from cri.ri to api.meta.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5278
diff
changeset
|
28 import com.oracle.graal.api.meta.*; |
9011
23762f2438b6
support for compiling LambdaForm invocations (invokevirtual instructions that were rewritten to invokehandle instructions)
Doug Simon <doug.simon@oracle.com>
parents:
8945
diff
changeset
|
29 import com.oracle.graal.bytecode.*; |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
30 import com.oracle.graal.graph.*; |
5060
4ed4295ce15f
Update import statements.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5059
diff
changeset
|
31 import com.oracle.graal.hotspot.*; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
32 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
33 /** |
5775
2c088af17e59
Removed left over Ri* prefixed identifiers
Doug Simon <doug.simon@oracle.com>
parents:
5554
diff
changeset
|
34 * Implementation of {@link ConstantPool} for HotSpot. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
35 */ |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5534
diff
changeset
|
36 public class HotSpotConstantPool extends CompilerObject implements ConstantPool { |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
37 |
4142
bc8527f3071c
Adjust code base to new level of warnings.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
3733
diff
changeset
|
38 private static final long serialVersionUID = -5443206401485234850L; |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
39 |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
40 /** |
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
41 * Reference to the C++ ConstantPool object. |
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
42 */ |
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
43 private final long metaspaceConstantPool; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
44 |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
45 public HotSpotConstantPool(long metaspaceConstantPool) { |
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
46 this.metaspaceConstantPool = metaspaceConstantPool; |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
47 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
48 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
49 /** |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
50 * Returns the constant pool tag at index {@code index}. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
51 * |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
52 * @param index constant pool index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
53 * @return constant pool tag at index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
54 */ |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
55 private int getTagAt(int index) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
56 assertBounds(index); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
57 HotSpotVMConfig config = runtime().getConfig(); |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
58 long tags = unsafe.getAddress(metaspaceConstantPool + config.constantPoolTagsOffset); |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
59 return unsafe.getByteVolatile(null, tags + config.arrayU1DataOffset + index); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
60 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
61 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
62 /** |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
63 * Returns the constant pool entry at index {@code index}. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
64 * |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
65 * @param index constant pool index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
66 * @return constant pool entry at index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
67 */ |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
68 private long getEntryAt(int index) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
69 assertBounds(index); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
70 HotSpotVMConfig config = runtime().getConfig(); |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
71 return unsafe.getAddress(metaspaceConstantPool + config.constantPoolSize + index * runtime().getTarget().wordSize); |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
72 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
73 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
74 /** |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
75 * Returns the integer constant pool entry at index {@code index}. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
76 * |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
77 * @param index constant pool index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
78 * @return integer constant pool entry at index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
79 */ |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
80 private int getIntAt(int index) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
81 HotSpotVMConfig config = runtime().getConfig(); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
82 assertTag(index, config.jvmConstantInteger); |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
83 return unsafe.getInt(metaspaceConstantPool + config.constantPoolSize + index * runtime().getTarget().wordSize); |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
84 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
85 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
86 /** |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
87 * Returns the long constant pool entry at index {@code index}. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
88 * |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
89 * @param index constant pool index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
90 * @return long constant pool entry at index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
91 */ |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
92 private long getLongAt(int index) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
93 HotSpotVMConfig config = runtime().getConfig(); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
94 assertTag(index, config.jvmConstantLong); |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
95 return unsafe.getLong(metaspaceConstantPool + config.constantPoolSize + index * runtime().getTarget().wordSize); |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
96 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
97 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
98 /** |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
99 * Returns the float constant pool entry at index {@code index}. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
100 * |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
101 * @param index constant pool index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
102 * @return float constant pool entry at index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
103 */ |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
104 private float getFloatAt(int index) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
105 HotSpotVMConfig config = runtime().getConfig(); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
106 assertTag(index, config.jvmConstantFloat); |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
107 return unsafe.getFloat(metaspaceConstantPool + config.constantPoolSize + index * runtime().getTarget().wordSize); |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
108 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
109 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
110 /** |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
111 * Returns the double constant pool entry at index {@code index}. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
112 * |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
113 * @param index constant pool index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
114 * @return float constant pool entry at index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
115 */ |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
116 private double getDoubleAt(int index) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
117 HotSpotVMConfig config = runtime().getConfig(); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
118 assertTag(index, config.jvmConstantDouble); |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
119 return unsafe.getDouble(metaspaceConstantPool + config.constantPoolSize + index * runtime().getTarget().wordSize); |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
120 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
121 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
122 /** |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
123 * Asserts that the constant pool index {@code index} is in the bounds of the constant pool. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
124 * |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
125 * @param index constant pool index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
126 */ |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
127 private void assertBounds(int index) { |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
128 assert 0 <= index && index < length() : "index " + index + " not between 0 and " + length(); |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
129 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
130 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
131 /** |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
132 * Asserts that the constant pool tag at index {@code index} is equal to {@code tag}. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
133 * |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
134 * @param index constant pool index |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
135 * @param tag expected tag |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
136 */ |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
137 private void assertTag(int index, int tag) { |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
138 assert getTagAt(index) == tag : "constant pool tag at index " + index + " is " + getNameForTag(getTagAt(index)) + " but expected " + getNameForTag(tag); |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
139 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
140 |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
141 private static String getNameForTag(int tag) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
142 HotSpotVMConfig config = runtime().getConfig(); |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
143 if (tag == config.jvmConstantUtf8) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
144 return "JVM_CONSTANT_Utf8"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
145 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
146 if (tag == config.jvmConstantInteger) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
147 return "JVM_CONSTANT_Integer"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
148 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
149 if (tag == config.jvmConstantLong) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
150 return "JVM_CONSTANT_Long"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
151 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
152 if (tag == config.jvmConstantFloat) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
153 return "JVM_CONSTANT_Float"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
154 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
155 if (tag == config.jvmConstantDouble) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
156 return "JVM_CONSTANT_Double"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
157 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
158 if (tag == config.jvmConstantClass) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
159 return "JVM_CONSTANT_Class"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
160 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
161 if (tag == config.jvmConstantUnresolvedClass) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
162 return "JVM_CONSTANT_UnresolvedClass"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
163 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
164 if (tag == config.jvmConstantUnresolvedClassInError) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
165 return "JVM_CONSTANT_UnresolvedClassInError"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
166 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
167 if (tag == config.jvmConstantString) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
168 return "JVM_CONSTANT_String"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
169 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
170 if (tag == config.jvmConstantFieldref) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
171 return "JVM_CONSTANT_Fieldref"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
172 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
173 if (tag == config.jvmConstantMethodref) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
174 return "JVM_CONSTANT_Methodref"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
175 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
176 if (tag == config.jvmConstantInterfaceMethodref) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
177 return "JVM_CONSTANT_InterfaceMethodref"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
178 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
179 if (tag == config.jvmConstantNameAndType) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
180 return "JVM_CONSTANT_NameAndType"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
181 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
182 if (tag == config.jvmConstantMethodHandle) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
183 return "JVM_CONSTANT_MethodHandle"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
184 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
185 if (tag == config.jvmConstantMethodHandleInError) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
186 return "JVM_CONSTANT_MethodHandleInError"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
187 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
188 if (tag == config.jvmConstantMethodType) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
189 return "JVM_CONSTANT_MethodType"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
190 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
191 if (tag == config.jvmConstantMethodTypeInError) { |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
192 return "JVM_CONSTANT_MethodTypeInError"; |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
193 } |
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
194 return "unknown constant tag " + tag; |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
195 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
196 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
197 @Override |
9108 | 198 public int length() { |
12559
ae412befde21
read HotSpotVMConfig fields from HotSpot's vmStructs via annotations
twisti
parents:
12431
diff
changeset
|
199 HotSpotVMConfig config = runtime().getConfig(); |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
200 return unsafe.getInt(metaspaceConstantPool + config.constantPoolLengthOffset); |
9108 | 201 } |
202 | |
203 @Override | |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
204 public Object lookupConstant(int cpi) { |
7002
74f0207b82f5
fixed bug in bytecode reconstitution
Doug Simon <doug.simon@oracle.com>
parents:
6588
diff
changeset
|
205 assert cpi != 0; |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
206 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
207 HotSpotVMConfig config = runtime().getConfig(); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
208 final int tag = getTagAt(cpi); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
209 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
210 // Handle primitive constant pool entries directly. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
211 if (tag == config.jvmConstantInteger) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
212 return Constant.forInt(getIntAt(cpi)); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
213 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
214 if (tag == config.jvmConstantLong) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
215 return Constant.forLong(getLongAt(cpi)); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
216 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
217 if (tag == config.jvmConstantFloat) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
218 return Constant.forFloat(getFloatAt(cpi)); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
219 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
220 if (tag == config.jvmConstantDouble) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
221 return Constant.forDouble(getDoubleAt(cpi)); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
222 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
223 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
224 // All the other constant pool entries need special attention so we call down into the VM. |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
225 if (tag == config.jvmConstantClass || tag == config.jvmConstantUnresolvedClass || tag == config.jvmConstantUnresolvedClassInError) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
226 final int opcode = -1; // opcode is not used |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
227 return lookupType(cpi, opcode); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
228 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
229 if (tag == config.jvmConstantString) { |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
230 Object string = runtime().getCompilerToVM().lookupConstantInPool(metaspaceConstantPool, cpi); |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
231 return Constant.forObject(string); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
232 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
233 if (tag == config.jvmConstantMethodHandle || tag == config.jvmConstantMethodHandleInError || tag == config.jvmConstantMethodType || tag == config.jvmConstantMethodTypeInError) { |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
234 Object obj = runtime().getCompilerToVM().lookupConstantInPool(metaspaceConstantPool, cpi); |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
235 return Constant.forObject(obj); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
236 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
237 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
238 throw GraalInternalError.shouldNotReachHere("unknown constant pool tag " + tag); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
239 } |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
240 |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
241 @Override |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
242 public String lookupUtf8(int cpi) { |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
243 assertTag(cpi, runtime().getConfig().jvmConstantUtf8); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
244 long signature = getEntryAt(cpi); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
245 HotSpotSymbol symbol = new HotSpotSymbol(signature); |
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
246 return symbol.asString(); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
247 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
248 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
249 @Override |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5534
diff
changeset
|
250 public Signature lookupSignature(int cpi) { |
13254
42aaf7306707
Teach Graal about Symbol and ConstantPool so we can move more logic into Java. We'll see how that ends...
twisti
parents:
12559
diff
changeset
|
251 return new HotSpotSignature(lookupUtf8(cpi)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
252 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
253 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
254 @Override |
9011
23762f2438b6
support for compiling LambdaForm invocations (invokevirtual instructions that were rewritten to invokehandle instructions)
Doug Simon <doug.simon@oracle.com>
parents:
8945
diff
changeset
|
255 public Object lookupAppendix(int cpi, int opcode) { |
23762f2438b6
support for compiling LambdaForm invocations (invokevirtual instructions that were rewritten to invokehandle instructions)
Doug Simon <doug.simon@oracle.com>
parents:
8945
diff
changeset
|
256 assert Bytecodes.isInvoke(opcode); |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
257 return runtime().getCompilerToVM().lookupAppendixInPool(metaspaceConstantPool, cpi, (byte) opcode); |
8945
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
7084
diff
changeset
|
258 } |
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
7084
diff
changeset
|
259 |
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
7084
diff
changeset
|
260 @Override |
6588
b89b5038ad7e
removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
5775
diff
changeset
|
261 public JavaMethod lookupMethod(int cpi, int opcode) { |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
262 return runtime().getCompilerToVM().lookupMethodInPool(metaspaceConstantPool, cpi, (byte) opcode); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
263 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
264 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
265 @Override |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5534
diff
changeset
|
266 public JavaType lookupType(int cpi, int opcode) { |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
267 return runtime().getCompilerToVM().lookupTypeInPool(metaspaceConstantPool, cpi); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
268 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
269 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
270 @Override |
5541
b4c406861c33
More renamings to drop Ri* prefix completely. Deleted graph.BitMap class and replaced with java.util.BitSet.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
5534
diff
changeset
|
271 public JavaField lookupField(int cpi, int opcode) { |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
272 return runtime().getCompilerToVM().lookupFieldInPool(metaspaceConstantPool, cpi, (byte) opcode); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
273 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
274 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
275 @Override |
6588
b89b5038ad7e
removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
5775
diff
changeset
|
276 public void loadReferencedType(int cpi, int opcode) { |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
277 runtime().getCompilerToVM().lookupReferencedTypeInPool(metaspaceConstantPool, cpi, (byte) opcode); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
278 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
279 } |