76 // that must be parseable as an oop by concurrent collectors.
77 oop finish(HeapWord* mem) const;
78
79 // Raw memory allocation. This will try to do a TLAB allocation, and otherwise fall
80 // back to calling CollectedHeap::mem_allocate().
81 HeapWord* mem_allocate(Allocation& allocation) const;
82
83 public:
84 // Allocate and fully construct the object, and perform various instrumentation. Could safepoint.
85 oop allocate() const;
86 };
87
88 class ObjAllocator: public MemAllocator {
89 public:
90 ObjAllocator(Klass* klass, size_t word_size, Thread* thread = Thread::current())
91 : MemAllocator(klass, word_size, thread) {}
92
93 virtual oop initialize(HeapWord* mem) const;
94 };
95
96 class ObjArrayAllocator: public MemAllocator {
97 protected:
98 const int _length;
99 const bool _do_zero;
100
101 public:
102 ObjArrayAllocator(Klass* klass, size_t word_size, int length, bool do_zero,
103 Thread* thread = Thread::current())
104 : MemAllocator(klass, word_size, thread),
105 _length(length),
106 _do_zero(do_zero) {}
107
108 virtual oop initialize(HeapWord* mem) const;
109 };
110
111 class ClassAllocator: public MemAllocator {
112 public:
113 ClassAllocator(Klass* klass, size_t word_size, Thread* thread = Thread::current())
114 : MemAllocator(klass, word_size, thread) {}
115
|
76 // that must be parseable as an oop by concurrent collectors.
77 oop finish(HeapWord* mem) const;
78
79 // Raw memory allocation. This will try to do a TLAB allocation, and otherwise fall
80 // back to calling CollectedHeap::mem_allocate().
81 HeapWord* mem_allocate(Allocation& allocation) const;
82
83 public:
84 // Allocate and fully construct the object, and perform various instrumentation. Could safepoint.
85 oop allocate() const;
86 };
87
88 class ObjAllocator: public MemAllocator {
89 public:
90 ObjAllocator(Klass* klass, size_t word_size, Thread* thread = Thread::current())
91 : MemAllocator(klass, word_size, thread) {}
92
93 virtual oop initialize(HeapWord* mem) const;
94 };
95
96 class ObjBufferAllocator: public MemAllocator {
97 public:
98 ObjBufferAllocator(Klass* klass, size_t word_size, Thread* thread = Thread::current())
99 : MemAllocator(klass, word_size, thread) {}
100 virtual oop initialize(HeapWord* mem) const;
101 };
102
103
104 class ObjArrayAllocator: public MemAllocator {
105 protected:
106 const int _length;
107 const bool _do_zero;
108
109 public:
110 ObjArrayAllocator(Klass* klass, size_t word_size, int length, bool do_zero,
111 Thread* thread = Thread::current())
112 : MemAllocator(klass, word_size, thread),
113 _length(length),
114 _do_zero(do_zero) {}
115
116 virtual oop initialize(HeapWord* mem) const;
117 };
118
119 class ClassAllocator: public MemAllocator {
120 public:
121 ClassAllocator(Klass* klass, size_t word_size, Thread* thread = Thread::current())
122 : MemAllocator(klass, word_size, thread) {}
123
|