Skip to content

Commit f94212a

Browse files
author
Andrew Haley
committed
More
1 parent 758d880 commit f94212a

1 file changed

Lines changed: 18 additions & 9 deletions

File tree

src/hotspot/cpu/aarch64/c1_MacroAssembler_aarch64.cpp

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,8 @@ void C1_MacroAssembler::step_random(Register state, Register temp, Register data
289289
// linear feedback shift register.
290290
crc32h(state, state, data);
291291
} else {
292-
/* LCG from glibc. */
292+
/* LCG by Marsaglia. From Karl Entacher,
293+
https://www.researchgate.net/publication/2683298_A_Collection_of_Selected_Pseudorandom_Number_Generators_With_Linear_Structures */
293294
mov(temp, 69069);
294295
mulw(state, state, temp);
295296
addw(state, state, 1);
@@ -298,21 +299,29 @@ void C1_MacroAssembler::step_random(Register state, Register temp, Register data
298299

299300
void C1_MacroAssembler::save_profile_rng() {
300301
if (ProfileCaptureRatio > 1) {
301-
Label not_zero;
302-
cbnzw(r_profile_rng, not_zero);
303-
stop("non-zero required before save");
304-
bind(not_zero);
302+
#ifndef PRODUCT
303+
if (VM_Version::supports_crc32()) {
304+
Label not_zero;
305+
cbnzw(r_profile_rng, not_zero);
306+
stop("non-zero required before save");
307+
bind(not_zero);
308+
}
309+
#endif
305310
strw(r_profile_rng, Address(rthread, JavaThread::profile_rng_offset()));
306311
}
307312
}
308313

309314
void C1_MacroAssembler::restore_profile_rng() {
310315
if (ProfileCaptureRatio > 1) {
311316
ldrw(r_profile_rng, Address(rthread, JavaThread::profile_rng_offset()));
312-
Label not_zero;
313-
cbnzw(r_profile_rng, not_zero);
314-
stop("non-zero required after restore");
315-
bind(not_zero);
317+
#ifndef PRODUCT
318+
if (VM_Version::supports_crc32()) {
319+
Label not_zero;
320+
cbnzw(r_profile_rng, not_zero);
321+
stop("non-zero required after restore");
322+
bind(not_zero);
323+
}
324+
#endif
316325
}
317326
}
318327

0 commit comments

Comments
 (0)