Mercurial > hg > truffle
comparison src/share/vm/c1x/c1x_VMEntries.cpp @ 2048:177398c6147d
Added unique concrete subtype assumption.
author | Thomas Wuerthinger <wuerthinger@ssw.jku.at> |
---|---|
date | Mon, 10 Jan 2011 10:50:22 +0100 |
parents | cf75612bdaa5 |
children | 7e09ea4a8f36 |
comparison
equal
deleted
inserted
replaced
2047:eb575e79136f | 2048:177398c6147d |
---|---|
373 VM_ENTRY_MARK; | 373 VM_ENTRY_MARK; |
374 assert(JNIHandles::resolve(klass) != NULL, ""); | 374 assert(JNIHandles::resolve(klass) != NULL, ""); |
375 return JNIHandles::make_local(C1XCompiler::get_RiType(element_type, java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)), THREAD)); | 375 return JNIHandles::make_local(C1XCompiler::get_RiType(element_type, java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass)), THREAD)); |
376 } | 376 } |
377 | 377 |
378 | |
379 // public RiType RiType_uniqueConcreteSubtype(HotSpotResolvedType klass); | |
380 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1uniqueConcreteSubtype(JNIEnv *, jobject, jobject klass) { | |
381 | |
382 Thread* THREAD = Thread::current(); | |
383 KlassHandle klass_handle(java_lang_Class::as_klassOop(HotSpotTypeResolved::javaMirror(klass))); | |
384 ciInstanceKlass* k = NULL; | |
385 { | |
386 VM_ENTRY_MARK; | |
387 k = (ciInstanceKlass *) CURRENT_ENV->get_object(klass_handle()); | |
388 } | |
389 | |
390 if (k->is_abstract()) { | |
391 ciInstanceKlass* sub = k->unique_concrete_subklass(); | |
392 if (sub != NULL) { | |
393 VM_ENTRY_MARK; | |
394 return JNIHandles::make_local(C1XCompiler::get_RiType(sub, klass_handle, THREAD)); | |
395 } | |
396 } else if (k->is_leaf_type()) { | |
397 assert(!k->is_interface(), ""); | |
398 return klass; | |
399 } | |
400 | |
401 return NULL; | |
402 } | |
403 | |
378 // public RiType RiType_arrayOf(long vmId); | 404 // public RiType RiType_arrayOf(long vmId); |
379 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1arrayOf(JNIEnv *, jobject, jlong vmId) { | 405 JNIEXPORT jobject JNICALL Java_com_sun_hotspot_c1x_VMEntries_RiType_1arrayOf(JNIEnv *, jobject, jlong vmId) { |
380 VM_ENTRY_MARK; | 406 VM_ENTRY_MARK; |
381 | 407 |
382 instanceKlass* klass = instanceKlass::cast(VmIds::get<klassOop>(vmId)); | 408 instanceKlass* klass = instanceKlass::cast(VmIds::get<klassOop>(vmId)); |
572 {CC"RiConstantPool_lookupSignature", CC"("PROXY"I)"SIGNATURE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupSignature)}, | 598 {CC"RiConstantPool_lookupSignature", CC"("PROXY"I)"SIGNATURE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupSignature)}, |
573 {CC"RiConstantPool_lookupType", CC"("PROXY"I)"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupType)}, | 599 {CC"RiConstantPool_lookupType", CC"("PROXY"I)"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupType)}, |
574 {CC"RiConstantPool_lookupField", CC"("PROXY"IB)"FIELD, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupField)}, | 600 {CC"RiConstantPool_lookupField", CC"("PROXY"IB)"FIELD, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiConstantPool_1lookupField)}, |
575 {CC"RiType_constantPool", CC"("RESOLVED_TYPE")"CONSTANT_POOL, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1constantPool)}, | 601 {CC"RiType_constantPool", CC"("RESOLVED_TYPE")"CONSTANT_POOL, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1constantPool)}, |
576 {CC"RiType_resolveMethodImpl", CC"("RESOLVED_TYPE STRING STRING")"METHOD, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_3resolveMethodImpl)}, | 602 {CC"RiType_resolveMethodImpl", CC"("RESOLVED_TYPE STRING STRING")"METHOD, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_3resolveMethodImpl)}, |
577 {CC"RiType_isSubtypeOf", CC"("RESOLVED_TYPE TYPE")Z", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_2isSubtypeOf)}, | 603 {CC"RiType_isSubtypeOf", CC"("RESOLVED_TYPE TYPE")Z", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_2isSubtypeOf)}, |
578 {CC"RiType_componentType", CC"("RESOLVED_TYPE")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1componentType)}, | 604 {CC"RiType_componentType", CC"("RESOLVED_TYPE")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1componentType)}, |
605 {CC"RiType_uniqueConcreteSubtype", CC"("RESOLVED_TYPE")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1uniqueConcreteSubtype)}, | |
579 {CC"RiType_arrayOf", CC"("PROXY")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1arrayOf)}, | 606 {CC"RiType_arrayOf", CC"("PROXY")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_RiType_1arrayOf)}, |
580 {CC"getPrimitiveArrayType", CC"("CI_KIND")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_getPrimitiveArrayType)}, | 607 {CC"getPrimitiveArrayType", CC"("CI_KIND")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_getPrimitiveArrayType)}, |
581 {CC"getType", CC"("CLASS")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_getType)}, | 608 {CC"getType", CC"("CLASS")"TYPE, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_getType)}, |
582 {CC"getConfiguration", CC"()"CONFIG, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_getConfiguration)}, | 609 {CC"getConfiguration", CC"()"CONFIG, FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_getConfiguration)}, |
583 {CC"installMethod", CC"("TARGET_METHOD")V", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_installMethod)}, | 610 {CC"installMethod", CC"("TARGET_METHOD")V", FN_PTR(Java_com_sun_hotspot_c1x_VMEntries_installMethod)}, |