7043301: assert(locals < caller->fp() || locals > (caller->fp() + 16)) failed: locals in save area
authornever
Mon, 09 May 2011 19:45:52 -0700
changeset 9632 cd86c748c12b
parent 9631 9782bd698ffe
child 9633 92a7a2841a16
child 9636 363ca5579aff
7043301: assert(locals < caller->fp() || locals > (caller->fp() + 16)) failed: locals in save area Reviewed-by: kvn
hotspot/src/cpu/sparc/vm/frame_sparc.cpp
hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp
hotspot/src/cpu/x86/vm/frame_x86.cpp
hotspot/src/share/vm/runtime/frame.cpp
hotspot/src/share/vm/runtime/frame.hpp
--- a/hotspot/src/cpu/sparc/vm/frame_sparc.cpp	Fri May 06 19:34:55 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/frame_sparc.cpp	Mon May 09 19:45:52 2011 -0700
@@ -811,7 +811,7 @@
 #ifdef ASSERT
 
 #define DESCRIBE_FP_OFFSET(name) \
-  values.describe(-1, fp() + frame::name##_offset, #name)
+  values.describe(frame_no, fp() + frame::name##_offset, #name)
 
 void frame::describe_pd(FrameValues& values, int frame_no) {
   for (int w = 0; w < frame::register_save_words; w++) {
--- a/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Fri May 06 19:34:55 2011 -0700
+++ b/hotspot/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Mon May 09 19:45:52 2011 -0700
@@ -1712,7 +1712,10 @@
       // frames so place the locals adjacent to the varargs area.
       locals = fp + frame::memory_parameter_word_sp_offset + local_words - 1;
       if (caller->is_interpreted_frame()) {
-        *interpreter_frame->register_addr(I5_savedSP)    = (intptr_t) (fp + rounded_cls) - STACK_BIAS;
+        int parm_words  = method->size_of_parameters() * Interpreter::stackElementWords;
+        int delta = local_words - parm_words;
+        int computed_sp_adjustment = (delta > 0) ? round_to(delta, WordsPerLong) : 0;
+        *interpreter_frame->register_addr(I5_savedSP)    = (intptr_t) (fp + computed_sp_adjustment) - STACK_BIAS;
       }
     }
     if (TraceDeoptimization) {
--- a/hotspot/src/cpu/x86/vm/frame_x86.cpp	Fri May 06 19:34:55 2011 -0700
+++ b/hotspot/src/cpu/x86/vm/frame_x86.cpp	Mon May 09 19:45:52 2011 -0700
@@ -650,7 +650,7 @@
 #ifdef ASSERT
 
 #define DESCRIBE_FP_OFFSET(name) \
-  values.describe(-1, fp() + frame::name##_offset, #name)
+  values.describe(frame_no, fp() + frame::name##_offset, #name)
 
 void frame::describe_pd(FrameValues& values, int frame_no) {
   if (is_interpreted_frame()) {
--- a/hotspot/src/share/vm/runtime/frame.cpp	Fri May 06 19:34:55 2011 -0700
+++ b/hotspot/src/share/vm/runtime/frame.cpp	Mon May 09 19:45:52 2011 -0700
@@ -1423,7 +1423,7 @@
 }
 
 
-bool FrameValues::validate() {
+void FrameValues::validate() {
   _values.sort(compare);
   bool error = false;
   FrameValue prev;
@@ -1446,7 +1446,7 @@
       prev = fv;
     }
   }
-  return error;
+  assert(!error, "invalid layout");
 }
 
 
--- a/hotspot/src/share/vm/runtime/frame.hpp	Fri May 06 19:34:55 2011 -0700
+++ b/hotspot/src/share/vm/runtime/frame.hpp	Mon May 09 19:45:52 2011 -0700
@@ -511,7 +511,7 @@
   // Used by frame functions to describe locations.
   void describe(int owner, intptr_t* location, const char* description, int priority = 0);
 
-  bool validate();
+  void validate();
   void print();
 };