Mercurial > hg > graal-jvmci-8
comparison src/share/vm/graal/graalJavaAccess.hpp @ 6674:fd71ca8c5f88
VM infrstructure for OnStackReplacement
author | Lukas Stadler <lukas.stadler@jku.at> |
---|---|
date | Wed, 07 Nov 2012 13:18:04 +0100 |
parents | 2463eb24b644 |
children | e522a00b91aa |
comparison
equal
deleted
inserted
replaced
6673:a52320a6bbda | 6674:fd71ca8c5f88 |
---|---|
27 void graal_compute_offsets(); | 27 void graal_compute_offsets(); |
28 | 28 |
29 #include "classfile/systemDictionary.hpp" | 29 #include "classfile/systemDictionary.hpp" |
30 #include "oops/instanceMirrorKlass.hpp" | 30 #include "oops/instanceMirrorKlass.hpp" |
31 | 31 |
32 /* This macro defines the structure of the InstalledCode - classes. | 32 /* This macro defines the structure of the CompilationResult - classes. |
33 * It will generate classes with accessors similar to javaClasses.hpp, but with specializations for oops, Handles and jni handles. | 33 * It will generate classes with accessors similar to javaClasses.hpp, but with specializations for oops, Handles and jni handles. |
34 * | 34 * |
35 * The public interface of these classes will look like this: | 35 * The public interface of these classes will look like this: |
36 | 36 |
37 * class StackSlot : AllStatic { | 37 * class StackSlot : AllStatic { |
70 int_field(HotSpotResolvedJavaMethod, codeSize) \ | 70 int_field(HotSpotResolvedJavaMethod, codeSize) \ |
71 int_field(HotSpotResolvedJavaMethod, accessFlags) \ | 71 int_field(HotSpotResolvedJavaMethod, accessFlags) \ |
72 int_field(HotSpotResolvedJavaMethod, maxLocals) \ | 72 int_field(HotSpotResolvedJavaMethod, maxLocals) \ |
73 int_field(HotSpotResolvedJavaMethod, maxStackSize) \ | 73 int_field(HotSpotResolvedJavaMethod, maxStackSize) \ |
74 boolean_field(HotSpotResolvedJavaMethod, canBeInlined) \ | 74 boolean_field(HotSpotResolvedJavaMethod, canBeInlined) \ |
75 end_class \ | 75 end_class \ |
76 start_class(HotSpotMethodData) \ | 76 start_class(HotSpotMethodData) \ |
77 oop_field(HotSpotMethodData, hotspotMirror, "Ljava/lang/Object;") \ | 77 oop_field(HotSpotMethodData, hotspotMirror, "Ljava/lang/Object;") \ |
78 int_field(HotSpotMethodData, normalDataSize) \ | 78 int_field(HotSpotMethodData, normalDataSize) \ |
79 int_field(HotSpotMethodData, extraDataSize) \ | 79 int_field(HotSpotMethodData, extraDataSize) \ |
80 end_class \ | 80 end_class \ |
81 start_class(HotSpotJavaType) \ | 81 start_class(HotSpotJavaType) \ |
82 oop_field(HotSpotJavaType, name, "Ljava/lang/String;") \ | 82 oop_field(HotSpotJavaType, name, "Ljava/lang/String;") \ |
83 end_class \ | 83 end_class \ |
84 start_class(HotSpotResolvedJavaField) \ | 84 start_class(HotSpotResolvedJavaField) \ |
85 oop_field(HotSpotResolvedJavaField, constant, "Lcom/oracle/graal/api/meta/Constant;") \ | 85 oop_field(HotSpotResolvedJavaField, constant, "Lcom/oracle/graal/api/meta/Constant;") \ |
86 int_field(HotSpotResolvedJavaField, offset) \ | 86 int_field(HotSpotResolvedJavaField, offset) \ |
87 int_field(HotSpotResolvedJavaField, accessFlags) \ | 87 int_field(HotSpotResolvedJavaField, accessFlags) \ |
88 end_class \ | 88 end_class \ |
89 start_class(HotSpotCompiledMethod) \ | 89 start_class(HotSpotCompiledMethod) \ |
90 long_field(HotSpotCompiledMethod, nmethod) \ | 90 long_field(HotSpotCompiledMethod, nmethod) \ |
91 oop_field(HotSpotCompiledMethod, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;")\ | 91 oop_field(HotSpotCompiledMethod, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ |
92 end_class \ | 92 end_class \ |
93 start_class(HotSpotCodeInfo) \ | 93 start_class(HotSpotCodeInfo) \ |
94 long_field(HotSpotCodeInfo, start) \ | 94 long_field(HotSpotCodeInfo, start) \ |
95 oop_field(HotSpotCodeInfo, code, "[B") \ | 95 oop_field(HotSpotCodeInfo, code, "[B") \ |
96 end_class \ | 96 end_class \ |
97 start_class(HotSpotCompilationResult) \ | 97 start_class(HotSpotCompilationResult) \ |
98 oop_field(HotSpotCompilationResult, comp, "Lcom/oracle/graal/api/code/CompilationResult;") \ | 98 oop_field(HotSpotCompilationResult, comp, "Lcom/oracle/graal/api/code/CompilationResult;") \ |
99 oop_field(HotSpotCompilationResult, method, "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod;") \ | 99 oop_field(HotSpotCompilationResult, method, "Lcom/oracle/graal/hotspot/meta/HotSpotResolvedJavaMethod;") \ |
100 oop_field(HotSpotCompilationResult, name, "Ljava/lang/String;") \ | 100 int_field(HotSpotCompilationResult, entryBCI) \ |
101 oop_field(HotSpotCompilationResult, name, "Ljava/lang/String;") \ | |
101 oop_field(HotSpotCompilationResult, sites, "[Lcom/oracle/graal/api/code/CompilationResult$Site;") \ | 102 oop_field(HotSpotCompilationResult, sites, "[Lcom/oracle/graal/api/code/CompilationResult$Site;") \ |
102 oop_field(HotSpotCompilationResult, exceptionHandlers, "[Lcom/oracle/graal/api/code/CompilationResult$ExceptionHandler;") \ | 103 oop_field(HotSpotCompilationResult, exceptionHandlers, "[Lcom/oracle/graal/api/code/CompilationResult$ExceptionHandler;") \ |
103 end_class \ | 104 end_class \ |
104 start_class(ExceptionHandler) \ | 105 start_class(ExceptionHandler) \ |
105 int_field(ExceptionHandler, startBCI) \ | 106 int_field(ExceptionHandler, startBCI) \ |
106 int_field(ExceptionHandler, endBCI) \ | 107 int_field(ExceptionHandler, endBCI) \ |
107 int_field(ExceptionHandler, handlerBCI) \ | 108 int_field(ExceptionHandler, handlerBCI) \ |
108 int_field(ExceptionHandler, catchTypeCPI) \ | 109 int_field(ExceptionHandler, catchTypeCPI) \ |
109 oop_field(ExceptionHandler, catchType, "Lcom/oracle/graal/api/meta/JavaType;") \ | 110 oop_field(ExceptionHandler, catchType, "Lcom/oracle/graal/api/meta/JavaType;") \ |
110 end_class \ | 111 end_class \ |
111 start_class(InstalledCode) \ | 112 start_class(CompilationResult) \ |
112 int_field(InstalledCode, frameSize) \ | 113 int_field(CompilationResult, frameSize) \ |
113 int_field(InstalledCode, customStackAreaOffset) \ | 114 int_field(CompilationResult, customStackAreaOffset) \ |
114 oop_field(InstalledCode, targetCode, "[B") \ | 115 oop_field(CompilationResult, targetCode, "[B") \ |
115 oop_field(InstalledCode, assumptions, "Lcom/oracle/graal/api/code/Assumptions;") \ | 116 oop_field(CompilationResult, assumptions, "Lcom/oracle/graal/api/code/Assumptions;") \ |
116 int_field(InstalledCode, targetCodeSize) \ | 117 int_field(CompilationResult, targetCodeSize) \ |
117 end_class \ | 118 end_class \ |
118 start_class(Assumptions) \ | 119 start_class(Assumptions) \ |
119 oop_field(Assumptions, list, "[Lcom/oracle/graal/api/code/Assumptions$Assumption;") \ | 120 oop_field(Assumptions, list, "[Lcom/oracle/graal/api/code/Assumptions$Assumption;") \ |
120 end_class \ | 121 end_class \ |
121 start_class(Assumptions_MethodContents) \ | 122 start_class(Assumptions_MethodContents) \ |
122 oop_field(Assumptions_MethodContents, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ | 123 oop_field(Assumptions_MethodContents, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ |
123 end_class \ | 124 end_class \ |
124 start_class(Assumptions_ConcreteSubtype) \ | 125 start_class(Assumptions_ConcreteSubtype) \ |
125 oop_field(Assumptions_ConcreteSubtype, context, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ | 126 oop_field(Assumptions_ConcreteSubtype, context, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ |
126 oop_field(Assumptions_ConcreteSubtype, subtype, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ | 127 oop_field(Assumptions_ConcreteSubtype, subtype, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ |
127 end_class \ | 128 end_class \ |
128 start_class(Assumptions_ConcreteMethod) \ | 129 start_class(Assumptions_ConcreteMethod) \ |
129 oop_field(Assumptions_ConcreteMethod, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ | 130 oop_field(Assumptions_ConcreteMethod, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ |
130 oop_field(Assumptions_ConcreteMethod, context, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ | 131 oop_field(Assumptions_ConcreteMethod, context, "Lcom/oracle/graal/api/meta/ResolvedJavaType;") \ |
131 oop_field(Assumptions_ConcreteMethod, impl, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ | 132 oop_field(Assumptions_ConcreteMethod, impl, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ |
132 end_class \ | 133 end_class \ |
133 start_class(InstalledCode_Site) \ | 134 start_class(CompilationResult_Site) \ |
134 int_field(InstalledCode_Site, pcOffset) \ | 135 int_field(CompilationResult_Site, pcOffset) \ |
135 end_class \ | 136 end_class \ |
136 start_class(InstalledCode_Call) \ | 137 start_class(CompilationResult_Call) \ |
137 oop_field(InstalledCode_Call, target, "Ljava/lang/Object;") \ | 138 oop_field(CompilationResult_Call, target, "Ljava/lang/Object;") \ |
138 oop_field(InstalledCode_Call, debugInfo, "Lcom/oracle/graal/api/code/DebugInfo;") \ | 139 oop_field(CompilationResult_Call, debugInfo, "Lcom/oracle/graal/api/code/DebugInfo;") \ |
139 end_class \ | 140 end_class \ |
140 start_class(InstalledCode_DataPatch) \ | 141 start_class(CompilationResult_DataPatch) \ |
141 oop_field(InstalledCode_DataPatch, constant, "Lcom/oracle/graal/api/meta/Constant;") \ | 142 oop_field(CompilationResult_DataPatch, constant, "Lcom/oracle/graal/api/meta/Constant;") \ |
142 int_field(InstalledCode_DataPatch, alignment) \ | 143 int_field(CompilationResult_DataPatch, alignment) \ |
143 end_class \ | 144 end_class \ |
144 start_class(InstalledCode_Safepoint) \ | 145 start_class(CompilationResult_Safepoint) \ |
145 oop_field(InstalledCode_Safepoint, debugInfo, "Lcom/oracle/graal/api/code/DebugInfo;") \ | 146 oop_field(CompilationResult_Safepoint, debugInfo, "Lcom/oracle/graal/api/code/DebugInfo;") \ |
146 end_class \ | 147 end_class \ |
147 start_class(InstalledCode_ExceptionHandler) \ | 148 start_class(CompilationResult_ExceptionHandler) \ |
148 int_field(InstalledCode_ExceptionHandler, handlerPos) \ | 149 int_field(CompilationResult_ExceptionHandler, handlerPos) \ |
149 end_class \ | 150 end_class \ |
150 start_class(InstalledCode_Mark) \ | 151 start_class(CompilationResult_Mark) \ |
151 oop_field(InstalledCode_Mark, id, "Ljava/lang/Object;") \ | 152 oop_field(CompilationResult_Mark, id, "Ljava/lang/Object;") \ |
152 oop_field(InstalledCode_Mark, references, "[Lcom/oracle/graal/api/code/CompilationResult$Mark;") \ | 153 oop_field(CompilationResult_Mark, references, "[Lcom/oracle/graal/api/code/CompilationResult$Mark;") \ |
153 end_class \ | 154 end_class \ |
154 start_class(DebugInfo) \ | 155 start_class(DebugInfo) \ |
155 oop_field(DebugInfo, bytecodePosition, "Lcom/oracle/graal/api/code/BytecodePosition;") \ | 156 oop_field(DebugInfo, bytecodePosition, "Lcom/oracle/graal/api/code/BytecodePosition;") \ |
156 oop_field(DebugInfo, registerRefMap, "Ljava/util/BitSet;") \ | 157 oop_field(DebugInfo, registerRefMap, "Ljava/util/BitSet;") \ |
157 oop_field(DebugInfo, frameRefMap, "Ljava/util/BitSet;") \ | 158 oop_field(DebugInfo, frameRefMap, "Ljava/util/BitSet;") \ |
158 end_class \ | 159 end_class \ |
159 start_class(GraalBitMap) \ | 160 start_class(GraalBitMap) \ |
160 oop_field(GraalBitMap, words, "[J") \ | 161 oop_field(GraalBitMap, words, "[J") \ |
161 end_class \ | 162 end_class \ |
162 start_class(BytecodeFrame) \ | 163 start_class(BytecodeFrame) \ |
163 oop_field(BytecodeFrame, values, "[Lcom/oracle/graal/api/meta/Value;") \ | 164 oop_field(BytecodeFrame, values, "[Lcom/oracle/graal/api/meta/Value;") \ |
164 int_field(BytecodeFrame, numLocals) \ | 165 int_field(BytecodeFrame, numLocals) \ |
165 int_field(BytecodeFrame, numStack) \ | 166 int_field(BytecodeFrame, numStack) \ |
166 int_field(BytecodeFrame, numLocks) \ | 167 int_field(BytecodeFrame, numLocks) \ |
167 long_field(BytecodeFrame, leafGraphId) \ | 168 long_field(BytecodeFrame, leafGraphId) \ |
168 boolean_field(BytecodeFrame, rethrowException) \ | 169 boolean_field(BytecodeFrame, rethrowException) \ |
169 boolean_field(BytecodeFrame, duringCall) \ | 170 boolean_field(BytecodeFrame, duringCall) \ |
170 end_class \ | 171 end_class \ |
171 start_class(BytecodePosition) \ | 172 start_class(BytecodePosition) \ |
172 oop_field(BytecodePosition, caller, "Lcom/oracle/graal/api/code/BytecodePosition;") \ | 173 oop_field(BytecodePosition, caller, "Lcom/oracle/graal/api/code/BytecodePosition;") \ |
173 oop_field(BytecodePosition, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ | 174 oop_field(BytecodePosition, method, "Lcom/oracle/graal/api/meta/ResolvedJavaMethod;") \ |
174 int_field(BytecodePosition, bci) \ | 175 int_field(BytecodePosition, bci) \ |
175 end_class \ | 176 end_class \ |
176 start_class(Constant) \ | 177 start_class(Constant) \ |
177 oop_field(Constant, kind, "Lcom/oracle/graal/api/meta/Kind;") \ | 178 oop_field(Constant, kind, "Lcom/oracle/graal/api/meta/Kind;") \ |
178 oop_field(Constant, object, "Ljava/lang/Object;") \ | 179 oop_field(Constant, object, "Ljava/lang/Object;") \ |
179 long_field(Constant, primitive) \ | 180 long_field(Constant, primitive) \ |
180 end_class \ | 181 end_class \ |
181 start_class(Kind) \ | 182 start_class(Kind) \ |
182 char_field(Kind, typeChar) \ | 183 char_field(Kind, typeChar) \ |
183 static_oop_field(Kind, Boolean, "Lcom/oracle/graal/api/meta/Kind;"); \ | 184 static_oop_field(Kind, Boolean, "Lcom/oracle/graal/api/meta/Kind;"); \ |
184 static_oop_field(Kind, Byte, "Lcom/oracle/graal/api/meta/Kind;"); \ | 185 static_oop_field(Kind, Byte, "Lcom/oracle/graal/api/meta/Kind;"); \ |
185 static_oop_field(Kind, Char, "Lcom/oracle/graal/api/meta/Kind;"); \ | 186 static_oop_field(Kind, Char, "Lcom/oracle/graal/api/meta/Kind;"); \ |
186 static_oop_field(Kind, Short, "Lcom/oracle/graal/api/meta/Kind;"); \ | 187 static_oop_field(Kind, Short, "Lcom/oracle/graal/api/meta/Kind;"); \ |
187 static_oop_field(Kind, Int, "Lcom/oracle/graal/api/meta/Kind;"); \ | 188 static_oop_field(Kind, Int, "Lcom/oracle/graal/api/meta/Kind;"); \ |
188 static_oop_field(Kind, Long, "Lcom/oracle/graal/api/meta/Kind;"); \ | 189 static_oop_field(Kind, Long, "Lcom/oracle/graal/api/meta/Kind;"); \ |
189 end_class \ | 190 end_class \ |
190 start_class(JavaMethod) \ | 191 start_class(JavaMethod) \ |
191 end_class \ | 192 end_class \ |
192 start_class(Value) \ | 193 start_class(Value) \ |
193 oop_field(Value, kind, "Lcom/oracle/graal/api/meta/Kind;") \ | 194 oop_field(Value, kind, "Lcom/oracle/graal/api/meta/Kind;") \ |
194 static_oop_field(Value, ILLEGAL, "Lcom/oracle/graal/api/meta/Value;"); \ | 195 static_oop_field(Value, ILLEGAL, "Lcom/oracle/graal/api/meta/Value;"); \ |
195 end_class \ | 196 end_class \ |
196 start_class(RegisterValue) \ | 197 start_class(RegisterValue) \ |
197 oop_field(RegisterValue, reg, "Lcom/oracle/graal/api/code/Register;") \ | 198 oop_field(RegisterValue, reg, "Lcom/oracle/graal/api/code/Register;") \ |
198 end_class \ | 199 end_class \ |
199 start_class(code_Register) \ | 200 start_class(code_Register) \ |
200 int_field(code_Register, number) \ | 201 int_field(code_Register, number) \ |
201 end_class \ | 202 end_class \ |
202 start_class(StackSlot) \ | 203 start_class(StackSlot) \ |
203 int_field(StackSlot, offset) \ | 204 int_field(StackSlot, offset) \ |
204 boolean_field(StackSlot, addFrameSize) \ | 205 boolean_field(StackSlot, addFrameSize) \ |
205 end_class \ | 206 end_class \ |
206 start_class(VirtualObject) \ | 207 start_class(VirtualObject) \ |
207 int_field(VirtualObject, id) \ | 208 int_field(VirtualObject, id) \ |
208 oop_field(VirtualObject, type, "Lcom/oracle/graal/api/meta/JavaType;") \ | 209 oop_field(VirtualObject, type, "Lcom/oracle/graal/api/meta/JavaType;") \ |
209 oop_field(VirtualObject, values, "[Lcom/oracle/graal/api/meta/Value;") \ | 210 oop_field(VirtualObject, values, "[Lcom/oracle/graal/api/meta/Value;") \ |
210 end_class \ | 211 end_class \ |
211 start_class(code_MonitorValue) \ | 212 start_class(code_MonitorValue) \ |
212 oop_field(code_MonitorValue, owner, "Lcom/oracle/graal/api/meta/Value;") \ | 213 oop_field(code_MonitorValue, owner, "Lcom/oracle/graal/api/meta/Value;") \ |
213 oop_field(code_MonitorValue, lockData, "Lcom/oracle/graal/api/meta/Value;") \ | 214 oop_field(code_MonitorValue, lockData, "Lcom/oracle/graal/api/meta/Value;") \ |
214 boolean_field(code_MonitorValue, eliminated) \ | 215 boolean_field(code_MonitorValue, eliminated) \ |
215 end_class \ | 216 end_class \ |
216 /* end*/ | 217 /* end*/ |
217 | 218 |
218 #define START_CLASS(name) \ | 219 #define START_CLASS(name) \ |
219 class name : AllStatic { \ | 220 class name : AllStatic { \ |
220 private: \ | 221 private: \ |