--- old/src/cpu/ppc/vm/nativeInst_ppc.cpp 2017-09-14 21:06:06.872433101 +0300 +++ new/src/cpu/ppc/vm/nativeInst_ppc.cpp 2017-09-14 21:06:06.785766438 +0300 @@ -221,12 +221,12 @@ // 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 first_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; + assert(first_insn_offset > 0, "first instruction must be found"); + const address start = addr - first_insn_offset; + const int range = BytesPerInstWord + first_insn_offset; ICache::ppc64_flush_icache_bytes(start, range); } next_address = addr + 1 * BytesPerInstWord; @@ -291,11 +291,11 @@ 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 first_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; + assert(first_insn_offset > 0, "first instruction must be found"); + const address start = addr - first_insn_offset; + const int range = BytesPerInstWord + first_insn_offset; ICache::ppc64_flush_icache_bytes(start, range); }