Skip to content

Commit 94b4e56

Browse files
author
Andrew Haley
committed
Checkpoint
1 parent eee4f5b commit 94b4e56

4 files changed

Lines changed: 20 additions & 17 deletions

File tree

src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -275,17 +275,20 @@ void C1_MacroAssembler::step_random(Register state, Register temp) {
275275
// One of these will be the best for a particular CPU.
276276

277277
/* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */
278-
// movl(temp, state);
279-
// sall(temp, 13);
280-
// xorl(state, temp);
281-
// movl(temp, state);
282-
// shrl(temp, 7);
283-
// xorl(state, temp);
284-
// movl(temp, state);
285-
// sall(temp, 5);
286-
// xorl(state, temp);
287-
288-
if (VM_Version::supports_sse4_2()) {
278+
if (getenv("APH_USE_XORSHIFT")) {
279+
movl(temp, state);
280+
sall(temp, 13);
281+
xorl(state, temp);
282+
movl(temp, state);
283+
shrl(temp, 7);
284+
xorl(state, temp);
285+
movl(temp, state);
286+
sall(temp, 5);
287+
xorl(state, temp);
288+
return;
289+
}
290+
291+
if (!getenv("APH_USE_LCG") && VM_Version::supports_sse4_2()) {
289292
/* CRC used as a psuedo-random-number generator */
290293
// In effect, the CRC instruction is being used here for its
291294
// linear feedback shift register. It's unbeatably fast, and

src/hotspot/cpu/x86/macroAssembler_x86.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4761,7 +4761,7 @@ Address MacroAssembler::argument_address(RegisterOrConstant arg_slot,
47614761
// counter updates are not atomic.
47624762
//
47634763
void MacroAssembler::profile_receiver_type(Register recv, Register mdp, int mdp_offset,
4764-
addptr_32_insn_t xx) {
4764+
addptr_32_insn_t increment) {
47654765
int base_receiver_offset = in_bytes(ReceiverTypeData::receiver_offset(0));
47664766
int end_receiver_offset = in_bytes(ReceiverTypeData::receiver_offset(ReceiverTypeData::row_limit()));
47674767
int poly_count_offset = in_bytes(CounterData::count_offset());
@@ -4805,8 +4805,8 @@ void MacroAssembler::profile_receiver_type(Register recv, Register mdp, int mdp_
48054805

48064806
// Corner case: no profile table. Increment poly counter and exit.
48074807
if (ReceiverTypeData::row_limit() == 0) {
4808-
addptr(Address(mdp, poly_count_offset, Address::times_ptr), DataLayout::counter_increment);
4809-
BLOCK_COMMENT("} profile_receiver_type {");
4808+
increment(this, Address(mdp, poly_count_offset, Address::times_ptr), DataLayout::counter_increment);
4809+
BLOCK_COMMENT("} profile_receiver_type");
48104810
return;
48114811
}
48124812

@@ -4948,7 +4948,7 @@ void MacroAssembler::profile_receiver_type(Register recv, Register mdp, int mdp_
49484948

49494949
bind(L_count_update);
49504950
// addptr(Address(mdp, offset, Address::times_ptr), DataLayout::counter_increment);
4951-
xx(this, Address(mdp, offset, Address::times_ptr), DataLayout::counter_increment);
4951+
increment(this, Address(mdp, offset, Address::times_ptr), DataLayout::counter_increment);
49524952

49534953
BLOCK_COMMENT("} profile_receiver_type");
49544954
}

src/hotspot/cpu/x86/macroAssembler_x86.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ class MacroAssembler: public Assembler {
673673
}
674674
typedef void (*addptr_32_insn_t)(MacroAssembler *masm, Address dst, int32_t src);
675675
void profile_receiver_type(Register recv, Register mdp, int mdp_offset,
676-
addptr_32_insn_t xx = &addptr_32);
676+
addptr_32_insn_t increment = &addptr_32);
677677

678678
// Debugging
679679

src/hotspot/share/compiler/compiler_globals.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@
388388
"If compilation is stopped with an error, capture diagnostic " \
389389
"information at the bailout point") \
390390
\
391-
product(int, ProfileCaptureRatio, 1, EXPERIMENTAL, \
391+
product(int, ProfileCaptureRatio, 64, EXPERIMENTAL, \
392392
"Reduce and randomize tiered-compilation profile captures " \
393393
"in order to reduce cache contention on shared method data. " \
394394
"Must be a power of 2.") \

0 commit comments

Comments
 (0)