< prev index next >

src/cpu/ppc/vm/nativeInst_ppc.cpp

Print this page

        

@@ -219,16 +219,16 @@
   } else if (cb != NULL &&
              MacroAssembler::is_calculate_address_from_global_toc_at(addr, cb->content_begin())) {
     // 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;
   } else if (MacroAssembler::is_load_const_at(addr)) {
     // A normal 5 instruction load_const code sequence.

@@ -289,15 +289,15 @@
 
 void NativeMovConstReg::set_narrow_oop(narrowOop data, CodeBlob *code /* = NULL */) {
   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);
 }
 
 // Do not use an assertion here. Let clients decide whether they only
 // want this when assertions are enabled.
< prev index next >