8049324: interpretedVFrame::expressions to index oopmap correctly
authormgronlun
Sat, 05 Jul 2014 20:05:29 +0200
changeset 25475 6adf1750b4f4
parent 25474 1d9e52cddcd0
child 25476 b97716c4b5c9
8049324: interpretedVFrame::expressions to index oopmap correctly Reviewed-by: sspitsyn, coleenp
hotspot/src/share/vm/runtime/vframe.cpp
--- a/hotspot/src/share/vm/runtime/vframe.cpp	Thu Jul 03 16:55:57 2014 -0700
+++ b/hotspot/src/share/vm/runtime/vframe.cpp	Sat Jul 05 20:05:29 2014 +0200
@@ -263,6 +263,10 @@
 static StackValue* create_stack_value_from_oop_map(const InterpreterOopMap& oop_mask,
                                                    int index,
                                                    const intptr_t* const addr) {
+
+  assert(index >= 0 &&
+         index < oop_mask.number_of_entries(), "invariant");
+
   // categorize using oop_mask
   if (oop_mask.is_oop(index)) {
     // reference (oop) "r"
@@ -307,6 +311,7 @@
 
 static void stack_expressions(StackValueCollection* result,
                               int length,
+                              int max_locals,
                               const InterpreterOopMap& oop_mask,
                               const frame& fr) {
 
@@ -319,7 +324,10 @@
       // Need to ensure no bogus escapes.
       addr = NULL;
     }
-    StackValue* const sv = create_stack_value_from_oop_map(oop_mask, i, addr);
+
+    StackValue* const sv = create_stack_value_from_oop_map(oop_mask,
+                                                           i + max_locals,
+                                                           addr);
     assert(sv != NULL, "sanity check");
 
     result->add(sv);
@@ -375,7 +383,7 @@
   }
 
   if (expressions) {
-    stack_expressions(result, length, oop_mask, fr());
+    stack_expressions(result, length, max_locals, oop_mask, fr());
   } else {
     stack_locals(result, length, oop_mask, fr());
   }