--- old/src/cpu/ppc/vm/nativeInst_ppc.cpp 2017-09-14 15:57:38.929899265 +0300 +++ new/src/cpu/ppc/vm/nativeInst_ppc.cpp 2017-09-14 15:57:38.843232602 +0300 @@ -221,12 +221,11 @@ // A calculation relative to the global TOC. if (MacroAssembler::get_address_of_calculate_address_from_global_toc_at(addr, cb->content_begin()) != (address)data) { - const int invalidated_range = + const int other_insn_offset = MacroAssembler::patch_calculate_address_from_global_toc_at(addr, cb->content_begin(), (address)data); - const address start = invalidated_range < 0 ? addr + invalidated_range : addr; - // FIXME: - const int range = invalidated_range < 0 ? 4 - invalidated_range : 8; + const address start = other_insn_offset < 0 ? addr + other_insn_offset : addr; + const int range = BytesPerInstWord + abs(other_insn_offset); ICache::ppc64_flush_icache_bytes(start, range); } next_address = addr + 1 * BytesPerInstWord; @@ -291,11 +290,10 @@ address addr = addr_at(0); CodeBlob* cb = (code) ? code : CodeCache::find_blob(instruction_address()); if (MacroAssembler::get_narrow_oop(addr, cb->content_begin()) == (long)data) return; - const int invalidated_range = + const int other_insn_offset = MacroAssembler::patch_set_narrow_oop(addr, cb->content_begin(), (long)data); - const address start = invalidated_range < 0 ? addr + invalidated_range : addr; - // FIXME: - const int range = invalidated_range < 0 ? 4 - invalidated_range : 8; + const address start = other_insn_offset < 0 ? addr + other_insn_offset : addr; + const int range = BytesPerInstWord + abs(other_insn_offset); ICache::ppc64_flush_icache_bytes(start, range); }