src/share/vm/gc_implementation/g1/heapRegion.hpp

changeset 7118
227a9e5e4b4a
parent 7100
edb5f3b38aab
child 7131
d35872270666
equal deleted inserted replaced
7117:8ec8971f511a 7118:227a9e5e4b4a
23 */ 23 */
24 24
25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP 25 #ifndef SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
26 #define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP 26 #define SHARE_VM_GC_IMPLEMENTATION_G1_HEAPREGION_HPP
27 27
28 #include "gc_implementation/g1/g1AllocationContext.hpp"
28 #include "gc_implementation/g1/g1BlockOffsetTable.hpp" 29 #include "gc_implementation/g1/g1BlockOffsetTable.hpp"
29 #include "gc_implementation/g1/g1_specialized_oop_closures.hpp" 30 #include "gc_implementation/g1/g1_specialized_oop_closures.hpp"
30 #include "gc_implementation/g1/survRateGroup.hpp" 31 #include "gc_implementation/g1/survRateGroup.hpp"
31 #include "gc_implementation/shared/ageTable.hpp" 32 #include "gc_implementation/shared/ageTable.hpp"
32 #include "gc_implementation/shared/spaceDecorator.hpp" 33 #include "gc_implementation/shared/spaceDecorator.hpp"
234 235
235 protected: 236 protected:
236 // The index of this region in the heap region sequence. 237 // The index of this region in the heap region sequence.
237 uint _hrm_index; 238 uint _hrm_index;
238 239
240 AllocationContext_t _allocation_context;
241
239 HumongousType _humongous_type; 242 HumongousType _humongous_type;
240 // For a humongous region, region in which it starts. 243 // For a humongous region, region in which it starts.
241 HeapRegion* _humongous_start_region; 244 HeapRegion* _humongous_start_region;
242 // For the start region of a humongous sequence, it's original end(). 245 // For the start region of a humongous sequence, it's original end().
243 HeapWord* _orig_end; 246 HeapWord* _orig_end;
330 size_t _predicted_bytes_to_copy; 333 size_t _predicted_bytes_to_copy;
331 334
332 public: 335 public:
333 HeapRegion(uint hrm_index, 336 HeapRegion(uint hrm_index,
334 G1BlockOffsetSharedArray* sharedOffsetArray, 337 G1BlockOffsetSharedArray* sharedOffsetArray,
335 MemRegion mr); 338 MemRegion mr,
339 AllocationContext_t context = AllocationContext::system());
336 340
337 // Initializing the HeapRegion not only resets the data structure, but also 341 // Initializing the HeapRegion not only resets the data structure, but also
338 // resets the BOT for that heap region. 342 // resets the BOT for that heap region.
339 // The default values for clear_space means that we will do the clearing if 343 // The default values for clear_space means that we will do the clearing if
340 // there's clearing to be done ourselves. We also always mangle the space. 344 // there's clearing to be done ourselves. We also always mangle the space.
525 assert(in_collection_set(), "should only invoke on member of CS."); 529 assert(in_collection_set(), "should only invoke on member of CS.");
526 assert(r == NULL || r->in_collection_set(), "Malformed CS."); 530 assert(r == NULL || r->in_collection_set(), "Malformed CS.");
527 _next_in_special_set = r; 531 _next_in_special_set = r;
528 } 532 }
529 533
534 void set_allocation_context(AllocationContext_t context) {
535 _allocation_context = context;
536 }
537
538 AllocationContext_t allocation_context() const {
539 return _allocation_context;
540 }
541
530 // Methods used by the HeapRegionSetBase class and subclasses. 542 // Methods used by the HeapRegionSetBase class and subclasses.
531 543
532 // Getter and setter for the next and prev fields used to link regions into 544 // Getter and setter for the next and prev fields used to link regions into
533 // linked lists. 545 // linked lists.
534 HeapRegion* next() { return _next; } 546 HeapRegion* next() { return _next; }

mercurial