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




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




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


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