Mercurial > hg > truffle
comparison src/share/vm/c1/c1_Runtime1.cpp @ 6983:070d523b96a7
8001471: Klass::cast() does nothing
Summary: Remove function Klass::cast() and calls to it.
Reviewed-by: dholmes, coleenp
author | hseigel |
---|---|
date | Mon, 12 Nov 2012 16:15:05 -0500 |
parents | d8ce2825b193 |
children | 2cb439954abf 46f6f063b272 |
comparison
equal
deleted
inserted
replaced
6981:8c413497f434 | 6983:070d523b96a7 |
---|---|
372 JRT_END | 372 JRT_END |
373 | 373 |
374 | 374 |
375 JRT_ENTRY(void, Runtime1::throw_array_store_exception(JavaThread* thread, oopDesc* obj)) | 375 JRT_ENTRY(void, Runtime1::throw_array_store_exception(JavaThread* thread, oopDesc* obj)) |
376 ResourceMark rm(thread); | 376 ResourceMark rm(thread); |
377 const char* klass_name = Klass::cast(obj->klass())->external_name(); | 377 const char* klass_name = obj->klass()->external_name(); |
378 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayStoreException(), klass_name); | 378 SharedRuntime::throw_and_post_jvmti_exception(thread, vmSymbols::java_lang_ArrayStoreException(), klass_name); |
379 JRT_END | 379 JRT_END |
380 | 380 |
381 | 381 |
382 // counter_overflow() is called from within C1-compiled methods. The enclosing method is the method | 382 // counter_overflow() is called from within C1-compiled methods. The enclosing method is the method |
629 | 629 |
630 JRT_ENTRY(void, Runtime1::throw_class_cast_exception(JavaThread* thread, oopDesc* object)) | 630 JRT_ENTRY(void, Runtime1::throw_class_cast_exception(JavaThread* thread, oopDesc* object)) |
631 NOT_PRODUCT(_throw_class_cast_exception_count++;) | 631 NOT_PRODUCT(_throw_class_cast_exception_count++;) |
632 ResourceMark rm(thread); | 632 ResourceMark rm(thread); |
633 char* message = SharedRuntime::generate_class_cast_message( | 633 char* message = SharedRuntime::generate_class_cast_message( |
634 thread, Klass::cast(object->klass())->external_name()); | 634 thread, object->klass()->external_name()); |
635 SharedRuntime::throw_and_post_jvmti_exception( | 635 SharedRuntime::throw_and_post_jvmti_exception( |
636 thread, vmSymbols::java_lang_ClassCastException(), message); | 636 thread, vmSymbols::java_lang_ClassCastException(), message); |
637 JRT_END | 637 JRT_END |
638 | 638 |
639 | 639 |
874 } | 874 } |
875 break; | 875 break; |
876 case Bytecodes::_anewarray: | 876 case Bytecodes::_anewarray: |
877 { Bytecode_anewarray anew(caller_method(), caller_method->bcp_from(bci)); | 877 { Bytecode_anewarray anew(caller_method(), caller_method->bcp_from(bci)); |
878 Klass* ek = caller_method->constants()->klass_at(anew.index(), CHECK); | 878 Klass* ek = caller_method->constants()->klass_at(anew.index(), CHECK); |
879 k = Klass::cast(ek)->array_klass(CHECK); | 879 k = ek->array_klass(CHECK); |
880 } | 880 } |
881 break; | 881 break; |
882 case Bytecodes::_ldc: | 882 case Bytecodes::_ldc: |
883 case Bytecodes::_ldc_w: | 883 case Bytecodes::_ldc_w: |
884 { | 884 { |
1234 bs->write_ref_array((HeapWord*)dst_addr, length); | 1234 bs->write_ref_array((HeapWord*)dst_addr, length); |
1235 return ac_ok; | 1235 return ac_ok; |
1236 } else { | 1236 } else { |
1237 Klass* bound = ObjArrayKlass::cast(dst->klass())->element_klass(); | 1237 Klass* bound = ObjArrayKlass::cast(dst->klass())->element_klass(); |
1238 Klass* stype = ObjArrayKlass::cast(src->klass())->element_klass(); | 1238 Klass* stype = ObjArrayKlass::cast(src->klass())->element_klass(); |
1239 if (stype == bound || Klass::cast(stype)->is_subtype_of(bound)) { | 1239 if (stype == bound || stype->is_subtype_of(bound)) { |
1240 // Elements are guaranteed to be subtypes, so no check necessary | 1240 // Elements are guaranteed to be subtypes, so no check necessary |
1241 bs->write_ref_array_pre(dst_addr, length); | 1241 bs->write_ref_array_pre(dst_addr, length); |
1242 Copy::conjoint_oops_atomic(src_addr, dst_addr, length); | 1242 Copy::conjoint_oops_atomic(src_addr, dst_addr, length); |
1243 bs->write_ref_array((HeapWord*)dst_addr, length); | 1243 bs->write_ref_array((HeapWord*)dst_addr, length); |
1244 return ac_ok; | 1244 return ac_ok; |