295 // separately and does not directly affect performance.
296 return uncolor_or_color_size + 4;
297 }
298
299 void* ZBarrierSetC2::create_barrier_state(Arena* comp_arena) const {
300 return new (comp_arena) ZBarrierSetC2State(comp_arena);
301 }
302
303 void ZBarrierSetC2::late_barrier_analysis() const {
304 compute_liveness_at_stubs();
305 analyze_dominating_barriers();
306 }
307
308 void ZBarrierSetC2::emit_stubs(CodeBuffer& cb) const {
309 MacroAssembler masm(&cb);
310 GrowableArray<ZBarrierStubC2*>* const stubs = barrier_set_state()->stubs();
311 barrier_set_state()->set_stubs_start_offset(masm.offset());
312
313 for (int i = 0; i < stubs->length(); i++) {
314 // Make sure there is enough space in the code buffer
315 if (cb.insts()->maybe_expand_to_ensure_remaining(PhaseOutput::MAX_inst_size) && cb.blob() == nullptr) {
316 ciEnv::current()->record_failure("CodeCache is full");
317 return;
318 }
319
320 stubs->at(i)->emit_code(masm);
321 }
322
323 masm.flush();
324 }
325
326 int ZBarrierSetC2::estimate_stub_size() const {
327 Compile* const C = Compile::current();
328 BufferBlob* const blob = C->output()->scratch_buffer_blob();
329 GrowableArray<ZBarrierStubC2*>* const stubs = barrier_set_state()->stubs();
330 int size = 0;
331
332 for (int i = 0; i < stubs->length(); i++) {
333 CodeBuffer cb(blob->content_begin(), checked_cast<CodeBuffer::csize_t>((address)C->output()->scratch_locs_memory() - blob->content_begin()));
334 MacroAssembler masm(&cb);
335 stubs->at(i)->emit_code(masm);
|
295 // separately and does not directly affect performance.
296 return uncolor_or_color_size + 4;
297 }
298
299 void* ZBarrierSetC2::create_barrier_state(Arena* comp_arena) const {
300 return new (comp_arena) ZBarrierSetC2State(comp_arena);
301 }
302
303 void ZBarrierSetC2::late_barrier_analysis() const {
304 compute_liveness_at_stubs();
305 analyze_dominating_barriers();
306 }
307
308 void ZBarrierSetC2::emit_stubs(CodeBuffer& cb) const {
309 MacroAssembler masm(&cb);
310 GrowableArray<ZBarrierStubC2*>* const stubs = barrier_set_state()->stubs();
311 barrier_set_state()->set_stubs_start_offset(masm.offset());
312
313 for (int i = 0; i < stubs->length(); i++) {
314 // Make sure there is enough space in the code buffer
315 if (cb.insts()->maybe_expand_to_ensure_remaining(PhaseOutput::max_inst_gcstub_size()) && cb.blob() == nullptr) {
316 ciEnv::current()->record_failure("CodeCache is full");
317 return;
318 }
319
320 stubs->at(i)->emit_code(masm);
321 }
322
323 masm.flush();
324 }
325
326 int ZBarrierSetC2::estimate_stub_size() const {
327 Compile* const C = Compile::current();
328 BufferBlob* const blob = C->output()->scratch_buffer_blob();
329 GrowableArray<ZBarrierStubC2*>* const stubs = barrier_set_state()->stubs();
330 int size = 0;
331
332 for (int i = 0; i < stubs->length(); i++) {
333 CodeBuffer cb(blob->content_begin(), checked_cast<CodeBuffer::csize_t>((address)C->output()->scratch_locs_memory() - blob->content_begin()));
334 MacroAssembler masm(&cb);
335 stubs->at(i)->emit_code(masm);
|