< prev index next >

src/hotspot/share/runtime/registerMap.hpp

Print this page

        

@@ -24,10 +24,11 @@
 
 #ifndef SHARE_RUNTIME_REGISTERMAP_HPP
 #define SHARE_RUNTIME_REGISTERMAP_HPP
 
 #include "code/vmreg.hpp"
+#include "runtime/handles.hpp"
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/macros.hpp"
 
 class JavaThread;
 

@@ -71,22 +72,30 @@
  private:
   intptr_t*    _location[reg_count];    // Location of registers (intptr_t* looks better than address in the debugger)
   LocationValidType _location_valid[location_valid_size];
   bool        _include_argument_oops;   // Should include argument_oop marked locations for compiler
   JavaThread* _thread;                  // Reference to current thread
+  Handle      _cont;                    // The current continuation, if any
+  bool        _on_hstack;               // Whether we're on the h-stack
+  intptr_t**  _last_vstack_fp;          // The location of the continuation entry frame's fp when walking h-stacks
+
   bool        _update_map;              // Tells if the register map need to be
                                         // updated when traversing the stack
+  bool        _validate_oops;           // whether to perform valid oop checks in asserts -- used only in the map use for continuation freeze/thaw
+  bool        _walk_cont;               // whether to walk frames on a continuation stack
+
+  DEBUG_ONLY(bool  _skip_missing;)     
 
 #ifdef ASSERT
   void check_location_valid();
 #else
   void check_location_valid() {}
 #endif
 
  public:
-  debug_only(intptr_t* _update_for_id;) // Assert that RegisterMap is not updated twice for same frame
-  RegisterMap(JavaThread *thread, bool update_map = true);
+  DEBUG_ONLY(intptr_t* _update_for_id;) // Assert that RegisterMap is not updated twice for same frame
+  RegisterMap(JavaThread *thread, bool update_map = true, bool walk_cont = false, bool validate_oops = true);
   RegisterMap(const RegisterMap* map);
 
   address location(VMReg reg) const {
     int index = reg->value() / location_valid_type_size;
     assert(0 <= reg->value() && reg->value() < reg_count, "range check");

@@ -96,15 +105,25 @@
     } else {
       return pd_location(reg);
     }
   }
 
+  address trusted_location(VMReg reg) const {
+    return (address) _location[reg->value()];
+  }
+
+  void verify(RegisterMap& other) {
+    for (int i = 0; i < reg_count; ++i) {
+      assert(_location[i] == other._location[i], "");
+    }
+  }
+
   void set_location(VMReg reg, address loc) {
     int index = reg->value() / location_valid_type_size;
     assert(0 <= reg->value() && reg->value() < reg_count, "range check");
     assert(0 <= index && index < location_valid_size, "range check");
-    assert(_update_map, "updating map that does not need updating");
+    assert(!_validate_oops || _update_map, "updating map that does not need updating");
     _location[reg->value()] = (intptr_t*) loc;
     _location_valid[index] |= ((LocationValidType)1 << (reg->value() % location_valid_type_size));
     check_location_valid();
   }
 

@@ -114,14 +133,34 @@
   bool include_argument_oops() const      { return _include_argument_oops; }
   void set_include_argument_oops(bool f)  { _include_argument_oops = f; }
 
   JavaThread *thread() const { return _thread; }
   bool update_map()    const { return _update_map; }
+  bool validate_oops() const { return _validate_oops; }
+  bool walk_cont()     const { return _walk_cont; }
+
+  bool in_cont()       const { return _on_hstack; } // Whether we are currently on the hstack
+  oop  cont()          const { return _cont(); }
+  void set_cont(oop cont);
+  void set_cont(Handle cont);
+  void set_in_cont(bool on_hstack);
+  intptr_t** last_vstack_fp()            { return _last_vstack_fp; }
+  void set_last_vstack_fp(intptr_t** fp) { _last_vstack_fp = fp; }
+
+  const RegisterMap* as_RegisterMap() const { return this; }
+  RegisterMap* as_RegisterMap() { return this; }
 
   void print_on(outputStream* st) const;
   void print() const;
 
+#ifdef ASSERT
+  void set_skip_missing(bool value) { _skip_missing = value; }
+  bool should_skip_missing() const  { return _skip_missing; }
+
+  VMReg find_register_spilled_here(void* p);
+#endif
+
   // the following contains the definition of pd_xxx methods
 #include CPU_HEADER(registerMap)
 
 };
 
< prev index next >