equal
deleted
inserted
replaced
21 * questions. |
21 * questions. |
22 * |
22 * |
23 */ |
23 */ |
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "gc/parallel/gcTaskManager.hpp" |
|
27 #include "gc/shared/preservedMarks.inline.hpp" |
26 #include "gc/shared/preservedMarks.inline.hpp" |
28 #include "gc/shared/workgroup.hpp" |
27 #include "gc/shared/workgroup.hpp" |
29 #include "memory/allocation.inline.hpp" |
28 #include "memory/allocation.inline.hpp" |
30 #include "memory/resourceArea.hpp" |
29 #include "memory/resourceArea.hpp" |
|
30 #include "utilities/macros.hpp" |
|
31 #if INCLUDE_ALL_GCS |
|
32 #include "gc/parallel/gcTaskManager.hpp" |
|
33 #endif |
31 |
34 |
32 void PreservedMarks::restore() { |
35 void PreservedMarks::restore() { |
33 while (!_stack.is_empty()) { |
36 while (!_stack.is_empty()) { |
34 const OopAndMarkOop elem = _stack.pop(); |
37 const OopAndMarkOop elem = _stack.pop(); |
35 elem.set_mark(); |
38 elem.set_mark(); |
106 assert(workers != NULL, "pre-condition"); |
109 assert(workers != NULL, "pre-condition"); |
107 ParRestoreTask task(workers->active_workers(), this, total_size_addr); |
110 ParRestoreTask task(workers->active_workers(), this, total_size_addr); |
108 workers->run_task(&task); |
111 workers->run_task(&task); |
109 } |
112 } |
110 |
113 |
|
114 #if INCLUDE_ALL_GCS |
111 class ParRestoreGCTask : public GCTask { |
115 class ParRestoreGCTask : public GCTask { |
112 private: |
116 private: |
113 const uint _id; |
117 const uint _id; |
114 PreservedMarksSet* const _preserved_marks_set; |
118 PreservedMarksSet* const _preserved_marks_set; |
115 volatile size_t* const _total_size_addr; |
119 volatile size_t* const _total_size_addr; |
144 for (uint i = 0; i < num(); i += 1) { |
148 for (uint i = 0; i < num(); i += 1) { |
145 q->enqueue(new ParRestoreGCTask(i, this, total_size_addr)); |
149 q->enqueue(new ParRestoreGCTask(i, this, total_size_addr)); |
146 } |
150 } |
147 gc_task_manager->execute_and_wait(q); |
151 gc_task_manager->execute_and_wait(q); |
148 } |
152 } |
|
153 #endif |
149 |
154 |
150 void PreservedMarksSet::reclaim() { |
155 void PreservedMarksSet::reclaim() { |
151 assert_empty(); |
156 assert_empty(); |
152 |
157 |
153 for (uint i = 0; i < _num; i += 1) { |
158 for (uint i = 0; i < _num; i += 1) { |