< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.cpp

G1BarrierSet_merge

34 #include "gc/g1/g1CollectionSet.hpp"                                                                                                 
35 #include "gc/g1/g1CollectorPolicy.hpp"                                                                                               
36 #include "gc/g1/g1CollectorState.hpp"                                                                                                
37 #include "gc/g1/g1ConcurrentRefine.hpp"                                                                                              
38 #include "gc/g1/g1ConcurrentRefineThread.hpp"                                                                                        
39 #include "gc/g1/g1EvacStats.inline.hpp"                                                                                              
40 #include "gc/g1/g1FullCollector.hpp"                                                                                                 
41 #include "gc/g1/g1GCPhaseTimes.hpp"                                                                                                  
42 #include "gc/g1/g1HeapSizingPolicy.hpp"                                                                                              
43 #include "gc/g1/g1HeapTransition.hpp"                                                                                                
44 #include "gc/g1/g1HeapVerifier.hpp"                                                                                                  
45 #include "gc/g1/g1HotCardCache.hpp"                                                                                                  
46 #include "gc/g1/g1MemoryPool.hpp"                                                                                                    
47 #include "gc/g1/g1OopClosures.inline.hpp"                                                                                            
48 #include "gc/g1/g1ParScanThreadState.inline.hpp"                                                                                     
49 #include "gc/g1/g1Policy.hpp"                                                                                                        
50 #include "gc/g1/g1RegionToSpaceMapper.hpp"                                                                                           
51 #include "gc/g1/g1RemSet.hpp"                                                                                                        
52 #include "gc/g1/g1RootClosures.hpp"                                                                                                  
53 #include "gc/g1/g1RootProcessor.hpp"                                                                                                 
54 #include "gc/g1/g1SATBCardTableModRefBS.hpp"                                                                                         
55 #include "gc/g1/g1StringDedup.hpp"                                                                                                   
56 #include "gc/g1/g1YCTypes.hpp"                                                                                                       
57 #include "gc/g1/g1YoungRemSetSamplingThread.hpp"                                                                                     
58 #include "gc/g1/heapRegion.inline.hpp"                                                                                               
59 #include "gc/g1/heapRegionRemSet.hpp"                                                                                                
60 #include "gc/g1/heapRegionSet.inline.hpp"                                                                                            
61 #include "gc/g1/vm_operations_g1.hpp"                                                                                                
62 #include "gc/shared/adaptiveSizePolicy.hpp"                                                                                          
63 #include "gc/shared/gcHeapSummary.hpp"                                                                                               
64 #include "gc/shared/gcId.hpp"                                                                                                        
65 #include "gc/shared/gcLocker.inline.hpp"                                                                                             
66 #include "gc/shared/gcTimer.hpp"                                                                                                     
67 #include "gc/shared/gcTrace.hpp"                                                                                                     
68 #include "gc/shared/gcTraceTime.inline.hpp"                                                                                          
69 #include "gc/shared/generationSpec.hpp"                                                                                              
70 #include "gc/shared/isGCActiveMark.hpp"                                                                                              
71 #include "gc/shared/preservedMarks.inline.hpp"                                                                                       
72 #include "gc/shared/suspendibleThreadSet.hpp"                                                                                        
73 #include "gc/shared/referenceProcessor.inline.hpp"                                                                                   

34 #include "gc/g1/g1CollectionSet.hpp"
35 #include "gc/g1/g1CollectorPolicy.hpp"
36 #include "gc/g1/g1CollectorState.hpp"
37 #include "gc/g1/g1ConcurrentRefine.hpp"
38 #include "gc/g1/g1ConcurrentRefineThread.hpp"
39 #include "gc/g1/g1EvacStats.inline.hpp"
40 #include "gc/g1/g1FullCollector.hpp"
41 #include "gc/g1/g1GCPhaseTimes.hpp"
42 #include "gc/g1/g1HeapSizingPolicy.hpp"
43 #include "gc/g1/g1HeapTransition.hpp"
44 #include "gc/g1/g1HeapVerifier.hpp"
45 #include "gc/g1/g1HotCardCache.hpp"
46 #include "gc/g1/g1MemoryPool.hpp"
47 #include "gc/g1/g1OopClosures.inline.hpp"
48 #include "gc/g1/g1ParScanThreadState.inline.hpp"
49 #include "gc/g1/g1Policy.hpp"
50 #include "gc/g1/g1RegionToSpaceMapper.hpp"
51 #include "gc/g1/g1RemSet.hpp"
52 #include "gc/g1/g1RootClosures.hpp"
53 #include "gc/g1/g1RootProcessor.hpp"

54 #include "gc/g1/g1StringDedup.hpp"
55 #include "gc/g1/g1YCTypes.hpp"
56 #include "gc/g1/g1YoungRemSetSamplingThread.hpp"
57 #include "gc/g1/heapRegion.inline.hpp"
58 #include "gc/g1/heapRegionRemSet.hpp"
59 #include "gc/g1/heapRegionSet.inline.hpp"
60 #include "gc/g1/vm_operations_g1.hpp"
61 #include "gc/shared/adaptiveSizePolicy.hpp"
62 #include "gc/shared/gcHeapSummary.hpp"
63 #include "gc/shared/gcId.hpp"
64 #include "gc/shared/gcLocker.inline.hpp"
65 #include "gc/shared/gcTimer.hpp"
66 #include "gc/shared/gcTrace.hpp"
67 #include "gc/shared/gcTraceTime.inline.hpp"
68 #include "gc/shared/generationSpec.hpp"
69 #include "gc/shared/isGCActiveMark.hpp"
70 #include "gc/shared/preservedMarks.inline.hpp"
71 #include "gc/shared/suspendibleThreadSet.hpp"
72 #include "gc/shared/referenceProcessor.inline.hpp"

1602 
1603   // When compressed oops are enabled, the preferred heap base                                                                       
1604   // is calculated by subtracting the requested size from the                                                                        
1605   // 32Gb boundary and using the result as the base address for                                                                      
1606   // heap reservation. If the requested size is not aligned to                                                                       
1607   // HeapRegion::GrainBytes (i.e. the alignment that is passed                                                                       
1608   // into the ReservedHeapSpace constructor) then the actual                                                                         
1609   // base of the reserved heap may end up differing from the                                                                         
1610   // address that was requested (i.e. the preferred heap base).                                                                      
1611   // If this happens then we could end up using a non-optimal                                                                        
1612   // compressed oops mode.                                                                                                           
1613 
1614   ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size,                                                                      
1615                                                  heap_alignment);                                                                    
1616 
1617   initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size()));                               
1618 
1619   // Create the barrier set for the entire reserved region.                                                                          
1620   G1CardTable* ct = new G1CardTable(reserved_region());                                                                              
1621   ct->initialize();                                                                                                                  
1622   G1SATBCardTableLoggingModRefBS* bs = new G1SATBCardTableLoggingModRefBS(ct);                                                       
1623   bs->initialize();                                                                                                                  
1624   assert(bs->is_a(BarrierSet::G1SATBCTLogging), "sanity");                                                                           
1625   set_barrier_set(bs);                                                                                                               
1626   _card_table = ct;                                                                                                                  
1627 
1628   // Create the hot card cache.                                                                                                      
1629   _hot_card_cache = new G1HotCardCache(this);                                                                                        
1630 
1631   // Carve out the G1 part of the heap.                                                                                              
1632   ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);                                                                           
1633   size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();                                                     
1634   G1RegionToSpaceMapper* heap_storage =                                                                                              
1635     G1RegionToSpaceMapper::create_mapper(g1_rs,                                                                                      
1636                                          g1_rs.size(),                                                                               
1637                                          page_size,                                                                                  
1638                                          HeapRegion::GrainBytes,                                                                     
1639                                          1,                                                                                          
1640                                          mtJavaHeap);                                                                                
1641   os::trace_page_sizes("Heap",                                                                                                       
1642                        collector_policy()->min_heap_byte_size(),                                                                     
1643                        max_byte_size,                                                                                                

1601 
1602   // When compressed oops are enabled, the preferred heap base
1603   // is calculated by subtracting the requested size from the
1604   // 32Gb boundary and using the result as the base address for
1605   // heap reservation. If the requested size is not aligned to
1606   // HeapRegion::GrainBytes (i.e. the alignment that is passed
1607   // into the ReservedHeapSpace constructor) then the actual
1608   // base of the reserved heap may end up differing from the
1609   // address that was requested (i.e. the preferred heap base).
1610   // If this happens then we could end up using a non-optimal
1611   // compressed oops mode.
1612 
1613   ReservedSpace heap_rs = Universe::reserve_heap(max_byte_size,
1614                                                  heap_alignment);
1615 
1616   initialize_reserved_region((HeapWord*)heap_rs.base(), (HeapWord*)(heap_rs.base() + heap_rs.size()));
1617 
1618   // Create the barrier set for the entire reserved region.
1619   G1CardTable* ct = new G1CardTable(reserved_region());
1620   ct->initialize();
1621   G1BarrierSet* bs = new G1BarrierSet(ct);
1622   bs->initialize();
1623   assert(bs->is_a(BarrierSet::G1BarrierSet), "sanity");
1624   set_barrier_set(bs);
1625   _card_table = ct;
1626 
1627   // Create the hot card cache.
1628   _hot_card_cache = new G1HotCardCache(this);
1629 
1630   // Carve out the G1 part of the heap.
1631   ReservedSpace g1_rs = heap_rs.first_part(max_byte_size);
1632   size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
1633   G1RegionToSpaceMapper* heap_storage =
1634     G1RegionToSpaceMapper::create_mapper(g1_rs,
1635                                          g1_rs.size(),
1636                                          page_size,
1637                                          HeapRegion::GrainBytes,
1638                                          1,
1639                                          mtJavaHeap);
1640   os::trace_page_sizes("Heap",
1641                        collector_policy()->min_heap_byte_size(),
1642                        max_byte_size,
< prev index next >