< prev index next >

src/hotspot/share/compiler/oopMap.hpp

Print this page




 410 #ifdef ASSERT
 411   void verify(address buffer, int size, const ImmutableOopMapSet* set);
 412 #endif
 413 
 414   bool has_empty() const {
 415     return _empty_offset != -1;
 416   }
 417 
 418   int size_for(const OopMap* map) const;
 419   void fill_pair(ImmutableOopMapPair* pair, const OopMap* map, int offset, const ImmutableOopMapSet* set);
 420   int fill_map(ImmutableOopMapPair* pair, const OopMap* map, int offset, const ImmutableOopMapSet* set);
 421   void fill(ImmutableOopMapSet* set, int size);
 422 };
 423 
 424 
 425 // Derived pointer support. This table keeps track of all derived points on a
 426 // stack.  It is cleared before each scavenge/GC.  During the traversal of all
 427 // oops, it is filled in with references to all locations that contains a
 428 // derived oop (assumed to be very few).  When the GC is complete, the derived
 429 // pointers are updated based on their base pointers new value and an offset.
 430 #if defined(COMPILER2) || INCLUDE_JVMCI
 431 class DerivedPointerTable : public AllStatic {
 432   friend class VMStructs;
 433  private:
 434    static GrowableArray<DerivedPointerEntry*>* _list;
 435    static bool _active;                      // do not record pointers for verify pass etc.
 436  public:
 437   static void clear();                       // Called before scavenge/GC
 438   static void add(oop *derived, oop *base);  // Called during scavenge/GC
 439   static void update_pointers();             // Called after  scavenge/GC
 440   static bool is_empty()                     { return _list == NULL || _list->is_empty(); }
 441   static bool is_active()                    { return _active; }
 442   static void set_active(bool value)         { _active = value; }
 443 };
 444 
 445 // A utility class to temporarily "deactivate" the DerivedPointerTable.
 446 // (Note: clients are responsible for any MT-safety issues)
 447 class DerivedPointerTableDeactivate: public StackObj {
 448  private:
 449   bool _active;
 450  public:
 451   DerivedPointerTableDeactivate() {
 452     _active = DerivedPointerTable::is_active();
 453     if (_active) {
 454       DerivedPointerTable::set_active(false);
 455     }
 456   }
 457 
 458   ~DerivedPointerTableDeactivate() {
 459     assert(!DerivedPointerTable::is_active(),
 460            "Inconsistency: not MT-safe");
 461     if (_active) {
 462       DerivedPointerTable::set_active(true);
 463     }
 464   }
 465 };
 466 #endif // COMPILER2 || INCLUDE_JVMCI
 467 
 468 #endif // SHARE_VM_COMPILER_OOPMAP_HPP


 410 #ifdef ASSERT
 411   void verify(address buffer, int size, const ImmutableOopMapSet* set);
 412 #endif
 413 
 414   bool has_empty() const {
 415     return _empty_offset != -1;
 416   }
 417 
 418   int size_for(const OopMap* map) const;
 419   void fill_pair(ImmutableOopMapPair* pair, const OopMap* map, int offset, const ImmutableOopMapSet* set);
 420   int fill_map(ImmutableOopMapPair* pair, const OopMap* map, int offset, const ImmutableOopMapSet* set);
 421   void fill(ImmutableOopMapSet* set, int size);
 422 };
 423 
 424 
 425 // Derived pointer support. This table keeps track of all derived points on a
 426 // stack.  It is cleared before each scavenge/GC.  During the traversal of all
 427 // oops, it is filled in with references to all locations that contains a
 428 // derived oop (assumed to be very few).  When the GC is complete, the derived
 429 // pointers are updated based on their base pointers new value and an offset.
 430 #if COMPILER2_OR_JVMCI
 431 class DerivedPointerTable : public AllStatic {
 432   friend class VMStructs;
 433  private:
 434    static GrowableArray<DerivedPointerEntry*>* _list;
 435    static bool _active;                      // do not record pointers for verify pass etc.
 436  public:
 437   static void clear();                       // Called before scavenge/GC
 438   static void add(oop *derived, oop *base);  // Called during scavenge/GC
 439   static void update_pointers();             // Called after  scavenge/GC
 440   static bool is_empty()                     { return _list == NULL || _list->is_empty(); }
 441   static bool is_active()                    { return _active; }
 442   static void set_active(bool value)         { _active = value; }
 443 };
 444 
 445 // A utility class to temporarily "deactivate" the DerivedPointerTable.
 446 // (Note: clients are responsible for any MT-safety issues)
 447 class DerivedPointerTableDeactivate: public StackObj {
 448  private:
 449   bool _active;
 450  public:
 451   DerivedPointerTableDeactivate() {
 452     _active = DerivedPointerTable::is_active();
 453     if (_active) {
 454       DerivedPointerTable::set_active(false);
 455     }
 456   }
 457 
 458   ~DerivedPointerTableDeactivate() {
 459     assert(!DerivedPointerTable::is_active(),
 460            "Inconsistency: not MT-safe");
 461     if (_active) {
 462       DerivedPointerTable::set_active(true);
 463     }
 464   }
 465 };
 466 #endif // COMPILER2_OR_JVMCI
 467 
 468 #endif // SHARE_VM_COMPILER_OOPMAP_HPP
< prev index next >