52 bool _defer_initial_card_mark; |
52 bool _defer_initial_card_mark; |
53 CardTable* _card_table; |
53 CardTable* _card_table; |
54 |
54 |
55 CardTableBarrierSet(BarrierSetAssembler* barrier_set_assembler, |
55 CardTableBarrierSet(BarrierSetAssembler* barrier_set_assembler, |
56 BarrierSetC1* barrier_set_c1, |
56 BarrierSetC1* barrier_set_c1, |
|
57 BarrierSetC2* barrier_set_c2, |
57 CardTable* card_table, |
58 CardTable* card_table, |
58 const BarrierSet::FakeRtti& fake_rtti); |
59 const BarrierSet::FakeRtti& fake_rtti); |
59 |
60 |
60 public: |
61 public: |
61 CardTableBarrierSet(CardTable* card_table); |
62 CardTableBarrierSet(CardTable* card_table); |
87 // If the CollectedHeap was asked to defer a store barrier above, |
88 // If the CollectedHeap was asked to defer a store barrier above, |
88 // this informs it to flush such a deferred store barrier to the |
89 // this informs it to flush such a deferred store barrier to the |
89 // remembered set. |
90 // remembered set. |
90 void flush_deferred_card_mark_barrier(JavaThread* thread); |
91 void flush_deferred_card_mark_barrier(JavaThread* thread); |
91 |
92 |
92 // Can a compiler initialize a new object without store barriers? |
|
93 // This permission only extends from the creation of a new object |
|
94 // via a TLAB up to the first subsequent safepoint. If such permission |
|
95 // is granted for this heap type, the compiler promises to call |
|
96 // defer_store_barrier() below on any slow path allocation of |
|
97 // a new object for which such initializing store barriers will |
|
98 // have been elided. G1, like CMS, allows this, but should be |
|
99 // ready to provide a compensating write barrier as necessary |
|
100 // if that storage came out of a non-young region. The efficiency |
|
101 // of this implementation depends crucially on being able to |
|
102 // answer very efficiently in constant time whether a piece of |
|
103 // storage in the heap comes from a young region or not. |
|
104 // See ReduceInitialCardMarks. |
|
105 virtual bool can_elide_tlab_store_barriers() const { |
|
106 return true; |
|
107 } |
|
108 |
|
109 // If a compiler is eliding store barriers for TLAB-allocated objects, |
93 // If a compiler is eliding store barriers for TLAB-allocated objects, |
110 // we will be informed of a slow-path allocation by a call |
94 // we will be informed of a slow-path allocation by a call |
111 // to on_slowpath_allocation_exit() below. Such a call precedes the |
95 // to on_slowpath_allocation_exit() below. Such a call precedes the |
112 // initialization of the object itself, and no post-store-barriers will |
96 // initialization of the object itself, and no post-store-barriers will |
113 // be issued. Some heap types require that the barrier strictly follows |
97 // be issued. Some heap types require that the barrier strictly follows |