changeset 2609:3cfb240033d1

7043301: assert(locals < caller->fp() || locals > (caller->fp() + 16)) failed: locals in save area Reviewed-by: kvn
author never
date Mon, 09 May 2011 19:45:52 -0700
parents 566ea7a12419
children e2a92dd0d3d2 3d2ab563047a
files src/cpu/sparc/vm/frame_sparc.cpp src/cpu/sparc/vm/templateInterpreter_sparc.cpp src/cpu/x86/vm/frame_x86.cpp src/share/vm/runtime/frame.cpp src/share/vm/runtime/frame.hpp
diffstat 5 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/frame_sparc.cpp	Fri May 06 19:34:55 2011 -0700
+++ b/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/src/cpu/sparc/vm/templateInterpreter_sparc.cpp	Fri May 06 19:34:55 2011 -0700
+++ b/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/src/cpu/x86/vm/frame_x86.cpp	Fri May 06 19:34:55 2011 -0700
+++ b/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/src/share/vm/runtime/frame.cpp	Fri May 06 19:34:55 2011 -0700
+++ b/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/src/share/vm/runtime/frame.hpp	Fri May 06 19:34:55 2011 -0700
+++ b/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();
 };