Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/parallelScavenge/psCompactionManager.hpp @ 1836:894b1d7c7e01
6423256: GC stacks should use a better data structure
6942771: SEGV in ParScanThreadState::take_from_overflow_stack
Reviewed-by: apetrusenko, ysr, pbk
author | jcoomes |
---|---|
date | Tue, 28 Sep 2010 15:56:15 -0700 |
parents | b2a00dd3117c |
children | f95d63e2154a |
comparison
equal
deleted
inserted
replaced
1835:4805b9f4779e | 1836:894b1d7c7e01 |
---|---|
78 // Is there a way to reuse the _marking_stack for the | 78 // Is there a way to reuse the _marking_stack for the |
79 // saving empty regions? For now just create a different | 79 // saving empty regions? For now just create a different |
80 // type of TaskQueue. | 80 // type of TaskQueue. |
81 RegionTaskQueue _region_stack; | 81 RegionTaskQueue _region_stack; |
82 | 82 |
83 #if 1 // does this happen enough to need a per thread stack? | 83 Stack<Klass*> _revisit_klass_stack; |
84 GrowableArray<Klass*>* _revisit_klass_stack; | 84 Stack<DataLayout*> _revisit_mdo_stack; |
85 GrowableArray<DataLayout*>* _revisit_mdo_stack; | 85 |
86 #endif | |
87 static ParMarkBitMap* _mark_bitmap; | 86 static ParMarkBitMap* _mark_bitmap; |
88 | 87 |
89 Action _action; | 88 Action _action; |
90 | 89 |
91 static PSOldGen* old_gen() { return _old_gen; } | 90 static PSOldGen* old_gen() { return _old_gen; } |
111 void set_action(Action v) { _action = v; } | 110 void set_action(Action v) { _action = v; } |
112 | 111 |
113 inline static ParCompactionManager* manager_array(int index); | 112 inline static ParCompactionManager* manager_array(int index); |
114 | 113 |
115 ParCompactionManager(); | 114 ParCompactionManager(); |
116 ~ParCompactionManager(); | |
117 | 115 |
118 void allocate_stacks(); | |
119 void deallocate_stacks(); | |
120 ParMarkBitMap* mark_bitmap() { return _mark_bitmap; } | 116 ParMarkBitMap* mark_bitmap() { return _mark_bitmap; } |
121 | 117 |
122 // Take actions in preparation for a compaction. | 118 // Take actions in preparation for a compaction. |
123 static void reset(); | 119 static void reset(); |
124 | 120 |
127 bool should_update(); | 123 bool should_update(); |
128 bool should_copy(); | 124 bool should_copy(); |
129 bool should_verify_only(); | 125 bool should_verify_only(); |
130 bool should_reset_only(); | 126 bool should_reset_only(); |
131 | 127 |
132 #if 1 | 128 Stack<Klass*>* revisit_klass_stack() { return &_revisit_klass_stack; } |
133 // Probably stays as a growable array | 129 Stack<DataLayout*>* revisit_mdo_stack() { return &_revisit_mdo_stack; } |
134 GrowableArray<Klass*>* revisit_klass_stack() { return _revisit_klass_stack; } | |
135 GrowableArray<DataLayout*>* revisit_mdo_stack() { return _revisit_mdo_stack; } | |
136 #endif | |
137 | 130 |
138 // Save for later processing. Must not fail. | 131 // Save for later processing. Must not fail. |
139 inline void push(oop obj) { _marking_stack.push(obj); } | 132 inline void push(oop obj) { _marking_stack.push(obj); } |
140 inline void push_objarray(oop objarray, size_t index); | 133 inline void push_objarray(oop objarray, size_t index); |
141 inline void push_region(size_t index); | 134 inline void push_region(size_t index); |
160 inline bool marking_stacks_empty() const; | 153 inline bool marking_stacks_empty() const; |
161 | 154 |
162 // Process tasks remaining on any stack | 155 // Process tasks remaining on any stack |
163 void drain_region_stacks(); | 156 void drain_region_stacks(); |
164 | 157 |
165 // Debugging support | |
166 #ifdef ASSERT | |
167 bool stacks_have_been_allocated(); | |
168 #endif | |
169 }; | 158 }; |
170 | 159 |
171 inline ParCompactionManager* ParCompactionManager::manager_array(int index) { | 160 inline ParCompactionManager* ParCompactionManager::manager_array(int index) { |
172 assert(_manager_array != NULL, "access of NULL manager_array"); | 161 assert(_manager_array != NULL, "access of NULL manager_array"); |
173 assert(index >= 0 && index <= (int)ParallelGCThreads, | 162 assert(index >= 0 && index <= (int)ParallelGCThreads, |