1.1 --- a/src/share/vm/memory/sharedHeap.hpp Wed Jun 04 13:51:09 2008 -0700 1.2 +++ b/src/share/vm/memory/sharedHeap.hpp Thu Jun 05 15:57:56 2008 -0700 1.3 @@ -44,6 +44,9 @@ 1.4 class SharedHeap : public CollectedHeap { 1.5 friend class VMStructs; 1.6 1.7 + friend class VM_GC_Operation; 1.8 + friend class VM_CGC_Operation; 1.9 + 1.10 private: 1.11 // For claiming strong_roots tasks. 1.12 SubTasksDone* _process_strong_tasks; 1.13 @@ -82,6 +85,14 @@ 1.14 // function. 1.15 SharedHeap(CollectorPolicy* policy_); 1.16 1.17 + // Returns true if the calling thread holds the heap lock, 1.18 + // or the calling thread is a par gc thread and the heap_lock is held 1.19 + // by the vm thread doing a gc operation. 1.20 + bool heap_lock_held_for_gc(); 1.21 + // True if the heap_lock is held by the a non-gc thread invoking a gc 1.22 + // operation. 1.23 + bool _thread_holds_heap_lock_for_gc; 1.24 + 1.25 public: 1.26 static SharedHeap* heap() { return _sh; } 1.27 1.28 @@ -97,8 +108,8 @@ 1.29 1.30 void set_perm(PermGen* perm_gen) { _perm_gen = perm_gen; } 1.31 1.32 - // A helper function that fills an allocated-but-not-yet-initialized 1.33 - // region with a garbage object. 1.34 + // A helper function that fills a region of the heap with 1.35 + // with a single object. 1.36 static void fill_region_with_object(MemRegion mr); 1.37 1.38 // Minimum garbage fill object size 1.39 @@ -214,13 +225,12 @@ 1.40 // "SharedHeap" can use in the implementation of its virtual 1.41 // functions. 1.42 1.43 -protected: 1.44 +public: 1.45 1.46 // Do anything common to GC's. 1.47 virtual void gc_prologue(bool full) = 0; 1.48 virtual void gc_epilogue(bool full) = 0; 1.49 1.50 -public: 1.51 // 1.52 // New methods from CollectedHeap 1.53 // 1.54 @@ -266,7 +276,8 @@ 1.55 } 1.56 1.57 // Some utilities. 1.58 - void print_size_transition(size_t bytes_before, 1.59 + void print_size_transition(outputStream* out, 1.60 + size_t bytes_before, 1.61 size_t bytes_after, 1.62 size_t capacity); 1.63 };