< prev index next >
src/share/vm/gc/shared/preservedMarks.hpp
Print this page
*** 28,38 ****
#include "memory/allocation.hpp"
#include "memory/padded.hpp"
#include "oops/oop.hpp"
#include "utilities/stack.hpp"
! class GCTaskManager;
class WorkGang;
class PreservedMarks VALUE_OBJ_CLASS_SPEC {
private:
class OopAndMarkOop {
--- 28,38 ----
#include "memory/allocation.hpp"
#include "memory/padded.hpp"
#include "oops/oop.hpp"
#include "utilities/stack.hpp"
! class PreservedMarksSet;
class WorkGang;
class PreservedMarks VALUE_OBJ_CLASS_SPEC {
private:
class OopAndMarkOop {
*** 59,68 ****
--- 59,69 ----
inline void push_if_necessary(oop obj, markOop m);
// Iterate over the stack, restore all preserved marks, and
// reclaim the memory taken up by the stack segments.
void restore();
+ void restore_and_increment(volatile size_t* const _total_size_addr);
inline static void init_forwarded_mark(oop obj);
// Assert the stack is empty and has no cached segments.
void assert_empty() PRODUCT_RETURN;
*** 73,82 ****
--- 74,101 ----
class RemoveForwardedPointerClosure: public ObjectClosure {
public:
virtual void do_object(oop obj);
};
+ class RestorePreservedMarksTaskExecutor {
+ public:
+ void virtual restore(PreservedMarksSet* preserved_marks_set,
+ volatile size_t* total_size_addr) = 0;
+ };
+
+ class SharedRestorePreservedMarksTaskExecutor : public RestorePreservedMarksTaskExecutor {
+ private:
+ WorkGang* _workers;
+
+ public:
+ SharedRestorePreservedMarksTaskExecutor(WorkGang* workers) : _workers(workers) { }
+
+ void restore(PreservedMarksSet* preserved_marks_set,
+ volatile size_t* total_size_addr);
+
+ };
+
class PreservedMarksSet : public CHeapObj<mtGC> {
private:
// true -> _stacks will be allocated in the C heap
// false -> _stacks will be allocated in the resource arena
const bool _in_c_heap;
*** 89,105 ****
// Stack array (typically, one stack per GC worker) of length _num.
// This should be != NULL if the stacks have been initialized,
// or == NULL if they have not.
Padded<PreservedMarks>* _stacks;
- // Internal version of restore() that uses a WorkGang for parallelism.
- void restore_internal(WorkGang* workers, volatile size_t* total_size_addr);
-
- // Internal version of restore() that uses a GCTaskManager for parallelism.
- void restore_internal(GCTaskManager* gc_task_manager,
- volatile size_t* total_size_addr);
-
public:
uint num() const { return _num; }
// Return the i'th stack.
PreservedMarks* get(uint i = 0) const {
--- 108,117 ----
*** 109,126 ****
}
// Allocate stack array.
void init(uint num);
! // Itrerate over all stacks, restore all presered marks, and reclaim
! // the memory taken up by the stack segments. If the executor is
! // NULL, restoration will be done serially. If the executor is not
! // NULL, restoration could be done in parallel (when it makes
! // sense). Supported executors: WorkGang (Serial, CMS, G1),
! // GCTaskManager (PS).
! template <class E>
! inline void restore(E* executor);
// Reclaim stack array.
void reclaim();
// Assert all the stacks are empty and have no cached segments.
--- 121,135 ----
}
// Allocate stack array.
void init(uint num);
! // Iterate over all stacks, restore all preserved marks, and reclaim
! // the memory taken up by the stack segments.
! // Supported executors: SharedRestorePreservedMarksTaskExecutor (Serial, CMS, G1),
! // PSRestorePreservedMarksTaskExecutor (PS).
! inline void restore(RestorePreservedMarksTaskExecutor* executor);
// Reclaim stack array.
void reclaim();
// Assert all the stacks are empty and have no cached segments.
< prev index next >