author | coleenp |
Mon, 08 Jan 2018 09:46:31 -0500 | |
changeset 48619 | 1703d83b3ffe |
parent 47998 | fb0275c320a0 |
child 49192 | 6734eeef4283 |
permissions | -rw-r--r-- |
33160 | 1 |
/* |
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
2 |
* Copyright (c) 2011, 2018, Oracle and/or its affiliates. All rights reserved. |
33160 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
7 |
* published by the Free Software Foundation. |
|
8 |
* |
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
13 |
* accompanied this code). |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License version |
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
18 |
* |
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
|
20 |
* or visit www.oracle.com if you need additional information or have any |
|
21 |
* questions. |
|
22 |
*/ |
|
23 |
||
24 |
#ifndef SHARE_VM_JVMCI_JVMCIJAVACLASSES_HPP |
|
25 |
#define SHARE_VM_JVMCI_JVMCIJAVACLASSES_HPP |
|
26 |
||
27 |
#include "classfile/systemDictionary.hpp" |
|
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47668
diff
changeset
|
28 |
#include "oops/access.inline.hpp" |
33160 | 29 |
#include "oops/instanceMirrorKlass.hpp" |
35498
392b50de06c6
8146401: Clean up oop.hpp: add inline directives and fix header files
goetz
parents:
34502
diff
changeset
|
30 |
#include "oops/oop.inline.hpp" |
33160 | 31 |
|
32 |
class JVMCIJavaClasses : AllStatic { |
|
33 |
public: |
|
34192
6da4892d7cd5
8142511: [JVMCI] must eagerly initialize classes with static fields accessed by JVMCI native code
twisti
parents:
34185
diff
changeset
|
34 |
static void compute_offsets(TRAPS); |
33160 | 35 |
}; |
36 |
||
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
37 |
/* This macro defines the structure of the JVMCI classes accessed from VM code. |
33160 | 38 |
* It will generate classes with accessors similar to javaClasses.hpp, but with specializations for oops, Handles and jni handles. |
39 |
* |
|
40 |
* The public interface of these classes will look like this: |
|
41 |
||
42 |
* class StackSlot : AllStatic { |
|
43 |
* public: |
|
44 |
* static Klass* klass(); |
|
45 |
* static jint index(oop obj); |
|
46 |
* static jint index(Handle obj); |
|
47 |
* static jint index(jobject obj); |
|
48 |
* static void set_index(oop obj, jint x); |
|
49 |
* static void set_index(Handle obj, jint x); |
|
50 |
* static void set_index(jobject obj, jint x); |
|
51 |
* }; |
|
52 |
* |
|
53 |
*/ |
|
54 |
||
55 |
#define COMPILER_CLASSES_DO(start_class, end_class, char_field, int_field, boolean_field, long_field, float_field, oop_field, typeArrayOop_field, objArrayOop_field, static_oop_field, static_objArrayOop_field, static_int_field, static_boolean_field) \ |
|
56 |
start_class(Architecture) \ |
|
57 |
oop_field(Architecture, wordKind, "Ljdk/vm/ci/meta/PlatformKind;") \ |
|
58 |
end_class \ |
|
59 |
start_class(TargetDescription) \ |
|
60 |
oop_field(TargetDescription, arch, "Ljdk/vm/ci/code/Architecture;") \ |
|
61 |
end_class \ |
|
62 |
start_class(HotSpotResolvedObjectTypeImpl) \ |
|
63 |
oop_field(HotSpotResolvedObjectTypeImpl, javaClass, "Ljava/lang/Class;") \ |
|
64 |
end_class \ |
|
65 |
start_class(HotSpotResolvedJavaMethodImpl) \ |
|
66 |
long_field(HotSpotResolvedJavaMethodImpl, metaspaceMethod) \ |
|
67 |
end_class \ |
|
68 |
start_class(InstalledCode) \ |
|
69 |
long_field(InstalledCode, address) \ |
|
33632 | 70 |
long_field(InstalledCode, entryPoint) \ |
33160 | 71 |
long_field(InstalledCode, version) \ |
72 |
oop_field(InstalledCode, name, "Ljava/lang/String;") \ |
|
73 |
end_class \ |
|
74 |
start_class(HotSpotInstalledCode) \ |
|
75 |
int_field(HotSpotInstalledCode, size) \ |
|
76 |
long_field(HotSpotInstalledCode, codeStart) \ |
|
77 |
int_field(HotSpotInstalledCode, codeSize) \ |
|
78 |
end_class \ |
|
79 |
start_class(HotSpotNmethod) \ |
|
80 |
boolean_field(HotSpotNmethod, isDefault) \ |
|
81 |
end_class \ |
|
82 |
start_class(HotSpotCompiledCode) \ |
|
83 |
oop_field(HotSpotCompiledCode, name, "Ljava/lang/String;") \ |
|
84 |
typeArrayOop_field(HotSpotCompiledCode, targetCode, "[B") \ |
|
85 |
int_field(HotSpotCompiledCode, targetCodeSize) \ |
|
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
86 |
objArrayOop_field(HotSpotCompiledCode, sites, "[Ljdk/vm/ci/code/site/Site;") \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
87 |
objArrayOop_field(HotSpotCompiledCode, assumptions, "[Ljdk/vm/ci/meta/Assumptions$Assumption;") \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
88 |
objArrayOop_field(HotSpotCompiledCode, methods, "[Ljdk/vm/ci/meta/ResolvedJavaMethod;") \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
89 |
objArrayOop_field(HotSpotCompiledCode, comments, "[Ljdk/vm/ci/hotspot/HotSpotCompiledCode$Comment;") \ |
33160 | 90 |
typeArrayOop_field(HotSpotCompiledCode, dataSection, "[B") \ |
91 |
int_field(HotSpotCompiledCode, dataSectionAlignment) \ |
|
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
92 |
objArrayOop_field(HotSpotCompiledCode, dataSectionPatches, "[Ljdk/vm/ci/code/site/DataPatch;") \ |
33160 | 93 |
boolean_field(HotSpotCompiledCode, isImmutablePIC) \ |
94 |
int_field(HotSpotCompiledCode, totalFrameSize) \ |
|
35823
59a847ec6ee3
8146608: [JVMCI] DebugInfo Tests on DeoptimizeALot runs fails in assert(_pc == *pc_addr || pc == *pc_addr) frame::patch_pc() /frame_x86.cpp:285
rschatz
parents:
35606
diff
changeset
|
95 |
oop_field(HotSpotCompiledCode, deoptRescueSlot, "Ljdk/vm/ci/code/StackSlot;") \ |
33160 | 96 |
end_class \ |
97 |
start_class(HotSpotCompiledCode_Comment) \ |
|
98 |
oop_field(HotSpotCompiledCode_Comment, text, "Ljava/lang/String;") \ |
|
99 |
int_field(HotSpotCompiledCode_Comment, pcOffset) \ |
|
100 |
end_class \ |
|
101 |
start_class(HotSpotCompiledNmethod) \ |
|
102 |
oop_field(HotSpotCompiledNmethod, method, "Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;") \ |
|
103 |
oop_field(HotSpotCompiledNmethod, installationFailureMessage, "Ljava/lang/String;") \ |
|
104 |
int_field(HotSpotCompiledNmethod, entryBCI) \ |
|
105 |
int_field(HotSpotCompiledNmethod, id) \ |
|
106 |
long_field(HotSpotCompiledNmethod, jvmciEnv) \ |
|
107 |
boolean_field(HotSpotCompiledNmethod, hasUnsafeAccess) \ |
|
108 |
end_class \ |
|
109 |
start_class(HotSpotJVMCIMetaAccessContext) \ |
|
110 |
static_objArrayOop_field(HotSpotJVMCIMetaAccessContext, allContexts, "[Ljava/lang/ref/WeakReference;") \ |
|
111 |
objArrayOop_field(HotSpotJVMCIMetaAccessContext, metadataRoots, "[Ljava/lang/Object;") \ |
|
112 |
end_class \ |
|
113 |
start_class(HotSpotForeignCallTarget) \ |
|
114 |
long_field(HotSpotForeignCallTarget, address) \ |
|
115 |
end_class \ |
|
39423
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
116 |
start_class(VMField) \ |
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
117 |
oop_field(VMField, name, "Ljava/lang/String;") \ |
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
118 |
oop_field(VMField, type, "Ljava/lang/String;") \ |
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
119 |
long_field(VMField, offset) \ |
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
120 |
long_field(VMField, address) \ |
43962 | 121 |
oop_field(VMField, value, "Ljava/lang/Object;") \ |
39423
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
122 |
end_class \ |
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
123 |
start_class(VMFlag) \ |
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
124 |
oop_field(VMFlag, name, "Ljava/lang/String;") \ |
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
125 |
oop_field(VMFlag, type, "Ljava/lang/String;") \ |
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
126 |
oop_field(VMFlag, value, "Ljava/lang/Object;") \ |
0f8dc3693499
8159167: [JVMCI] fix HotSpotVMConfig startup performance
rschatz
parents:
38695
diff
changeset
|
127 |
end_class \ |
40878
5d87104b10d5
8164358: [JVMCI] expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI
dnsimon
parents:
39423
diff
changeset
|
128 |
start_class(VMIntrinsicMethod) \ |
5d87104b10d5
8164358: [JVMCI] expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI
dnsimon
parents:
39423
diff
changeset
|
129 |
oop_field(VMIntrinsicMethod, declaringClass, "Ljava/lang/String;") \ |
5d87104b10d5
8164358: [JVMCI] expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI
dnsimon
parents:
39423
diff
changeset
|
130 |
oop_field(VMIntrinsicMethod, name, "Ljava/lang/String;") \ |
5d87104b10d5
8164358: [JVMCI] expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI
dnsimon
parents:
39423
diff
changeset
|
131 |
oop_field(VMIntrinsicMethod, descriptor, "Ljava/lang/String;") \ |
5d87104b10d5
8164358: [JVMCI] expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI
dnsimon
parents:
39423
diff
changeset
|
132 |
int_field(VMIntrinsicMethod, id) \ |
5d87104b10d5
8164358: [JVMCI] expose Hotspot intrinsics and HotSpotIntrinsicCandidate info to JVMCI
dnsimon
parents:
39423
diff
changeset
|
133 |
end_class \ |
33160 | 134 |
start_class(Assumptions_NoFinalizableSubclass) \ |
135 |
oop_field(Assumptions_NoFinalizableSubclass, receiverType, "Ljdk/vm/ci/meta/ResolvedJavaType;") \ |
|
136 |
end_class \ |
|
137 |
start_class(Assumptions_ConcreteSubtype) \ |
|
138 |
oop_field(Assumptions_ConcreteSubtype, context, "Ljdk/vm/ci/meta/ResolvedJavaType;") \ |
|
139 |
oop_field(Assumptions_ConcreteSubtype, subtype, "Ljdk/vm/ci/meta/ResolvedJavaType;") \ |
|
140 |
end_class \ |
|
141 |
start_class(Assumptions_LeafType) \ |
|
142 |
oop_field(Assumptions_LeafType, context, "Ljdk/vm/ci/meta/ResolvedJavaType;") \ |
|
143 |
end_class \ |
|
144 |
start_class(Assumptions_ConcreteMethod) \ |
|
145 |
oop_field(Assumptions_ConcreteMethod, method, "Ljdk/vm/ci/meta/ResolvedJavaMethod;") \ |
|
146 |
oop_field(Assumptions_ConcreteMethod, context, "Ljdk/vm/ci/meta/ResolvedJavaType;") \ |
|
147 |
oop_field(Assumptions_ConcreteMethod, impl, "Ljdk/vm/ci/meta/ResolvedJavaMethod;") \ |
|
148 |
end_class \ |
|
149 |
start_class(Assumptions_CallSiteTargetValue) \ |
|
150 |
oop_field(Assumptions_CallSiteTargetValue, callSite, "Ljava/lang/invoke/CallSite;") \ |
|
151 |
oop_field(Assumptions_CallSiteTargetValue, methodHandle, "Ljava/lang/invoke/MethodHandle;") \ |
|
152 |
end_class \ |
|
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
153 |
start_class(site_Site) \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
154 |
int_field(site_Site, pcOffset) \ |
33160 | 155 |
end_class \ |
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
156 |
start_class(site_Call) \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
157 |
oop_field(site_Call, target, "Ljdk/vm/ci/meta/InvokeTarget;") \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
158 |
oop_field(site_Call, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ |
33160 | 159 |
end_class \ |
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
160 |
start_class(site_DataPatch) \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
161 |
oop_field(site_DataPatch, reference, "Ljdk/vm/ci/code/site/Reference;") \ |
33160 | 162 |
end_class \ |
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
163 |
start_class(site_ConstantReference) \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
164 |
oop_field(site_ConstantReference, constant, "Ljdk/vm/ci/meta/VMConstant;") \ |
33160 | 165 |
end_class \ |
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
166 |
start_class(site_DataSectionReference) \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
167 |
int_field(site_DataSectionReference, offset) \ |
33160 | 168 |
end_class \ |
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
169 |
start_class(site_InfopointReason) \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
170 |
static_oop_field(site_InfopointReason, SAFEPOINT, "Ljdk/vm/ci/code/site/InfopointReason;") \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
171 |
static_oop_field(site_InfopointReason, CALL, "Ljdk/vm/ci/code/site/InfopointReason;") \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
172 |
static_oop_field(site_InfopointReason, IMPLICIT_EXCEPTION, "Ljdk/vm/ci/code/site/InfopointReason;") \ |
33160 | 173 |
end_class \ |
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
174 |
start_class(site_Infopoint) \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
175 |
oop_field(site_Infopoint, debugInfo, "Ljdk/vm/ci/code/DebugInfo;") \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
176 |
oop_field(site_Infopoint, reason, "Ljdk/vm/ci/code/site/InfopointReason;") \ |
33160 | 177 |
end_class \ |
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
178 |
start_class(site_ExceptionHandler) \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
179 |
int_field(site_ExceptionHandler, handlerPos) \ |
33160 | 180 |
end_class \ |
35582
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
181 |
start_class(site_Mark) \ |
c32a0cc19877
8147599: [JVMCI] simplify code installation interface
rschatz
parents:
34502
diff
changeset
|
182 |
oop_field(site_Mark, id, "Ljava/lang/Object;") \ |
33160 | 183 |
end_class \ |
38695 | 184 |
start_class(HotSpotCompilationRequestResult) \ |
185 |
oop_field(HotSpotCompilationRequestResult, failureMessage, "Ljava/lang/String;") \ |
|
186 |
boolean_field(HotSpotCompilationRequestResult, retry) \ |
|
187 |
int_field(HotSpotCompilationRequestResult, inlinedBytecodes) \ |
|
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35582
diff
changeset
|
188 |
end_class \ |
33160 | 189 |
start_class(DebugInfo) \ |
190 |
oop_field(DebugInfo, bytecodePosition, "Ljdk/vm/ci/code/BytecodePosition;") \ |
|
191 |
oop_field(DebugInfo, referenceMap, "Ljdk/vm/ci/code/ReferenceMap;") \ |
|
192 |
oop_field(DebugInfo, calleeSaveInfo, "Ljdk/vm/ci/code/RegisterSaveLayout;") \ |
|
193 |
objArrayOop_field(DebugInfo, virtualObjectMapping, "[Ljdk/vm/ci/code/VirtualObject;") \ |
|
194 |
end_class \ |
|
195 |
start_class(HotSpotReferenceMap) \ |
|
196 |
objArrayOop_field(HotSpotReferenceMap, objects, "[Ljdk/vm/ci/code/Location;") \ |
|
197 |
objArrayOop_field(HotSpotReferenceMap, derivedBase, "[Ljdk/vm/ci/code/Location;") \ |
|
198 |
typeArrayOop_field(HotSpotReferenceMap, sizeInBytes, "[I") \ |
|
199 |
int_field(HotSpotReferenceMap, maxRegisterSize) \ |
|
200 |
end_class \ |
|
201 |
start_class(RegisterSaveLayout) \ |
|
202 |
objArrayOop_field(RegisterSaveLayout, registers, "[Ljdk/vm/ci/code/Register;") \ |
|
203 |
typeArrayOop_field(RegisterSaveLayout, slots, "[I") \ |
|
204 |
end_class \ |
|
205 |
start_class(BytecodeFrame) \ |
|
206 |
objArrayOop_field(BytecodeFrame, values, "[Ljdk/vm/ci/meta/JavaValue;") \ |
|
207 |
objArrayOop_field(BytecodeFrame, slotKinds, "[Ljdk/vm/ci/meta/JavaKind;") \ |
|
208 |
int_field(BytecodeFrame, numLocals) \ |
|
209 |
int_field(BytecodeFrame, numStack) \ |
|
210 |
int_field(BytecodeFrame, numLocks) \ |
|
211 |
boolean_field(BytecodeFrame, rethrowException) \ |
|
212 |
boolean_field(BytecodeFrame, duringCall) \ |
|
213 |
static_int_field(BytecodeFrame, BEFORE_BCI) \ |
|
214 |
end_class \ |
|
215 |
start_class(BytecodePosition) \ |
|
216 |
oop_field(BytecodePosition, caller, "Ljdk/vm/ci/code/BytecodePosition;") \ |
|
217 |
oop_field(BytecodePosition, method, "Ljdk/vm/ci/meta/ResolvedJavaMethod;") \ |
|
218 |
int_field(BytecodePosition, bci) \ |
|
219 |
end_class \ |
|
220 |
start_class(JavaConstant) \ |
|
221 |
end_class \ |
|
222 |
start_class(PrimitiveConstant) \ |
|
223 |
oop_field(PrimitiveConstant, kind, "Ljdk/vm/ci/meta/JavaKind;") \ |
|
224 |
long_field(PrimitiveConstant, primitive) \ |
|
225 |
end_class \ |
|
226 |
start_class(RawConstant) \ |
|
227 |
long_field(RawConstant, primitive) \ |
|
228 |
end_class \ |
|
229 |
start_class(NullConstant) \ |
|
230 |
end_class \ |
|
231 |
start_class(HotSpotCompressedNullConstant) \ |
|
232 |
end_class \ |
|
233 |
start_class(HotSpotObjectConstantImpl) \ |
|
234 |
oop_field(HotSpotObjectConstantImpl, object, "Ljava/lang/Object;") \ |
|
235 |
boolean_field(HotSpotObjectConstantImpl, compressed) \ |
|
236 |
end_class \ |
|
237 |
start_class(HotSpotMetaspaceConstantImpl) \ |
|
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
238 |
oop_field(HotSpotMetaspaceConstantImpl, metaspaceObject, "Ljdk/vm/ci/hotspot/MetaspaceWrapperObject;") \ |
33160 | 239 |
boolean_field(HotSpotMetaspaceConstantImpl, compressed) \ |
240 |
end_class \ |
|
241 |
start_class(HotSpotSentinelConstant) \ |
|
242 |
end_class \ |
|
243 |
start_class(JavaKind) \ |
|
244 |
char_field(JavaKind, typeChar) \ |
|
245 |
static_oop_field(JavaKind, Boolean, "Ljdk/vm/ci/meta/JavaKind;"); \ |
|
246 |
static_oop_field(JavaKind, Byte, "Ljdk/vm/ci/meta/JavaKind;"); \ |
|
247 |
static_oop_field(JavaKind, Char, "Ljdk/vm/ci/meta/JavaKind;"); \ |
|
248 |
static_oop_field(JavaKind, Short, "Ljdk/vm/ci/meta/JavaKind;"); \ |
|
249 |
static_oop_field(JavaKind, Int, "Ljdk/vm/ci/meta/JavaKind;"); \ |
|
250 |
static_oop_field(JavaKind, Long, "Ljdk/vm/ci/meta/JavaKind;"); \ |
|
251 |
end_class \ |
|
38692
54a84b7f3721
8156942: [JVMCI] replace LIRKind with abstract base class
rschatz
parents:
38678
diff
changeset
|
252 |
start_class(ValueKind) \ |
54a84b7f3721
8156942: [JVMCI] replace LIRKind with abstract base class
rschatz
parents:
38678
diff
changeset
|
253 |
oop_field(ValueKind, platformKind, "Ljdk/vm/ci/meta/PlatformKind;") \ |
33160 | 254 |
end_class \ |
255 |
start_class(Value) \ |
|
38692
54a84b7f3721
8156942: [JVMCI] replace LIRKind with abstract base class
rschatz
parents:
38678
diff
changeset
|
256 |
oop_field(Value, valueKind, "Ljdk/vm/ci/meta/ValueKind;") \ |
33160 | 257 |
static_oop_field(Value, ILLEGAL, "Ljdk/vm/ci/meta/AllocatableValue;"); \ |
258 |
end_class \ |
|
259 |
start_class(RegisterValue) \ |
|
260 |
oop_field(RegisterValue, reg, "Ljdk/vm/ci/code/Register;") \ |
|
261 |
end_class \ |
|
262 |
start_class(code_Location) \ |
|
263 |
oop_field(code_Location, reg, "Ljdk/vm/ci/code/Register;") \ |
|
264 |
int_field(code_Location, offset) \ |
|
265 |
end_class \ |
|
266 |
start_class(code_Register) \ |
|
267 |
int_field(code_Register, number) \ |
|
268 |
int_field(code_Register, encoding) \ |
|
269 |
end_class \ |
|
270 |
start_class(StackSlot) \ |
|
271 |
int_field(StackSlot, offset) \ |
|
272 |
boolean_field(StackSlot, addFrameSize) \ |
|
273 |
end_class \ |
|
274 |
start_class(VirtualObject) \ |
|
275 |
int_field(VirtualObject, id) \ |
|
276 |
oop_field(VirtualObject, type, "Ljdk/vm/ci/meta/ResolvedJavaType;") \ |
|
277 |
objArrayOop_field(VirtualObject, values, "[Ljdk/vm/ci/meta/JavaValue;") \ |
|
278 |
objArrayOop_field(VirtualObject, slotKinds, "[Ljdk/vm/ci/meta/JavaKind;") \ |
|
279 |
end_class \ |
|
280 |
start_class(StackLockValue) \ |
|
281 |
oop_field(StackLockValue, owner, "Ljdk/vm/ci/meta/JavaValue;") \ |
|
33632 | 282 |
oop_field(StackLockValue, slot, "Ljdk/vm/ci/meta/AllocatableValue;") \ |
33160 | 283 |
boolean_field(StackLockValue, eliminated) \ |
284 |
end_class \ |
|
33632 | 285 |
start_class(HotSpotSpeculationLog) \ |
286 |
oop_field(HotSpotSpeculationLog, lastFailed, "Ljava/lang/Object;") \ |
|
33160 | 287 |
end_class \ |
288 |
start_class(HotSpotStackFrameReference) \ |
|
289 |
oop_field(HotSpotStackFrameReference, compilerToVM, "Ljdk/vm/ci/hotspot/CompilerToVM;") \ |
|
290 |
long_field(HotSpotStackFrameReference, stackPointer) \ |
|
291 |
int_field(HotSpotStackFrameReference, frameNumber) \ |
|
292 |
int_field(HotSpotStackFrameReference, bci) \ |
|
293 |
oop_field(HotSpotStackFrameReference, method, "Ljdk/vm/ci/hotspot/HotSpotResolvedJavaMethod;") \ |
|
294 |
objArrayOop_field(HotSpotStackFrameReference, locals, "[Ljava/lang/Object;") \ |
|
295 |
typeArrayOop_field(HotSpotStackFrameReference, localIsVirtual, "[Z") \ |
|
296 |
end_class \ |
|
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
297 |
start_class(HotSpotMetaData) \ |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
298 |
typeArrayOop_field(HotSpotMetaData, pcDescBytes, "[B") \ |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
299 |
typeArrayOop_field(HotSpotMetaData, scopesDescBytes, "[B") \ |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
300 |
typeArrayOop_field(HotSpotMetaData, relocBytes, "[B") \ |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
301 |
typeArrayOop_field(HotSpotMetaData, exceptionBytes, "[B") \ |
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
302 |
typeArrayOop_field(HotSpotMetaData, oopMaps, "[B") \ |
47668 | 303 |
objArrayOop_field(HotSpotMetaData, metadata, "[Ljava/lang/Object;") \ |
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
304 |
end_class \ |
33160 | 305 |
start_class(HotSpotConstantPool) \ |
306 |
long_field(HotSpotConstantPool, metaspaceConstantPool) \ |
|
307 |
end_class \ |
|
33632 | 308 |
start_class(HotSpotJVMCIRuntime) \ |
35592
5814f874d736
8147432: JVMCI should report bailouts in PrintCompilation output
never
parents:
35582
diff
changeset
|
309 |
objArrayOop_field(HotSpotJVMCIRuntime, trivialPrefixes, "[Ljava/lang/String;") \ |
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
310 |
int_field(HotSpotJVMCIRuntime, compilationLevelAdjustment) \ |
33632 | 311 |
end_class \ |
33160 | 312 |
/* end*/ |
313 |
||
314 |
#define START_CLASS(name) \ |
|
315 |
class name : AllStatic { \ |
|
316 |
private: \ |
|
317 |
friend class JVMCICompiler; \ |
|
318 |
static void check(oop obj, const char* field_name, int offset) { \ |
|
33198 | 319 |
assert(obj != NULL, "NULL field access of %s.%s", #name, field_name); \ |
320 |
assert(obj->is_a(SystemDictionary::name##_klass()), "wrong class, " #name " expected, found %s", obj->klass()->external_name()); \ |
|
33160 | 321 |
assert(offset != 0, "must be valid offset"); \ |
322 |
} \ |
|
38666
5ff19807abd5
8152311: [JVMCI] allow JVMCI compiler to change the compilation policy for a method
dnsimon
parents:
36842
diff
changeset
|
323 |
static void compute_offsets(TRAPS); \ |
33160 | 324 |
public: \ |
33602 | 325 |
static InstanceKlass* klass() { return SystemDictionary::name##_klass(); } |
33160 | 326 |
|
327 |
#define END_CLASS }; |
|
328 |
||
329 |
#define FIELD(name, type, accessor, cast) \ |
|
330 |
static int _##name##_offset; \ |
|
331 |
static type name(oop obj) { check(obj, #name, _##name##_offset); return cast obj->accessor(_##name##_offset); } \ |
|
34165 | 332 |
static type name(Handle obj) { check(obj(), #name, _##name##_offset); return cast obj->accessor(_##name##_offset); } \ |
33160 | 333 |
static type name(jobject obj) { check(JNIHandles::resolve(obj), #name, _##name##_offset); return cast JNIHandles::resolve(obj)->accessor(_##name##_offset); } \ |
334 |
static void set_##name(oop obj, type x) { check(obj, #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); } \ |
|
34165 | 335 |
static void set_##name(Handle obj, type x) { check(obj(), #name, _##name##_offset); obj->accessor##_put(_##name##_offset, x); } \ |
33160 | 336 |
static void set_##name(jobject obj, type x) { check(JNIHandles::resolve(obj), #name, _##name##_offset); JNIHandles::resolve(obj)->accessor##_put(_##name##_offset, x); } |
337 |
||
338 |
#define EMPTY_CAST |
|
339 |
#define CHAR_FIELD(klass, name) FIELD(name, jchar, char_field, EMPTY_CAST) |
|
340 |
#define INT_FIELD(klass, name) FIELD(name, jint, int_field, EMPTY_CAST) |
|
341 |
#define BOOLEAN_FIELD(klass, name) FIELD(name, jboolean, bool_field, EMPTY_CAST) |
|
342 |
#define LONG_FIELD(klass, name) FIELD(name, jlong, long_field, EMPTY_CAST) |
|
343 |
#define FLOAT_FIELD(klass, name) FIELD(name, jfloat, float_field, EMPTY_CAST) |
|
344 |
#define OOP_FIELD(klass, name, signature) FIELD(name, oop, obj_field, EMPTY_CAST) |
|
345 |
#define OBJARRAYOOP_FIELD(klass, name, signature) FIELD(name, objArrayOop, obj_field, (objArrayOop)) |
|
346 |
#define TYPEARRAYOOP_FIELD(klass, name, signature) FIELD(name, typeArrayOop, obj_field, (typeArrayOop)) |
|
347 |
#define STATIC_OOP_FIELD(klassName, name, signature) STATIC_OOPISH_FIELD(klassName, name, oop, signature) |
|
348 |
#define STATIC_OBJARRAYOOP_FIELD(klassName, name, signature) STATIC_OOPISH_FIELD(klassName, name, objArrayOop, signature) |
|
349 |
#define STATIC_OOPISH_FIELD(klassName, name, type, signature) \ |
|
350 |
static int _##name##_offset; \ |
|
351 |
static type name() { \ |
|
352 |
assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ |
|
353 |
InstanceKlass* ik = klassName::klass(); \ |
|
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
354 |
address addr = ik->static_field_addr(_##name##_offset); \ |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47668
diff
changeset
|
355 |
oop result = HeapAccess<>::oop_load((HeapWord*)addr); \ |
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47668
diff
changeset
|
356 |
return type(result); \ |
33160 | 357 |
} \ |
358 |
static void set_##name(type x) { \ |
|
359 |
assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ |
|
360 |
assert(klassName::klass() != NULL, "Class not yet loaded: " #klassName); \ |
|
361 |
InstanceKlass* ik = klassName::klass(); \ |
|
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
362 |
address addr = ik->static_field_addr(_##name##_offset); \ |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47668
diff
changeset
|
363 |
HeapAccess<>::oop_store((HeapWord*)addr, x); \ |
33160 | 364 |
} |
365 |
#define STATIC_PRIMITIVE_FIELD(klassName, name, jtypename) \ |
|
366 |
static int _##name##_offset; \ |
|
367 |
static jtypename name() { \ |
|
368 |
assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ |
|
369 |
InstanceKlass* ik = klassName::klass(); \ |
|
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
370 |
address addr = ik->static_field_addr(_##name##_offset); \ |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47668
diff
changeset
|
371 |
return HeapAccess<>::load((jtypename*)addr); \ |
33160 | 372 |
} \ |
373 |
static void set_##name(jtypename x) { \ |
|
374 |
assert(klassName::klass() != NULL && klassName::klass()->is_linked(), "Class not yet linked: " #klassName); \ |
|
375 |
InstanceKlass* ik = klassName::klass(); \ |
|
48619
1703d83b3ffe
8058259: compute_offset() is confusing for static fields
coleenp
parents:
47998
diff
changeset
|
376 |
address addr = ik->static_field_addr(_##name##_offset); \ |
47998
fb0275c320a0
8189871: Refactor GC barriers to use declarative semantics
eosterlund
parents:
47668
diff
changeset
|
377 |
HeapAccess<>::store((jtypename*)addr, x); \ |
33160 | 378 |
} |
379 |
||
380 |
#define STATIC_INT_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jint) |
|
381 |
#define STATIC_BOOLEAN_FIELD(klassName, name) STATIC_PRIMITIVE_FIELD(klassName, name, jboolean) |
|
382 |
||
383 |
COMPILER_CLASSES_DO(START_CLASS, END_CLASS, CHAR_FIELD, INT_FIELD, BOOLEAN_FIELD, LONG_FIELD, FLOAT_FIELD, OOP_FIELD, TYPEARRAYOOP_FIELD, OBJARRAYOOP_FIELD, STATIC_OOP_FIELD, STATIC_OBJARRAYOOP_FIELD, STATIC_INT_FIELD, STATIC_BOOLEAN_FIELD) |
|
384 |
#undef START_CLASS |
|
385 |
#undef END_CLASS |
|
386 |
#undef FIELD |
|
387 |
#undef CHAR_FIELD |
|
388 |
#undef INT_FIELD |
|
389 |
#undef BOOLEAN_FIELD |
|
390 |
#undef LONG_FIELD |
|
391 |
#undef FLOAT_FIELD |
|
392 |
#undef OOP_FIELD |
|
393 |
#undef TYPEARRAYOOP_FIELD |
|
394 |
#undef OBJARRAYOOP_FIELD |
|
395 |
#undef STATIC_OOPISH_FIELD |
|
396 |
#undef STATIC_OOP_FIELD |
|
397 |
#undef STATIC_OBJARRAYOOP_FIELD |
|
398 |
#undef STATIC_INT_FIELD |
|
399 |
#undef STATIC_BOOLEAN_FIELD |
|
400 |
#undef EMPTY_CAST |
|
401 |
||
34192
6da4892d7cd5
8142511: [JVMCI] must eagerly initialize classes with static fields accessed by JVMCI native code
twisti
parents:
34185
diff
changeset
|
402 |
void compute_offset(int &dest_offset, Klass* klass, const char* name, const char* signature, bool static_field, TRAPS); |
33160 | 403 |
|
404 |
#endif // SHARE_VM_JVMCI_JVMCIJAVACLASSES_HPP |