hotspot/src/cpu/x86/vm/frame_x86.cpp
changeset 10733 49cc61508e86
parent 10539 f87cedf7983c
child 10980 8b23df12c7f6
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri Oct 07 13:28:44 2011 +0200
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Tue Oct 11 02:19:37 2011 -0700
@@ -232,11 +232,13 @@
 
 
 void frame::patch_pc(Thread* thread, address pc) {
+  address* pc_addr = &(((address*) sp())[-1]);
   if (TracePcPatching) {
-    tty->print_cr("patch_pc at address" INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "] ",
-                  &((address *)sp())[-1], ((address *)sp())[-1], pc);
+    tty->print_cr("patch_pc at address " INTPTR_FORMAT " [" INTPTR_FORMAT " -> " INTPTR_FORMAT "] ",
+                  pc_addr, *pc_addr, pc);
   }
-  ((address *)sp())[-1] = pc;
+  assert(_pc == *pc_addr, err_msg("must be: " INTPTR_FORMAT " == " INTPTR_FORMAT, _pc, *pc_addr));
+  *pc_addr = pc;
   _cb = CodeCache::find_blob(pc);
   address original_pc = nmethod::get_deopt_original_pc(this);
   if (original_pc != NULL) {
@@ -671,4 +673,3 @@
   // used to reset the saved FP
   return fp();
 }
-