7081938: JSR292: assert(magic_number_2() == MAGIC_NUMBER_2) failed
authortwisti
Tue, 11 Oct 2011 02:19:37 -0700
changeset 10733 49cc61508e86
parent 10732 6a893b38ee30
child 10734 065435337883
7081938: JSR292: assert(magic_number_2() == MAGIC_NUMBER_2) failed Reviewed-by: never, bdelsart
hotspot/src/cpu/x86/vm/frame_x86.cpp
hotspot/src/cpu/x86/vm/methodHandles_x86.cpp
hotspot/src/cpu/x86/vm/methodHandles_x86.hpp
--- 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();
 }
-
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Fri Oct 07 13:28:44 2011 +0200
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.cpp	Tue Oct 11 02:19:37 2011 -0700
@@ -410,8 +410,8 @@
 
 void MethodHandles::RicochetFrame::verify() const {
   verify_offsets();
-  assert(magic_number_1() == MAGIC_NUMBER_1, "");
-  assert(magic_number_2() == MAGIC_NUMBER_2, "");
+  assert(magic_number_1() == MAGIC_NUMBER_1, err_msg(PTR_FORMAT " == " PTR_FORMAT, magic_number_1(), MAGIC_NUMBER_1));
+  assert(magic_number_2() == MAGIC_NUMBER_2, err_msg(PTR_FORMAT " == " PTR_FORMAT, magic_number_2(), MAGIC_NUMBER_2));
   if (!Universe::heap()->is_gc_active()) {
     if (saved_args_layout() != NULL) {
       assert(saved_args_layout()->is_method(), "must be valid oop");
--- a/hotspot/src/cpu/x86/vm/methodHandles_x86.hpp	Fri Oct 07 13:28:44 2011 +0200
+++ b/hotspot/src/cpu/x86/vm/methodHandles_x86.hpp	Tue Oct 11 02:19:37 2011 -0700
@@ -132,7 +132,10 @@
   intptr_t* sender_link() const         { return _sender_link; }
   address   sender_pc() const           { return _sender_pc; }
 
-  intptr_t* extended_sender_sp() const  { return saved_args_base(); }
+  intptr_t* extended_sender_sp() const {
+    // The extended sender SP is above the current RicochetFrame.
+    return (intptr_t*) (((address) this) + sizeof(RicochetFrame));
+  }
 
   intptr_t  return_value_slot_number() const {
     return adapter_conversion_vminfo(conversion());