Mercurial > hg > truffle
comparison src/share/vm/graal/graalVMEntries.cpp @ 2891:75a99b4f1c98
Rebranded C++ part from C1X to Graal.
author | Thomas Wuerthinger <thomas@wuerthinger.net> |
---|---|
date | Wed, 08 Jun 2011 14:01:51 +0200 |
parents | c23d45daff9b |
children | d577d07cedec |
comparison
equal
deleted
inserted
replaced
2890:c23d45daff9b | 2891:75a99b4f1c98 |
---|---|
20 * or visit www.oracle.com if you need additional information or have any | 20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. | 21 * questions. |
22 */ | 22 */ |
23 | 23 |
24 #include "precompiled.hpp" | 24 #include "precompiled.hpp" |
25 #include "c1x/c1x_VMEntries.hpp" | 25 #include "graal/graalVMEntries.hpp" |
26 #include "c1x/c1x_Compiler.hpp" | 26 #include "graal/graalCompiler.hpp" |
27 #include "c1x/c1x_JavaAccess.hpp" | 27 #include "graal/graalJavaAccess.hpp" |
28 #include "c1x/c1x_CodeInstaller.hpp" | 28 #include "graal/graalCodeInstaller.hpp" |
29 #include "c1x/c1x_VMExits.hpp" | 29 #include "graal/graalVMExits.hpp" |
30 #include "c1x/c1x_VmIds.hpp" | 30 #include "graal/graalVmIds.hpp" |
31 #include "c1/c1_Runtime1.hpp" | 31 #include "c1/c1_Runtime1.hpp" |
32 #include "memory/oopFactory.hpp" | 32 #include "memory/oopFactory.hpp" |
33 | 33 |
34 // public byte[] RiMethod_code(long vmId); | 34 // public byte[] RiMethod_code(long vmId); |
35 JNIEXPORT jbyteArray JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1code(JNIEnv *env, jobject, jlong vmId) { | 35 JNIEXPORT jbyteArray JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1code(JNIEnv *env, jobject, jlong vmId) { |
36 TRACE_C1X_3("VMEntries::RiMethod_code"); | 36 TRACE_graal_3("VMEntries::RiMethod_code"); |
37 methodHandle method = VmIds::get<methodOop>(vmId); | 37 methodHandle method = VmIds::get<methodOop>(vmId); |
38 int code_size = method->code_size(); | 38 int code_size = method->code_size(); |
39 jbyteArray result = env->NewByteArray(code_size); | 39 jbyteArray result = env->NewByteArray(code_size); |
40 env->SetByteArrayRegion(result, 0, code_size, (const jbyte *) method->code_base()); | 40 env->SetByteArrayRegion(result, 0, code_size, (const jbyte *) method->code_base()); |
41 return result; | 41 return result; |
42 } | 42 } |
43 | 43 |
44 // public int RiMethod_maxStackSize(long vmId); | 44 // public int RiMethod_maxStackSize(long vmId); |
45 JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxStackSize(JNIEnv *, jobject, jlong vmId) { | 45 JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxStackSize(JNIEnv *, jobject, jlong vmId) { |
46 TRACE_C1X_3("VMEntries::RiMethod_maxStackSize"); | 46 TRACE_graal_3("VMEntries::RiMethod_maxStackSize"); |
47 return VmIds::get<methodOop>(vmId)->max_stack(); | 47 return VmIds::get<methodOop>(vmId)->max_stack(); |
48 } | 48 } |
49 | 49 |
50 // public int RiMethod_maxLocals(long vmId); | 50 // public int RiMethod_maxLocals(long vmId); |
51 JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxLocals(JNIEnv *, jobject, jlong vmId) { | 51 JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1maxLocals(JNIEnv *, jobject, jlong vmId) { |
52 TRACE_C1X_3("VMEntries::RiMethod_maxLocals"); | 52 TRACE_graal_3("VMEntries::RiMethod_maxLocals"); |
53 return VmIds::get<methodOop>(vmId)->max_locals(); | 53 return VmIds::get<methodOop>(vmId)->max_locals(); |
54 } | 54 } |
55 | 55 |
56 // public RiType RiMethod_holder(long vmId); | 56 // public RiType RiMethod_holder(long vmId); |
57 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1holder(JNIEnv *, jobject, jlong vmId) { | 57 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1holder(JNIEnv *, jobject, jlong vmId) { |
58 TRACE_C1X_3("VMEntries::RiMethod_holder"); | 58 TRACE_graal_3("VMEntries::RiMethod_holder"); |
59 VM_ENTRY_MARK | 59 VM_ENTRY_MARK |
60 KlassHandle klass = VmIds::get<methodOop>(vmId)->method_holder(); | 60 KlassHandle klass = VmIds::get<methodOop>(vmId)->method_holder(); |
61 Handle name = VmIds::toString<Handle>(klass->name(), CHECK_NULL); | 61 Handle name = VmIds::toString<Handle>(klass->name(), CHECK_NULL); |
62 oop holder = C1XCompiler::createHotSpotTypeResolved(klass, name, CHECK_NULL); | 62 oop holder = GraalCompiler::createHotSpotTypeResolved(klass, name, CHECK_NULL); |
63 return JNIHandles::make_local(THREAD, holder); | 63 return JNIHandles::make_local(THREAD, holder); |
64 } | 64 } |
65 | 65 |
66 // public String RiMethod_signature(long vmId); | 66 // public String RiMethod_signature(long vmId); |
67 JNIEXPORT jstring JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1signature(JNIEnv *env, jobject, jlong vmId) { | 67 JNIEXPORT jstring JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1signature(JNIEnv *env, jobject, jlong vmId) { |
68 TRACE_C1X_3("VMEntries::RiMethod_signature"); | 68 TRACE_graal_3("VMEntries::RiMethod_signature"); |
69 VM_ENTRY_MARK | 69 VM_ENTRY_MARK |
70 methodOop method = VmIds::get<methodOop>(vmId); | 70 methodOop method = VmIds::get<methodOop>(vmId); |
71 return VmIds::toString<jstring>(method->signature(), THREAD); | 71 return VmIds::toString<jstring>(method->signature(), THREAD); |
72 } | 72 } |
73 | 73 |
74 // public int RiMethod_accessFlags(long vmId); | 74 // public int RiMethod_accessFlags(long vmId); |
75 JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1accessFlags(JNIEnv *, jobject, jlong vmId) { | 75 JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1accessFlags(JNIEnv *, jobject, jlong vmId) { |
76 TRACE_C1X_3("VMEntries::RiMethod_accessFlags"); | 76 TRACE_graal_3("VMEntries::RiMethod_accessFlags"); |
77 return VmIds::get<methodOop>(vmId)->access_flags().as_int(); | 77 return VmIds::get<methodOop>(vmId)->access_flags().as_int(); |
78 } | 78 } |
79 | 79 |
80 // public RiExceptionHandler[] RiMethod_exceptionHandlers(long vmId); | 80 // public RiExceptionHandler[] RiMethod_exceptionHandlers(long vmId); |
81 JNIEXPORT jobjectArray JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1exceptionHandlers(JNIEnv *, jobject, jlong vmId) { | 81 JNIEXPORT jobjectArray JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1exceptionHandlers(JNIEnv *, jobject, jlong vmId) { |
82 TRACE_C1X_3("VMEntries::RiMethod_exceptionHandlers"); | 82 TRACE_graal_3("VMEntries::RiMethod_exceptionHandlers"); |
83 VM_ENTRY_MARK | 83 VM_ENTRY_MARK |
84 methodHandle method = VmIds::get<methodOop>(vmId); | 84 methodHandle method = VmIds::get<methodOop>(vmId); |
85 typeArrayHandle handlers = method->exception_table(); | 85 typeArrayHandle handlers = method->exception_table(); |
86 int handler_count = handlers.is_null() ? 0 : handlers->length() / 4; | 86 int handler_count = handlers.is_null() ? 0 : handlers->length() / 4; |
87 | 87 |
103 } else { | 103 } else { |
104 constantPoolOop cp = instanceKlass::cast(method->method_holder())->constants(); | 104 constantPoolOop cp = instanceKlass::cast(method->method_holder())->constants(); |
105 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(method->method_holder()); | 105 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(method->method_holder()); |
106 bool is_accessible = false; | 106 bool is_accessible = false; |
107 ciKlass *klass = CURRENT_ENV->get_klass_by_index(cp, catch_class_index, is_accessible, loading_klass); | 107 ciKlass *klass = CURRENT_ENV->get_klass_by_index(cp, catch_class_index, is_accessible, loading_klass); |
108 oop catch_class = C1XCompiler::get_RiType(klass, method->method_holder(), CHECK_NULL); | 108 oop catch_class = GraalCompiler::get_RiType(klass, method->method_holder(), CHECK_NULL); |
109 | 109 |
110 HotSpotExceptionHandler::set_catchClass(entry, catch_class); | 110 HotSpotExceptionHandler::set_catchClass(entry, catch_class); |
111 } | 111 } |
112 array->obj_at_put(i, entry()); | 112 array->obj_at_put(i, entry()); |
113 } | 113 } |
115 return (jobjectArray) JNIHandles::make_local(array()); | 115 return (jobjectArray) JNIHandles::make_local(array()); |
116 } | 116 } |
117 | 117 |
118 // public boolean RiMethod_hasBalancedMonitors(long vmId); | 118 // public boolean RiMethod_hasBalancedMonitors(long vmId); |
119 JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1hasBalancedMonitors(JNIEnv *, jobject, jlong vmId) { | 119 JNIEXPORT jint JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1hasBalancedMonitors(JNIEnv *, jobject, jlong vmId) { |
120 TRACE_C1X_3("VMEntries::RiMethod_hasBalancedMonitors"); | 120 TRACE_graal_3("VMEntries::RiMethod_hasBalancedMonitors"); |
121 ciMethod* cimethod; | 121 ciMethod* cimethod; |
122 { | 122 { |
123 VM_ENTRY_MARK; | 123 VM_ENTRY_MARK; |
124 cimethod = (ciMethod*)CURRENT_ENV->get_object(VmIds::get<methodOop>(vmId)); | 124 cimethod = (ciMethod*)CURRENT_ENV->get_object(VmIds::get<methodOop>(vmId)); |
125 } | 125 } |
126 return cimethod->has_balanced_monitors(); | 126 return cimethod->has_balanced_monitors(); |
127 } | 127 } |
128 | 128 |
129 // public boolean RiMethod_uniqueConcreteMethod(long vmId); | 129 // public boolean RiMethod_uniqueConcreteMethod(long vmId); |
130 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1uniqueConcreteMethod(JNIEnv *, jobject, jlong vmId) { | 130 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiMethod_1uniqueConcreteMethod(JNIEnv *, jobject, jlong vmId) { |
131 TRACE_C1X_3("VMEntries::RiMethod_uniqueConcreteMethod"); | 131 TRACE_graal_3("VMEntries::RiMethod_uniqueConcreteMethod"); |
132 VM_ENTRY_MARK; | 132 VM_ENTRY_MARK; |
133 ciMethod* cimethod = (ciMethod*)CURRENT_ENV->get_object(VmIds::get<methodOop>(vmId)); | 133 ciMethod* cimethod = (ciMethod*)CURRENT_ENV->get_object(VmIds::get<methodOop>(vmId)); |
134 if (cimethod->holder()->is_interface()) { | 134 if (cimethod->holder()->is_interface()) { |
135 // Cannot trust interfaces. Because of: | 135 // Cannot trust interfaces. Because of: |
136 // interface I { void foo(); } | 136 // interface I { void foo(); } |
158 return JNIHandles::make_local(THREAD, method_resolved); | 158 return JNIHandles::make_local(THREAD, method_resolved); |
159 } | 159 } |
160 | 160 |
161 // public RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass); | 161 // public RiType RiSignature_lookupType(String returnType, HotSpotTypeResolved accessingClass); |
162 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiSignature_1lookupType(JNIEnv *env, jobject, jstring jname, jobject accessingClass) { | 162 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiSignature_1lookupType(JNIEnv *env, jobject, jstring jname, jobject accessingClass) { |
163 TRACE_C1X_3("VMEntries::RiSignature_lookupType"); | 163 TRACE_graal_3("VMEntries::RiSignature_lookupType"); |
164 VM_ENTRY_MARK; | 164 VM_ENTRY_MARK; |
165 | 165 |
166 Symbol* nameSymbol = VmIds::toSymbol(jname); | 166 Symbol* nameSymbol = VmIds::toSymbol(jname); |
167 Handle name = JNIHandles::resolve(jname); | 167 Handle name = JNIHandles::resolve(jname); |
168 | 168 |
198 CLEAR_PENDING_EXCEPTION; | 198 CLEAR_PENDING_EXCEPTION; |
199 resolved_type = NULL; | 199 resolved_type = NULL; |
200 } | 200 } |
201 } | 201 } |
202 if (resolved_type != NULL) { | 202 if (resolved_type != NULL) { |
203 result = C1XCompiler::createHotSpotTypeResolved(resolved_type, name, CHECK_NULL); | 203 result = GraalCompiler::createHotSpotTypeResolved(resolved_type, name, CHECK_NULL); |
204 } else { | 204 } else { |
205 result = VMExits::createRiTypeUnresolved(name, THREAD); | 205 result = VMExits::createRiTypeUnresolved(name, THREAD); |
206 } | 206 } |
207 } | 207 } |
208 | 208 |
209 return JNIHandles::make_local(THREAD, result); | 209 return JNIHandles::make_local(THREAD, result); |
210 } | 210 } |
211 | 211 |
212 // public Object RiConstantPool_lookupConstant(long vmId, int cpi); | 212 // public Object RiConstantPool_lookupConstant(long vmId, int cpi); |
213 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupConstant(JNIEnv *env, jobject, jlong vmId, jint index) { | 213 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupConstant(JNIEnv *env, jobject, jlong vmId, jint index) { |
214 TRACE_C1X_3("VMEntries::RiConstantPool_lookupConstant"); | 214 TRACE_graal_3("VMEntries::RiConstantPool_lookupConstant"); |
215 VM_ENTRY_MARK; | 215 VM_ENTRY_MARK; |
216 | 216 |
217 constantPoolOop cp = VmIds::get<constantPoolOop>(vmId); | 217 constantPoolOop cp = VmIds::get<constantPoolOop>(vmId); |
218 | 218 |
219 oop result = NULL; | 219 oop result = NULL; |
242 result = VMExits::createCiConstantObject(string, CHECK_0); | 242 result = VMExits::createCiConstantObject(string, CHECK_0); |
243 } else if (tag.is_klass() || tag.is_unresolved_klass()) { | 243 } else if (tag.is_klass() || tag.is_unresolved_klass()) { |
244 bool ignore; | 244 bool ignore; |
245 ciInstanceKlass* accessor = (ciInstanceKlass*) ciEnv::current()->get_object(cp->pool_holder()); | 245 ciInstanceKlass* accessor = (ciInstanceKlass*) ciEnv::current()->get_object(cp->pool_holder()); |
246 ciKlass* klass = ciEnv::current()->get_klass_by_index(cp, index, ignore, accessor); | 246 ciKlass* klass = ciEnv::current()->get_klass_by_index(cp, index, ignore, accessor); |
247 result = C1XCompiler::get_RiType(klass, cp->pool_holder(), CHECK_NULL); | 247 result = GraalCompiler::get_RiType(klass, cp->pool_holder(), CHECK_NULL); |
248 } else if (tag.is_object()) { | 248 } else if (tag.is_object()) { |
249 oop obj = cp->object_at(index); | 249 oop obj = cp->object_at(index); |
250 assert(obj->is_instance(), "must be an instance"); | 250 assert(obj->is_instance(), "must be an instance"); |
251 result = VMExits::createCiConstantObject(obj, CHECK_NULL); | 251 result = VMExits::createCiConstantObject(obj, CHECK_NULL); |
252 } else { | 252 } else { |
256 return JNIHandles::make_local(THREAD, result); | 256 return JNIHandles::make_local(THREAD, result); |
257 } | 257 } |
258 | 258 |
259 // public RiMethod RiConstantPool_lookupMethod(long vmId, int cpi, byte byteCode); | 259 // public RiMethod RiConstantPool_lookupMethod(long vmId, int cpi, byte byteCode); |
260 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupMethod(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) { | 260 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupMethod(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) { |
261 TRACE_C1X_3("VMEntries::RiConstantPool_lookupMethod"); | 261 TRACE_graal_3("VMEntries::RiConstantPool_lookupMethod"); |
262 VM_ENTRY_MARK; | 262 VM_ENTRY_MARK; |
263 | 263 |
264 index = C1XCompiler::to_cp_index_u2(index); | 264 index = GraalCompiler::to_cp_index_u2(index); |
265 constantPoolHandle cp = VmIds::get<constantPoolOop>(vmId); | 265 constantPoolHandle cp = VmIds::get<constantPoolOop>(vmId); |
266 | 266 |
267 Bytecodes::Code bc = (Bytecodes::Code) (((int) byteCode) & 0xFF); | 267 Bytecodes::Code bc = (Bytecodes::Code) (((int) byteCode) & 0xFF); |
268 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder()); | 268 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder()); |
269 ciMethod *cimethod = CURRENT_ENV->get_method_by_index(cp, index, bc, loading_klass); | 269 ciMethod *cimethod = CURRENT_ENV->get_method_by_index(cp, index, bc, loading_klass); |
272 Handle name = VmIds::toString<Handle>(method->name(), CHECK_NULL); | 272 Handle name = VmIds::toString<Handle>(method->name(), CHECK_NULL); |
273 return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), name, THREAD)); | 273 return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), name, THREAD)); |
274 } else { | 274 } else { |
275 Handle name = VmIds::toString<Handle>(cimethod->name()->get_symbol(), CHECK_NULL); | 275 Handle name = VmIds::toString<Handle>(cimethod->name()->get_symbol(), CHECK_NULL); |
276 Handle signature = VmIds::toString<Handle>(cimethod->signature()->as_symbol()->get_symbol(), CHECK_NULL); | 276 Handle signature = VmIds::toString<Handle>(cimethod->signature()->as_symbol()->get_symbol(), CHECK_NULL); |
277 Handle holder = C1XCompiler::get_RiType(cimethod->holder(), cp->klass(), THREAD); | 277 Handle holder = GraalCompiler::get_RiType(cimethod->holder(), cp->klass(), THREAD); |
278 return JNIHandles::make_local(THREAD, VMExits::createRiMethodUnresolved(name, signature, holder, THREAD)); | 278 return JNIHandles::make_local(THREAD, VMExits::createRiMethodUnresolved(name, signature, holder, THREAD)); |
279 } | 279 } |
280 } | 280 } |
281 | 281 |
282 // public RiSignature RiConstantPool_lookupSignature(long vmId, int cpi); | 282 // public RiSignature RiConstantPool_lookupSignature(long vmId, int cpi); |
285 return NULL; | 285 return NULL; |
286 } | 286 } |
287 | 287 |
288 // public RiType RiConstantPool_lookupType(long vmId, int cpi); | 288 // public RiType RiConstantPool_lookupType(long vmId, int cpi); |
289 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupType(JNIEnv *env, jobject, jlong vmId, jint index) { | 289 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupType(JNIEnv *env, jobject, jlong vmId, jint index) { |
290 TRACE_C1X_3("VMEntries::RiConstantPool_lookupType"); | 290 TRACE_graal_3("VMEntries::RiConstantPool_lookupType"); |
291 VM_ENTRY_MARK; | 291 VM_ENTRY_MARK; |
292 | 292 |
293 constantPoolOop cp = VmIds::get<constantPoolOop>(vmId); | 293 constantPoolOop cp = VmIds::get<constantPoolOop>(vmId); |
294 | 294 |
295 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder()); | 295 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder()); |
296 bool is_accessible = false; | 296 bool is_accessible = false; |
297 ciKlass *klass = CURRENT_ENV->get_klass_by_index(cp, index, is_accessible, loading_klass); | 297 ciKlass *klass = CURRENT_ENV->get_klass_by_index(cp, index, is_accessible, loading_klass); |
298 return JNIHandles::make_local(THREAD, C1XCompiler::get_RiType(klass, cp->klass(), THREAD)); | 298 return JNIHandles::make_local(THREAD, GraalCompiler::get_RiType(klass, cp->klass(), THREAD)); |
299 } | 299 } |
300 | 300 |
301 // public RiField RiConstantPool_lookupField(long vmId, int cpi); | 301 // public RiField RiConstantPool_lookupField(long vmId, int cpi); |
302 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupField(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) { | 302 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiConstantPool_1lookupField(JNIEnv *env, jobject, jlong vmId, jint index, jbyte byteCode) { |
303 TRACE_C1X_3("VMEntries::RiConstantPool_lookupField"); | 303 TRACE_graal_3("VMEntries::RiConstantPool_lookupField"); |
304 VM_ENTRY_MARK; | 304 VM_ENTRY_MARK; |
305 | 305 |
306 index = C1XCompiler::to_cp_index_u2(index); | 306 index = GraalCompiler::to_cp_index_u2(index); |
307 constantPoolOop cp = VmIds::get<constantPoolOop>(vmId); | 307 constantPoolOop cp = VmIds::get<constantPoolOop>(vmId); |
308 | 308 |
309 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder()); | 309 ciInstanceKlass* loading_klass = (ciInstanceKlass *) CURRENT_ENV->get_object(cp->pool_holder()); |
310 ciField *field = CURRENT_ENV->get_field_by_index(loading_klass, index); | 310 ciField *field = CURRENT_ENV->get_field_by_index(loading_klass, index); |
311 | 311 |
312 Bytecodes::Code code = (Bytecodes::Code)(((int) byteCode) & 0xFF); | 312 Bytecodes::Code code = (Bytecodes::Code)(((int) byteCode) & 0xFF); |
313 Handle field_handle = C1XCompiler::get_RiField(field, loading_klass, cp->pool_holder(), code, THREAD); | 313 Handle field_handle = GraalCompiler::get_RiField(field, loading_klass, cp->pool_holder(), code, THREAD); |
314 bool is_constant = field->is_constant(); | 314 bool is_constant = field->is_constant(); |
315 if (is_constant && field->is_static()) { | 315 if (is_constant && field->is_static()) { |
316 ciConstant constant = field->constant_value(); | 316 ciConstant constant = field->constant_value(); |
317 oop constant_object = NULL; | 317 oop constant_object = NULL; |
318 switch (constant.basic_type()) { | 318 switch (constant.basic_type()) { |
362 return JNIHandles::make_local(THREAD, field_handle()); | 362 return JNIHandles::make_local(THREAD, field_handle()); |
363 } | 363 } |
364 | 364 |
365 // public RiConstantPool RiType_constantPool(HotSpotTypeResolved klass); | 365 // public RiConstantPool RiType_constantPool(HotSpotTypeResolved klass); |
366 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1constantPool(JNIEnv *, jobject, jobject klass) { | 366 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1constantPool(JNIEnv *, jobject, jobject klass) { |
367 TRACE_C1X_3("VMEntries::RiType_constantPool"); | 367 TRACE_graal_3("VMEntries::RiType_constantPool"); |
368 VM_ENTRY_MARK; | 368 VM_ENTRY_MARK; |
369 | 369 |
370 assert(JNIHandles::resolve(klass) != NULL, ""); | 370 assert(JNIHandles::resolve(klass) != NULL, ""); |
371 constantPoolOop constantPool = ((instanceKlass*)java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))->klass_part())->constants(); | 371 constantPoolOop constantPool = ((instanceKlass*)java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))->klass_part())->constants(); |
372 return JNIHandles::make_local(VMExits::createRiConstantPool(VmIds::add<constantPoolOop>(constantPool), THREAD)); | 372 return JNIHandles::make_local(VMExits::createRiConstantPool(VmIds::add<constantPoolOop>(constantPool), THREAD)); |
373 } | 373 } |
374 | 374 |
375 // public RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature); | 375 // public RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature); |
376 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_3resolveMethodImpl(JNIEnv *, jobject, jobject resolved_type, jstring name, jstring signature) { | 376 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_3resolveMethodImpl(JNIEnv *, jobject, jobject resolved_type, jstring name, jstring signature) { |
377 TRACE_C1X_3("VMEntries::RiType_resolveMethodImpl"); | 377 TRACE_graal_3("VMEntries::RiType_resolveMethodImpl"); |
378 VM_ENTRY_MARK; | 378 VM_ENTRY_MARK; |
379 | 379 |
380 assert(JNIHandles::resolve(resolved_type) != NULL, ""); | 380 assert(JNIHandles::resolve(resolved_type) != NULL, ""); |
381 klassOop klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(resolved_type)); | 381 klassOop klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(resolved_type)); |
382 Symbol* name_symbol = VmIds::toSymbol(name); | 382 Symbol* name_symbol = VmIds::toSymbol(name); |
383 Symbol* signature_symbol = VmIds::toSymbol(signature); | 383 Symbol* signature_symbol = VmIds::toSymbol(signature); |
384 methodOop method = klass->klass_part()->lookup_method(name_symbol, signature_symbol); | 384 methodOop method = klass->klass_part()->lookup_method(name_symbol, signature_symbol); |
385 if (method == NULL) { | 385 if (method == NULL) { |
386 if (TraceC1X >= 3) { | 386 if (Tracegraal >= 3) { |
387 ResourceMark rm; | 387 ResourceMark rm; |
388 tty->print_cr("Could not resolve method %s %s on klass %s", name_symbol->as_C_string(), signature_symbol->as_C_string(), klass->klass_part()->name()->as_C_string()); | 388 tty->print_cr("Could not resolve method %s %s on klass %s", name_symbol->as_C_string(), signature_symbol->as_C_string(), klass->klass_part()->name()->as_C_string()); |
389 } | 389 } |
390 return NULL; | 390 return NULL; |
391 } | 391 } |
392 return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), Handle(JNIHandles::resolve(name)), THREAD)); | 392 return JNIHandles::make_local(THREAD, VMExits::createRiMethodResolved(VmIds::add<methodOop>(method), Handle(JNIHandles::resolve(name)), THREAD)); |
393 } | 393 } |
394 | 394 |
395 // public boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other); | 395 // public boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other); |
396 JNIEXPORT jboolean JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_2isSubtypeOf(JNIEnv *, jobject, jobject klass, jobject jother) { | 396 JNIEXPORT jboolean JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_2isSubtypeOf(JNIEnv *, jobject, jobject klass, jobject jother) { |
397 TRACE_C1X_3("VMEntries::RiType_isSubtypeOf"); | 397 TRACE_graal_3("VMEntries::RiType_isSubtypeOf"); |
398 oop other = JNIHandles::resolve(jother); | 398 oop other = JNIHandles::resolve(jother); |
399 assert(other->is_a(HotSpotTypeResolved::klass()), "resolved hotspot type expected"); | 399 assert(other->is_a(HotSpotTypeResolved::klass()), "resolved hotspot type expected"); |
400 assert(JNIHandles::resolve(klass) != NULL, ""); | 400 assert(JNIHandles::resolve(klass) != NULL, ""); |
401 klassOop thisKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)); | 401 klassOop thisKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)); |
402 klassOop otherKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(other)); | 402 klassOop otherKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(other)); |
410 } | 410 } |
411 } | 411 } |
412 | 412 |
413 // public RiType RiType_componentType(HotSpotResolvedType klass); | 413 // public RiType RiType_componentType(HotSpotResolvedType klass); |
414 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1componentType(JNIEnv *, jobject, jobject klass) { | 414 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1componentType(JNIEnv *, jobject, jobject klass) { |
415 TRACE_C1X_3("VMEntries::RiType_componentType"); | 415 TRACE_graal_3("VMEntries::RiType_componentType"); |
416 ciArrayKlass* array_klass; | 416 ciArrayKlass* array_klass; |
417 { | 417 { |
418 VM_ENTRY_MARK; | 418 VM_ENTRY_MARK; |
419 assert(JNIHandles::resolve(klass) != NULL, ""); | 419 assert(JNIHandles::resolve(klass) != NULL, ""); |
420 array_klass = (ciArrayKlass *) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); | 420 array_klass = (ciArrayKlass *) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); |
421 } | 421 } |
422 ciType* element_type = array_klass->element_type(); | 422 ciType* element_type = array_klass->element_type(); |
423 | 423 |
424 VM_ENTRY_MARK; | 424 VM_ENTRY_MARK; |
425 assert(JNIHandles::resolve(klass) != NULL, ""); | 425 assert(JNIHandles::resolve(klass) != NULL, ""); |
426 return JNIHandles::make_local(C1XCompiler::get_RiType(element_type, java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)), THREAD)); | 426 return JNIHandles::make_local(GraalCompiler::get_RiType(element_type, java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)), THREAD)); |
427 } | 427 } |
428 | 428 |
429 // public RiType RiType_superType(HotSpotResolvedType klass); | 429 // public RiType RiType_superType(HotSpotResolvedType klass); |
430 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1superType(JNIEnv *, jobject, jobject klass) { | 430 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1superType(JNIEnv *, jobject, jobject klass) { |
431 TRACE_C1X_3("VMEntries::RiType_superType"); | 431 TRACE_graal_3("VMEntries::RiType_superType"); |
432 VM_ENTRY_MARK; | 432 VM_ENTRY_MARK; |
433 KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); | 433 KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); |
434 ciInstanceKlass* k = NULL; | 434 ciInstanceKlass* k = NULL; |
435 | 435 |
436 if (klass_handle->oop_is_array()) { | 436 if (klass_handle->oop_is_array()) { |
440 k = (ciInstanceKlass *) CURRENT_ENV->get_object(klass_handle()); | 440 k = (ciInstanceKlass *) CURRENT_ENV->get_object(klass_handle()); |
441 k = k->super(); | 441 k = k->super(); |
442 } | 442 } |
443 | 443 |
444 if (k != NULL) { | 444 if (k != NULL) { |
445 return JNIHandles::make_local(C1XCompiler::get_RiType(k, klass_handle, THREAD)); | 445 return JNIHandles::make_local(GraalCompiler::get_RiType(k, klass_handle, THREAD)); |
446 } else { | 446 } else { |
447 return NULL; | 447 return NULL; |
448 } | 448 } |
449 } | 449 } |
450 | 450 |
451 // public RiType RiType_uniqueConcreteSubtype(HotSpotResolvedType klass); | 451 // public RiType RiType_uniqueConcreteSubtype(HotSpotResolvedType klass); |
452 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1uniqueConcreteSubtype(JNIEnv *, jobject, jobject klass) { | 452 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1uniqueConcreteSubtype(JNIEnv *, jobject, jobject klass) { |
453 TRACE_C1X_3("VMEntries::RiType_uniqueConcreteSubtype"); | 453 TRACE_graal_3("VMEntries::RiType_uniqueConcreteSubtype"); |
454 Thread* THREAD = Thread::current(); | 454 Thread* THREAD = Thread::current(); |
455 KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); | 455 KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); |
456 ciInstanceKlass* k = NULL; | 456 ciInstanceKlass* k = NULL; |
457 { | 457 { |
458 VM_ENTRY_MARK; | 458 VM_ENTRY_MARK; |
461 | 461 |
462 if (k->is_abstract()) { | 462 if (k->is_abstract()) { |
463 ciInstanceKlass* sub = k->unique_concrete_subklass(); | 463 ciInstanceKlass* sub = k->unique_concrete_subklass(); |
464 if (sub != NULL && sub->is_leaf_type()) { | 464 if (sub != NULL && sub->is_leaf_type()) { |
465 VM_ENTRY_MARK; | 465 VM_ENTRY_MARK; |
466 return JNIHandles::make_local(C1XCompiler::get_RiType(sub, klass_handle, THREAD)); | 466 return JNIHandles::make_local(GraalCompiler::get_RiType(sub, klass_handle, THREAD)); |
467 } | 467 } |
468 } else if (k->is_leaf_type()) { | 468 } else if (k->is_leaf_type()) { |
469 assert(!k->is_interface(), ""); | 469 assert(!k->is_interface(), ""); |
470 return klass; | 470 return klass; |
471 } | 471 } |
473 return NULL; | 473 return NULL; |
474 } | 474 } |
475 | 475 |
476 // public RiType RiType_arrayOf(HotSpotTypeResolved klass); | 476 // public RiType RiType_arrayOf(HotSpotTypeResolved klass); |
477 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1arrayOf(JNIEnv *, jobject, jobject klass) { | 477 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_RiType_1arrayOf(JNIEnv *, jobject, jobject klass) { |
478 TRACE_C1X_3("VMEntries::RiType_arrayOf"); | 478 TRACE_graal_3("VMEntries::RiType_arrayOf"); |
479 VM_ENTRY_MARK; | 479 VM_ENTRY_MARK; |
480 | 480 |
481 KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); | 481 KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); |
482 KlassHandle array = klass_handle->array_klass(THREAD); | 482 KlassHandle array = klass_handle->array_klass(THREAD); |
483 Handle name = VmIds::toString<Handle>(array->name(), CHECK_NULL); | 483 Handle name = VmIds::toString<Handle>(array->name(), CHECK_NULL); |
484 return JNIHandles::make_local(THREAD, C1XCompiler::createHotSpotTypeResolved(array, name, THREAD)); | 484 return JNIHandles::make_local(THREAD, GraalCompiler::createHotSpotTypeResolved(array, name, THREAD)); |
485 } | 485 } |
486 | 486 |
487 // public RiType getPrimitiveArrayType(CiKind kind); | 487 // public RiType getPrimitiveArrayType(CiKind kind); |
488 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getPrimitiveArrayType(JNIEnv *env, jobject, jobject kind) { | 488 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getPrimitiveArrayType(JNIEnv *env, jobject, jobject kind) { |
489 TRACE_C1X_3("VMEntries::VMEntries_getPrimitiveArrayType"); | 489 TRACE_graal_3("VMEntries::VMEntries_getPrimitiveArrayType"); |
490 VM_ENTRY_MARK; | 490 VM_ENTRY_MARK; |
491 BasicType type = C1XCompiler::kindToBasicType(CiKind::typeChar(kind)); | 491 BasicType type = GraalCompiler::kindToBasicType(CiKind::typeChar(kind)); |
492 assert(type != T_OBJECT, "primitive type expecteds"); | 492 assert(type != T_OBJECT, "primitive type expecteds"); |
493 ciKlass* klass = ciTypeArrayKlass::make(type); | 493 ciKlass* klass = ciTypeArrayKlass::make(type); |
494 return JNIHandles::make_local(THREAD, C1XCompiler::get_RiType(klass, KlassHandle(), THREAD)); | 494 return JNIHandles::make_local(THREAD, GraalCompiler::get_RiType(klass, KlassHandle(), THREAD)); |
495 } | 495 } |
496 | 496 |
497 // public RiType getType(Class<?> javaClass); | 497 // public RiType getType(Class<?> javaClass); |
498 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getType(JNIEnv *env, jobject, jobject javaClass) { | 498 JNIEXPORT jobject JNICALL Java_com_oracle_graal_runtime_VMEntries_getType(JNIEnv *env, jobject, jobject javaClass) { |
499 TRACE_C1X_3("VMEntries::VMEntries_getType"); | 499 TRACE_graal_3("VMEntries::VMEntries_getType"); |
500 VM_ENTRY_MARK; | 500 VM_ENTRY_MARK; |
501 oop javaClassOop = JNIHandles::resolve(javaClass); | 501 oop javaClassOop = JNIHandles::resolve(javaClass); |
502 if (javaClassOop == NULL) { | 502 if (javaClassOop == NULL) { |
503 fatal("argument to VMEntries.getType must not be NULL"); | 503 fatal("argument to VMEntries.getType must not be NULL"); |
504 return NULL; | 504 return NULL; |
507 return JNIHandles::make_local(THREAD, VMExits::createRiTypePrimitive((int) basicType, THREAD)); | 507 return JNIHandles::make_local(THREAD, VMExits::createRiTypePrimitive((int) basicType, THREAD)); |
508 } else { | 508 } else { |
509 KlassHandle klass = java_lang_Class::as_klassOop(javaClassOop); | 509 KlassHandle klass = java_lang_Class::as_klassOop(javaClassOop); |
510 Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NULL); | 510 Handle name = java_lang_String::create_from_symbol(klass->name(), CHECK_NULL); |
511 | 511 |
512 oop type = C1XCompiler::createHotSpotTypeResolved(klass, name, CHECK_NULL); | 512 oop type = GraalCompiler::createHotSpotTypeResolved(klass, name, CHECK_NULL); |
513 return JNIHandles::make_local(THREAD, type); | 513 return JNIHandles::make_local(THREAD, type); |
514 } | 514 } |
515 } | 515 } |
516 | 516 |
517 | 517 |
518 // helpers used to set fields in the HotSpotVMConfig object | 518 // helpers used to set fields in the HotSpotVMConfig object |
519 jfieldID getFieldID(JNIEnv* env, jobject obj, const char* name, const char* sig) { | 519 jfieldID getFieldID(JNIEnv* env, jobject obj, const char* name, const char* sig) { |
520 jfieldID id = env->GetFieldID(env->GetObjectClass(obj), name, sig); | 520 jfieldID id = env->GetFieldID(env->GetObjectClass(obj), name, sig); |
521 if (id == NULL) { | 521 if (id == NULL) { |
522 TRACE_C1X_1("field not found: %s (%s)", name, sig); | 522 TRACE_graal_1("field not found: %s (%s)", name, sig); |
523 fatal("field not found"); | 523 fatal("field not found"); |
524 } | 524 } |
525 return id; | 525 return id; |
526 } | 526 } |
527 | 527 |
566 set_int(env, config, "threadTlabEndOffset", in_bytes(JavaThread::tlab_end_offset())); | 566 set_int(env, config, "threadTlabEndOffset", in_bytes(JavaThread::tlab_end_offset())); |
567 set_int(env, config, "threadObjectOffset", in_bytes(JavaThread::threadObj_offset())); | 567 set_int(env, config, "threadObjectOffset", in_bytes(JavaThread::threadObj_offset())); |
568 set_int(env, config, "instanceHeaderPrototypeOffset", Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()); | 568 set_int(env, config, "instanceHeaderPrototypeOffset", Klass::prototype_header_offset_in_bytes() + klassOopDesc::klass_part_offset_in_bytes()); |
569 set_int(env, config, "threadExceptionOopOffset", in_bytes(JavaThread::exception_oop_offset())); | 569 set_int(env, config, "threadExceptionOopOffset", in_bytes(JavaThread::exception_oop_offset())); |
570 set_int(env, config, "threadExceptionPcOffset", in_bytes(JavaThread::exception_pc_offset())); | 570 set_int(env, config, "threadExceptionPcOffset", in_bytes(JavaThread::exception_pc_offset())); |
571 set_int(env, config, "threadMultiNewArrayStorage", in_bytes(JavaThread::c1x_multinewarray_storage_offset())); | 571 set_int(env, config, "threadMultiNewArrayStorage", in_bytes(JavaThread::graal_multinewarray_storage_offset())); |
572 set_int(env, config, "classMirrorOffset", klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes()); | 572 set_int(env, config, "classMirrorOffset", klassOopDesc::klass_part_offset_in_bytes() + Klass::java_mirror_offset_in_bytes()); |
573 | 573 |
574 set_long(env, config, "debugStub", VmIds::addStub((address)warning)); | 574 set_long(env, config, "debugStub", VmIds::addStub((address)warning)); |
575 set_long(env, config, "instanceofStub", VmIds::addStub(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); | 575 set_long(env, config, "instanceofStub", VmIds::addStub(Runtime1::entry_for(Runtime1::slow_subtype_check_id))); |
576 set_long(env, config, "verifyPointerStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_verify_pointer_id))); | 576 set_long(env, config, "verifyPointerStub", VmIds::addStub(Runtime1::entry_for(Runtime1::graal_verify_pointer_id))); |
577 set_long(env, config, "newInstanceStub", VmIds::addStub(Runtime1::entry_for(Runtime1::fast_new_instance_init_check_id))); | 577 set_long(env, config, "newInstanceStub", VmIds::addStub(Runtime1::entry_for(Runtime1::fast_new_instance_init_check_id))); |
578 set_long(env, config, "unresolvedNewInstanceStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_instance_id))); | 578 set_long(env, config, "unresolvedNewInstanceStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_instance_id))); |
579 set_long(env, config, "newTypeArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_type_array_id))); | 579 set_long(env, config, "newTypeArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_type_array_id))); |
580 set_long(env, config, "newObjectArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_object_array_id))); | 580 set_long(env, config, "newObjectArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_object_array_id))); |
581 set_long(env, config, "newMultiArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_multi_array_id))); | 581 set_long(env, config, "newMultiArrayStub", VmIds::addStub(Runtime1::entry_for(Runtime1::new_multi_array_id))); |
582 set_long(env, config, "loadKlassStub", VmIds::addStub(Runtime1::entry_for(Runtime1::load_klass_patching_id))); | 582 set_long(env, config, "loadKlassStub", VmIds::addStub(Runtime1::entry_for(Runtime1::load_klass_patching_id))); |
583 set_long(env, config, "accessFieldStub", VmIds::addStub(Runtime1::entry_for(Runtime1::access_field_patching_id))); | 583 set_long(env, config, "accessFieldStub", VmIds::addStub(Runtime1::entry_for(Runtime1::access_field_patching_id))); |
584 set_long(env, config, "resolveStaticCallStub", VmIds::addStub(SharedRuntime::get_resolve_static_call_stub())); | 584 set_long(env, config, "resolveStaticCallStub", VmIds::addStub(SharedRuntime::get_resolve_static_call_stub())); |
585 set_long(env, config, "inlineCacheMissStub", VmIds::addStub(SharedRuntime::get_ic_miss_stub())); | 585 set_long(env, config, "inlineCacheMissStub", VmIds::addStub(SharedRuntime::get_ic_miss_stub())); |
586 set_long(env, config, "unwindExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_unwind_exception_call_id))); | 586 set_long(env, config, "unwindExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::graal_unwind_exception_call_id))); |
587 set_long(env, config, "handleExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::handle_exception_nofpu_id))); | 587 set_long(env, config, "handleExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::handle_exception_nofpu_id))); |
588 set_long(env, config, "handleDeoptStub", VmIds::addStub(SharedRuntime::deopt_blob()->unpack())); | 588 set_long(env, config, "handleDeoptStub", VmIds::addStub(SharedRuntime::deopt_blob()->unpack())); |
589 set_long(env, config, "monitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorenter_id))); | 589 set_long(env, config, "monitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorenter_id))); |
590 set_long(env, config, "monitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorexit_id))); | 590 set_long(env, config, "monitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorexit_id))); |
591 set_long(env, config, "fastMonitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_monitorenter_id))); | 591 set_long(env, config, "fastMonitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::graal_monitorenter_id))); |
592 set_long(env, config, "fastMonitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_monitorexit_id))); | 592 set_long(env, config, "fastMonitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::graal_monitorexit_id))); |
593 set_long(env, config, "safepointPollingAddress", (jlong)(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()))); | 593 set_long(env, config, "safepointPollingAddress", (jlong)(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()))); |
594 | 594 |
595 BarrierSet* bs = Universe::heap()->barrier_set(); | 595 BarrierSet* bs = Universe::heap()->barrier_set(); |
596 switch (bs->kind()) { | 596 switch (bs->kind()) { |
597 case BarrierSet::CardTableModRef: | 597 case BarrierSet::CardTableModRef: |
640 return id; | 640 return id; |
641 } | 641 } |
642 | 642 |
643 // public void recordBailout(String reason); | 643 // public void recordBailout(String reason); |
644 JNIEXPORT void JNICALL Java_com_oracle_graal_runtime_VMEntries_recordBailout(JNIEnv *jniEnv, jobject, jobject message) { | 644 JNIEXPORT void JNICALL Java_com_oracle_graal_runtime_VMEntries_recordBailout(JNIEnv *jniEnv, jobject, jobject message) { |
645 if (C1XBailoutIsFatal) { | 645 if (GraalBailoutIsFatal) { |
646 Handle msg = JNIHandles::resolve(message); | 646 Handle msg = JNIHandles::resolve(message); |
647 if (!msg.is_null()) { | 647 if (!msg.is_null()) { |
648 java_lang_String::print(msg, tty); | 648 java_lang_String::print(msg, tty); |
649 } | 649 } |
650 vm_abort(false); | 650 vm_abort(false); |