27 #include "c1/c1_LIRAssembler.hpp" |
27 #include "c1/c1_LIRAssembler.hpp" |
28 #include "c1/c1_MacroAssembler.hpp" |
28 #include "c1/c1_MacroAssembler.hpp" |
29 #include "gc/g1/c1/g1BarrierSetC1.hpp" |
29 #include "gc/g1/c1/g1BarrierSetC1.hpp" |
30 #include "gc/g1/g1BarrierSet.hpp" |
30 #include "gc/g1/g1BarrierSet.hpp" |
31 #include "gc/g1/g1BarrierSetAssembler.hpp" |
31 #include "gc/g1/g1BarrierSetAssembler.hpp" |
|
32 #include "gc/g1/g1BarrierSetRuntime.hpp" |
32 #include "gc/g1/g1CardTable.hpp" |
33 #include "gc/g1/g1CardTable.hpp" |
33 #include "gc/g1/g1ThreadLocalData.hpp" |
34 #include "gc/g1/g1ThreadLocalData.hpp" |
34 #include "gc/g1/heapRegion.hpp" |
35 #include "gc/g1/heapRegion.hpp" |
35 #include "gc/shared/collectedHeap.hpp" |
36 #include "gc/shared/collectedHeap.hpp" |
36 #include "runtime/sharedRuntime.hpp" |
37 #include "runtime/sharedRuntime.hpp" |
58 } else { |
59 } else { |
59 __ mov(c_rarg0, addr); |
60 __ mov(c_rarg0, addr); |
60 __ mov(c_rarg1, count); |
61 __ mov(c_rarg1, count); |
61 } |
62 } |
62 if (UseCompressedOops) { |
63 if (UseCompressedOops) { |
63 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_pre_narrow_oop_entry), 2); |
64 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_array_pre_narrow_oop_entry), 2); |
64 } else { |
65 } else { |
65 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_pre_oop_entry), 2); |
66 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_array_pre_oop_entry), 2); |
66 } |
67 } |
67 __ pop(saved_regs, sp); |
68 __ pop(saved_regs, sp); |
68 } |
69 } |
69 } |
70 } |
70 |
71 |
76 __ lea(scratch, Address(end, BytesPerHeapOop)); |
77 __ lea(scratch, Address(end, BytesPerHeapOop)); |
77 __ sub(scratch, scratch, start); // subtract start to get #bytes |
78 __ sub(scratch, scratch, start); // subtract start to get #bytes |
78 __ lsr(scratch, scratch, LogBytesPerHeapOop); // convert to element count |
79 __ lsr(scratch, scratch, LogBytesPerHeapOop); // convert to element count |
79 __ mov(c_rarg0, start); |
80 __ mov(c_rarg0, start); |
80 __ mov(c_rarg1, scratch); |
81 __ mov(c_rarg1, scratch); |
81 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_post_entry), 2); |
82 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_array_post_entry), 2); |
82 __ pop(saved_regs, sp); |
83 __ pop(saved_regs, sp); |
83 } |
84 } |
84 |
85 |
85 void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, |
86 void G1BarrierSetAssembler::g1_write_barrier_pre(MacroAssembler* masm, |
86 Register obj, |
87 Register obj, |
159 // So when we do not have have a full interpreter frame on the stack |
160 // So when we do not have have a full interpreter frame on the stack |
160 // expand_call should be passed true. |
161 // expand_call should be passed true. |
161 |
162 |
162 if (expand_call) { |
163 if (expand_call) { |
163 assert(pre_val != c_rarg1, "smashed arg"); |
164 assert(pre_val != c_rarg1, "smashed arg"); |
164 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), pre_val, thread); |
165 __ super_call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), pre_val, thread); |
165 } else { |
166 } else { |
166 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), pre_val, thread); |
167 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), pre_val, thread); |
167 } |
168 } |
168 |
169 |
169 __ pop(saved, sp); |
170 __ pop(saved, sp); |
170 |
171 |
171 __ bind(done); |
172 __ bind(done); |
243 |
244 |
244 __ bind(runtime); |
245 __ bind(runtime); |
245 // save the live input values |
246 // save the live input values |
246 RegSet saved = RegSet::of(store_addr, new_val); |
247 RegSet saved = RegSet::of(store_addr, new_val); |
247 __ push(saved, sp); |
248 __ push(saved, sp); |
248 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), card_addr, thread); |
249 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), card_addr, thread); |
249 __ pop(saved, sp); |
250 __ pop(saved, sp); |
250 |
251 |
251 __ bind(done); |
252 __ bind(done); |
252 } |
253 } |
253 |
254 |
396 __ b(done); |
397 __ b(done); |
397 |
398 |
398 __ bind(runtime); |
399 __ bind(runtime); |
399 __ push_call_clobbered_registers(); |
400 __ push_call_clobbered_registers(); |
400 __ load_parameter(0, pre_val); |
401 __ load_parameter(0, pre_val); |
401 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), pre_val, thread); |
402 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), pre_val, thread); |
402 __ pop_call_clobbered_registers(); |
403 __ pop_call_clobbered_registers(); |
403 __ bind(done); |
404 __ bind(done); |
404 |
405 |
405 __ epilogue(); |
406 __ epilogue(); |
406 } |
407 } |
466 __ str(card_addr, Address(buffer_addr, rscratch1)); |
467 __ str(card_addr, Address(buffer_addr, rscratch1)); |
467 __ b(done); |
468 __ b(done); |
468 |
469 |
469 __ bind(runtime); |
470 __ bind(runtime); |
470 __ push_call_clobbered_registers(); |
471 __ push_call_clobbered_registers(); |
471 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), card_addr, thread); |
472 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), card_addr, thread); |
472 __ pop_call_clobbered_registers(); |
473 __ pop_call_clobbered_registers(); |
473 __ bind(done); |
474 __ bind(done); |
474 __ epilogue(); |
475 __ epilogue(); |
475 } |
476 } |
476 |
477 |