--- old/src/share/vm/code/relocInfo.cpp 2016-10-31 17:46:40.000000000 -0700 +++ new/src/share/vm/code/relocInfo.cpp 2016-10-31 17:46:40.000000000 -0700 @@ -565,14 +565,18 @@ short* p = (short*) dest->locs_end(); CodeSection* insts = dest->outer()->insts(); normalize_address(_static_call, insts); - p = pack_1_int_to(p, scaled_offset(_static_call, insts->start())); + jint is_aot = _is_aot ? 1 : 0; + p = pack_2_ints_to(p, scaled_offset(_static_call, insts->start()), is_aot); dest->set_locs_end((relocInfo*) p); } void static_stub_Relocation::unpack_data() { address base = binding()->section_start(CodeBuffer::SECT_INSTS); - jint offset = unpack_1_int(); + jint offset; + jint is_aot; + unpack_2_ints(offset, is_aot); _static_call = address_from_scaled_offset(offset, base); + _is_aot = (is_aot == 1); } void trampoline_stub_Relocation::pack_data_to(CodeSection* dest ) { @@ -796,14 +800,14 @@ } -address opt_virtual_call_Relocation::static_stub() { +address opt_virtual_call_Relocation::static_stub(bool is_aot) { // search for the static stub who points back to this static call address static_call_addr = addr(); RelocIterator iter(code()); while (iter.next()) { if (iter.type() == relocInfo::static_stub_type) { static_stub_Relocation* stub_reloc = iter.static_stub_reloc(); - if (stub_reloc->static_call() == static_call_addr) { + if (stub_reloc->static_call() == static_call_addr && stub_reloc->is_aot() == is_aot) { return iter.addr(); } } @@ -832,19 +836,19 @@ void static_call_Relocation::clear_inline_cache() { // Safe call site info - CompiledStaticCall* handler = compiledStaticCall_at(this); + CompiledStaticCall* handler = this->code()->compiledStaticCall_at(this); handler->set_to_clean(); } -address static_call_Relocation::static_stub() { +address static_call_Relocation::static_stub(bool is_aot) { // search for the static stub who points back to this static call address static_call_addr = addr(); RelocIterator iter(code()); while (iter.next()) { if (iter.type() == relocInfo::static_stub_type) { static_stub_Relocation* stub_reloc = iter.static_stub_reloc(); - if (stub_reloc->static_call() == static_call_addr) { + if (stub_reloc->static_call() == static_call_addr && stub_reloc->is_aot() == is_aot) { return iter.addr(); } } @@ -875,7 +879,7 @@ void static_stub_Relocation::clear_inline_cache() { // Call stub is only used when calling the interpreted code. // It does not really need to be cleared, except that we want to clean out the methodoop. - CompiledStaticCall::set_stub_to_clean(this); + CompiledDirectStaticCall::set_stub_to_clean(this); }