diff --git a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp index 1054449adb1..39f81800baf 100644 --- a/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/c1_MacroAssembler_x86.cpp @@ -275,17 +275,20 @@ void C1_MacroAssembler::step_random(Register state, Register temp) { // One of these will be the best for a particular CPU. /* Algorithm "xor" from p. 4 of Marsaglia, "Xorshift RNGs" */ - // movl(temp, state); - // sall(temp, 13); - // xorl(state, temp); - // movl(temp, state); - // shrl(temp, 7); - // xorl(state, temp); - // movl(temp, state); - // sall(temp, 5); - // xorl(state, temp); + if (getenv("APH_USE_XORSHIFT")) { + movl(temp, state); + sall(temp, 13); + xorl(state, temp); + movl(temp, state); + shrl(temp, 7); + xorl(state, temp); + movl(temp, state); + sall(temp, 5); + xorl(state, temp); + return; + } - if (VM_Version::supports_sse4_2()) { + if (!getenv("APH_USE_LCG") && VM_Version::supports_sse4_2()) { /* CRC used as a psuedo-random-number generator */ // In effect, the CRC instruction is being used here for its // linear feedback shift register. It's unbeatably fast, and diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.cpp b/src/hotspot/cpu/x86/macroAssembler_x86.cpp index 411d0a79015..3c6de7991bc 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.cpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.cpp @@ -4761,7 +4761,7 @@ Address MacroAssembler::argument_address(RegisterOrConstant arg_slot, // counter updates are not atomic. // void MacroAssembler::profile_receiver_type(Register recv, Register mdp, int mdp_offset, - addptr_32_insn_t xx) { + addptr_32_insn_t increment) { int base_receiver_offset = in_bytes(ReceiverTypeData::receiver_offset(0)); int end_receiver_offset = in_bytes(ReceiverTypeData::receiver_offset(ReceiverTypeData::row_limit())); int poly_count_offset = in_bytes(CounterData::count_offset()); @@ -4805,8 +4805,8 @@ void MacroAssembler::profile_receiver_type(Register recv, Register mdp, int mdp_ // Corner case: no profile table. Increment poly counter and exit. if (ReceiverTypeData::row_limit() == 0) { - addptr(Address(mdp, poly_count_offset, Address::times_ptr), DataLayout::counter_increment); - BLOCK_COMMENT("} profile_receiver_type {"); + increment(this, Address(mdp, poly_count_offset, Address::times_ptr), DataLayout::counter_increment); + BLOCK_COMMENT("} profile_receiver_type"); return; } @@ -4948,7 +4948,7 @@ void MacroAssembler::profile_receiver_type(Register recv, Register mdp, int mdp_ bind(L_count_update); // addptr(Address(mdp, offset, Address::times_ptr), DataLayout::counter_increment); - xx(this, Address(mdp, offset, Address::times_ptr), DataLayout::counter_increment); + increment(this, Address(mdp, offset, Address::times_ptr), DataLayout::counter_increment); BLOCK_COMMENT("} profile_receiver_type"); } diff --git a/src/hotspot/cpu/x86/macroAssembler_x86.hpp b/src/hotspot/cpu/x86/macroAssembler_x86.hpp index de354c51789..1a224d8a6b5 100644 --- a/src/hotspot/cpu/x86/macroAssembler_x86.hpp +++ b/src/hotspot/cpu/x86/macroAssembler_x86.hpp @@ -673,7 +673,7 @@ public: } typedef void (*addptr_32_insn_t)(MacroAssembler *masm, Address dst, int32_t src); void profile_receiver_type(Register recv, Register mdp, int mdp_offset, - addptr_32_insn_t xx = &addptr_32); + addptr_32_insn_t increment = &addptr_32); // Debugging diff --git a/src/hotspot/share/compiler/compiler_globals.hpp b/src/hotspot/share/compiler/compiler_globals.hpp index 0558df874dc..349ee43be48 100644 --- a/src/hotspot/share/compiler/compiler_globals.hpp +++ b/src/hotspot/share/compiler/compiler_globals.hpp @@ -388,7 +388,7 @@ "If compilation is stopped with an error, capture diagnostic " \ "information at the bailout point") \ \ - product(int, ProfileCaptureRatio, 1, EXPERIMENTAL, \ + product(int, ProfileCaptureRatio, 64, EXPERIMENTAL, \ "Reduce and randomize tiered-compilation profile captures " \ "in order to reduce cache contention on shared method data. " \ "Must be a power of 2.") \