< prev index next >

src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp

Print this page

2477       sve_and(vtmp, T, min_jlong);
2478       sve_orr(vtmp, T, jlong_cast(1.0));
2479       break;
2480     default:
2481       assert(false, "unsupported");
2482       ShouldNotReachHere();
2483     }
2484     sve_sel(dst, T, pgtmp, vtmp, src); // Select either from src or vtmp based on the predicate register pgtmp
2485                                        // Result in dst
2486 }
2487 
2488 bool C2_MacroAssembler::in_scratch_emit_size() {
2489   if (ciEnv::current()->task() != nullptr) {
2490     PhaseOutput* phase_output = Compile::current()->output();
2491     if (phase_output != nullptr && phase_output->in_scratch_emit_size()) {
2492       return true;
2493     }
2494   }
2495   return MacroAssembler::in_scratch_emit_size();
2496 }




























2477       sve_and(vtmp, T, min_jlong);
2478       sve_orr(vtmp, T, jlong_cast(1.0));
2479       break;
2480     default:
2481       assert(false, "unsupported");
2482       ShouldNotReachHere();
2483     }
2484     sve_sel(dst, T, pgtmp, vtmp, src); // Select either from src or vtmp based on the predicate register pgtmp
2485                                        // Result in dst
2486 }
2487 
2488 bool C2_MacroAssembler::in_scratch_emit_size() {
2489   if (ciEnv::current()->task() != nullptr) {
2490     PhaseOutput* phase_output = Compile::current()->output();
2491     if (phase_output != nullptr && phase_output->in_scratch_emit_size()) {
2492       return true;
2493     }
2494   }
2495   return MacroAssembler::in_scratch_emit_size();
2496 }
2497 
2498 void C2_MacroAssembler::load_nklass_compact(Register dst, Register obj, Register index, int scale, int disp) {
2499   C2LoadNKlassStub* stub = new (Compile::current()->comp_arena()) C2LoadNKlassStub(dst);
2500   Compile::current()->output()->add_stub(stub);
2501 
2502   // Note: Don't clobber obj anywhere in that method!
2503 
2504   // The incoming address is pointing into obj-start + klass_offset_in_bytes. We need to extract
2505   // obj-start, so that we can load from the object's mark-word instead. Usually the address
2506   // comes as obj-start in obj and klass_offset_in_bytes in disp. However, sometimes C2
2507   // emits code that pre-computes obj-start + klass_offset_in_bytes into a register, and
2508   // then passes that register as obj and 0 in disp. The following code extracts the base
2509   // and offset to load the mark-word.
2510   int offset = oopDesc::mark_offset_in_bytes() + disp - oopDesc::klass_offset_in_bytes();
2511   if (index == noreg) {
2512     ldr(dst, Address(obj, offset));
2513   } else {
2514     lea(dst, Address(obj, index, Address::lsl(scale)));
2515     ldr(dst, Address(dst, offset));
2516   }
2517   // NOTE: We can't use tbnz here, because the target is sometimes too far away
2518   // and cannot be encoded.
2519   tst(dst, markWord::monitor_value);
2520   br(Assembler::NE, stub->entry());
2521   bind(stub->continuation());
2522   lsr(dst, dst, markWord::klass_shift);
2523 }
< prev index next >