49 friend class VM_HeapDumper;
50 friend class HeapInspection;
51 friend class GCCauseSetter;
52 friend class VMStructs;
53 public:
54 enum SomeConstants {
55 max_gens = 10
56 };
57
58 friend class VM_PopulateDumpSharedSpace;
59
60 protected:
61 // Fields:
62 static GenCollectedHeap* _gch;
63
64 private:
65 int _n_gens;
66 Generation* _gens[max_gens];
67 GenerationSpec** _gen_specs;
68
69 // The generational collector policy.
70 GenCollectorPolicy* _gen_policy;
71
72 // Indicates that the most recent previous incremental collection failed.
73 // The flag is cleared when an action is taken that might clear the
74 // condition that caused that incremental collection to fail.
75 bool _incremental_collection_failed;
76
77 // In support of ExplicitGCInvokesConcurrent functionality
78 unsigned int _full_collections_completed;
79
80 // Data structure for claiming the (potentially) parallel tasks in
81 // (gen-specific) roots processing.
82 SubTasksDone* _gen_process_roots_tasks;
83 SubTasksDone* gen_process_roots_tasks() { return _gen_process_roots_tasks; }
84
85 // In block contents verification, the number of header words to skip
86 NOT_PRODUCT(static size_t _skip_header_HeapWords;)
87
88 protected:
365 guarantee(l > 0, "Out of bounds");
366 return _gens[l-1];
367 }
368
369 // Return the generation after "gen".
370 Generation* next_gen(Generation* gen) const {
371 int l = gen->level() + 1;
372 guarantee(l < _n_gens, "Out of bounds");
373 return _gens[l];
374 }
375
376 Generation* get_gen(int i) const {
377 guarantee(i >= 0 && i < _n_gens, "Out of bounds");
378 return _gens[i];
379 }
380
381 int n_gens() const {
382 assert(_n_gens == gen_policy()->number_of_generations(), "Sanity");
383 return _n_gens;
384 }
385
386 // Convenience function to be used in situations where the heap type can be
387 // asserted to be this type.
388 static GenCollectedHeap* heap();
389
390 void set_par_threads(uint t);
391
392 // Invoke the "do_oop" method of one of the closures "not_older_gens"
393 // or "older_gens" on root locations for the generation at
394 // "level". (The "older_gens" closure is used for scanning references
395 // from older generations; "not_older_gens" is used everywhere else.)
396 // If "younger_gens_as_roots" is false, younger generations are
397 // not scanned as roots; in this case, the caller must be arranging to
398 // scan the younger generations itself. (For example, a generation might
399 // explicitly mark reachable objects in younger generations, to avoid
400 // excess storage retention.)
401 // The "so" argument determines which of the roots
402 // the closure is applied to:
403 // "SO_None" does none;
404 private:
|
49 friend class VM_HeapDumper;
50 friend class HeapInspection;
51 friend class GCCauseSetter;
52 friend class VMStructs;
53 public:
54 enum SomeConstants {
55 max_gens = 10
56 };
57
58 friend class VM_PopulateDumpSharedSpace;
59
60 protected:
61 // Fields:
62 static GenCollectedHeap* _gch;
63
64 private:
65 int _n_gens;
66 Generation* _gens[max_gens];
67 GenerationSpec** _gen_specs;
68
69 // The singleton Gen Remembered Set.
70 GenRemSet* _rem_set;
71
72 // The generational collector policy.
73 GenCollectorPolicy* _gen_policy;
74
75 // Indicates that the most recent previous incremental collection failed.
76 // The flag is cleared when an action is taken that might clear the
77 // condition that caused that incremental collection to fail.
78 bool _incremental_collection_failed;
79
80 // In support of ExplicitGCInvokesConcurrent functionality
81 unsigned int _full_collections_completed;
82
83 // Data structure for claiming the (potentially) parallel tasks in
84 // (gen-specific) roots processing.
85 SubTasksDone* _gen_process_roots_tasks;
86 SubTasksDone* gen_process_roots_tasks() { return _gen_process_roots_tasks; }
87
88 // In block contents verification, the number of header words to skip
89 NOT_PRODUCT(static size_t _skip_header_HeapWords;)
90
91 protected:
368 guarantee(l > 0, "Out of bounds");
369 return _gens[l-1];
370 }
371
372 // Return the generation after "gen".
373 Generation* next_gen(Generation* gen) const {
374 int l = gen->level() + 1;
375 guarantee(l < _n_gens, "Out of bounds");
376 return _gens[l];
377 }
378
379 Generation* get_gen(int i) const {
380 guarantee(i >= 0 && i < _n_gens, "Out of bounds");
381 return _gens[i];
382 }
383
384 int n_gens() const {
385 assert(_n_gens == gen_policy()->number_of_generations(), "Sanity");
386 return _n_gens;
387 }
388
389 // This function returns the "GenRemSet" object that allows us to scan
390 // generations in a fully generational heap.
391 GenRemSet* rem_set() { return _rem_set; }
392
393 // Convenience function to be used in situations where the heap type can be
394 // asserted to be this type.
395 static GenCollectedHeap* heap();
396
397 void set_par_threads(uint t);
398
399 // Invoke the "do_oop" method of one of the closures "not_older_gens"
400 // or "older_gens" on root locations for the generation at
401 // "level". (The "older_gens" closure is used for scanning references
402 // from older generations; "not_older_gens" is used everywhere else.)
403 // If "younger_gens_as_roots" is false, younger generations are
404 // not scanned as roots; in this case, the caller must be arranging to
405 // scan the younger generations itself. (For example, a generation might
406 // explicitly mark reachable objects in younger generations, to avoid
407 // excess storage retention.)
408 // The "so" argument determines which of the roots
409 // the closure is applied to:
410 // "SO_None" does none;
411 private:
|