Mercurial > hg > graal-jvmci-8
annotate jvmci/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotConstantPool.java @ 23387:a920338dd4d4
remove JVMCIError and UnsafeUtil classes (JDK-8156759)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Wed, 11 May 2016 15:54:36 +0200 |
parents | 4b58c92e939b |
children | b3a816d3b844 |
rev | line source |
---|---|
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
1 /* |
21552
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21431
diff
changeset
|
2 * Copyright (c) 2011, 2015, 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 */ |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
23 package jdk.vm.ci.hotspot; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
24 |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
25 import static jdk.vm.ci.hotspot.CompilerToVM.compilerToVM; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
26 import static jdk.vm.ci.hotspot.HotSpotJVMCIRuntime.runtime; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
27 import static jdk.vm.ci.hotspot.HotSpotVMConfig.config; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
28 import static jdk.vm.ci.hotspot.UnsafeAccess.UNSAFE; |
9289
261a43921c5e
rename: HotSpotGraalRuntime.getInstance() -> graalRuntime()
Doug Simon <doug.simon@oracle.com>
parents:
9108
diff
changeset
|
29 |
22569
ec96f33a101d
updated imports to be explicit and added checkstyle rule to forbid * imports
Doug Simon <doug.simon@oracle.com>
parents:
22542
diff
changeset
|
30 import java.lang.invoke.MethodHandle; |
14093 | 31 |
22672
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
32 import jdk.vm.ci.meta.ConstantPool; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
33 import jdk.vm.ci.meta.JavaConstant; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
34 import jdk.vm.ci.meta.JavaField; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
35 import jdk.vm.ci.meta.JavaMethod; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
36 import jdk.vm.ci.meta.JavaType; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
37 import jdk.vm.ci.meta.ResolvedJavaMethod; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
38 import jdk.vm.ci.meta.ResolvedJavaType; |
1bbd4a7c274b
Rename jdk.internal.jvmci to jdk.vm.ci
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22605
diff
changeset
|
39 import jdk.vm.ci.meta.Signature; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
40 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
41 /** |
5775
2c088af17e59
Removed left over Ri* prefixed identifiers
Doug Simon <doug.simon@oracle.com>
parents:
5554
diff
changeset
|
42 * Implementation of {@link ConstantPool} for HotSpot. |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
43 */ |
22598
ed53e370f04c
Make implementation classes package private.
Roland Schatz <roland.schatz@oracle.com>
parents:
22582
diff
changeset
|
44 final class HotSpotConstantPool implements ConstantPool, HotSpotProxified, MetaspaceWrapperObject { |
5278
74dfa6f86879
removed last remaining references to vmEntries and vmExits
Lukas Stadler <lukas.stadler@jku.at>
parents:
5061
diff
changeset
|
45 |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
46 /** |
21720
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
47 * Subset of JVM bytecode opcodes used by {@link HotSpotConstantPool}. |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
48 */ |
21780
3d15183f3c93
Introduce Compiler interface in jvmci. Use it from jvmci.hotspot.CompilationTask
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21720
diff
changeset
|
49 public static class Bytecodes { |
21720
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
50 public static final int LDC = 18; // 0x12 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
51 public static final int LDC_W = 19; // 0x13 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
52 public static final int LDC2_W = 20; // 0x14 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
53 public static final int GETSTATIC = 178; // 0xB2 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
54 public static final int PUTSTATIC = 179; // 0xB3 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
55 public static final int GETFIELD = 180; // 0xB4 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
56 public static final int PUTFIELD = 181; // 0xB5 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
57 public static final int INVOKEVIRTUAL = 182; // 0xB6 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
58 public static final int INVOKESPECIAL = 183; // 0xB7 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
59 public static final int INVOKESTATIC = 184; // 0xB8 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
60 public static final int INVOKEINTERFACE = 185; // 0xB9 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
61 public static final int INVOKEDYNAMIC = 186; // 0xBA |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
62 public static final int NEW = 187; // 0xBB |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
63 public static final int NEWARRAY = 188; // 0xBC |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
64 public static final int ANEWARRAY = 189; // 0xBD |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
65 public static final int CHECKCAST = 192; // 0xC0 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
66 public static final int INSTANCEOF = 193; // 0xC1 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
67 public static final int MULTIANEWARRAY = 197; // 0xC5 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
68 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
69 static boolean isInvoke(int opcode) { |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
70 switch (opcode) { |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
71 case INVOKEVIRTUAL: |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
72 case INVOKESPECIAL: |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
73 case INVOKESTATIC: |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
74 case INVOKEINTERFACE: |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
75 case INVOKEDYNAMIC: |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
76 return true; |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
77 default: |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
78 return false; |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
79 } |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
80 } |
22089
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
81 |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
82 /** |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
83 * See: {@code Rewriter::maybe_rewrite_invokehandle}. |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
84 */ |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
85 static boolean isInvokeHandleAlias(int opcode) { |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
86 switch (opcode) { |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
87 case INVOKEVIRTUAL: |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
88 case INVOKESPECIAL: |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
89 return true; |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
90 default: |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
91 return false; |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
92 } |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
93 } |
21720
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
94 } |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
95 |
d915361cc3a1
moved asm, bytecode and asm.test code back to com.oracle.graal name space (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21713
diff
changeset
|
96 /** |
14529 | 97 * Enum of all {@code JVM_CONSTANT} constants used in the VM. This includes the public and |
98 * internal ones. | |
99 */ | |
100 private enum JVM_CONSTANT { | |
101 // @formatter:off | |
102 Utf8(config().jvmConstantUtf8), | |
103 Integer(config().jvmConstantInteger), | |
104 Long(config().jvmConstantLong), | |
105 Float(config().jvmConstantFloat), | |
106 Double(config().jvmConstantDouble), | |
107 Class(config().jvmConstantClass), | |
108 UnresolvedClass(config().jvmConstantUnresolvedClass), | |
109 UnresolvedClassInError(config().jvmConstantUnresolvedClassInError), | |
110 String(config().jvmConstantString), | |
111 Fieldref(config().jvmConstantFieldref), | |
112 MethodRef(config().jvmConstantMethodref), | |
113 InterfaceMethodref(config().jvmConstantInterfaceMethodref), | |
114 NameAndType(config().jvmConstantNameAndType), | |
115 MethodHandle(config().jvmConstantMethodHandle), | |
116 MethodHandleInError(config().jvmConstantMethodHandleInError), | |
117 MethodType(config().jvmConstantMethodType), | |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
118 MethodTypeInError(config().jvmConstantMethodTypeInError), |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
119 InvokeDynamic(config().jvmConstantInvokeDynamic); |
14529 | 120 // @formatter:on |
121 | |
17393
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
122 private final int tag; |
14529 | 123 |
17393
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
124 private static final int ExternalMax = config().jvmConstantExternalMax; |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
125 private static final int InternalMin = config().jvmConstantInternalMin; |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
126 private static final int InternalMax = config().jvmConstantInternalMax; |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
127 |
23297
4b58c92e939b
remove redundant modifiers
Manuel Rigger <rigger.manuel@gmail.com>
parents:
22672
diff
changeset
|
128 JVM_CONSTANT(int tag) { |
17393
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
129 this.tag = tag; |
14529 | 130 } |
131 | |
17393
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
132 /** |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
133 * Maps JVM_CONSTANT tags to {@link JVM_CONSTANT} values. Using a separate class for lazy |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
134 * initialization. |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
135 */ |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
136 static class TagValueMap { |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
137 private static final JVM_CONSTANT[] table = new JVM_CONSTANT[ExternalMax + 1 + (InternalMax - InternalMin) + 1]; |
22013
3904e33db5b3
Make sure HotSpotConstantPool.loadReferencedType resolves invokehandle call sites properly. Fixes eager resolution problems at those call sites.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
138 |
17393
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
139 static { |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
140 assert InternalMin > ExternalMax; |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
141 for (JVM_CONSTANT e : values()) { |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
142 table[indexOf(e.tag)] = e; |
14529 | 143 } |
144 } | |
17393
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
145 |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
146 private static int indexOf(int tag) { |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
147 if (tag >= InternalMin) { |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
148 return tag - InternalMin + ExternalMax + 1; |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
149 } else { |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
150 assert tag <= ExternalMax; |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
151 } |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
152 return tag; |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
153 } |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
154 |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
155 static JVM_CONSTANT get(int tag) { |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
156 JVM_CONSTANT res = table[indexOf(tag)]; |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
157 if (res != null) { |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
158 return res; |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
159 } |
23387
a920338dd4d4
remove JVMCIError and UnsafeUtil classes (JDK-8156759)
Doug Simon <doug.simon@oracle.com>
parents:
23297
diff
changeset
|
160 throw new InternalError("Unknown JVM_CONSTANT tag " + tag); |
17393
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
161 } |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
162 } |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
163 |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
164 public static JVM_CONSTANT getEnum(int tag) { |
a8186c7f73e9
added table to speed up mapping JVM_CONSTANT tag value to JVM_CONSTANT enum object
Doug Simon <doug.simon@oracle.com>
parents:
15968
diff
changeset
|
165 return TagValueMap.get(tag); |
14529 | 166 } |
167 } | |
168 | |
21252
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
169 private static class LookupTypeCacheElement { |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
170 int lastCpi = Integer.MIN_VALUE; |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
171 JavaType javaType; |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
172 |
23297
4b58c92e939b
remove redundant modifiers
Manuel Rigger <rigger.manuel@gmail.com>
parents:
22672
diff
changeset
|
173 LookupTypeCacheElement(int lastCpi, JavaType javaType) { |
21252
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
174 super(); |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
175 this.lastCpi = lastCpi; |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
176 this.javaType = javaType; |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
177 } |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
178 } |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
179 |
14529 | 180 /** |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
181 * Reference to the C++ ConstantPool object. |
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
182 */ |
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
183 private final long metaspaceConstantPool; |
21252
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
184 private volatile LookupTypeCacheElement lastLookupType; |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
185 |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
186 /** |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
187 * Gets the JVMCI mirror from a HotSpot constant pool.The VM is responsible for ensuring that |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
188 * the ConstantPool is kept alive for the duration of this call and the |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
189 * {@link HotSpotJVMCIMetaAccessContext} keeps it alive after that. |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
190 * |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
191 * Called from the VM. |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
192 * |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
193 * @param metaspaceConstantPool a metaspace ConstantPool object |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
194 * @return the {@link HotSpotConstantPool} corresponding to {@code metaspaceConstantPool} |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
195 */ |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
196 @SuppressWarnings("unused") |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
197 private static HotSpotConstantPool fromMetaspace(long metaspaceConstantPool) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
198 return new HotSpotConstantPool(metaspaceConstantPool); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
199 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
200 |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
201 private HotSpotConstantPool(long metaspaceConstantPool) { |
13259
b16fb0b7479b
every HotSpotResolvedJavaMethod needs its own constant pool
twisti
parents:
13254
diff
changeset
|
202 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
|
203 } |
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
|
204 |
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
|
205 /** |
18223
17c98fad6980
converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18222
diff
changeset
|
206 * Gets the holder for this constant pool as {@link HotSpotResolvedObjectTypeImpl}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
207 * |
14093 | 208 * @return holder for this constant pool |
209 */ | |
14117
2b2f0022900f
removed unnecessary lookupKlassByName method
Doug Simon <doug.simon@oracle.com>
parents:
14093
diff
changeset
|
210 private HotSpotResolvedObjectType getHolder() { |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
211 return compilerToVM().getResolvedJavaType(this, config().constantPoolHolderOffset, false); |
14093 | 212 } |
213 | |
214 /** | |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
215 * Converts a raw index from the bytecodes to a constant pool index by adding a |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
216 * {@link HotSpotVMConfig#constantPoolCpCacheIndexTag constant}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
217 * |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
218 * @param rawIndex index from the bytecode |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
219 * @param opcode bytecode to convert the index for |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
220 * @return constant pool index |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
221 */ |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
222 private static int rawIndexToConstantPoolIndex(int rawIndex, int opcode) { |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
223 int index; |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
224 if (opcode == Bytecodes.INVOKEDYNAMIC) { |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
225 index = rawIndex; |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
226 // See: ConstantPool::is_invokedynamic_index |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
227 assert index < 0 : "not an invokedynamic constant pool index " + index; |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
228 } else { |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
229 assert opcode == Bytecodes.GETFIELD || opcode == Bytecodes.PUTFIELD || opcode == Bytecodes.GETSTATIC || opcode == Bytecodes.PUTSTATIC || opcode == Bytecodes.INVOKEINTERFACE || |
21552
9579a3c62a9e
use skeleton findbugs jar containing only SuppresFBWarnings to avoid external dependency for JVMCI classes (JBS:GRAAL-53)
Doug Simon <doug.simon@oracle.com>
parents:
21431
diff
changeset
|
230 opcode == Bytecodes.INVOKEVIRTUAL || opcode == Bytecodes.INVOKESPECIAL || opcode == Bytecodes.INVOKESTATIC : "unexpected invoke opcode " + opcode; |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
231 index = rawIndex + config().constantPoolCpCacheIndexTag; |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
232 } |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
233 return index; |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
234 } |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
235 |
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
236 /** |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
237 * Decode a constant pool cache index to a constant pool index. |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
238 * |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
239 * See {@code ConstantPool::decode_cpcache_index}. |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
240 * |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
241 * @param index constant pool cache index |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
242 * @return decoded index |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
243 */ |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
244 private static int decodeConstantPoolCacheIndex(int index) { |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
245 if (isInvokedynamicIndex(index)) { |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
246 return decodeInvokedynamicIndex(index); |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
247 } else { |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
248 return index - config().constantPoolCpCacheIndexTag; |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
249 } |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
250 } |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
251 |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
252 /** |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
253 * See {@code ConstantPool::is_invokedynamic_index}. |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
254 */ |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
255 private static boolean isInvokedynamicIndex(int index) { |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
256 return index < 0; |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
257 } |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
258 |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
259 /** |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
260 * See {@code ConstantPool::decode_invokedynamic_index}. |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
261 */ |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
262 private static int decodeInvokedynamicIndex(int i) { |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
263 assert isInvokedynamicIndex(i) : i; |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
264 return ~i; |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
265 } |
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
266 |
22598
ed53e370f04c
Make implementation classes package private.
Roland Schatz <roland.schatz@oracle.com>
parents:
22582
diff
changeset
|
267 long getMetaspaceConstantPool() { |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
268 return metaspaceConstantPool; |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
269 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
270 |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
271 public long getMetaspacePointer() { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
272 return getMetaspaceConstantPool(); |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
273 } |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
274 |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
275 /** |
14093 | 276 * Gets the constant pool tag at index {@code index}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
277 * |
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
|
278 * @param index constant pool index |
14093 | 279 * @return constant pool 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
|
280 */ |
14529 | 281 private JVM_CONSTANT getTagAt(int index) { |
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
|
282 assertBounds(index); |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
283 HotSpotVMConfig config = config(); |
22542
15579668ec3a
renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents:
22541
diff
changeset
|
284 final long metaspaceConstantPoolTags = UNSAFE.getAddress(getMetaspaceConstantPool() + config.constantPoolTagsOffset); |
15579668ec3a
renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents:
22541
diff
changeset
|
285 final int tag = UNSAFE.getByteVolatile(null, metaspaceConstantPoolTags + config.arrayU1DataOffset + index); |
17394
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
286 if (tag == 0) { |
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
287 return null; |
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
288 } |
14529 | 289 return JVM_CONSTANT.getEnum(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
|
290 } |
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
|
291 |
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
|
292 /** |
14093 | 293 * Gets the constant pool entry at index {@code index}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
294 * |
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
|
295 * @param index constant pool index |
14093 | 296 * @return constant pool entry |
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
|
297 */ |
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
|
298 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
|
299 assertBounds(index); |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
300 return UNSAFE.getAddress(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().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
|
301 } |
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
|
302 |
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
|
303 /** |
14093 | 304 * Gets the integer constant pool entry at index {@code index}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
305 * |
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
|
306 * @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
|
307 * @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
|
308 */ |
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
|
309 private int getIntAt(int index) { |
14529 | 310 assertTag(index, JVM_CONSTANT.Integer); |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
311 return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().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
|
312 } |
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
|
313 |
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
|
314 /** |
14093 | 315 * Gets the long constant pool entry at index {@code index}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
316 * |
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
|
317 * @param index constant pool index |
14093 | 318 * @return long constant pool entry |
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
|
319 */ |
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
|
320 private long getLongAt(int index) { |
14529 | 321 assertTag(index, JVM_CONSTANT.Long); |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
322 return UNSAFE.getLong(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().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
|
323 } |
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
|
324 |
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
|
325 /** |
14093 | 326 * Gets the float constant pool entry at index {@code index}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
327 * |
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
|
328 * @param index constant pool index |
14093 | 329 * @return float constant pool entry |
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
|
330 */ |
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
|
331 private float getFloatAt(int index) { |
14529 | 332 assertTag(index, JVM_CONSTANT.Float); |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
333 return UNSAFE.getFloat(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().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
|
334 } |
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
|
335 |
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
|
336 /** |
14093 | 337 * Gets the double constant pool entry at index {@code index}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
338 * |
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
|
339 * @param index constant pool index |
14093 | 340 * @return float constant pool entry |
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
|
341 */ |
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
|
342 private double getDoubleAt(int index) { |
14529 | 343 assertTag(index, JVM_CONSTANT.Double); |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
344 return UNSAFE.getDouble(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().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
|
345 } |
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
|
346 |
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
|
347 /** |
14093 | 348 * Gets the {@code JVM_CONSTANT_NameAndType} constant pool entry at index {@code index}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
349 * |
14093 | 350 * @param index constant pool index |
351 * @return {@code JVM_CONSTANT_NameAndType} constant pool entry | |
352 */ | |
353 private int getNameAndTypeAt(int index) { | |
14529 | 354 assertTag(index, JVM_CONSTANT.NameAndType); |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
355 return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize); |
14093 | 356 } |
357 | |
358 /** | |
359 * Gets the {@code JVM_CONSTANT_NameAndType} reference index constant pool entry at index | |
360 * {@code index}. | |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
361 * |
14093 | 362 * @param index constant pool index |
363 * @return {@code JVM_CONSTANT_NameAndType} reference constant pool entry | |
364 */ | |
365 private int getNameAndTypeRefIndexAt(int index) { | |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
366 return compilerToVM().lookupNameAndTypeRefIndexInPool(this, index); |
14093 | 367 } |
368 | |
369 /** | |
22605
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
370 * Gets the name of a {@code JVM_CONSTANT_NameAndType} constant pool entry referenced by another |
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
371 * entry denoted by {@code which}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
372 * |
22605
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
373 * @param which constant pool index or constant pool cache index |
14093 | 374 * @return name as {@link String} |
375 */ | |
22605
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
376 private String getNameOf(int which) { |
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
377 return compilerToVM().lookupNameInPool(this, which); |
14093 | 378 } |
379 | |
380 /** | |
381 * Gets the name reference index of a {@code JVM_CONSTANT_NameAndType} constant pool entry at | |
382 * index {@code index}. | |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
383 * |
14093 | 384 * @param index constant pool index |
385 * @return name reference index | |
386 */ | |
387 private int getNameRefIndexAt(int index) { | |
388 final int refIndex = getNameAndTypeAt(index); | |
389 // name ref index is in the low 16-bits. | |
390 return refIndex & 0xFFFF; | |
391 } | |
392 | |
393 /** | |
22605
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
394 * Gets the signature of a {@code JVM_CONSTANT_NameAndType} constant pool entry referenced by |
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
395 * another entry denoted by {@code which}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
396 * |
22605
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
397 * @param which constant pool index or constant pool cache index |
14093 | 398 * @return signature as {@link String} |
399 */ | |
22605
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
400 private String getSignatureOf(int which) { |
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
401 return compilerToVM().lookupSignatureInPool(this, which); |
14093 | 402 } |
403 | |
404 /** | |
405 * Gets the signature reference index of a {@code JVM_CONSTANT_NameAndType} constant pool entry | |
406 * at index {@code index}. | |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
407 * |
14093 | 408 * @param index constant pool index |
409 * @return signature reference index | |
410 */ | |
411 private int getSignatureRefIndexAt(int index) { | |
412 final int refIndex = getNameAndTypeAt(index); | |
413 // signature ref index is in the high 16-bits. | |
414 return refIndex >>> 16; | |
415 } | |
416 | |
417 /** | |
22487
a0e5714d5436
Remove Java implementation of HotSpotConstantPool Cache and ResolvedReferences and HotSpotSymbol.
twisti
parents:
22455
diff
changeset
|
418 * Gets the klass reference index constant pool entry at index {@code index}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
419 * |
14093 | 420 * @param index constant pool index |
421 * @return klass reference index | |
422 */ | |
423 private int getKlassRefIndexAt(int index) { | |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
424 return compilerToVM().lookupKlassRefIndexInPool(this, index); |
14093 | 425 } |
426 | |
427 /** | |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
428 * Gets the uncached klass reference index constant pool entry at index {@code index}. See: |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
429 * {@code ConstantPool::uncached_klass_ref_index_at}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
430 * |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
431 * @param index constant pool index |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
432 * @return klass reference index |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
433 */ |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
434 private int getUncachedKlassRefIndexAt(int index) { |
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
435 assertTagIsFieldOrMethod(index); |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
436 final int refIndex = UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolSize + index * runtime().getHostJVMCIBackend().getTarget().wordSize); |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
437 // klass ref index is in the low 16-bits. |
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
438 return refIndex & 0xFFFF; |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
439 } |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
440 |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
441 /** |
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
|
442 * Asserts that the constant pool index {@code index} is in the bounds of the constant pool. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
443 * |
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
|
444 * @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
|
445 */ |
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
|
446 private void assertBounds(int index) { |
13261
0ffe9e4bb364
don't go through VM to create HotSpotResolvedObjectType (part 1)
twisti
parents:
13259
diff
changeset
|
447 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
|
448 } |
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
|
449 |
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
|
450 /** |
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
|
451 * Asserts that the constant pool tag at index {@code index} is equal to {@code tag}. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
452 * |
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
|
453 * @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
|
454 * @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
|
455 */ |
14529 | 456 private void assertTag(int index, JVM_CONSTANT tag) { |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
457 final JVM_CONSTANT tagAt = getTagAt(index); |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
458 assert tagAt == tag : "constant pool tag at index " + index + " is " + tagAt + " but expected " + tag; |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
459 } |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
460 |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
461 /** |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
462 * Asserts that the constant pool tag at index {@code index} is a {@link JVM_CONSTANT#Fieldref}, |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
463 * or a {@link JVM_CONSTANT#MethodRef}, or a {@link JVM_CONSTANT#InterfaceMethodref}. |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
464 * |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
465 * @param index constant pool index |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
466 */ |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
467 private void assertTagIsFieldOrMethod(int index) { |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
468 final JVM_CONSTANT tagAt = getTagAt(index); |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
469 assert tagAt == JVM_CONSTANT.Fieldref || tagAt == JVM_CONSTANT.MethodRef || tagAt == JVM_CONSTANT.InterfaceMethodref : tagAt; |
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
|
470 } |
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
|
471 |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
472 @Override |
9108 | 473 public int length() { |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
474 return UNSAFE.getInt(getMetaspaceConstantPool() + config().constantPoolLengthOffset); |
9108 | 475 } |
476 | |
477 @Override | |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
478 public Object lookupConstant(int cpi) { |
7002
74f0207b82f5
fixed bug in bytecode reconstitution
Doug Simon <doug.simon@oracle.com>
parents:
6588
diff
changeset
|
479 assert cpi != 0; |
14529 | 480 final JVM_CONSTANT tag = getTagAt(cpi); |
481 switch (tag) { | |
482 case Integer: | |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18167
diff
changeset
|
483 return JavaConstant.forInt(getIntAt(cpi)); |
14529 | 484 case Long: |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18167
diff
changeset
|
485 return JavaConstant.forLong(getLongAt(cpi)); |
14529 | 486 case Float: |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18167
diff
changeset
|
487 return JavaConstant.forFloat(getFloatAt(cpi)); |
14529 | 488 case Double: |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18167
diff
changeset
|
489 return JavaConstant.forDouble(getDoubleAt(cpi)); |
14529 | 490 case Class: |
491 case UnresolvedClass: | |
492 case UnresolvedClassInError: | |
493 final int opcode = -1; // opcode is not used | |
494 return lookupType(cpi, opcode); | |
495 case String: | |
22272
b6d504612b3f
fix HotSpotConstantPool#lookupConstant for pseudo-string entries
Andreas Woess <andreas.woess@oracle.com>
parents:
22234
diff
changeset
|
496 /* |
b6d504612b3f
fix HotSpotConstantPool#lookupConstant for pseudo-string entries
Andreas Woess <andreas.woess@oracle.com>
parents:
22234
diff
changeset
|
497 * Normally, we would expect a String here, but anonymous classes can have |
b6d504612b3f
fix HotSpotConstantPool#lookupConstant for pseudo-string entries
Andreas Woess <andreas.woess@oracle.com>
parents:
22234
diff
changeset
|
498 * "pseudo strings" (arbitrary live objects) patched into a String entry. Such |
b6d504612b3f
fix HotSpotConstantPool#lookupConstant for pseudo-string entries
Andreas Woess <andreas.woess@oracle.com>
parents:
22234
diff
changeset
|
499 * entries do not have a symbol in the constant pool slot. |
b6d504612b3f
fix HotSpotConstantPool#lookupConstant for pseudo-string entries
Andreas Woess <andreas.woess@oracle.com>
parents:
22234
diff
changeset
|
500 */ |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
501 Object string = compilerToVM().resolvePossiblyCachedConstantInPool(this, cpi); |
18262
f7d45e2426d4
converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18223
diff
changeset
|
502 return HotSpotObjectConstantImpl.forObject(string); |
14529 | 503 case MethodHandle: |
504 case MethodHandleInError: | |
505 case MethodType: | |
506 case MethodTypeInError: | |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
507 Object obj = compilerToVM().resolveConstantInPool(this, cpi); |
18262
f7d45e2426d4
converted HotSpotObjectConstant to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18223
diff
changeset
|
508 return HotSpotObjectConstantImpl.forObject(obj); |
14529 | 509 default: |
23387
a920338dd4d4
remove JVMCIError and UnsafeUtil classes (JDK-8156759)
Doug Simon <doug.simon@oracle.com>
parents:
23297
diff
changeset
|
510 throw new InternalError("Unknown constant pool 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
|
511 } |
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
|
512 } |
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
|
513 |
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
|
514 @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
|
515 public String lookupUtf8(int cpi) { |
14529 | 516 assertTag(cpi, JVM_CONSTANT.Utf8); |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
517 return compilerToVM().getSymbol(getEntryAt(cpi)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
518 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
519 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
520 @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
|
521 public Signature lookupSignature(int cpi) { |
18540
21384a8fbb64
removed static accesses to HotSpotGraalRuntime from some HotSpot meta API classes
Doug Simon <doug.simon@oracle.com>
parents:
18530
diff
changeset
|
522 return new HotSpotSignature(runtime(), lookupUtf8(cpi)); |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
523 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
524 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
525 @Override |
18187
9619ba4daf4c
Rename Constant to JavaConstant.
Roland Schatz <roland.schatz@oracle.com>
parents:
18167
diff
changeset
|
526 public JavaConstant lookupAppendix(int cpi, int opcode) { |
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
|
527 assert Bytecodes.isInvoke(opcode); |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
528 final int index = rawIndexToConstantPoolIndex(cpi, opcode); |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
529 Object appendix = compilerToVM().lookupAppendixInPool(this, index); |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
530 if (appendix == null) { |
15018
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14979
diff
changeset
|
531 return null; |
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14979
diff
changeset
|
532 } else { |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
533 return HotSpotObjectConstantImpl.forObject(appendix); |
15018
db4254246f9a
Remove Constant.forObject and Constant.asObject to improve compiler/VM separation
Christian Wimmer <christian.wimmer@oracle.com>
parents:
14979
diff
changeset
|
534 } |
8945
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
7084
diff
changeset
|
535 } |
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
7084
diff
changeset
|
536 |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
537 /** |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
538 * Gets a {@link JavaType} corresponding a given resolved or unresolved type. |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
539 * |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
540 * @param type either a ResolvedJavaType or a String naming a unresolved type. |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
541 */ |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
542 private static JavaType getJavaType(final Object type) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
543 if (type instanceof String) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
544 String name = (String) type; |
18540
21384a8fbb64
removed static accesses to HotSpotGraalRuntime from some HotSpot meta API classes
Doug Simon <doug.simon@oracle.com>
parents:
18530
diff
changeset
|
545 return HotSpotUnresolvedJavaType.create(runtime(), "L" + name + ";"); |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
546 } else { |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
547 return (JavaType) type; |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
548 } |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
549 } |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
550 |
8945
7ef66078d837
add basic invokedynamic support
Andreas Woess <andreas.woess@jku.at>
parents:
7084
diff
changeset
|
551 @Override |
6588
b89b5038ad7e
removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
5775
diff
changeset
|
552 public JavaMethod lookupMethod(int cpi, int opcode) { |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
553 final int index = rawIndexToConstantPoolIndex(cpi, opcode); |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
554 final HotSpotResolvedJavaMethod method = compilerToVM().lookupMethodInPool(this, index, (byte) opcode); |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
555 if (method != null) { |
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
556 return method; |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
557 } else { |
14093 | 558 // Get the method's name and signature. |
22605
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
559 String name = getNameOf(index); |
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
560 HotSpotSignature signature = new HotSpotSignature(runtime(), getSignatureOf(index)); |
14093 | 561 if (opcode == Bytecodes.INVOKEDYNAMIC) { |
18540
21384a8fbb64
removed static accesses to HotSpotGraalRuntime from some HotSpot meta API classes
Doug Simon <doug.simon@oracle.com>
parents:
18530
diff
changeset
|
562 HotSpotResolvedObjectType holder = HotSpotResolvedObjectTypeImpl.fromObjectClass(MethodHandle.class); |
14093 | 563 return new HotSpotMethodUnresolved(name, signature, holder); |
564 } else { | |
565 final int klassIndex = getKlassRefIndexAt(index); | |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
566 final Object type = compilerToVM().lookupKlassInPool(this, klassIndex); |
22455
7ad03bf3d4a9
renames related to using metaspace wrappers instead of raw metaspace values
Doug Simon <doug.simon@oracle.com>
parents:
22454
diff
changeset
|
567 JavaType holder = getJavaType(type); |
14093 | 568 return new HotSpotMethodUnresolved(name, signature, holder); |
569 } | |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
570 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
571 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
572 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
573 @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
|
574 public JavaType lookupType(int cpi, int opcode) { |
21252
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
575 final LookupTypeCacheElement elem = this.lastLookupType; |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
576 if (elem != null && elem.lastCpi == cpi) { |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
577 return elem.javaType; |
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
578 } else { |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
579 final Object type = compilerToVM().lookupKlassInPool(this, cpi); |
22454
76af33d4d504
Make jvmci redefinition safe
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22420
diff
changeset
|
580 JavaType result = getJavaType(type); |
21431
90c55b9ad309
only put type in HotSpotConstantPool cache if it's resolved
Lukas Stadler <lukas.stadler@oracle.com>
parents:
21411
diff
changeset
|
581 if (result instanceof ResolvedJavaType) { |
90c55b9ad309
only put type in HotSpotConstantPool cache if it's resolved
Lukas Stadler <lukas.stadler@oracle.com>
parents:
21411
diff
changeset
|
582 this.lastLookupType = new LookupTypeCacheElement(cpi, result); |
90c55b9ad309
only put type in HotSpotConstantPool cache if it's resolved
Lukas Stadler <lukas.stadler@oracle.com>
parents:
21411
diff
changeset
|
583 } |
21252
39ee26e85256
Use boxed cache in HotSpotConstantpool instead of synchronization
Stefan Anzinger <stefan.anzinger@oracle.com>
parents:
21215
diff
changeset
|
584 return result; |
19377
2ff3a30501da
Prototype caching in HotSpotConstantPool.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18867
diff
changeset
|
585 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
586 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
587 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
588 @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
|
589 public JavaField lookupField(int cpi, int opcode) { |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
590 final int index = rawIndexToConstantPoolIndex(cpi, opcode); |
14093 | 591 final int nameAndTypeIndex = getNameAndTypeRefIndexAt(index); |
592 final int nameIndex = getNameRefIndexAt(nameAndTypeIndex); | |
593 String name = lookupUtf8(nameIndex); | |
594 final int typeIndex = getSignatureRefIndexAt(nameAndTypeIndex); | |
595 String typeName = lookupUtf8(typeIndex); | |
14117
2b2f0022900f
removed unnecessary lookupKlassByName method
Doug Simon <doug.simon@oracle.com>
parents:
14093
diff
changeset
|
596 JavaType type = runtime().lookupType(typeName, getHolder(), false); |
14093 | 597 |
598 final int holderIndex = getKlassRefIndexAt(index); | |
599 JavaType holder = lookupType(holderIndex, opcode); | |
600 | |
18223
17c98fad6980
converted HotSpotResolvedObjectType to an interface
Doug Simon <doug.simon@oracle.com>
parents:
18222
diff
changeset
|
601 if (holder instanceof HotSpotResolvedObjectTypeImpl) { |
14093 | 602 long[] info = new long[2]; |
22455
7ad03bf3d4a9
renames related to using metaspace wrappers instead of raw metaspace values
Doug Simon <doug.simon@oracle.com>
parents:
22454
diff
changeset
|
603 HotSpotResolvedObjectTypeImpl resolvedHolder; |
14093 | 604 try { |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
605 resolvedHolder = compilerToVM().resolveFieldInPool(this, index, (byte) opcode, info); |
14093 | 606 } catch (Throwable t) { |
607 /* | |
608 * If there was an exception resolving the field we give up and return an unresolved | |
609 * field. | |
610 */ | |
611 return new HotSpotUnresolvedField(holder, name, type); | |
612 } | |
613 final int flags = (int) info[0]; | |
614 final long offset = info[1]; | |
19377
2ff3a30501da
Prototype caching in HotSpotConstantPool.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18867
diff
changeset
|
615 HotSpotResolvedJavaField result = resolvedHolder.createField(name, type, offset, flags); |
2ff3a30501da
Prototype caching in HotSpotConstantPool.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
18867
diff
changeset
|
616 return result; |
14069
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
617 } else { |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
618 return new HotSpotUnresolvedField(holder, name, type); |
2f37b0e442fe
removed remaining VMToCompiler calls for allocating Graal API objects
Doug Simon <doug.simon@oracle.com>
parents:
14052
diff
changeset
|
619 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
620 } |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
621 |
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
622 @Override |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
623 @SuppressWarnings("fallthrough") |
6588
b89b5038ad7e
removed _'s from method names in CompilerToVM
Doug Simon <doug.simon@oracle.com>
parents:
5775
diff
changeset
|
624 public void loadReferencedType(int cpi, int opcode) { |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
625 int index; |
14093 | 626 switch (opcode) { |
627 case Bytecodes.CHECKCAST: | |
628 case Bytecodes.INSTANCEOF: | |
629 case Bytecodes.NEW: | |
630 case Bytecodes.ANEWARRAY: | |
631 case Bytecodes.MULTIANEWARRAY: | |
632 case Bytecodes.LDC: | |
633 case Bytecodes.LDC_W: | |
634 case Bytecodes.LDC2_W: | |
635 index = cpi; | |
636 break; | |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
637 case Bytecodes.INVOKEDYNAMIC: { |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
638 // invokedynamic instructions point to a constant pool cache entry. |
22581
3884a98ebcde
consistently use HotSpotVMConfig.config() for static access to the HotSpotVMConfig instance
Doug Simon <doug.simon@oracle.com>
parents:
22569
diff
changeset
|
639 index = decodeConstantPoolCacheIndex(cpi) + config().constantPoolCpCacheIndexTag; |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
640 index = compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index); |
14979
5dfaaa91be37
fixed com.oracle.graal.hotspot.meta.HotSpotConstantPool.loadReferencedType(int, int) for invokedynamic
twisti
parents:
14530
diff
changeset
|
641 break; |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
642 } |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
643 case Bytecodes.GETSTATIC: |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
644 case Bytecodes.PUTSTATIC: |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
645 case Bytecodes.GETFIELD: |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
646 case Bytecodes.PUTFIELD: |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
647 case Bytecodes.INVOKEVIRTUAL: |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
648 case Bytecodes.INVOKESPECIAL: |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
649 case Bytecodes.INVOKESTATIC: |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
650 case Bytecodes.INVOKEINTERFACE: { |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
651 // invoke and field instructions point to a constant pool cache entry. |
22488
b5ebb80da4f1
Correct formatting
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22487
diff
changeset
|
652 index = rawIndexToConstantPoolIndex(cpi, opcode); |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
653 index = compilerToVM().constantPoolRemapInstructionOperandFromCache(this, index); |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
654 break; |
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
655 } |
14093 | 656 default: |
23387
a920338dd4d4
remove JVMCIError and UnsafeUtil classes (JDK-8156759)
Doug Simon <doug.simon@oracle.com>
parents:
23297
diff
changeset
|
657 throw new InternalError("Unexpected opcode " + opcode); |
14052
361acb279104
moved to-constant-pool-index conversion up to Java
twisti
parents:
13261
diff
changeset
|
658 } |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
659 |
22089
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
660 final JVM_CONSTANT tag = getTagAt(index); |
17394
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
661 if (tag == null) { |
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
662 assert getTagAt(index - 1) == JVM_CONSTANT.Double || getTagAt(index - 1) == JVM_CONSTANT.Long; |
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
663 return; |
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
664 } |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
665 switch (tag) { |
22013
3904e33db5b3
Make sure HotSpotConstantPool.loadReferencedType resolves invokehandle call sites properly. Fixes eager resolution problems at those call sites.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
666 case MethodRef: |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
667 case Fieldref: |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
668 case InterfaceMethodref: |
22517
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
669 index = getUncachedKlassRefIndexAt(index); |
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
670 // Read the tag only once because it could change between multiple reads. |
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
671 final JVM_CONSTANT klassTag = getTagAt(index); |
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
672 assert klassTag == JVM_CONSTANT.Class || klassTag == JVM_CONSTANT.UnresolvedClass || klassTag == JVM_CONSTANT.UnresolvedClassInError : klassTag; |
0915f5bfdfaa
Adopt some jvmci-9 source changes
Tom Rodriguez <tom.rodriguez@oracle.com>
parents:
22505
diff
changeset
|
673 // fall through |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
674 case Class: |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
675 case UnresolvedClass: |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
676 case UnresolvedClassInError: |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
677 final HotSpotResolvedObjectTypeImpl type = compilerToVM().resolveTypeInPool(this, index); |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
678 Class<?> klass = type.mirror(); |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
679 if (!klass.isPrimitive() && !klass.isArray()) { |
22542
15579668ec3a
renamed constant field to UNSAFE
Doug Simon <doug.simon@oracle.com>
parents:
22541
diff
changeset
|
680 UNSAFE.ensureClassInitialized(klass); |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
681 } |
22089
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
682 switch (tag) { |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
683 case MethodRef: |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
684 if (Bytecodes.isInvokeHandleAlias(opcode)) { |
22234
179db500f6e5
Add Java code for reading the constant pool cache plus sun.reflect.ConstantPool substitutions.
twisti
parents:
22100
diff
changeset
|
685 final int methodRefCacheIndex = rawIndexToConstantPoolIndex(cpi, opcode); |
22089
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
686 if (isInvokeHandle(methodRefCacheIndex, type)) { |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
687 compilerToVM().resolveInvokeHandleInPool(this, methodRefCacheIndex); |
22089
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
688 } |
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
689 } |
22013
3904e33db5b3
Make sure HotSpotConstantPool.loadReferencedType resolves invokehandle call sites properly. Fixes eager resolution problems at those call sites.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
690 } |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
691 break; |
15205
affef8631cf4
Add eager resolving for indy call sites
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15193
diff
changeset
|
692 case InvokeDynamic: |
17394
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
693 if (isInvokedynamicIndex(cpi)) { |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
694 compilerToVM().resolveInvokeDynamicInPool(this, cpi); |
15255
cf6aedb39215
Prevent using loadReferencedType with LDC when the constant pool index refers to InvokeDynamic entry but isn't an invokedynamic index.
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15205
diff
changeset
|
695 } |
15205
affef8631cf4
Add eager resolving for indy call sites
Gilles Duboscq <duboscq@ssw.jku.at>
parents:
15193
diff
changeset
|
696 break; |
14530
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
697 default: |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
698 // nothing |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
699 break; |
d87b84dade7d
moved CompilerToVM.loadReferencedTypeInPool logic into Java
twisti
parents:
14529
diff
changeset
|
700 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
701 } |
17394
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
702 |
22089
13a50cb905b7
Only invokevirtual and invokespecial are invokehandle aliases.
twisti
parents:
22054
diff
changeset
|
703 private boolean isInvokeHandle(int methodRefCacheIndex, HotSpotResolvedObjectTypeImpl klass) { |
22582
232c53e17ea0
added CompilerToVM.compilerToVM() for static access to the CompilerToVM instance
Doug Simon <doug.simon@oracle.com>
parents:
22581
diff
changeset
|
704 assertTag(compilerToVM().constantPoolRemapInstructionOperandFromCache(this, methodRefCacheIndex), JVM_CONSTANT.MethodRef); |
22605
f0ec628cb987
fixed javadoc for lookupNameRefInPool and lookupSignatureRefInPool in CompilerToVM and renamed them to lookupNameInPool and lookupSignatureInPool
Doug Simon <doug.simon@oracle.com>
parents:
22598
diff
changeset
|
705 return ResolvedJavaMethod.isSignaturePolymorphic(klass, getNameOf(methodRefCacheIndex), runtime().getHostJVMCIBackend().getMetaAccess()); |
22013
3904e33db5b3
Make sure HotSpotConstantPool.loadReferencedType resolves invokehandle call sites properly. Fixes eager resolution problems at those call sites.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
706 } |
3904e33db5b3
Make sure HotSpotConstantPool.loadReferencedType resolves invokehandle call sites properly. Fixes eager resolution problems at those call sites.
Gilles Duboscq <gilles.m.duboscq@oracle.com>
parents:
21798
diff
changeset
|
707 |
17394
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
708 @Override |
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
709 public String toString() { |
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
710 HotSpotResolvedObjectType holder = getHolder(); |
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
711 return "HotSpotConstantPool<" + holder.toJavaName() + ">"; |
f520089af480
made HotSpotConstantPool.loadReferencedType handle attempts to resolve constant pool indexes that do not refer to a type
Doug Simon <doug.simon@oracle.com>
parents:
17393
diff
changeset
|
712 } |
3733
e233f5660da4
Added Java files from Maxine project.
Thomas Wuerthinger <thomas.wuerthinger@oracle.com>
parents:
diff
changeset
|
713 } |