mirror of
https://github.com/openjdk/jdk.git
synced 2026-08-04 15:15:23 +00:00
Fix Arm32.
This commit is contained in:
parent
448475aed7
commit
767aac76d1
@ -48,6 +48,7 @@ LIR_Opr FrameMap::R3_metadata_opr;
|
||||
LIR_Opr FrameMap::R4_metadata_opr;
|
||||
LIR_Opr FrameMap::R5_metadata_opr;
|
||||
|
||||
LIR_Opr FrameMap::profile_rng_opr;
|
||||
|
||||
LIR_Opr FrameMap::LR_opr;
|
||||
LIR_Opr FrameMap::LR_oop_opr;
|
||||
@ -142,6 +143,10 @@ void FrameMap::initialize() {
|
||||
SP_opr = as_pointer_opr(SP);
|
||||
Rthread_opr = as_pointer_opr(Rthread);
|
||||
|
||||
if (ProfileCaptureRatio > 1) {
|
||||
profile_rng_opr = LIR_OprFact::single_cpu(cpu_reg2rnr(r_profile_rng));
|
||||
}
|
||||
|
||||
// LIR operands for result
|
||||
Int_result_opr = R0_opr;
|
||||
Object_result_opr = R0_oop_opr;
|
||||
|
||||
@ -54,6 +54,7 @@
|
||||
static LIR_Opr R4_metadata_opr;
|
||||
static LIR_Opr R5_metadata_opr;
|
||||
|
||||
static LIR_Opr profile_rng_opr;
|
||||
|
||||
static LIR_Opr LR_opr;
|
||||
static LIR_Opr LR_oop_opr;
|
||||
|
||||
@ -2473,14 +2473,13 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr,
|
||||
}
|
||||
#endif
|
||||
|
||||
int profile_capture_ratio = ProfileCaptureRatio;
|
||||
int ratio_shift = exact_log2(profile_capture_ratio);
|
||||
int ratio_shift = exact_log2(ProfileCaptureRatio);
|
||||
uint64_t threshold = (UCONST64(1) << 32) >> ratio_shift;
|
||||
|
||||
assert(threshold > 0, "must be");
|
||||
|
||||
ProfileStub *counter_stub
|
||||
= profile_capture_ratio > 1 ? new ProfileStub() : nullptr;
|
||||
= ProfileCaptureRatio > 1 ? new ProfileStub() : nullptr;
|
||||
|
||||
Register dest = dest_opr->as_register();
|
||||
|
||||
@ -2544,7 +2543,7 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr,
|
||||
}
|
||||
}
|
||||
|
||||
if (overflow_stub) {
|
||||
if (overflow_stub != nullptr) {
|
||||
guarantee(step->is_valid(), "must be");
|
||||
if (!freq_opr->is_valid()) {
|
||||
if (!step->is_constant()) {
|
||||
@ -2562,9 +2561,16 @@ void LIR_Assembler::increment_profile_ctr(LIR_Opr step, LIR_Opr dest_opr,
|
||||
}
|
||||
juint mask = freq_opr->as_jint();
|
||||
__ mov_slow(Rtemp, mask);
|
||||
__ tst(dest, Rtemp);
|
||||
__ b(*overflow_stub->entry(), eq);
|
||||
__ andr(dest, dest, Rtemp);
|
||||
|
||||
if (step->is_register()) {
|
||||
__ cmp(dest, AsmOperand(step->as_register(), lsl, ratio_shift));
|
||||
} else {
|
||||
__ mov(Rtemp, step->as_constant_ptr()->as_jint_bits() << ratio_shift);
|
||||
__ cmp(dest, Rtemp);
|
||||
}
|
||||
}
|
||||
__ b(*overflow_stub->entry(), lo);
|
||||
}
|
||||
|
||||
if (counter_stub != nullptr) {
|
||||
|
||||
@ -93,6 +93,10 @@ LIR_Opr LIRGenerator::atomicLockOpr() {
|
||||
return LIR_OprFact::illegalOpr;
|
||||
}
|
||||
|
||||
LIR_Opr LIRGenerator::profile_rng_opr() {
|
||||
return FrameMap::profile_rng_opr;
|
||||
}
|
||||
|
||||
LIR_Opr LIRGenerator::result_register_for(ValueType* type, bool callee) {
|
||||
LIR_Opr opr;
|
||||
switch (type->tag()) {
|
||||
|
||||
@ -252,6 +252,7 @@ void C1_MacroAssembler::step_random(Register state, Register temp, Register data
|
||||
https://www.researchgate.net/publication/2683298_A_Collection_of_Selected_Pseudorandom_Number_Generators_With_Linear_Structures */
|
||||
mov_slow(temp, 69069);
|
||||
mul(state, state, temp);
|
||||
add(state, state, 1);
|
||||
}
|
||||
|
||||
void C1_MacroAssembler::save_profile_rng() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user