diff -r 97c4abf5aa0a -r fff6b7b5611f hotspot/src/share/vm/aot/aotCompiledMethod.cpp --- a/hotspot/src/share/vm/aot/aotCompiledMethod.cpp Mon Feb 06 14:20:33 2017 -0800 +++ b/hotspot/src/share/vm/aot/aotCompiledMethod.cpp Wed Jan 18 14:36:54 2017 -0800 @@ -71,15 +71,6 @@ } #endif -void AOTCompiledMethod::oops_do(OopClosure* f) { - if (_oop != NULL) { - f->do_oop(&_oop); - } -#if 0 - metadata_oops_do(metadata_begin(), metadata_end(), f); -#endif -} - bool AOTCompiledMethod::do_unloading_oops(address low_boundary, BoolObjectClosure* is_alive, bool unloading_occurred) { return false; } @@ -161,9 +152,6 @@ *entry = (Metadata*)meta; // Should be atomic on x64 return (Metadata*)m; } - // need to resolve it here..., patching of GOT need to be CAS or atomic operation. - // FIXIT: need methods for debuginfo. - // return _method; } ShouldNotReachHere(); return NULL; } @@ -288,11 +276,19 @@ f(cichk->holder_method()); f(cichk->holder_klass()); } else { + // Get Klass* or NULL (if value is -1) from GOT cell of virtual call PLT stub. Metadata* ic_oop = ic->cached_metadata(); if (ic_oop != NULL) { f(ic_oop); } } + } else if (iter.type() == relocInfo::static_call_type || + iter.type() == relocInfo::opt_virtual_call_type){ + // Check Method* in AOT c2i stub for other calls. + Metadata* meta = (Metadata*)nativeLoadGot_at(nativePltCall_at(iter.addr())->plt_c2i_stub())->data(); + if (meta != NULL) { + f(meta); + } } } } @@ -332,7 +328,12 @@ st->print("%4d ", _aot_id); // print compilation number st->print(" aot[%2d]", _heap->dso_id()); // Stubs have _method == NULL - st->print(" %s", (_method == NULL ? _name : _method->name_and_sig_as_C_string())); + if (_method == NULL) { + st->print(" %s", _name); + } else { + ResourceMark m; + st->print(" %s", _method->name_and_sig_as_C_string()); + } if (Verbose) { st->print(" entry at " INTPTR_FORMAT, p2i(_code)); }