--- a/hotspot/src/share/vm/oops/methodOop.cpp Fri Jun 01 15:30:44 2012 -0700
+++ b/hotspot/src/share/vm/oops/methodOop.cpp Wed Jun 06 14:33:43 2012 -0400
@@ -531,9 +531,9 @@
bool methodOopDesc::is_klass_loaded_by_klass_index(int klass_index) const {
- if( _constants->tag_at(klass_index).is_unresolved_klass() ) {
+ if( constants()->tag_at(klass_index).is_unresolved_klass() ) {
Thread *thread = Thread::current();
- Symbol* klass_name = _constants->klass_name_at(klass_index);
+ 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;
@@ -544,7 +544,7 @@
bool methodOopDesc::is_klass_loaded(int refinfo_index, bool must_be_resolved) const {
- int klass_index = _constants->klass_ref_index_at(refinfo_index);
+ 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;
@@ -886,11 +886,13 @@
}
jint* methodOopDesc::method_type_offsets_chain() {
- static jint pchase[] = { -1, -1, -1 };
+ static jint pchase[] = { -1, -1, -1, -1 };
if (pchase[0] == -1) {
- jint step0 = in_bytes(constants_offset());
- jint step1 = (constantPoolOopDesc::header_size() + _imcp_method_type_value) * HeapWordSize;
+ 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);
}
@@ -1076,9 +1078,7 @@
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);