Skip to content

Commit 7bb4b0d

Browse files
author
Andrew Haley
committed
Merge branch 'JDK-8134940' of https://github.com/theRealAph/jdk into JDK-8134940
2 parents 56f9ec8 + 531531b commit 7bb4b0d

2 files changed

Lines changed: 8 additions & 37 deletions

File tree

src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -280,13 +280,13 @@ void C1_MacroAssembler::load_parameter(int offset_in_words, Register reg) {
280280
// Randomized profile capture.
281281

282282
void C1_MacroAssembler::step_random(Register state, Register temp, Register data) {
283+
if (VM_Version::supports_crc32()) {
283284
#ifndef PRODUCT
284-
Label not_zero;
285-
cbnzw(r_profile_rng, not_zero);
286-
stop("non-zero required before step");
287-
bind(not_zero);
285+
Label not_zero;
286+
cbnzw(r_profile_rng, not_zero);
287+
stop("non-zero required before step");
288+
bind(not_zero);
288289
#endif
289-
if (VM_Version::supports_crc32()) {
290290
/* CRC used as a pseudo-random-number generator */
291291
// In effect, the CRC instruction is being used here for its
292292
// linear feedback shift register.

src/hotspot/cpu/x86/c1_LIRAssembler_x86.cpp

Lines changed: 3 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1356,11 +1356,6 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
13561356

13571357
__ testptr(obj, obj);
13581358
if (op->should_profile()) {
1359-
int profile_capture_ratio = ProfileCaptureRatio;
1360-
int ratio_shift = exact_log2(profile_capture_ratio);
1361-
auto threshold = (UCONST64(1) << 32) >> ratio_shift;
1362-
assert(threshold > 0, "must be");
1363-
13641359
Label not_null;
13651360
Register mdo = klass_RInfo;
13661361
__ mov_metadata(mdo, md->constant_encoding());
@@ -1372,33 +1367,9 @@ void LIR_Assembler::emit_typecheck_helper(LIR_OpTypeCheck *op, Label* success, L
13721367
__ jmp(*obj_is_null);
13731368
__ bind(not_null);
13741369

1375-
ProfileStub *stub
1376-
= profile_capture_ratio > 1 ? new ProfileStub() : nullptr;
1377-
1378-
auto lambda = [stub, md, mdo, data, k_RInfo, obj, Rtmp1, tmp_load_klass]
1379-
(LIR_Assembler* ce, LIR_Op* base_op) {
1380-
auto masm = [=]() { return ce->masm(); };
1381-
if (stub != nullptr) __ bind(*stub->entry());
1382-
1383-
Register recv = k_RInfo;
1384-
__ load_klass(recv, obj, tmp_load_klass);
1385-
ce->type_profile_helper(mdo, md, data, recv, Rtmp1);
1386-
1387-
if (stub != nullptr) __ jmp(*stub->continuation());
1388-
};
1389-
1390-
if (stub != nullptr) {
1391-
__ cmpl(r_profile_rng, threshold);
1392-
__ jcc(Assembler::below, *stub->entry());
1393-
__ bind(*stub->continuation());
1394-
__ step_random(r_profile_rng, rscratch1);
1395-
1396-
stub->set_action(lambda, op);
1397-
stub->set_name("Typecheck stub");
1398-
append_code_stub(stub);
1399-
} else {
1400-
lambda(this, op);
1401-
}
1370+
Register recv = k_RInfo;
1371+
__ load_klass(recv, obj, tmp_load_klass);
1372+
type_profile_helper(mdo, md, data, recv, Rtmp1);
14021373
} else {
14031374
__ jcc(Assembler::equal, *obj_is_null);
14041375
}

0 commit comments

Comments
 (0)