diff src/share/vm/gc_implementation/g1/heapRegion.cpp @ 20404:227a9e5e4b4a

8057536: Refactor G1 to allow context specific allocations Summary: Splitting out a g1 allocator class to simply specialized allocators which can associate each allocation with a given context. Reviewed-by: mgerdin, brutisso
author sjohanss
date Fri, 05 Sep 2014 09:49:19 +0200
parents a8ea2f110d87
children d35872270666
line wrap: on
line diff
--- a/src/share/vm/gc_implementation/g1/heapRegion.cpp	Thu Sep 04 16:53:27 2014 -0700
+++ b/src/share/vm/gc_implementation/g1/heapRegion.cpp	Fri Sep 05 09:49:19 2014 +0200
@@ -219,6 +219,7 @@
 
   _in_collection_set = false;
 
+  set_allocation_context(AllocationContext::system());
   set_young_index_in_cset(-1);
   uninstall_surv_rate_group();
   set_young_type(NotYoung);
@@ -346,9 +347,9 @@
 
 HeapRegion::HeapRegion(uint hrm_index,
                        G1BlockOffsetSharedArray* sharedOffsetArray,
-                       MemRegion mr) :
+                       MemRegion mr, AllocationContext_t context) :
     G1OffsetTableContigSpace(sharedOffsetArray, mr),
-    _hrm_index(hrm_index),
+    _hrm_index(hrm_index), _allocation_context(context),
     _humongous_type(NotHumongous), _humongous_start_region(NULL),
     _in_collection_set(false),
     _next_in_special_set(NULL), _orig_end(NULL),
@@ -715,6 +716,8 @@
 
 void HeapRegion::print() const { print_on(gclog_or_tty); }
 void HeapRegion::print_on(outputStream* st) const {
+  st->print("AC%4u", allocation_context());
+
   if (isHumongous()) {
     if (startsHumongous())
       st->print(" HS");