src/share/vm/oops/cpCache.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File hotspot Sdiff src/share/vm/oops

src/share/vm/oops/cpCache.cpp

Print this page




 390         Method* m = f2_as_vfinal_method();
 391         assert(m->is_method(), "");
 392         return m;
 393       } else {
 394         int holder_index = cpool->uncached_klass_ref_index_at(constant_pool_index());
 395         if (cpool->tag_at(holder_index).is_klass()) {
 396           Klass* klass = cpool->resolved_klass_at(holder_index);
 397           if (!klass->oop_is_instance())
 398             klass = SystemDictionary::Object_klass();
 399           return InstanceKlass::cast(klass)->method_at_vtable(f2_as_index());
 400         }
 401       }
 402       break;
 403     }
 404   }
 405   return NULL;
 406 }
 407 
 408 
 409 oop ConstantPoolCacheEntry::appendix_if_resolved(constantPoolHandle cpool) {
 410   if (is_f1_null() || !has_appendix())
 411     return NULL;
 412   const int ref_index = f2_as_index() + _indy_resolved_references_appendix_offset;
 413   objArrayOop resolved_references = cpool->resolved_references();
 414   return resolved_references->obj_at(ref_index);
 415 }
 416 
 417 
 418 oop ConstantPoolCacheEntry::method_type_if_resolved(constantPoolHandle cpool) {
 419   if (is_f1_null() || !has_method_type())
 420     return NULL;
 421   const int ref_index = f2_as_index() + _indy_resolved_references_method_type_offset;
 422   objArrayOop resolved_references = cpool->resolved_references();
 423   return resolved_references->obj_at(ref_index);
 424 }
 425 
 426 
 427 #if INCLUDE_JVMTI
 428 // RedefineClasses() API support:
 429 // If this ConstantPoolCacheEntry refers to old_method then update it
 430 // to refer to new_method.
 431 bool ConstantPoolCacheEntry::adjust_method_entry(Method* old_method,
 432        Method* new_method, bool * trace_name_printed) {
 433 
 434   if (is_vfinal()) {
 435     // virtual and final so _f2 contains method ptr instead of vtable index
 436     if (f2_as_vfinal_method() == old_method) {
 437       // match old_method so need an update
 438       // NOTE: can't use set_f2_as_vfinal_method as it asserts on different values
 439       _f2 = (intptr_t)new_method;




 390         Method* m = f2_as_vfinal_method();
 391         assert(m->is_method(), "");
 392         return m;
 393       } else {
 394         int holder_index = cpool->uncached_klass_ref_index_at(constant_pool_index());
 395         if (cpool->tag_at(holder_index).is_klass()) {
 396           Klass* klass = cpool->resolved_klass_at(holder_index);
 397           if (!klass->oop_is_instance())
 398             klass = SystemDictionary::Object_klass();
 399           return InstanceKlass::cast(klass)->method_at_vtable(f2_as_index());
 400         }
 401       }
 402       break;
 403     }
 404   }
 405   return NULL;
 406 }
 407 
 408 
 409 oop ConstantPoolCacheEntry::appendix_if_resolved(constantPoolHandle cpool) {
 410   if (!has_appendix())
 411     return NULL;
 412   const int ref_index = f2_as_index() + _indy_resolved_references_appendix_offset;
 413   objArrayOop resolved_references = cpool->resolved_references();
 414   return resolved_references->obj_at(ref_index);
 415 }
 416 
 417 
 418 oop ConstantPoolCacheEntry::method_type_if_resolved(constantPoolHandle cpool) {
 419   if (!has_method_type())
 420     return NULL;
 421   const int ref_index = f2_as_index() + _indy_resolved_references_method_type_offset;
 422   objArrayOop resolved_references = cpool->resolved_references();
 423   return resolved_references->obj_at(ref_index);
 424 }
 425 
 426 
 427 #if INCLUDE_JVMTI
 428 // RedefineClasses() API support:
 429 // If this ConstantPoolCacheEntry refers to old_method then update it
 430 // to refer to new_method.
 431 bool ConstantPoolCacheEntry::adjust_method_entry(Method* old_method,
 432        Method* new_method, bool * trace_name_printed) {
 433 
 434   if (is_vfinal()) {
 435     // virtual and final so _f2 contains method ptr instead of vtable index
 436     if (f2_as_vfinal_method() == old_method) {
 437       // match old_method so need an update
 438       // NOTE: can't use set_f2_as_vfinal_method as it asserts on different values
 439       _f2 = (intptr_t)new_method;


src/share/vm/oops/cpCache.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File