Mercurial > hg > graal-jvmci-8
comparison src/share/vm/c1x/c1x_VMEntries.cpp @ 1942:00bc9eaf0e24
Support for -XX:+UseFastLocking flag. Fixed monitor enter XIR template for correct debug info at the runtime call.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Wed, 29 Dec 2010 20:06:41 +0100 |
parents | 79d04223b8a5 |
children | 9c96c873c42b |
comparison
equal
deleted
inserted
replaced
1941:79d04223b8a5 | 1942:00bc9eaf0e24 |
---|---|
139 result = VMExits::createRiTypePrimitive((int) T_FLOAT, THREAD); | 139 result = VMExits::createRiTypePrimitive((int) T_FLOAT, THREAD); |
140 } else { | 140 } else { |
141 klassOop resolved_type = NULL; | 141 klassOop resolved_type = NULL; |
142 // if the name isn't in the symbol table then the class isn't loaded anyway... | 142 // if the name isn't in the symbol table then the class isn't loaded anyway... |
143 if (nameSymbol != NULL) { | 143 if (nameSymbol != NULL) { |
144 Handle classloader = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(accessingClass))->klass_part()->class_loader(); | 144 Handle classloader; |
145 Handle protectionDomain = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(accessingClass))->klass_part()->protection_domain(); | 145 Handle protectionDomain; |
146 if (JNIHandles::resolve(accessingClass) != NULL) { | |
147 classloader = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(accessingClass))->klass_part()->class_loader(); | |
148 protectionDomain = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(accessingClass))->klass_part()->protection_domain(); | |
149 } | |
146 resolved_type = SystemDictionary::resolve_or_null(nameSymbol, classloader, protectionDomain, THREAD); | 150 resolved_type = SystemDictionary::resolve_or_null(nameSymbol, classloader, protectionDomain, THREAD); |
147 if (HAS_PENDING_EXCEPTION) { | 151 if (HAS_PENDING_EXCEPTION) { |
148 CLEAR_PENDING_EXCEPTION; | 152 CLEAR_PENDING_EXCEPTION; |
149 resolved_type = NULL; | 153 resolved_type = NULL; |
150 } | 154 } |
308 | 312 |
309 // public RiConstantPool RiType_constantPool(HotSpotTypeResolved klass); | 313 // public RiConstantPool RiType_constantPool(HotSpotTypeResolved klass); |
310 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1constantPool(JNIEnv *, jobject, jobject klass) { | 314 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1constantPool(JNIEnv *, jobject, jobject klass) { |
311 VM_ENTRY_MARK; | 315 VM_ENTRY_MARK; |
312 | 316 |
317 assert(JNIHandles::resolve(klass) != NULL, ""); | |
313 constantPoolOop constantPool = ((instanceKlass*)java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))->klass_part())->constants(); | 318 constantPoolOop constantPool = ((instanceKlass*)java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))->klass_part())->constants(); |
314 return JNIHandles::make_local(VMExits::createRiConstantPool(VmIds::add<constantPoolOop>(constantPool), THREAD)); | 319 return JNIHandles::make_local(VMExits::createRiConstantPool(VmIds::add<constantPoolOop>(constantPool), THREAD)); |
315 } | 320 } |
316 | 321 |
317 // public RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature); | 322 // public RiMethod RiType_resolveMethodImpl(HotSpotTypeResolved klass, String name, String signature); |
318 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_3resolveMethodImpl(JNIEnv *, jobject, jobject resolved_type, jstring name, jstring signature) { | 323 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_3resolveMethodImpl(JNIEnv *, jobject, jobject resolved_type, jstring name, jstring signature) { |
319 VM_ENTRY_MARK; | 324 VM_ENTRY_MARK; |
320 | 325 |
326 assert(JNIHandles::resolve(resolved_type) != NULL, ""); | |
321 klassOop klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(resolved_type)); | 327 klassOop klass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(resolved_type)); |
322 symbolOop name_symbol = VmIds::toSymbol(name); | 328 symbolOop name_symbol = VmIds::toSymbol(name); |
323 symbolOop signature_symbol = VmIds::toSymbol(signature); | 329 symbolOop signature_symbol = VmIds::toSymbol(signature); |
324 methodOop method = klass->klass_part()->lookup_method(name_symbol, signature_symbol); | 330 methodOop method = klass->klass_part()->lookup_method(name_symbol, signature_symbol); |
325 if (method == NULL) { | 331 if (method == NULL) { |
334 | 340 |
335 // public boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other); | 341 // public boolean RiType_isSubtypeOf(HotSpotTypeResolved klass, RiType other); |
336 JNIEXPORT jboolean JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_2isSubtypeOf(JNIEnv *, jobject, jobject klass, jobject jother) { | 342 JNIEXPORT jboolean JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_2isSubtypeOf(JNIEnv *, jobject, jobject klass, jobject jother) { |
337 oop other = JNIHandles::resolve(jother); | 343 oop other = JNIHandles::resolve(jother); |
338 assert(other->is_a(HotSpotTypeResolved::klass()), "resolved hotspot type expected"); | 344 assert(other->is_a(HotSpotTypeResolved::klass()), "resolved hotspot type expected"); |
345 assert(JNIHandles::resolve(klass) != NULL, ""); | |
339 klassOop thisKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)); | 346 klassOop thisKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)); |
340 klassOop otherKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(other)); | 347 klassOop otherKlass = java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(other)); |
341 if (thisKlass->klass_part()->oop_is_instance_slow()) { | 348 if (thisKlass->klass_part()->oop_is_instance_slow()) { |
342 return instanceKlass::cast(thisKlass)->is_subtype_of(otherKlass); | 349 return instanceKlass::cast(thisKlass)->is_subtype_of(otherKlass); |
343 } else if (thisKlass->klass_part()->oop_is_array()) { | 350 } else if (thisKlass->klass_part()->oop_is_array()) { |
350 // public RiType RiType_componentType(HotSpotResolvedType klass); | 357 // public RiType RiType_componentType(HotSpotResolvedType klass); |
351 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1componentType(JNIEnv *, jobject, jobject klass) { | 358 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1componentType(JNIEnv *, jobject, jobject klass) { |
352 ciArrayKlass* array_klass; | 359 ciArrayKlass* array_klass; |
353 { | 360 { |
354 VM_ENTRY_MARK; | 361 VM_ENTRY_MARK; |
362 assert(JNIHandles::resolve(klass) != NULL, ""); | |
355 array_klass = (ciArrayKlass *) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); | 363 array_klass = (ciArrayKlass *) CURRENT_ENV->get_object(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); |
356 } | 364 } |
357 ciType* element_type = array_klass->element_type(); | 365 ciType* element_type = array_klass->element_type(); |
358 | 366 |
359 VM_ENTRY_MARK; | 367 VM_ENTRY_MARK; |
368 assert(JNIHandles::resolve(klass) != NULL, ""); | |
360 return JNIHandles::make_local(C1XCompiler::get_RiType(element_type, java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)), THREAD)); | 369 return JNIHandles::make_local(C1XCompiler::get_RiType(element_type, java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)), THREAD)); |
361 } | 370 } |
362 | 371 |
363 // public RiType RiType_arrayOf(long vmId); | 372 // public RiType RiType_arrayOf(long vmId); |
364 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1arrayOf(JNIEnv *, jobject, jlong vmId) { | 373 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1arrayOf(JNIEnv *, jobject, jlong vmId) { |
425 set_boolean(env, config, "windowsOs", true); | 434 set_boolean(env, config, "windowsOs", true); |
426 #else | 435 #else |
427 set_boolean(env, config, "windowsOs", false); | 436 set_boolean(env, config, "windowsOs", false); |
428 #endif | 437 #endif |
429 set_boolean(env, config, "verifyPointers", VerifyOops); | 438 set_boolean(env, config, "verifyPointers", VerifyOops); |
439 set_boolean(env, config, "useFastLocking", UseFastLocking); | |
430 set_int(env, config, "codeEntryAlignment", CodeEntryAlignment); | 440 set_int(env, config, "codeEntryAlignment", CodeEntryAlignment); |
431 set_int(env, config, "vmPageSize", os::vm_page_size()); | 441 set_int(env, config, "vmPageSize", os::vm_page_size()); |
432 set_int(env, config, "stackShadowPages", StackShadowPages); | 442 set_int(env, config, "stackShadowPages", StackShadowPages); |
433 set_int(env, config, "hubOffset", oopDesc::klass_offset_in_bytes()); | 443 set_int(env, config, "hubOffset", oopDesc::klass_offset_in_bytes()); |
434 set_int(env, config, "arrayLengthOffset", arrayOopDesc::length_offset_in_bytes()); | 444 set_int(env, config, "arrayLengthOffset", arrayOopDesc::length_offset_in_bytes()); |
457 set_long(env, config, "handleExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::handle_exception_nofpu_id))); | 467 set_long(env, config, "handleExceptionStub", VmIds::addStub(Runtime1::entry_for(Runtime1::handle_exception_nofpu_id))); |
458 set_long(env, config, "handleDeoptStub", VmIds::addStub(SharedRuntime::deopt_blob()->unpack())); | 468 set_long(env, config, "handleDeoptStub", VmIds::addStub(SharedRuntime::deopt_blob()->unpack())); |
459 set_long(env, config, "throwClassCastException", VmIds::addStub(Runtime1::entry_for(Runtime1::throw_class_cast_exception_id))); | 469 set_long(env, config, "throwClassCastException", VmIds::addStub(Runtime1::entry_for(Runtime1::throw_class_cast_exception_id))); |
460 set_long(env, config, "throwArrayStoreException", VmIds::addStub(Runtime1::entry_for(Runtime1::throw_array_store_exception_id))); | 470 set_long(env, config, "throwArrayStoreException", VmIds::addStub(Runtime1::entry_for(Runtime1::throw_array_store_exception_id))); |
461 set_long(env, config, "throwArrayIndexException", VmIds::addStub(Runtime1::entry_for(Runtime1::throw_range_check_failed_id))); | 471 set_long(env, config, "throwArrayIndexException", VmIds::addStub(Runtime1::entry_for(Runtime1::throw_range_check_failed_id))); |
462 set_long(env, config, "monitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_monitorenter_id))); | 472 set_long(env, config, "monitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorenter_id))); |
463 set_long(env, config, "monitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_monitorexit_id))); | 473 set_long(env, config, "monitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::monitorexit_id))); |
474 set_long(env, config, "fastMonitorEnterStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_monitorenter_id))); | |
475 set_long(env, config, "fastMonitorExitStub", VmIds::addStub(Runtime1::entry_for(Runtime1::c1x_monitorexit_id))); | |
464 set_long(env, config, "safepointPollingAddress", (jlong)(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()))); | 476 set_long(env, config, "safepointPollingAddress", (jlong)(os::get_polling_page() + (SafepointPollOffset % os::vm_page_size()))); |
465 | 477 |
466 BarrierSet* bs = Universe::heap()->barrier_set(); | 478 BarrierSet* bs = Universe::heap()->barrier_set(); |
467 switch (bs->kind()) { | 479 switch (bs->kind()) { |
468 case BarrierSet::CardTableModRef: | 480 case BarrierSet::CardTableModRef: |