hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp
changeset 28187 fc19df82d6ee
parent 25374 d7fb2af5d53c
child 33105 294e48b4f704
--- a/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp	Wed Dec 10 16:45:55 2014 +0100
+++ b/hotspot/src/cpu/ppc/vm/nativeInst_ppc.cpp	Tue Dec 09 11:57:46 2014 +0100
@@ -100,10 +100,7 @@
   MacroAssembler* a = new MacroAssembler(&cb);
 
   // Patch the call.
-  if (ReoptimizeCallSequences &&
-      a->is_within_range_of_b(dest, addr_call)) {
-    a->bl(dest);
-  } else {
+  if (!ReoptimizeCallSequences || !a->is_within_range_of_b(dest, addr_call)) {
     address trampoline_stub_addr = get_trampoline();
 
     // We did not find a trampoline stub because the current codeblob
@@ -115,9 +112,12 @@
 
     // Patch the constant in the call's trampoline stub.
     NativeCallTrampolineStub_at(trampoline_stub_addr)->set_destination(dest);
+    dest = trampoline_stub_addr;
+  }
 
-    a->bl(trampoline_stub_addr);
-  }
+  OrderAccess::release();
+  a->bl(dest);
+
   ICache::ppc64_flush_icache_bytes(addr_call, code_size);
 }