129 // for example, those needing virtual calls.
130 // This code could perhaps be moved into initialize() but would
131 // be slightly more awkward because we want the latter to be a
132 // pure virtual.
133 void pre_initialize();
134
135 // Create a new tlab. All TLAB allocations must go through this.
136 virtual HeapWord* allocate_new_tlab(size_t size);
137
138 // Accumulate statistics on all tlabs.
139 virtual void accumulate_statistics_all_tlabs();
140
141 // Reinitialize tlabs before resuming mutators.
142 virtual void resize_all_tlabs();
143
144 // Allocate from the current thread's TLAB, with broken-out slow path.
145 inline static HeapWord* allocate_from_tlab(Klass* klass, Thread* thread, size_t size);
146 static HeapWord* allocate_from_tlab_slow(Klass* klass, Thread* thread, size_t size);
147
148 // Sample the allocation via HeapMonitoring.
149 static void sample_allocation(Thread* thread, HeapWord* obj, size_t size,
150 size_t fix_sample_rate = 0);
151 // Try to allocate the object we want to sample in this tlab, returns NULL if
152 // fails to allocate.
153 static HeapWord* allocate_sampled_object(Thread* thread, size_t size);
154
155 // Allocate an uninitialized block of the given size, or returns NULL if
156 // this is impossible.
157 inline static HeapWord* common_mem_allocate_noinit(Klass* klass, size_t size, TRAPS);
158
159 // Like allocate_init, but the block returned by a successful allocation
160 // is guaranteed initialized to zeros.
161 inline static HeapWord* common_mem_allocate_init(Klass* klass, size_t size, TRAPS);
162
163 // Helper functions for (VM) allocation.
164 inline static void post_allocation_setup_common(Klass* klass, HeapWord* obj);
165 inline static void post_allocation_setup_no_klass_install(Klass* klass,
166 HeapWord* objPtr);
167
168 inline static void post_allocation_setup_obj(Klass* klass, HeapWord* obj, int size);
169
170 inline static void post_allocation_setup_array(Klass* klass,
|
129 // for example, those needing virtual calls.
130 // This code could perhaps be moved into initialize() but would
131 // be slightly more awkward because we want the latter to be a
132 // pure virtual.
133 void pre_initialize();
134
135 // Create a new tlab. All TLAB allocations must go through this.
136 virtual HeapWord* allocate_new_tlab(size_t size);
137
138 // Accumulate statistics on all tlabs.
139 virtual void accumulate_statistics_all_tlabs();
140
141 // Reinitialize tlabs before resuming mutators.
142 virtual void resize_all_tlabs();
143
144 // Allocate from the current thread's TLAB, with broken-out slow path.
145 inline static HeapWord* allocate_from_tlab(Klass* klass, Thread* thread, size_t size);
146 static HeapWord* allocate_from_tlab_slow(Klass* klass, Thread* thread, size_t size);
147
148 // Sample the allocation via HeapMonitoring.
149 // overflowed_words represents the number of HeapWords that went passed the
150 // sampling boundary. This is used to fix the next sampling rate.
151 static void sample_allocation(Thread* thread, HeapWord* obj, size_t size,
152 size_t overflowed_words = 0);
153 // Try to allocate the object we want to sample in this tlab, returns NULL if
154 // fails to allocate.
155 static HeapWord* allocate_sampled_object(Thread* thread, size_t size);
156
157 // Allocate an uninitialized block of the given size, or returns NULL if
158 // this is impossible.
159 inline static HeapWord* common_mem_allocate_noinit(Klass* klass, size_t size, TRAPS);
160
161 // Like allocate_init, but the block returned by a successful allocation
162 // is guaranteed initialized to zeros.
163 inline static HeapWord* common_mem_allocate_init(Klass* klass, size_t size, TRAPS);
164
165 // Helper functions for (VM) allocation.
166 inline static void post_allocation_setup_common(Klass* klass, HeapWord* obj);
167 inline static void post_allocation_setup_no_klass_install(Klass* klass,
168 HeapWord* objPtr);
169
170 inline static void post_allocation_setup_obj(Klass* klass, HeapWord* obj, int size);
171
172 inline static void post_allocation_setup_array(Klass* klass,
|