equal
deleted
inserted
replaced
24 |
24 |
25 #include "precompiled.hpp" |
25 #include "precompiled.hpp" |
26 #include "asm/macroAssembler.inline.hpp" |
26 #include "asm/macroAssembler.inline.hpp" |
27 #include "gc/g1/g1BarrierSet.hpp" |
27 #include "gc/g1/g1BarrierSet.hpp" |
28 #include "gc/g1/g1BarrierSetAssembler.hpp" |
28 #include "gc/g1/g1BarrierSetAssembler.hpp" |
|
29 #include "gc/g1/g1BarrierSetRuntime.hpp" |
29 #include "gc/g1/g1ThreadLocalData.hpp" |
30 #include "gc/g1/g1ThreadLocalData.hpp" |
30 #include "gc/g1/g1CardTable.hpp" |
31 #include "gc/g1/g1CardTable.hpp" |
31 #include "gc/g1/g1ThreadLocalData.hpp" |
32 #include "gc/g1/g1ThreadLocalData.hpp" |
32 #include "gc/g1/heapRegion.hpp" |
33 #include "gc/g1/heapRegion.hpp" |
33 #include "interpreter/interp_masm.hpp" |
34 #include "interpreter/interp_masm.hpp" |
72 if (addr != R0) { |
73 if (addr != R0) { |
73 assert_different_registers(count, R0); |
74 assert_different_registers(count, R0); |
74 __ mov(R0, addr); |
75 __ mov(R0, addr); |
75 } |
76 } |
76 #ifdef AARCH64 |
77 #ifdef AARCH64 |
77 __ zero_extend(R1, count, 32); // G1BarrierSet::write_ref_array_pre_*_entry takes size_t |
78 __ zero_extend(R1, count, 32); // G1BarrierSetRuntime::write_ref_array_pre_*_entry takes size_t |
78 #else |
79 #else |
79 if (count != R1) { |
80 if (count != R1) { |
80 __ mov(R1, count); |
81 __ mov(R1, count); |
81 } |
82 } |
82 #endif // AARCH64 |
83 #endif // AARCH64 |
83 |
84 |
84 if (UseCompressedOops) { |
85 if (UseCompressedOops) { |
85 __ call(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_pre_narrow_oop_entry)); |
86 __ call(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_array_pre_narrow_oop_entry)); |
86 } else { |
87 } else { |
87 __ call(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_pre_oop_entry)); |
88 __ call(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_array_pre_oop_entry)); |
88 } |
89 } |
89 |
90 |
90 #ifdef AARCH64 |
91 #ifdef AARCH64 |
91 for (int i = callee_saved_regs - 2; i >= 0; i -= 2) { |
92 for (int i = callee_saved_regs - 2; i >= 0; i -= 2) { |
92 __ raw_pop(as_Register(i), as_Register(i+1)); |
93 __ raw_pop(as_Register(i), as_Register(i+1)); |
104 if (addr != R0) { |
105 if (addr != R0) { |
105 assert_different_registers(count, R0); |
106 assert_different_registers(count, R0); |
106 __ mov(R0, addr); |
107 __ mov(R0, addr); |
107 } |
108 } |
108 #ifdef AARCH64 |
109 #ifdef AARCH64 |
109 __ zero_extend(R1, count, 32); // G1BarrierSet::write_ref_array_post_entry takes size_t |
110 __ zero_extend(R1, count, 32); // G1BarrierSetRuntime::write_ref_array_post_entry takes size_t |
110 #else |
111 #else |
111 if (count != R1) { |
112 if (count != R1) { |
112 __ mov(R1, count); |
113 __ mov(R1, count); |
113 } |
114 } |
114 #if R9_IS_SCRATCHED |
115 #if R9_IS_SCRATCHED |
118 // is scratched. Note that the optimization might not be to |
119 // is scratched. Note that the optimization might not be to |
119 // difficult for this particular call site. |
120 // difficult for this particular call site. |
120 __ push(R9); |
121 __ push(R9); |
121 #endif // !R9_IS_SCRATCHED |
122 #endif // !R9_IS_SCRATCHED |
122 #endif // !AARCH64 |
123 #endif // !AARCH64 |
123 __ call(CAST_FROM_FN_PTR(address, G1BarrierSet::write_ref_array_post_entry)); |
124 __ call(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_array_post_entry)); |
124 #ifndef AARCH64 |
125 #ifndef AARCH64 |
125 #if R9_IS_SCRATCHED |
126 #if R9_IS_SCRATCHED |
126 __ pop(R9); |
127 __ pop(R9); |
127 #endif // !R9_IS_SCRATCHED |
128 #endif // !R9_IS_SCRATCHED |
128 #endif // !AARCH64 |
129 #endif // !AARCH64 |
203 if (pre_val != R0) { |
204 if (pre_val != R0) { |
204 __ mov(R0, pre_val); |
205 __ mov(R0, pre_val); |
205 } |
206 } |
206 __ mov(R1, Rthread); |
207 __ mov(R1, Rthread); |
207 |
208 |
208 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), R0, R1); |
209 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), R0, R1); |
209 |
210 |
210 #ifdef AARCH64 |
211 #ifdef AARCH64 |
211 if (store_addr != noreg) { |
212 if (store_addr != noreg) { |
212 __ raw_pop(store_addr, new_val); |
213 __ raw_pop(store_addr, new_val); |
213 } else { |
214 } else { |
294 |
295 |
295 if (card_addr != R0) { |
296 if (card_addr != R0) { |
296 __ mov(R0, card_addr); |
297 __ mov(R0, card_addr); |
297 } |
298 } |
298 __ mov(R1, Rthread); |
299 __ mov(R1, Rthread); |
299 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), R0, R1); |
300 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), R0, R1); |
300 |
301 |
301 __ bind(done); |
302 __ bind(done); |
302 } |
303 } |
303 |
304 |
304 void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, |
305 void G1BarrierSetAssembler::load_at(MacroAssembler* masm, DecoratorSet decorators, BasicType type, |
465 |
466 |
466 __ save_live_registers(); |
467 __ save_live_registers(); |
467 |
468 |
468 assert(r_pre_val_0 == c_rarg0, "pre_val should be in R0"); |
469 assert(r_pre_val_0 == c_rarg0, "pre_val should be in R0"); |
469 __ mov(c_rarg1, Rthread); |
470 __ mov(c_rarg1, Rthread); |
470 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_pre), c_rarg0, c_rarg1); |
471 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_pre_entry), c_rarg0, c_rarg1); |
471 |
472 |
472 __ restore_live_registers_without_return(); |
473 __ restore_live_registers_without_return(); |
473 |
474 |
474 __ b(done); |
475 __ b(done); |
475 } |
476 } |
572 |
573 |
573 __ save_live_registers(); |
574 __ save_live_registers(); |
574 |
575 |
575 assert(r_card_addr_0 == c_rarg0, "card_addr should be in R0"); |
576 assert(r_card_addr_0 == c_rarg0, "card_addr should be in R0"); |
576 __ mov(c_rarg1, Rthread); |
577 __ mov(c_rarg1, Rthread); |
577 __ call_VM_leaf(CAST_FROM_FN_PTR(address, SharedRuntime::g1_wb_post), c_rarg0, c_rarg1); |
578 __ call_VM_leaf(CAST_FROM_FN_PTR(address, G1BarrierSetRuntime::write_ref_field_post_entry), c_rarg0, c_rarg1); |
578 |
579 |
579 __ restore_live_registers_without_return(); |
580 __ restore_live_registers_without_return(); |
580 |
581 |
581 __ b(done); |
582 __ b(done); |
582 } |
583 } |