src/hotspot/share/compiler/oopMap.hpp
changeset 54916 7136c9ac56a7
parent 54807 33fe50b6d707
child 58527 f9cc0141574c
equal deleted inserted replaced
54915:278600885731 54916:7136c9ac56a7
    27 
    27 
    28 #include "code/compressedStream.hpp"
    28 #include "code/compressedStream.hpp"
    29 #include "code/vmreg.hpp"
    29 #include "code/vmreg.hpp"
    30 #include "memory/allocation.hpp"
    30 #include "memory/allocation.hpp"
    31 #include "oops/oopsHierarchy.hpp"
    31 #include "oops/oopsHierarchy.hpp"
    32 #include "utilities/growableArray.hpp"
       
    33 
    32 
    34 // Interface for generating the frame map for compiled code.  A frame map
    33 // Interface for generating the frame map for compiled code.  A frame map
    35 // describes for a specific pc whether each register and frame stack slot is:
    34 // describes for a specific pc whether each register and frame stack slot is:
    36 //   Oop         - A GC root for current frame
    35 //   Oop         - A GC root for current frame
    37 //   Dead        - Dead; can be Zapped for debugging
    36 //   Dead        - Dead; can be Zapped for debugging
    40 //
    39 //
    41 // OopMapValue describes a single OopMap entry
    40 // OopMapValue describes a single OopMap entry
    42 
    41 
    43 class frame;
    42 class frame;
    44 class RegisterMap;
    43 class RegisterMap;
    45 class DerivedPointerEntry;
       
    46 class OopClosure;
    44 class OopClosure;
    47 
    45 
    48 class OopMapValue: public StackObj {
    46 class OopMapValue: public StackObj {
    49   friend class VMStructs;
    47   friend class VMStructs;
    50 private:
    48 private:
   431 // pointers are updated based on their base pointers new value and an offset.
   429 // pointers are updated based on their base pointers new value and an offset.
   432 #if COMPILER2_OR_JVMCI
   430 #if COMPILER2_OR_JVMCI
   433 class DerivedPointerTable : public AllStatic {
   431 class DerivedPointerTable : public AllStatic {
   434   friend class VMStructs;
   432   friend class VMStructs;
   435  private:
   433  private:
   436    static GrowableArray<DerivedPointerEntry*>* _list;
   434   class Entry;
   437    static bool _active;                      // do not record pointers for verify pass etc.
   435   static bool _active;                      // do not record pointers for verify pass etc.
       
   436 
   438  public:
   437  public:
   439   static void clear();                       // Called before scavenge/GC
   438   static void clear();                       // Called before scavenge/GC
   440   static void add(oop *derived, oop *base);  // Called during scavenge/GC
   439   static void add(oop *derived, oop *base);  // Called during scavenge/GC
   441   static void update_pointers();             // Called after  scavenge/GC
   440   static void update_pointers();             // Called after  scavenge/GC
   442   static bool is_empty()                     { return _list == NULL || _list->is_empty(); }
   441   static bool is_empty();
   443   static bool is_active()                    { return _active; }
   442   static bool is_active()                    { return _active; }
   444   static void set_active(bool value)         { _active = value; }
   443   static void set_active(bool value)         { _active = value; }
   445 };
   444 };
   446 
   445 
   447 // A utility class to temporarily "deactivate" the DerivedPointerTable.
   446 // A utility class to temporarily "deactivate" the DerivedPointerTable.