src/share/vm/oops/methodOop.cpp

Print this page

        

*** 529,552 **** return best_line; } bool methodOopDesc::is_klass_loaded_by_klass_index(int klass_index) const { ! if( _constants->tag_at(klass_index).is_unresolved_klass() ) { Thread *thread = Thread::current(); ! Symbol* klass_name = _constants->klass_name_at(klass_index); Handle loader(thread, instanceKlass::cast(method_holder())->class_loader()); Handle prot (thread, Klass::cast(method_holder())->protection_domain()); return SystemDictionary::find(klass_name, loader, prot, thread) != NULL; } else { return true; } } bool methodOopDesc::is_klass_loaded(int refinfo_index, bool must_be_resolved) const { ! int klass_index = _constants->klass_ref_index_at(refinfo_index); if (must_be_resolved) { // Make sure klass is resolved in constantpool. if (constants()->tag_at(klass_index).is_unresolved_klass()) return false; } return is_klass_loaded_by_klass_index(klass_index); --- 529,552 ---- return best_line; } bool methodOopDesc::is_klass_loaded_by_klass_index(int klass_index) const { ! if( constants()->tag_at(klass_index).is_unresolved_klass() ) { Thread *thread = Thread::current(); ! Symbol* klass_name = constants()->klass_name_at(klass_index); Handle loader(thread, instanceKlass::cast(method_holder())->class_loader()); Handle prot (thread, Klass::cast(method_holder())->protection_domain()); return SystemDictionary::find(klass_name, loader, prot, thread) != NULL; } else { return true; } } bool methodOopDesc::is_klass_loaded(int refinfo_index, bool must_be_resolved) const { ! int klass_index = constants()->klass_ref_index_at(refinfo_index); if (must_be_resolved) { // Make sure klass is resolved in constantpool. if (constants()->tag_at(klass_index).is_unresolved_klass()) return false; } return is_klass_loaded_by_klass_index(klass_index);
*** 884,898 **** assert(mt->klass() == SystemDictionary::MethodType_klass(), ""); return mt; } jint* methodOopDesc::method_type_offsets_chain() { ! static jint pchase[] = { -1, -1, -1 }; if (pchase[0] == -1) { ! jint step0 = in_bytes(constants_offset()); ! jint step1 = (constantPoolOopDesc::header_size() + _imcp_method_type_value) * HeapWordSize; // do this in reverse to avoid races: OrderAccess::release_store(&pchase[1], step1); OrderAccess::release_store(&pchase[0], step0); } return pchase; } --- 884,900 ---- assert(mt->klass() == SystemDictionary::MethodType_klass(), ""); return mt; } jint* methodOopDesc::method_type_offsets_chain() { ! static jint pchase[] = { -1, -1, -1, -1 }; if (pchase[0] == -1) { ! jint step0 = in_bytes(const_offset()); ! jint step1 = in_bytes(constMethodOopDesc::constants_offset()); ! jint step2 = (constantPoolOopDesc::header_size() + _imcp_method_type_value) * HeapWordSize; // do this in reverse to avoid races: + OrderAccess::release_store(&pchase[2], step2); OrderAccess::release_store(&pchase[1], step1); OrderAccess::release_store(&pchase[0], step0); } return pchase; }
*** 1074,1086 **** memcpy(newcm, m->constMethod(), sizeof(constMethodOopDesc)); m->constMethod()->set_is_conc_safe(oopDesc::IsSafeConc); assert(m->constMethod()->is_parsable(), "Should remain parsable"); // Reset correct method/const method, method size, and parameter info - newcm->set_method(newm()); newm->set_constMethod(newcm); - assert(newcm->method() == newm(), "check"); newm->constMethod()->set_code_size(new_code_length); newm->constMethod()->set_constMethod_size(new_const_method_size); newm->set_method_size(new_method_size); assert(newm->code_size() == new_code_length, "check"); assert(newm->checked_exceptions_length() == checked_exceptions_len, "check"); --- 1076,1086 ----