26 #include "asm/macroAssembler.inline.hpp"
27 #include "c1/c1_MacroAssembler.hpp"
28 #include "c1/c1_Runtime1.hpp"
29 #include "gc/shared/barrierSet.hpp"
30 #include "gc/shared/barrierSetAssembler.hpp"
31 #include "gc/shared/collectedHeap.hpp"
32 #include "gc/shared/tlab_globals.hpp"
33 #include "interpreter/interpreter.hpp"
34 #include "oops/arrayOop.hpp"
35 #include "oops/markWord.hpp"
36 #include "runtime/basicLock.hpp"
37 #include "runtime/os.hpp"
38 #include "runtime/sharedRuntime.hpp"
39 #include "runtime/stubRoutines.hpp"
40 #include "utilities/macros.hpp"
41
42 void C1_MacroAssembler::explicit_null_check(Register base) {
43 ShouldNotCallThis(); // unused
44 }
45
46 void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes) {
47 assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
48 generate_stack_overflow_check(bang_size_in_bytes);
49 save_return_pc();
50 push_frame(frame_size_in_bytes);
51
52 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
53 bs->nmethod_entry_barrier(this);
54 }
55
56 void C1_MacroAssembler::verified_entry(bool breakAtEntry) {
57 if (breakAtEntry) z_illtrap(0xC1);
58 }
59
60 void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case) {
61 const Register tmp = Z_R1_scratch;
62
63 assert_different_registers(Rmark, Roop, Rbox, tmp);
64
65 verify_oop(Roop, FILE_AND_LINE);
66
231 if (zero_array) {
232 Label done;
233 Register object_fields = t1;
234 Register Rzero = Z_R1_scratch;
235 z_aghi(arr_size, -base_offset_in_bytes);
236 z_bre(done); // Jump if size of fields is zero.
237 z_la(object_fields, base_offset_in_bytes, obj);
238 z_xgr(Rzero, Rzero);
239 initialize_body(object_fields, arr_size, Rzero);
240 bind(done);
241 }
242
243 // Dtrace support is unimplemented.
244 // if (CURRENT_ENV->dtrace_alloc_probes()) {
245 // assert(obj == rax, "must be");
246 // call(RuntimeAddress(Runtime1::entry_for (StubId::c1_dtrace_object_alloc_id)));
247 // }
248
249 verify_oop(obj, FILE_AND_LINE);
250 }
251
252
253 #ifndef PRODUCT
254
255 void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
256 if (!VerifyOops) return;
257 verify_oop_addr(Address(Z_SP, stack_offset), FILE_AND_LINE);
258 }
259
260 void C1_MacroAssembler::verify_not_null_oop(Register r) {
261 if (!VerifyOops) return;
262 NearLabel not_null;
263 compareU64_and_branch(r, (intptr_t)0, bcondNotEqual, not_null);
264 stop("non-null oop required");
265 bind(not_null);
266 verify_oop(r, FILE_AND_LINE);
267 }
268
269 void C1_MacroAssembler::invalidate_registers(Register preserve1,
270 Register preserve2,
|
26 #include "asm/macroAssembler.inline.hpp"
27 #include "c1/c1_MacroAssembler.hpp"
28 #include "c1/c1_Runtime1.hpp"
29 #include "gc/shared/barrierSet.hpp"
30 #include "gc/shared/barrierSetAssembler.hpp"
31 #include "gc/shared/collectedHeap.hpp"
32 #include "gc/shared/tlab_globals.hpp"
33 #include "interpreter/interpreter.hpp"
34 #include "oops/arrayOop.hpp"
35 #include "oops/markWord.hpp"
36 #include "runtime/basicLock.hpp"
37 #include "runtime/os.hpp"
38 #include "runtime/sharedRuntime.hpp"
39 #include "runtime/stubRoutines.hpp"
40 #include "utilities/macros.hpp"
41
42 void C1_MacroAssembler::explicit_null_check(Register base) {
43 ShouldNotCallThis(); // unused
44 }
45
46 void C1_MacroAssembler::build_frame(int frame_size_in_bytes, int bang_size_in_bytes,
47 int sp_offset_for_orig_pc,
48 bool needs_stack_repair, bool has_scalarized_args,
49 Label* verified_inline_entry_label) {
50 assert(bang_size_in_bytes >= frame_size_in_bytes, "stack bang size incorrect");
51 generate_stack_overflow_check(bang_size_in_bytes);
52 save_return_pc();
53 push_frame(frame_size_in_bytes);
54
55 BarrierSetAssembler* bs = BarrierSet::barrier_set()->barrier_set_assembler();
56 bs->nmethod_entry_barrier(this);
57 }
58
59 void C1_MacroAssembler::verified_entry(bool breakAtEntry) {
60 if (breakAtEntry) z_illtrap(0xC1);
61 }
62
63 void C1_MacroAssembler::lock_object(Register Rmark, Register Roop, Register Rbox, Label& slow_case) {
64 const Register tmp = Z_R1_scratch;
65
66 assert_different_registers(Rmark, Roop, Rbox, tmp);
67
68 verify_oop(Roop, FILE_AND_LINE);
69
234 if (zero_array) {
235 Label done;
236 Register object_fields = t1;
237 Register Rzero = Z_R1_scratch;
238 z_aghi(arr_size, -base_offset_in_bytes);
239 z_bre(done); // Jump if size of fields is zero.
240 z_la(object_fields, base_offset_in_bytes, obj);
241 z_xgr(Rzero, Rzero);
242 initialize_body(object_fields, arr_size, Rzero);
243 bind(done);
244 }
245
246 // Dtrace support is unimplemented.
247 // if (CURRENT_ENV->dtrace_alloc_probes()) {
248 // assert(obj == rax, "must be");
249 // call(RuntimeAddress(Runtime1::entry_for (StubId::c1_dtrace_object_alloc_id)));
250 // }
251
252 verify_oop(obj, FILE_AND_LINE);
253 }
254
255 int C1_MacroAssembler::scalarized_entry(const CompiledEntrySignature* ces, int frame_size_in_bytes, int bang_size_in_bytes, int sp_offset_for_orig_pc, Label& verified_inline_entry_label, bool is_inline_ro_entry) {
256 Unimplemented();
257 }
258
259
260
261 #ifndef PRODUCT
262
263 void C1_MacroAssembler::verify_stack_oop(int stack_offset) {
264 if (!VerifyOops) return;
265 verify_oop_addr(Address(Z_SP, stack_offset), FILE_AND_LINE);
266 }
267
268 void C1_MacroAssembler::verify_not_null_oop(Register r) {
269 if (!VerifyOops) return;
270 NearLabel not_null;
271 compareU64_and_branch(r, (intptr_t)0, bcondNotEqual, not_null);
272 stop("non-null oop required");
273 bind(not_null);
274 verify_oop(r, FILE_AND_LINE);
275 }
276
277 void C1_MacroAssembler::invalidate_registers(Register preserve1,
278 Register preserve2,
|