< prev index next >

src/hotspot/cpu/aarch64/c2_MacroAssembler_aarch64.cpp

Print this page

2041       sve_and(vtmp, T, min_jlong);
2042       sve_orr(vtmp, T, jlong_cast(1.0));
2043       break;
2044     default:
2045       assert(false, "unsupported");
2046       ShouldNotReachHere();
2047     }
2048     sve_sel(dst, T, pgtmp, vtmp, src); // Select either from src or vtmp based on the predicate register pgtmp
2049                                        // Result in dst
2050 }
2051 
2052 bool C2_MacroAssembler::in_scratch_emit_size() {
2053   if (ciEnv::current()->task() != nullptr) {
2054     PhaseOutput* phase_output = Compile::current()->output();
2055     if (phase_output != nullptr && phase_output->in_scratch_emit_size()) {
2056       return true;
2057     }
2058   }
2059   return MacroAssembler::in_scratch_emit_size();
2060 }




























2041       sve_and(vtmp, T, min_jlong);
2042       sve_orr(vtmp, T, jlong_cast(1.0));
2043       break;
2044     default:
2045       assert(false, "unsupported");
2046       ShouldNotReachHere();
2047     }
2048     sve_sel(dst, T, pgtmp, vtmp, src); // Select either from src or vtmp based on the predicate register pgtmp
2049                                        // Result in dst
2050 }
2051 
2052 bool C2_MacroAssembler::in_scratch_emit_size() {
2053   if (ciEnv::current()->task() != nullptr) {
2054     PhaseOutput* phase_output = Compile::current()->output();
2055     if (phase_output != nullptr && phase_output->in_scratch_emit_size()) {
2056       return true;
2057     }
2058   }
2059   return MacroAssembler::in_scratch_emit_size();
2060 }
2061 
2062 void C2_MacroAssembler::load_nklass_compact(Register dst, Register obj, Register index, int scale, int disp) {
2063   C2LoadNKlassStub* stub = new (Compile::current()->comp_arena()) C2LoadNKlassStub(dst);
2064   Compile::current()->output()->add_stub(stub);
2065 
2066   // Note: Don't clobber obj anywhere in that method!
2067 
2068   // The incoming address is pointing into obj-start + klass_offset_in_bytes. We need to extract
2069   // obj-start, so that we can load from the object's mark-word instead. Usually the address
2070   // comes as obj-start in obj and klass_offset_in_bytes in disp. However, sometimes C2
2071   // emits code that pre-computes obj-start + klass_offset_in_bytes into a register, and
2072   // then passes that register as obj and 0 in disp. The following code extracts the base
2073   // and offset to load the mark-word.
2074   int offset = oopDesc::mark_offset_in_bytes() + disp - oopDesc::klass_offset_in_bytes();
2075   if (index == noreg) {
2076     ldr(dst, Address(obj, offset));
2077   } else {
2078     lea(dst, Address(obj, index, Address::lsl(scale)));
2079     ldr(dst, Address(dst, offset));
2080   }
2081   // NOTE: We can't use tbnz here, because the target is sometimes too far away
2082   // and cannot be encoded.
2083   tst(dst, markWord::monitor_value);
2084   br(Assembler::NE, stub->entry());
2085   bind(stub->continuation());
2086   lsr(dst, dst, markWord::klass_shift);
2087 }
< prev index next >