hotspot/src/share/vm/gc/shared/preservedMarks.hpp
changeset 37045 41e3f98fa3dc
parent 36202 219f8808c3bd
child 37422 8a7443b5edf8
equal deleted inserted replaced
37044:f1965d5d1055 37045:41e3f98fa3dc
    51   inline bool should_preserve_mark(oop obj, markOop m) const;
    51   inline bool should_preserve_mark(oop obj, markOop m) const;
    52   inline void push(oop obj, markOop m);
    52   inline void push(oop obj, markOop m);
    53 
    53 
    54 public:
    54 public:
    55   bool is_empty() const { return _stack.is_empty(); }
    55   bool is_empty() const { return _stack.is_empty(); }
       
    56   size_t size() const { return _stack.size(); }
    56   inline void push_if_necessary(oop obj, markOop m);
    57   inline void push_if_necessary(oop obj, markOop m);
    57   // Iterate over the stack, restore the preserved marks, then reclaim
    58   // Iterate over the stack, restore the preserved marks, then reclaim
    58   // the memory taken up by stack chunks.
    59   // the memory taken up by stack chunks.
    59   void restore();
    60   void restore();
    60   ~PreservedMarks() { assert(is_empty(), "should have been cleared"); }
    61   ~PreservedMarks() { assert(is_empty(), "should have been cleared"); }
    63 class RemoveForwardedPointerClosure: public ObjectClosure {
    64 class RemoveForwardedPointerClosure: public ObjectClosure {
    64 public:
    65 public:
    65   virtual void do_object(oop obj);
    66   virtual void do_object(oop obj);
    66 };
    67 };
    67 
    68 
    68 class PreservedMarksSet VALUE_OBJ_CLASS_SPEC {
    69 class PreservedMarksSet : public CHeapObj<mtGC> {
    69 private:
    70 private:
    70   // true -> _stacks will be allocated in the C heap
    71   // true -> _stacks will be allocated in the C heap
    71   // false -> _stacks will be allocated in the resource arena
    72   // false -> _stacks will be allocated in the resource arena
    72   const bool _in_c_heap;
    73   const bool _in_c_heap;
    73 
    74