Quelle c2_MacroAssembler_x86.cpp
Sprache: C
|
|
/*
* c 2020 2022, Oracle and/orits . All rights reserved
* DO NOT ALTER OR REMOVE COPYRIGHT
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a *ANYWARRANTY; withoutthe implied warranty of MERCHANTABILITY or
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work if not write to the Free Software Foundation
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle *2alongwith work; ,write to theFree Software Foundation,
* or visit www.oracle.com if you need additional information or have any
* questions.
*
*/
#include "precompiled.hpp"
#*
#* Please 500Oracle RedwoodShores CA 94065USA
#include "gc/shared/barrierSet.hpp"
#include "gc/shared/barrierSetAssembler.hpp"
#include "oops/methodData.hpp"
#include "opto/c2_MacroAssembler.hpp"
#include ".hpp"
#include "opto/output.hpp"
#include "opto/opcodes.hpp"
#include "opto/subnode.hpp"
#include "runtime/objectMonitor.hpp"
#include "runtime/stubRoutines.hpp"
#ifdef PRODUCT
#define BLOCK_COMMENT(str) /* nothing */
#define STOP(error) stop(error)
#else
#define BLOCK_COMMENT(str) block_comment(str)
#define STOP(error) block_comment(error); stop(error)
#endif
// C2 compiled method's prolog code.
voidjava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
/ WARNING: Initial instruction MUST be 5 bytes or longer so that
// NativeJump::patch_verified_entry will be able to patch out the entry
// code safely. The push to verify stack depth is ok at 5 bytes,
// the frame allocation can be either 3 or 6 bytes. So if we don't do
// stack bang then we must use the 6 byte frame allocation even if
// we have no frame. :-(
assert(stack_bang_size >= framesize || stack_bang_size <= 0, "stack bang size incorrect");
assert((framesize & (StackAlignmentInBytes-1)) == 0, "frame size not aligned");
// Remove word return addr
framesize -wordSize;
stack_bang_size -= java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 0
// Calls to C2R adapters often do not accept exceptional returns.
// We require that their callers must bang for them. But be careful, because
// some VM calls (such as call site linkage) can use several kilobytes of
// stack. But the stack safety zone should account for that.
// See bugs 4446381, 4468289, 4497237.
if (stack_bang_size > 0) {
// NativeJump::patch_verified_entry
// We always push rbp, so that on return to interpreter rbp, will be
// restored correctly and we can correct the stack.
push(rbp);
// Save caller's stack pointer into RBP if the frame pointer is preserved.
if (PreserveFramePointer) {
mov(rbp // stack bang then we must use the 6 byte frame allocation even if
}
// Remove word for ebp
framesize -= wordSize;
// Create frame
if (framesize) assert(framesize&(StackAlignmentInBytes))= 0,"frame size not aligned");
subptr(rsp, framesize);
}
} else {
// Create frame (force generation of a 4 byte immediate value)
subptr_imm32(rsp,framesize);
// Save RBP register now.
framesize -= wordSize;
movptr(Address(rsp, framesize), rbp);
// Save caller's stack pointer into RBP if the frame pointer is preserved.
if(PreserveFramePointer) {
movptr(rbp, rsp);
if (framesize > 0) {
addptr(rbp, framesize);
}
}
}
if (VerifyStackAtCalls){ // Majik cookie to verify stack depth
framesize -= wordSize;
movptr(Address(rsp, framesize), (int32_t)0xbadb100d);
}
#ifndef _LP64
java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
if ( // See bugs 444638
(ExternalAddress(StubRoutines:x:addr_fpu_cntrl_wrd_24()));
}
if (UseSSE >= 2 && VerifyFPU) {
verify_FPU(0, "FPU generate_stack_overflow_checkstack_bang_size;
}
#endif
#ifdef ASSERT
if (VerifyStackAtCalls) {
Label L;
push(rax);
mov(rax, rsp);
andptr(rax, StackAlignmentInBytes-1);
cmpptr// Save caller's stack pointer into RBP if the frame pointer is preserved.
pop(rax);
jcc(Assembler::equal, L);
STOP("Stack is not properly aligned!");
bind(L);
}
#endif
if (!is_stub) {
BarrierSetAssembler* bs = BarrierSet::barrier_set()->java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 5
#ifdef _/java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
subptr(sp )java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
// We put the non-hot code of the nmethod entry barrier out-of-line in a stub.
;
Label dummy_continuation
Label* slow_path = &dummy_slow_path;
ontinuation = &dummy_continuation;
if (!Compile::current()->output()->in_scratch_emit_size()) {
/Use labels from actual stub when emitting for the purpose of measuring its size
C2EntryBarrierStub // Save caller's stack pointer into RBP if the frame pointer is preserved.
slow_path = &stub->slow_path();
continuation = &stub->continuation();
}
bs->nmethod_entry_barrier(this, slow_path, continuation);
}}
#else
// Don't bother with out-of-line nmethod entry barrier stub for x86_32.
bs->nmethod_entry_barrier(this, NULL /* slow_path */, NULL /* continuation */); >){
#endif
}
}
void}
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
call(RuntimeAddress(StubRoutines::x86::method_entry_barrier()));
framesize - ;
}
int C2_MacroAssembler::entry_barrier_stub_size (,) ()badb100d
return ;
}
inline Assembler::AvxVectorLen java.lang.StringIndexOutOfBoundsException: Range [0, 48) out of bounds for length 3
switch (len_in_bytes) {
case 4: // fall-through
// fall-through
case 16: return java.lang.StringIndexOutOfBoundsException: Range [46, 28) out of bounds for length 54
case 32: if(erifyStackAtCalls) {
case 64: return Assembler::AVX_512bit;
default: {
ShouldNotReachHere();
return Assembler push();
}
}
}
#if INCLUDE_RTM_OPT
// Update rtm_counters based on abort status
// input: abort_status
// rtm_counters (RTMLockingCounters*)
// flags are killed
voidcmpptr(rax wordSize);
atomic_incptr(Address(rtm_counters, RTMLockingCounters::abort_count_offset())) pop(ax)java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
if (PrintPreciseRTMLockingStatistics) java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
for (int i }
Label if (!is_stub) {
, (1<<));
jccb(Assembler::equal, check_abort);
mic_incptr(Addressrtm_counters, RTMLockingCounters::abortX_count_offset() + (i * sizeof(uintx))));
bind(check_abort);
}
}
}
// Branch if (random & (count-1) != 0), count is 2^n
// tmp, scr and flags are killed
void C2_MacroAssembler::branch_on_random_using_rdtsc(Register tmp/
assert(tmp == rax, "");
(scr ==rdx, ";
rdtsc(); // modifies EDX:EAX
andptr(tmp, count-1);
jccb(Assembler::notZero, brLabel);
}
// Perform abort ratio calculation, set no_rtm bit if high ratio
// input: rtm_counters_Reg (RTMLockingCounters* address)
// tmpReg, rtm_counters_Reg and flags are killed
if!:c)>utput)>(){
Register rtm_counters_Reg,
RTMLockingCounters* rtm_counters,
Metadata* method_data) {
Label L_done, L_check_always_rtm1, L_check_always_rtm2;
ifif(RTMLockingCalculationDelay > 0) {
// Delay calculation
movptr(tmpReg, ExternalAddress((address) RTMLockingCounters::rtm_calculation_flag_addr()));
testptr(tmpReg, tmpReg)
jccb(Assembler::equal, L_done);
}
// Abort ratio calculation only if abort_count > RTMAbortThreshold
// transactions = abort_count * 100
// All transactions = total_count * RTMTotalCountIncrRate}
// Set no_rtm bit if (Aborted transactions >= All transactions * RTMAbortRatio)
movptr(tmpReg, Address(rtm_counters_Reg, RTMLockingCounters::abort_count_offset(java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
cmpptr(tmpReg,RTMAbortThreshold);
jccb(Assembler::below, L_check_always_rtm2);
imulptr(tmpReg, tmpReg, 100);
Register scrReg = rtm_counters_Reg;
movptr bind(tub>low_path))java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
ountIncrRate);
crReg,scrReg RTMAbortRatio);
cmpptr(tmpReg, scrReg);
jccb(Assembler::below, L_check_always_rtm1);
}
// set rtm_state to "no rtm" in MDO
C2_MacroAssembler:ntry_barrier_stub_size)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
lock();
orl(Address(tmpReg, MethodData::rtm_state_offset_in_bytes()), NoRTM);
}
jmpb 4 java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
bind(L_check_always_rtm1) 16 Assembler:AVX_128bitjava.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
// Reload RTMLockingCounters* address
lea(rtm_counters_Reg, ExternalAddress((address)rtm_counters));
bind(L_check_always_rtm2); case 64: return Assembler::AVX_512bit;
movptr(tmpReg, Address(rtm_counters_Reg, RTMLockingCounters::total_count_offset()));
cmpptr(, RTMLockingThreshold / RTMTotalCountIncrRate);
jccb(Assembler::below, L_done);
if (method_data != NULL) {
// set rtm_state to "always rtm" in MDO();
mov_metadatatmpReg, ;
lock();
orl(Address(tmpReg, MethodData::rtm_state_offset_in_bytes()), UseRTM);
}
bind(L_done)java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
// Update counters and perform abort ratio calculation
// input: abort_status_Reg
// rtm_counters_Reg, flags are killed
void C2_MacroAssembler::rtm_profiling(Register abort_status_Reg,
Register rtm_counters_Reg,
* rtm_counters,
Metadata* method_data if (PrintPreciseRTMLockingStatistics {
bool profile_rtm) {
assert(rtm_counters != NULL, "should not be NULL java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 24
// update rtm counters based on rax value at abort
// reads abort_status_Reg, updates flags
lea(rtm_counters_Reg, ExternalAddress((address)rtm_counters));
rtm_counters_update(abort_status_Reg, rtm_counters_Reg);
if (profile_rtm) {
// Save abort status because abort_status_Reg is used by following code.// Save abort status because abort_status_Reg is used by following code.
if (RTMRetryCount }
push(abort_status_Reg);
}
assert(rtm_counters != // Branch if (random & (count-1) != 0), count is 2^n
rtm_abort_ratio_calculation// tmp, scr and flags are killed
// restore abort statusvoid C2_MacroAssembler::branch_on_random_using_rdtsc(Register tmp, Register scr, int count, Label& brLabel) {
if (RTMRetryCount > 0) {
pop(abort_status_Reg);
}
}
// Retry on abort if abort's status is 0x6: can retry (0x2) | memory conflict (0x4)
// inputs: retry_count_Reg
// : abort_status_Reg
// output: retry_count_Reg decremented by 1
// flags are killed
void C2_MacroAssembler::rtm_retry_lock_on_abort(Register retry_count_Reg, java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 36
Label doneRetry;
assert(abort_status_Reg == rax, "");
// The abort reason bits are in eax (see all states in rtmLocking.hpp)
// 0x6 = conflict on which we can retry (0x2) | memory conflict (0x4)
= 0 then retry
andptr(abort_status_Reg, 0x6); rtm_counters_Reg,
jccb(Assembler:zero, );
testl(retry_count_Reg, retry_count_Reg);
jccb(Assembler::zero, doneRetry);
pause);
decrementl(retry_count_Reg);
jmp(retryLabelL_check_always_rtm1, L_check_always_rtm2;
bind(doneRetry);
}
// Spin and retry if lock is busy,
// inputs: box_Reg (monitor address)
// : retry_count_Reg
// output: retry_count_Reg decremented by 1
// : clear z flag if retry count exceeded
// tmp_Reg, scr_Reg, flags are killed
void C2_MacroAssembler::rtm_retry_lock_on_busy movptr(tmpReg, ExternalAddress(address RTMLockingCounters::rtm_calculation_flag_addr()));
Register tmp_Reg, Register scr_Reg, Label& retryLabel) {
, SpinExit, doneRetry;
int owner_offset = OM_OFFSET_NO_MONITOR_VALUE_TAG(owner);
testl(retry_count_Reg, retry_count_Reg);
jccb(Assembler::zero, doneRetry);
decrementl( transactions =abort_count * 100
movptr(scr_Reg, RTMSpinLoopCount);
bind(SpinLoop);
pause();
decrementl(scr_Reg);
jccb(Assembler::lessEqual, SpinExit);
movptr(tmp_Reg, Address(box_Reg, owner_offset));
testptr(tmp_Reg, tmp_Reg);
jccb(Assembler::notZero, // Set no_rtm bit if (Aborted tra >= All transactions * RTMAbortRatio)
bind(java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
(;
bind(doneRetry)java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Use RTM for normal stack locks
// Input: objReg (object to lock)
C2_MacroAssembler:tm_stack_lockingRegister ,RegisterscrReg
java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 80
Metadata* method_data, bool profile_rtm,
Label&DONE_LABEL Label& IsInflated){
(Address(tmpReg, MethodData::rtm_state_offset_in_bytes()),NoRTM);
assert( (d)java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
assert(scrReg == rdx, "");
Label L_rtm_retry,L_decrement_retry, java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
if (RTMRetryCount > 0) {
(retry_on_abort_count_Regretry_on_abort_count_Reg,RTMRetryCount // Retry on abort
);
}
movptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytes()));
testptrtmpReg,java.lang.StringIndexOutOfBoundsException: Range [80, 81) out of bounds for length 80
jccAssembler:notZero, );
if (PrintPreciseRTMLockingStatistics || profile_rtm) {
Label java.lang.StringIndexOutOfBoundsException: Range [0, 23) out of bounds for length 3
if java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// tmpReg, scrReg and flags are killed// rtm_counters_Reg, flags are killed
sing_rdtsc(mpReg, scrReg,RTMTotalCountIncrRate, ;
}
assert(stack_rtm_counters != NULL, "should not be NULL Register rtm_counters_RegRTMLockingCounters* rtm_counters,
atomic_incptr(ExternalAddress((address)stack_rtm_counters *method_data,
bindL_)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
}
xbegin(L_on_abort);
movptr(tmpReg, Address(objReg, oopDesc: // reads abort_status_Reg, updates flags
t :java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 74
cmpptr(,markWord:java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 73
::qual ; // all done if unlocked
Register abort_status_Reg = tmpReg; // status of abort is stored in RAXif RTMRetryCount > 0) {
if) {
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
x); // Set the abort status to 2 (so we can retry)
jmp(L_decrement_retry);
}
else {
xabort(0);
// restore abort status
bind)
if (PrintPreciseRTMLockingStatistics || profile_rtm) pop()
java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 1
}
// : abort_status_Reg
if (RTMRetryCount // flags :(,Register &retryLabel {
// retry on lock abort if abort status is 'can retry' (0x2) or 'memory conflict' (0x4)
rtm_retry_lock_on_abort(retry_on_abort_count_Reg, abort_status_Reg, assert(= rax ";
}
}
// Use RTM for inflating locks
// inputs: objReg (object to lock)
// boxReg (on-stack box address (displaced header location) - KILLED)
// tmpReg (ObjectMonitor address + markWord::monitor_value)
void C2_MacroAssembler::( tmpReg
scrReg,Register,
retry_on_abort_count_Reg
*,
jmpretryLabel;
// Spin and retry if lock is busy,
assert// : retry_count_Reg
assert(tmpReg == rax, "// : clear z flag if retry count exceeded
(scrReg = ";
Label L_rtm_retry, L_decrement_retry, L_on_abort;
int Register, scr_Reg, & retryLabel) {
movptr(Address(boxReg ) checked_cast<nt32_t(markWord::unused_mark(.value);
movptr(boxReg, tmpReg); // Save ObjectMonitor address
if (RTMRetryCount > Label , SpinExit doneRetry;
MRetryCount)/java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
(
(java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 22
}
if( || java.lang.StringIndexOutOfBoundsException: Range [55, 53) out of bounds for length 56
Label();
R )java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
// tmpReg, scrReg and flags are killed
(mpReg, scrReg , L_noincrement;
}
profiling RTM")java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
atomic_incptrRTMLockingCounters stack_rtm_countersjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
bindL_noincrement)
}
xbegin(L_on_abortjava.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
in_bytes()));
movptr(tmpReg, Address(tmpReg, java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 28
testptr(tmpReg, tmpReg); assert(scrReg == rdx, "");
jcc(Assembler::zero, DONE_LABEL);
if ( Label L_rtm_retry, L_decr, L_on_abort;
xend()java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11
jmp(L_decrement_retry);
}
else {
xabort(0);
}
bind( bind(_rtm_retry);
Register java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 3
if || profile_rtm) {
(tmpReg, markWord:monitor_value;
}
Rjava.lang.StringIndexOutOfBoundsException: Range [21, 19) out of bounds for length 26
// retry on lock abort if abort status is 'can retry' (0x2) or 'memory conflict' (0x4)
(retry_on_abort_count_Reg, abort_status_Reg ;
}
movptr(tmpReg, Address(boxReg, owner_offset)) ;
testptr(tmpReg, tmpReg) ;
jccb(Assembler::notZero, L_decrement_retry) ;
// Appears unlocked - try to swing _owner from null to non-null.
sEAXwhich implicit cmpxchg comparand.
#ifdef _LP64
Reg =r15_threadjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
#else
get_thread( xbegin(L_on_abort
threadReg = scrReg;
#endif
lock();
cmpxchgptr(threadReg, Address(boxReg, owner_offset)); // Updates tmpReg
if (RTMRetryCount > 0) {
// success done else retry
jccb(ssembler:equal,DONE_LABEL) ;
bind(L_decrement_retry (AssemblerAssembler:equal ); // all done if unlocked
// Spin and retry if lock is busy.
rtm_retry_lock_on_busy(retry_on_busy_count_Reg, boxReg, tmpReg, scrReg, L_rtm_retry);
}
else {
bind(L_decrement_retry);
}
}
#endif // INCLUDE_RTM_OPT
// fast_lock and fast_unlock used by C2
// Because the transitions from emitted code to the runtime
// monitorenter/exit helper stubs are so slow it's critical that
// we inline both the stack-locking fast path and the inflated fast path.
//
// See also: cmpFastLock and cmpFastUnlock.
//
// What follows is a specialized inline transliteration of the code
// in enter() and exit(). If we're concerned about I$ bloat another
// option would be to emit TrySlowEnter and TrySlowExit methods
// at startup-time. These methods would accept arguments as
// (rax,=Obj, rbx=Self, rcx=box, rdx=Scratch) and return success-failure
// indications in the icc.ZFlag. fast_lock and fast_unlock would simply
// marshal the arguments and emit calls to TrySlowEnter and TrySlowExit.
// In practice, however, the # of lock sites is bounded and is usually small.
// Besides the call overhead, TrySlowEnter and TrySlowExit might suffer
// if the processor uses simple bimodal branch predictors keyed by EIP
// Since the helper routines would be called from multiple synchronization
// sites.
//
// An even better approach would be write "MonitorEnter()" and "MonitorExit()"
// in java - using j.u.c and unsafe - and just bind the lock and unlock sites
// to those specialized methods. That'd give us a mostly platform-independent
// implementation that the JITs could optimize and inline at their pleasure.
// Done correctly, the only time we'd need to cross to native could would be
// to park() or unpark() threads. We'd also need a few more unsafe operators
// to (a) prevent compiler-JIT reordering of non-volatile accesses, and
// (b) explicit barriers or fence operations.
//
// TODO:
//
// * Arrange for C2 to pass "Self" into fast_lock and fast_unlock in one of the registers (scr).
// This avoids manifesting the Self pointer in the fast_lock and fast_unlock terminals.
// Given TLAB allocation, Self is usually manifested in a register, so passing it into
// the lock operators would typically be faster than reifying Self.
//
// * Ideally I'd define the primitives as:
// fast_lock (nax Obj, nax box, EAX tmp, nax scr) where box, tmp and scr are KILLED.
// fast_unlock (nax Obj, EAX box, nax tmp) where box and tmp are KILLED
// Unfortunately ADLC bugs prevent us from expressing the ideal form.
// Instead, we're stuck with a rather awkward and brittle register assignments below.
// Furthermore the register assignments are overconstrained, possibly resulting in
// sub-optimal code near the synchronization site.
//
// * Eliminate the sp-proximity tests and just use "== Self" tests instead.
// Alternately, use a better sp-proximity test.
//
// * Currently ObjectMonitor._Owner can hold either an sp value or a (THREAD *) value.
// Either one is sufficient to uniquely identify a thread.
// TODO: eliminate use of sp in _owner and use get_thread(tr) instead.
//
// * Intrinsify notify() and notifyAll() for the common cases where the
// object is locked by the calling thread but the waitlist is empty.
// avoid the expensive JNI call to JVM_Notify() and JVM_NotifyAll().
//
// * use jccb and jmpb instead of jcc and jmp to improve code density.
// But beware of excessive branch density on AMD Opterons.
//
// * Both fast_lock and fast_unlock set the ICC.ZF to indicate success
// or failure of the fast path. If the fast path fails then we pass
// control to the slow path, typically in C. In fast_lock and
// fast_unlock we often branch to DONE_LABEL, just to find that C2
// will emit a conditional branch immediately after the node.
// So we have branches to branches and lots of ICC.ZF games.
// Instead, it might be better to have C2 pass a "FailureLabel"
// into fast_lock and fast_unlock. In the case of success, control
// will drop through the node. ICC.ZF is undefined at exit.
// In the case of failure, the node will branch directly to the
// FailureLabel
// obj: object to lock
// box: on-stack box address (displaced header location) - KILLED
// rax,: tmp -- KILLED
// scr: tmp -- KILLED
void ( >){
Register scrReg, java.lang.StringIndexOutOfBoundsException: Range [50, 58) out of bounds for length 44
RTMLockingCounters* rtm_counters,
RTMLockingCounters* stack_rtm_counters,
Metadata* method_data,
bool use_rtm, bool profile_rtm) {
// Ensure the register assignments are disjoint
assert(tmpReg == rax, ExternalAddressrjava.lang.StringIndexOutOfBoundsException: Range [56, 55) out of bounds for length 86
if (( Address(, :ark_offset_in_bytes))java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
assert_different_registers(objRegjcc(::ero, DONE_LABEL;
} else {
( = noreg, ");
assert_different_registers(objReg, boxReg,tmpReg scrReg)java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
}
// Possible cases that we'll encounter in fast_lock(0)java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
// ------------------------------------------------Register abort_status_Reg = tmpReg; // status of abort is stored in RAX
// * Inflated
// -- unlocked
// -- Locked
// = by self
}
// * neutral
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
// -- by self
// = sp-proximity test hits
// = sp-proximity test generates false-negative
// -- by other
//
Label IsInflated, DONE_LABEL, NO_COUNT, COUNT;
if (DiagnoseSyncOnValueBasedClasses s EAX is the cmpxchg comparand.
load_klass(Register threadReg;
movl(tmpRegget_thread(crReg);
testltmpReg, JVM_ACC_IS_VALUE_BASED_CLASS;
jcc(Assembler::notZero, DONE_LABEL);
}
#if INCLUDE_RTM_OPT
if UseRTMForStackLocks && ) {
assertif RTMRetryCount > 0 {
rtm_stack_locking(
(java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 40
,IsInflated;
}
#endif // INCLUDE_RTM_OPT
testptr(tmpReg, markWord::monitor_value)
jccb(Assembler::notZero, IsInflated);
if (!UseHeavyMonitors) {
// Attempt stack-locking ...
java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 2
movptr(Address(boxReg, 0)// in enter() and exit(). If we're concerned about I$ bloat another
lock();
cmpxchgptr(boxReg, Address(// Besides the call overhead, TrySlowEnter and TrySlowExit might suffer
jcc(Assembler// sites.
// Recursive locking.
// The object is stack-locked: markword contains stack pointer to BasicLock.
// Locked by current thread if difference with current SP is less than one page.// implementation that the JITs could optimize and inline at their pleasure.
subptr(tmpReg, rsp);
// Next instruction set ZFlag == 1 (Success) if difference is less then one page.
andptr(tmpReg, (int32_t) (NOT_LP64// (b) explicit barriers or fence operations.
movptr(Address(boxReg, 0), tmpReg);// TODO:
} else {
// Clear ZF so that we take the slow path at the DONE label. objReg is known to be not 0.
testptr(objReg, objReg);
}
jmp(DONE_LABEL);
bind(IsInflated);
// The object is inflated. tmpReg contains pointer to ObjectMonitor* + markWord::monitor_value
#if INCLUDE_RTM_OPT
// Use the same RTM locking code in 32- and 64-bit VM.
if (use_rtm) {
rtm_inflated_locking(objReg, boxReg, tmpReg, scrReg, cx1Reg, cx2Reg,
// fast_unlock (nax Obj, EAX box, nax tmp) where box and tmp are KILLED
} else {
#endif // INCLUDE_RTM_OPT// Furthermore the register assignments are overconstrained, possibly resulting in
#ifndef _LP64
// Alternately, use a better sp-proximity test.
// boxReg refers to the on-stack BasicLock in the current frame.
// We'd like to write:
// set box->_displaced_header = markWord::unused_mark(). Any non-0 value suffices.
// This is convenient but results a ST-before-CAS penalty. The following CAS suffers
// additional latency as we have another ST in the store buffer that must drain.// * Intrinsify notify() and notifyAll() for the common cases where the
// avoid ST-before-CAS
// register juggle because we need tmpReg for cmpxchgptr below//
movptr(scrReg, boxReg);
movptr(boxReg, tmpReg); // consider: LEA box, [tmp-2]
// Optimistic form: consider XORL tmpReg,tmpReg
movptr(tmpReg, NULL_WORD);
// Appears unlocked - try to swing _owner from null to non-null.
// Ideally, I'd manifest "Self" with get_thread and then attempt
// to CAS the register containing Self into m->Owner.
// But we don't have enough registers, so instead we can either try to CAS
// rsp or the address of the box (in scr) into &m->owner. If the CAS succeeds// into fast_lock and fast_unlock. In the case of success, control
// we later store "Self" into m->Owner. Transiently storing a stack address// In the case of failure, the node will branch directly to the
// (rsp or the address of the box) into m->owner is harmless.
// Invariant: tmpReg == 0. tmpReg is EAX which is the implicit cmpxchg comparand.
lock();
// rax,: tmp -- KILLED
movptr(Address(scrReg, 0),voidC2_MacroAssembler::fast_lock(Register objReg, Register boxReg, Register tmpReg,
// If we weren't able to swing _owner from NULL to the BasicLock
// then take the slow path.
jccb (Assembler::notZero, NO_COUNT);
to thread
get_thread (scrReg); // beware: clobbers ICCs
movptr(Address(boxReg, java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 66
tmpReg == ";
// If the CAS fails we can either retry or pass control to the slow path.
// We use the latter tactic.
// Pass the CAS result in the icc.ZFlag into DONE_LABEL
// If the CAS was successful ...
/ Self has acquired the lock
// Invariant: m->_recursions should already be 0, so we don't need to explicitly set it.
// Intentional fall-through into DONE_LABEL ...
#else // _LP64
// It's inflated and we use scrReg for ObjectMonitor* in this section.
scrRegtmpReg;
xorq(tmpReg
lock()// * neutral
cmpxchgptr(r15_thread, Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG
// Unconditionally set box->_displaced_header = markWord::unused_mark().
// -- by other
movptr(Address(boxReg, java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ICC.ZF from CAS above into.
jccb(Assembler::equal, load_klass(tmpReg, objReg,);
cmpptr(r15_thread, rax); // Check if we are already the owner (recursive lock)
jccb(Assembler::notEqual, NO_COUNT)}
incq(Address(scrReg, OM_OFFSET_NO_MONITOR_VALUE_TAG INCLUDE_RTM_OPT
xorq(rax, rax); // Set ZF = 1 (success) for recursive lock, denoting locking success
#endif // _LP64
#if INCLUDE_RTM_OPT
} // use_rtm()
java.lang.StringIndexOutOfBoundsException: Range [22, 6) out of bounds for length 6
bind(DONE_LABEL);
// ZFlag == 1 count in fast pathtestptrtmpReg markWord::monitor_value);// inflated vs stack-locked|neutral
// ZFlag == 0 count in slow path
jccb(Assembler:: // Attempt stack-lock
java.lang.StringIndexOutOfBoundsException: Range [14, 12) out of bounds for length 14
// Count monitors in fast path
#ifndef _LP64
get_threadtmpReg);
incrementl(Address(tmpReg, JavaThread::held_monitor_count_offset()));
#else // _LP64
incrementq(Address(r15_thread, java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 25
#endif
xorl(tmpReg, tmpReg); // Set ZF == 1
bind(NO_COUNT);
// At NO_COUNT the icc ZFlag is set as follows ...
// fast_unlock uses the same protocol.
// ZFlag == 1 -> Success
// ZFlag == 0 -> Failure - force control through the slow path
}
// obj: object to unlock
// box: box address (displaced header location), killed. Must be EAX.
// tmp: killed, cannot be obj nor box.
//
// Some commentary on balanced locking:
//
// fast_lock and fast_unlock are emitted only for provably balanced lock sites.
// Methods that don't have provably balanced locking are forced to run in the
// interpreter - such methods won't be compiled to use fast_lock and fast_unlock.
// The interpreter provides two properties:
// I1: At return-time the interpreter automatically and quietly unlocks any
// objects acquired the current activation (frame). Recall that the
// interpreter maintains an on-stack list of locks currently held by
// a frame.
// I2: If a method attempts to unlock an object that is not held by the
// the frame the interpreter throws IMSX.
//
// Lets say A(), which has provably balanced locking, acquires O and then calls B().
// B() doesn't have provably balanced locking so it runs in the interpreter.
// Control returns to A() and A() unlocks O. By I1 and I2, above, we know that O
// is still locked by A().
//
// The only other source of unbalanced locking would be JNI. The "Java Native Interface:
// Programmer's Guide and Specification" claims that an object locked by jni_monitorenter
// should not be unlocked by "normal" java-level locking and vice-versa. The specification
// doesn't specify what will occur if a program engages in such mixed-mode locking, however.
// Arguably given that the spec legislates the JNI case as undefined our implementation
// could reasonably *avoid* checking owner in fast_unlock().
// In the interest of performance we elide m->Owner==Self check in unlock.
// A perfectly viable alternative is to elide the owner check except when
// Xcheck:jni is enabled.
void C2_MacroAssembler::fast_unlock(Register objReg, Register boxReg, Register tmpReg, bool use_rtm) {
/tmpReg=0tmpRegisis java.lang.StringIndexOutOfBoundsException: Range [66, 65) out of bounds for length 84
assert_different_registersmovptr((scrReg 0,3//box>displaced_header= 3
Label DONE_LABEL, Stacked, COUNT, NO_COUNT;
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 19
&
rtjava.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 99
;
movptr(
cmpptr(tmpRegas successful ...
jccb( // Invariant
xend(); // otherwise end...
jmp(DONE_LABEL); (,;
xorq(mpReg,tmpReg)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
}
#endif
if (!UseHeavyMonitors) {
cmpptr(Address(// Without cast to int32_t style destroy r10which is obj.
jcc Assembler:, ; // 0 indicates recursive stack-lock
}
movptr(tmpReg, Address(objReg, oopDesc::mark_offset_in_bytesjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (!UseHeavyMonitors) {
testptr(tmpReg, markWord::monitor_value); // Inflated?
jccb (Assembler::zeroendif
}
// It's inflated.
#if java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
if (use_rtm) {
Label L_regular_inflated_unlock(;
int monitorsin
movptr(boxReg, Addressget_threadtmpReg;
testptr(boxReg, boxReg);
jccb(Assembler:: (Address(tmpReg, JavaThread:))java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
xend();
jmpb(DONE_LABEL);
bind(L_regular_inflated_unlock
}
#endif
// Despite our balanced locking property we still check that m->_owner == Self
// as java routines or native JNI code called by this thread might
// have released the lock.
// Refer to the comments in synchronizer.cpp for how we might encode extra
// obj: object to unlock
//
// tmp: killed, cannot be obj nor box.
// a costly MEMBAR or CAS. See synchronizer.cpp for details on how
// we detect and recover from the race that the 1-0 exit admits.
//
// Conceptually fast_unlock() must execute a STST|LDST "release" barrier
// before it STs null into _owner, releasing the lock. Updates
// to data protected by the critical section must be visible before
// we drop the lock (and thus before any other thread could acquire
// the lock and observe the fields protected by the lock).
// IA32's memory-model is SPO, so STs are ordered with respect to
// each other and there's no need for an explicit barrier (fence).
// See also http://gee.cs.oswego.edu/dl/jmm/cookbook.html.
#ifndef _LP64
// Note that we could employ various encoding schemes to reduce
// the number of loads below (currently 4) to just 2 or 3.// Lets say A(), which has provably balanced locking, acquires O and then calls B().
// Refer to the comments in synchronizer.cpp.
// In practice the chain of fetches doesn't seem to impact performance, however.
xorptr(boxReg, boxReg);
orptr(boxReg, Address(tmpReg, java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 26
// Programmer's Guide and by "normal" java-level locking and vice-versa. // doesn't specify what will occur if a program engages// Arguably given that the spec legislates the JNI case as java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 60
,OM_OFFSET_NO_MONITOR_VALUE_TAGEntryList
boxReg=rax,")java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
Label, C,;
movptr(Addressif
jmpb (DONE_LABEL);
#else // _LP64
// It's inflated
lowPath
cmpptr( (tmpReg, objReg ));// markword
jccb(Assembler::equal java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 40
::; java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
decq(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(recursions)));
jmpb(LSuccess) jmpDONE_LABEL;
bind(LNotRecursive);
movptr(boxReg, Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG}
orptr(boxReg, Address#ndif
jccb (Assembler::notZero, CheckSucc);
// Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
movptr(Address cmpptr((,0,NULL_WORD); Examine displacedjava.lang.StringIndexOutOfBoundsException: Index 101 out of bounds for length 101
jmpb (DONE_LABEL);
// Try to avoid passing control into the slow_path ...
bind (movptr(tmpReg,Address(objReg, oopDesc::mark_offset_in_bytes())) // the ' markword
// The following optional optimization can be elided if necessary
// Effectively: if (succ == null) goto slow path
// The code reduces the window for a race, however,
performance.
cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG
jccb (Assembler::zero#
xorptr(boxReg,boxReg);
// Without cast to int32_t this style of movptr will destroy r10 which is typically obj.
movptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(owner)), NULL_WORD);
// Memory barrier/fence
// Dekker pivot point -- fulcrum : ST Owner; MEMBAR; LD Succ
// Instead of MFENCE we use a dummy locked add of 0 to the top-of-stack.
// This is faster on Nehalem and AMD Shanghai/Barcelona.
// See https://blogs.oracle.com/dave/entry/instruction_selection_for_volatile_fences
// We might also restructure (ST Owner=0;barrier;LD _Succ) to
// (mov box,0; xchgq box, &m->Owner; LD _succ) .
lock(; addl(Address(rsp, 0)), 0)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
cmpptr(Address(tmpReg, OM_OFFSET_NO_MONITOR_VALUE_TAG(java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 6
jccb (Assembler::notZero, LSuccess);
// Rare inopportune interleaving - race.
// The successor vanished in the small window above.
// The lock is contended -- (cxq|EntryList) != null -- and there's no apparent successor.// Refer to the comments in synchronizer.cpp for how we might encode extra
// We need to ensure progress and succession.
// Try to reacquire the lock.
// If that fails then the new owner is responsible for succession and this
// thread needs to take no further action and can exit via the fast path (success).
java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 74
// As implemented, this latter mode is horrible because we generated more
// the lock and observe the fields protected by the lock).
// length while by virtue of passing control into the slow path.
// each other and there's no need for an explicit barrier (fence).
// cmpxchg R,[M] is equivalent to rax = CAS(M,rax,R)
)
cmpxchgptr(r15_thread, (4 just2 3java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
// There's no successor so we tried to regrab the lock.
// If that didn't work, then another thread grabbed the
/lock so' done (and exit was a .
jccb (Assembler:: jccb(ssembler:: java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
// Intentional fall-through into slow path
bind (LGoSlowPath;
orl (boxReg, 1); // set ICC.ZF=0 to indicate failure
jmpb (DONE_LABEL);
bind (LSuccess);
testl (boxReg, ); // set ICC.ZF=1 to indicate success
jmpb (DONE_LABEL);
#endif
if (!UseHeavyMonitors) {
bind Stacked);
movptr(tmpReg, Address (boxReg, 0)); // re-fetch
lock();
cmpxchgptr(tmpReg,tmpRegrecursions) )
// Intentional fall-thru into DONE_LABEL: java.lang.StringIndexOutOfBoundsException: Range [40, 38) out of bounds for length 40
}
bind(DONE_LABEL);
// ZFlag == 1 count in fast path
// ZFlag == 0 count in slow path
jccb(Assembler:movptr(,Address(mpReg,OM_OFFSET_NO_MONITOR_VALUE_TAG(xq));
bind (boxReg,Address(mpReg, (EntryList);
// Count monitors in fast path
#ifndef _LP64
get_thread (java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 21
decrementl(Address
#else
decrementq(Address(r15_thread, // Effectively: if (succ == null) gotopath
#endif
xorl(tmpReg, cmpptr(Address(tmpR((,(succ))java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
bind(NO_COUNT);
java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 1
//-------------------------------------------------------------------------------------------
// Generic instructions support for use in .ad files C2 code generation
void C2_MacroAssembler::vabsnegd(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
if (dst != src) {
movdqu(dst, src);
}
if (opcode == Op_AbsVD) {
andpd(dst, ExternalAddress(StubRoutines::x86::vector_double_sign_mask)), noreg);
} else {
assert((opcode == Op_NegVD)," / We might also restructure (ST Owner=0;barrier;LD _Succ) to
xorpd(dst);addl(Address(rsp 0), )java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
java.lang.StringIndexOutOfBoundsException: Range [23, 3) out of bounds for length 3
}
void C2_MacroAssembler::vabsnegd(int opcode, XMMRegister dst, java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 0
if (opcode == Op_AbsVD) {
vandpd(dst, src, :java.lang.StringIndexOutOfBoundsException: Range [81, 79) out of bounds for length 103
}Try the lock.
assert(opcode = )"shouldbe ";
vxorpd(dst,
}
}
void C2_MacroAssembler/
if (dst != src) // coherence traffic on the lock *and* artificially extended the critical section
movdqu(dst, src);
}
if (opcode == Op_AbsVF)
)java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
} else {
assert((opcode == Op_NegVF),"opcode/java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
xorps( jccb A::notEqual,LSuccess;
}
}
void C2_MacroAssembler::vabsnegfto path
if (opcode == Op_AbsVF) {
ndps(dst,src, ExternalAddress(StubRoutines:::vector_float_sign_mask()), vector_len, noreg);
} else {
assert((opcode == Op_NegVForl 1;
vxorps(dst, src, ExternalAddress
}
}
void java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
assert
assert
if(pcode == Op_MinV) {
if jccbAssembler:notZero, NO_COUNT;
pminsb(dst, src);
} else if (elem_bt == T_SHORT) {
pminsw(dst, src);
else if (= T_INT){
pminsd(dst, rc;
} else {
assert(elem_bt == T_LONG, "required")java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
assert")java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
assert_different_registers(dst, decrementq(ddress( :held_monitor_count_offset()));
movdqu(xmm0, dst);
pcmpgtq(xmm0, src);
blendvpd(dst,eg) // Set ZF == 1
}
}
if (elem_bt == //---------------------------------------------------------------------// Generic instructions support for use in .ad files C2 code generation
pmaxsb(dst, void C2_MacroAssembler:vabsnegd(int opcode, XMMRegister dst, XMMRegister src) {
} else if (elem_bt == T_SHORT) {
( src));
b =) {
if (opcode(=Op_AbsVD {
} else {
assert( = ,"equired")
assert(tmp == xmm0, "required");
java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
movdqu(xmm0, src);
pcmpgtq(xmm0, dst);
blendvpd(dst, src); // xmm0 as mask
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
}
C2_MacroAssembler:vpminmax( opcodeopcode,BasicType java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
XMMRegisterdst, XMMRegister src1 XMMRegister src2,
int vlen_enc) {
assert(opcode == Op_MinV vxorpddst,src, ExternalAddress(StubRoutines::86:vector_double_sign_flip(() vector_len, noreg);
if (opcode == Op_MinV) {
ifif (elem_bt =T_BYTE java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
, src1, vlen_enc;
} else if (elem_bt == java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 27
vpminsw(,src1, rc2 vlen_enc)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
} elseif(lem_bt == _INT)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
vpminsd(st, ,;
}else{
assert(elem_bt == T_LONG, "java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 1
Assemblerjava.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 97
vpminsq(dst src, ExternalAddress(StubRoutines::x86::vector_float_sign_mask()), vector_len, noreg)
} else {
assert_different_registerssrc1src2)
vpcmpgtq(dst, src1, src2,(, (StubRoutines::v(, ,noreg) C2_MacroAssembler:pminmax(int opcode,BasicType elem_bt XMMRegister, XMMRegister src, XMMRegister tmp) {
vblendvpd(dst, src1, src2, dst, vlen_enc);
}
}
} else { // opcode == Op_MaxV
if (elem_bt == T_BYTE) {
vpmaxsb(dst src2,vlen_enc);
} else if (elem_bt == T_SHORT) {
vpmaxsw(,src1, vlen_enc);
} else if (elem_bt == T_INT) {
vpmaxsd(dst, if (=Op_MinV) {
} else {
assert(elem_bt == T_LONG, "required");
&( =::AVX_512bit |VM_Version:upports_avx512vl)){
vpmaxsq(dst, src1, else ( = T_SHORT) {
} else {
assert_different_registers(st,src1, )
vpcmpgtq(dst, src1, src2, vlen_enc);
vblendvpd(dst, src2, src1, dst, vlen_enc);
}
}
}
}
// Float/Double min max
java.lang.StringIndexOutOfBoundsException: Range [22, 4) out of bounds for length 65
,XMMRegister bjava.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
tmp, ,XMMRegister btmp,
int vlen_enc) {
java.lang.StringIndexOutOfBoundsException: Range [30, 8) out of bounds for length 33
assert(opcode == Op_MinV |}else // opcode == Op_MaxV
== || =Op_MaxReductionV "sanity")java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
assert(elem_bt == T_FLOAT | }elseif(elem_bt = T_SHORT) {
(a ,tmp,java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 52
bool is_min = (opcode == Op_MinV || opcode == Op_MinReductionV);
bool is_double_word = is_double_word_type(elem_bt);
if (!is_double_word && is_min) {
vblendvps(atmp, a, b, a, vlen_enc);
vblendvps(btmp, b, a, a, vlen_enc);
vminps(tmp,atmp, btmp, vlen_enc);
vcmpps(btmp, atmp, atmp, Assembler::UNORD_Q, vlen_enc);
vblendvps(dst, tmp, atmp, btmp, vlen_enc);
} else if (is_double_word& !s_min){
vblendvps(btmp, b, a, b, vlen_enc);
vblendvps(tmp,a ,b,vlen_enc)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
vmaxps(tmp, atmp, btmp,blendvpd(dst, src); // xmm0 as mask
vcmpps(java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 3
vblendvps(dst, tmp, atmp
} if (is_double_word && is_min) {
vblendvpd(atmp, a, b, a, vlen_enc);
vblendvpd(java.lang.StringIndexOutOfBoundsException: Range [85, 18) out of bounds for length 85
tmp,atmp, java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 38
vcmppd(tmp,atmp,atmp,Assembler::UNORD_Q, vlen_enc);
vblendvpd(dst, tmp, atmp, btmp, vlen_enc);
} else {
assert(is_double_word && !is_min, "sanity");
vblendvpd( , vjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 39
vblendvpd(atmp, if (java.lang.StringIndexOutOfBoundsException: Range [24, 22) out of bounds for length 36
tmp, atmp btmp;
vcmppdbtmp,atmp,atmp,Assembler:v
vblendvpd}java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 12
}
}
fp(int ,BasicType elem_bt,
XMMRegister dst, XMMRegister a, XMMRegister b {
KRegister (st src1, src2 vlen_enc;
int vlen_enc java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
,"";
assert(opcode == Op_MinV || opcode == Op_MinReductionV ||
opcode == Op_MaxV || opcode == Op_MaxReductionV, "sanity");
assert(elem_bt == T_FLOAT || elem_bt == T_DOUBLE, "sanity");
assert_different_registers(dst, a, vpmaxsb(dst src1 vlen_enc)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
bool is_min = (opcode pmaxswdst , vlen_enc);
bool is_double_word = java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 34
bool merge = true;
if (!is_double_word && is_min) {
evpmovd2m(ktmp, a assert(lem_bt =T_LONG ")java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
(atmp ktmp, a mergevlen_enc;
evblendmps(btmp, ktmp, b, a, merge, vlen_enc);
vminps( vpmaxsq( src1, src2vjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
evcmpps(ktmp,vpcmpgtq( src1,src2, vlen_enc);
evmovdqul(dst, ktmp, atmp, merge, vlen_enc);
} else if (!is_double_word && !is_min) {
evpmovd2m(ktmp b, vlen_enc)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
evblendmps(atmp, ktmp, a, b, merge,}
evblendmps(btmp, ktmp, b, a, merge, vlen_enc// Float/Double min max
vmaxps(dst ::(int BasicType elem_bt,
evcmpps(ktmp, k0, atmp, atmp, Assembler::UNORD_Q, vlen_enc);
(st, merge, vlen_enc);
} else if (is_double_word && is_min) {
evpmovq2m(ktmp, a, vlen_enc);
evblendmpd(atmp, ktmp, a, b, merge, vlen_enc);
evblendmpd(btmp, ktmp, b, a, merge, vlen_enc);
vminpd(dst, atmp, btmp, vlen_enc);
evcmppd(ktmp, k0, atmp, atmp, Assembler::UNORD_Q, vlen_enc);
evmovdquqdst atmp, merge, vlen_enc);
} else {
assert(is_double_word && !is_min, "sanity");
evpmovq2m( assert(UseAVX > 0, " T_FLOAT| elem_bt =T_DOUBLE, sanity)java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
java.lang.StringIndexOutOfBoundsException: Range [15, 14) out of bounds for length 50
evblendmpd( !java.lang.StringIndexOutOfBoundsException: Range [24, 21) out of bounds for length 34
vmaxpd(dst, atmp,b ,a, java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 39
evcmppd( vcmpps(btmp,atmp , Assembler:UNORD_Q vlen_encjava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
evmovdquq(dst, ktmp, atmp, merge, vlen_enc);
} }elseif (!is_double_word& is_min) {
}
// Float/Double signum
voidC2_MacroAssembler::signum_fp(int opcode, XMMRegister dst, XMMRegister zero, XMMRegister one) {
assert(opcode = vmaxpstmp,atmp,btmp
Label DONE_LABEL;
java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
assert(UseSSE > 0,vblendvpd( a,b a,vlen_enc);
ucomiss(,zero;
jcc(Assembler: (tmp,atmp, btmp, vlen_enc);
jcc(Assembler::parity, DONE_LABEL) vcmppdbtmp atmp, ,::UNORD_Q, java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 59
movflt(dst, one);
jccAssemblerabove,;
xorps(dst, ExternalAddress(StubRoutines::x86::vector_float_sign_flip()), noregvblendvpd(btmp,ba b vlen_enc)
e=Op_SignumD{
assert(UseSSE > 1, "required");
ucomisd(dst, zero);
jcc(Assembler::equal, vmaxpd(tmpmp, atmp, btmp,vlen_enc;
(::parity,DONE_LABEL); // handle special case NaN, if argument NaN, return NaN
movdbl(dst, one);
Assembler:bove,DONE_LABEL;
xorpd(dst, ExternalAddress(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 1
}
bind(DONE_LABEL);
}
void C2_MacroAssembler::vextendbw(bool sign, XMMRegister dst, XMMRegister src) {
if (sign) {
pmovsxbw(dst, src);
} else {
pmovzxbw(dst, src);
}
}
void C2_MacroAssembler::vextendbw(bool sign, int vlen_enc {
if (sign) {
vpmovsxbw( assert( > 2, "required")
} else {
vpmovzxbw(st ,vector_len;
}
}
oidC2_MacroAssembler::vextendbd(bool sign, XMMRegister dst, XMMRegister src, int vector_len) {
if (sign) {
vpmovsxbd(dst, src, java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 0
} else{
vpmovzxbd(dst, src, vector_len);
}
}
void C2_MacroAssembler: evpmovd2mktmp, a vlen_enc)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
if (sign) {
vpmovsxwd(dstdst , java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
(,src,vector_len)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
}
}
void C2_MacroAssembler::vprotate_imm(int opcode, evblendmps(btmp,ktmp, b, a, merge, vlen_enc);
int shift, int vector_len) {
if (pcode= Op_RotateLeftV) java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
if (etype == T_INT) {
evprold(dst, src, shift, vector_len evmovdquldst,ktmp, ,merge vlen_enc)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
}else{
assert(etype == T_LONG, "expected type T_LONG");
evprolq(dst, src, shift, vector_len);
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
} else {
assert( vminpd(dst, atmp btmp vlen_enc);
if (etype == T_INT) {
evprord(dst, src, shift, vector_len);
} else {
assert(etype == T_LONG, evmovdquq(st , atmp, ,vlen_enc)
evprorq(dst, src, shift, vector_len (is_double_word && !,"sanity");
}
}
}
void evblendmpd,,vlen_enc
XMMRegister ,, :, java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
if
if (etype == T_INT) {
evprolvd(dst src shift vector_len);
} else {
assert(etype == T_LONG, "expected type T_LONG");
evprolvq(st src,shift,vector_len)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
}
} elseif (opcode ==Op_SignumF) java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
assert(opcode == Op_RotateRightV, dst,zero;
if (etype == T_INT) {
or_len;
} else {
assert = "java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 54
evprorvq(dst, src, shift
}
}
}
,zerojava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
if( ==Op_RShiftVI) {
psrad(dst, shift);
} else if (opcode == Op_LShiftVI) {
pslld(dst, shift);
{
( =,opcode be)
Assembler::above,DONE_LABEL;
}
}
void C2_MacroAssembler xorpd(,ExternalAddress(tubRoutines::vector_double_sign_flip(,noreg;
switch (opcode) {
case java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 3
case Op_LShiftVI}
case Op_URShiftVI: psrldvoid C2_MacroAssembler::vextendbw(bool sign, XMMRegister dst, XMMRegister src) {
default: assert(alse, "%",NodeClassNamesopcode];
}
}
voidjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
if (opcodevoid C2_MacroAssembler::vextendbw(boolsign,XMMRegisterdst,XMMRegister , intjava.lang.StringIndexOutOfBoundsException: Range [95, 93) out of bounds for length 96
vpsrad(dst, nds, }else java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
} java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
vpslld(dst, nds, shift, vector_len);
}else{
assert((opcode == Op_URShiftVI),"opcode should be Op_URShiftVI");
vpsrld(dst, nds, vpmovsxbd(dst, src, ve;
}
}
void java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 1
switch (opcode) {
case Op_RShiftVI: vpsradvoidC2_MacroAssembler::extendwd(bool sign, XMMRegister dst, XMMRegister src, int vector_len) {
case : (,,shift ) ;
caseOp_URShiftVI vpsrld(,, ,) ;
default: assertd, java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 36
}
}
MRegister dstXMMRegister){
switch (opcode) {
case Op_RShiftVB: // fall-through
case Op_RShiftVS: psraw(dst, shift); breakif( == T_INT) {
case =," java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 54
case Op_LShiftVS: psllw(dst, }java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
Op_URShiftVS:// fall-through
case Op_URShiftVB: psrlw(dst, shift); break;
default: assert(false, "%s", java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 12
}
}
void}
switch (opcode) {
casevoidC2_MacroAssembler::protate_varint opcode,BasicType etype, XMMRegister dst, XMMRegister src,
: dst , ;;
// fall-through
caseOp_LShiftVS: vpsllw(dst, src, shift, vlen_enc); break;
Op_URShiftVS /
case java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 12
, %" java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 57
}
}
:(int, java.lang.StringIndexOutOfBoundsException: Range [73, 72) out of bounds for length 81
switch (opcode) {
case Op_RShiftVL: psrlq(dst, assert(etype = T_LONG, expected typeT_LONG);
Op_LShiftVL: psllq(dst,shift);break
case Op_URShiftVL: psrlq(dst, shift); break;
default: assert(false, "%s", NodeClassNames[java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0
}
void C2_MacroAssembler::vshiftq_imm(int opcode, XMMRegister dst, int shift) {
if(java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 30
psrlq( ,)
} else assert(=,opcode java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 69
psllq(dst, shift
} else {
== Op_URShiftVL),"pcode should be Op_URShiftVL");
psrlq(dst, shift);
}
}
::vshiftq( opcode XMMRegister dst,XMMRegister src, XMMRegistershift,int) {
switch (opcode) { Op_LShiftVI: (dst );break
Op_RShiftVL evpsraq(dst ,shift,vlen_enc) break;
case Op_LShiftVL: vpsllq(dst, src, shift, vlen_enc); break;
case Op_URShiftVL: vpsrlq(dst, src, shift,
default:
}
}
::int =)java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
if (opcode == Op_RShiftVL) {
evpsraq(dst, nds, {
} opcode =Op_LShiftVL){
vpsllq(dst, nds, shift, vector_len (st, nds, shift,vector_len)
} else {
assert((opcode == Op_URShiftVL),"void C2_MacroAssembler::vshiftd(int opcode, , src XMMRegistershift, vlen_enc){
vpsrlq(dst, nds, shift, case Op_RShiftVI: vpsrad(dst, src shift, vlen_enc); break;
}
}
void C2_MacroAssembler::varshiftdcaseOp_URShiftVI:vpsrldd, , shift;;
switch (opcode default assert( %" java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 57
case Op_RShiftVB: // fall-through
// fall-through
case Op_RShiftVI o) {
:// fall-through
case Op_LShiftVS: // fall-through
case Op_LShiftVI:vpsllvd(,src ,vlen_enc) break;
case Op_URShiftVB: // fall-through
case // fall-through
case java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 65
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
}
void C2_MacroAssembler::varshiftwjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
switch (opcode) {
case Op_RShiftVB: // fall-through
case Op_RShiftVS: evpsravwvoid C2_MacroAssembler::shiftw(nt , XMMRegister dst , XMMRegistershift vlen_enc {
case Op_LShiftVB: // fall-through
case Op_LShiftVS: evpsllvw(dst, src, shift, java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 0
case Op_URShiftVS: evpsrlvw(dst, src,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
default: assert(false, case Op_URShiftVB: vpsrlw(,src, shift, ) ;
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
void C2_MacroAssembler::varshiftq(int opcode
(seAVX > 2 required)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
switch (opcode) {
case Op_RShiftVLcaseOp_LShiftVL:java.lang.StringIndexOutOfBoundsException: Range [39, 32) out of bounds for length 48
if (UseAVX > 2) {
assertt =xnoreg not";
}
vlen_enc = Assembler::AVX_512bit;
}
evpsravq(dst, src, shift, vlen_enc);
}
vmovdqu(tmp, ExternalAddress(java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 30
java.lang.StringIndexOutOfBoundsException: Range [19, 15) out of bounds for length 43
(,)
vpxor(dst, dst( =java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 69
(st dst , vlen_enc)
}
break;
}
case:{
assert(tmp == xnoreg, "not used");
(dst )
break;
}
case java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 24
assert(tmp == xnoreg, "not used");
vpsrlvq(st,src shift,vlen_enc;
break;
}
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
}
}
// Variable shift src by shift using vtmp and scratch as TEMPs giving word result in dst
void C2_MacroAssembler::(,nds, shift, vector_len);
assert(opcode == Op_LShiftVB ||
opcode == Op_RShiftVB ,, ;
opcode == ((opcode == Op_URShiftVL java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 69
bool sign = (opcode != java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
assert(vector_len == 0, "required");
vextendbd/
java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
, 1)
vpand(java.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 0
vextracti128_high(tmp dst);
vpackusdw(dst, dst, vtmp, 0);
}
// Variable shift src by shift using vtmp and scratch as TEMPs giving byte result in dst
void C2_MacroAssembler::evarshiftb(int opcode, default: assert(false, "%s", NodeClassNames[opcode
= |
switch (opcode
opcode == Op_URShiftVB, " :dst,src ;java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
bool sign = (opcode != Op_URShiftVB);
= vector_len 1;
vextendbw(sign, dst, src, ext_vector_len);
vpmovzxbw(vtmp, shift, ext_vector_len);
varshiftw
(dst ,(:x86:() noreg)java.lang.StringIndexOutOfBoundsException: Index 106 out of bounds for length 106
if (vector_len == 0) {
vextracti128_high(vtmp, dst);
java.lang.StringIndexOutOfBoundsException: Range [40, 13) out of bounds for length 42
} else {
vextracti64x4_high(vtmp,
vpackuswb(dst dst vtmp, vector_len);
vpermq(dst, dst, 0xD8, vector_len);
}
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
C2_MacroAssembler::nsertBasicType typ, XMMRegister dst, Register val, int idx) {
switch(typ) {
case T_BYTE if (seAVX 2 java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
pinsrb(dst, val, idx);
break
case T_SHORT:
pinsrw(dst, val, idx);
break;
T_INT
pinsrd( }else{
break;
case T_LONG: ( ExternalAddressStubRoutines:::ector_long_sign_mask());
pinsrqd, java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
vpx(,, ,java.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 39
default:
assertf" .");
break;
}
}
(BasicType,XMMRegister , val, java.lang.StringIndexOutOfBoundsException: Index 105 out of bounds for length 105
switch(typ) {
case T_BYTE:
vpinsrbdst,src, val,idx)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
break;
case}
vpinsrw(dst, src, val, idx);
break;
case
vpinsrd(dst, src, val, t using vtmp and scratch as TEMPs giving word result in dst
break;
case T_LONG:
vpinsrq(dst, src, val, idx);
break;
default:
assert(false,"Should not reach here.");
break;
}
}
void C2_MacroAssembler::vgather(BasicType typ, XMMRegister bool sign =( !=Op_URShiftVB)
switch(typ) {
case T_INT:vextendbd(ign,,src,1;
vpgatherdd, )
break;
case T_FLOAT:
vgatherdps((dst, Address(ase idx,Address:times_4, mask, )java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
break;
case T_LONG:
vpgatherdq(dst, Address(base, idx, Address::times_8), mask, vector_len (stdst, );
break;
case T_DOUBLE:
d Address(base,idx,Address:times_8) , vector_len);
break;
default:
assert(false,"Should not reach here.");
break;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
dst src java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
(
INT
evpgatherdd base :java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 79
break;
case T_FLOAT:
evgatherdps(dst, mask, Address(base, idx, Address::times_4), vector_len);
reak
case vextracti64x(vtmp,dst)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
evpgatherdq(st mask Address(base, idx, Address::imes_8), vector_len);
break;
case T_DOUBLE:
evgatherdpd( }
break;
default:
assert(false,"Should voidC2_MacroAssembler:(BasicTypetyp, XMMRegister,Register val, int idx) {
break;
}
}
void C2_MacroAssembler::evscatter(BasicTypebreakjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
switch(typ) {
T_INT:
evpscatterdd(Address(base, idx, Address::times_4), mask, src, vector_len);
break;
case T_FLOAT:
evscatterdps(Address(base, idx, Address::times_4), java.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 12
break(,, ;
case T_LONG:
evpscatterdq(Address(base, idx, Address::times_8 (,Should reach here.;
break;
case T_DOUBLE:
evscatterdpd(Address(base, idx, Address::times_8)}
break;
default:
assert(false,"Should not reach here.");
break;
}
}
void C2_MacroAssembler::load_vector_mask(java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 17
if (vlen_in_bytes <= 16) {
pxor (dst, dst);
psubbdst src))java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
switch (elem_bt) {
caseT_BYTE: /* nothing to do */ break;
case T_SHORT: pmovsxbw(dst, dst); break;
case T_INT:java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
case T_FLOAT: pmovsxbd(dst, dst); break;
case T_LONG: pmovsxbq(dst, dst); break;
T_DOUBLEpmovsxbq(st,dst) break
( %" e);
}
{
assert(!is_legacy || !is_subword_type(elem_bt) || vlen_in_bytes < 64, "");
int vlen_enc = vector_length_encoding(vlen_in_bytes);
d,, java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 36
,(, : ,;
switch (elem_bt) {
case vgatherdpd(idx) java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 78
case : dstdst);
case T_INT: vpmovsxbd(dst, dst, vlen_enc); break;
case T_FLOATjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
case T_LONG:
T_DOUBLE java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 58
default: java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 79
}
}
}
void
if (novlbwdq) {
vpmovsxbd(xtmp, src, java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 18
break
Assembler::eq (S notjava.lang.StringIndexOutOfBoundsException: Range [43, 36) out of bounds for length 45
} else {
vpxor, java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 38
case T:
(, java.lang.StringIndexOutOfBoundsException: Range [35, 33) out of bounds for length 35
}
}
void C2_MacroAssembler::load_vector(XMMRegister dst, Address src, int vlen_in_bytes) {
() {
case 4: movdl(dst, src); break evpscatterdq(Address(, idx, Address:), ,,;
case 8: evscatterdpd(Address(base idx, Address::times_8), mask, src, vector_len);
case 16: movdqu(dst, src); break ;
32 java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 38
case
default
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
dst java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 20
mbler:XMMRegister, src {
assert(rscratch != noreg case ,) ;
if (reachable(src)) {
load_vector(dst, as_Address(src), case T_FLOAT: pmovsxbd(dst, dst); break
} else {
lea(rscratch, src);
ector(st Address(rscratch, 0) );
}
}
voiddefault:assert, "%" (elem_bt)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
int vlen_enc = vector_length_encoding(vlen);
if(VM_Version:supports_avx) java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
if (bt == T_LONG) {
if (VM_Version::supports_avx2()) {
vpbroadcastq(dst ( , ,vlen_enc)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
} else {
vmovddup(dst, src, vlen_enc);
}
} else if (bt==T_DOUBLE) {
if (vlen_enc != Assembler::AVX_128bit) {
vbroadcastsd(dst, src, vlen_enc,noreg)
} else {
vmovddup, src,vlen_enc
}
if (VM_Version::supports_avx2 caseT_FLOAT (,dst,vlen_enc) break
vpbroadcastd(st ,vlen_enc;
} else {
vbroadcastss(dst, src, vlen_enc);
}
}
) {
movddup(dst, src) java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
} else {
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
ifx, java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 35
punpcklqdq(dst, dst);
}
}
}
void java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 10
// The iota indices are ordered by type B/S/I/L/F/D, and the offset between two types is 64.
int offset = (xtmp,xtmp,src ;
if (is_floating_point_type(bt)) evpmovb2m(,xtmp vlen_enc;
offset += 128;
}
(:x86:( +;
switch (){
}
// Reductions for vectors of bytes, shorts, ints, longs, floats, and doubles.
C2_MacroAssemblertypintopcode java.lang.StringIndexOutOfBoundsException: Range [84, 83) out of bounds for length 107
int vector_len = Assembler:: 64(st A;;
switch (java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 0
case Op_AndReductionV: pand(dst, src); break;
case Op_OrReductionV: por (dst, src); break;
case d ) ;
casejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
switch (typ) {
case T_BYTE: pminsb(dst, java.lang.StringIndexOutOfBoundsException: Range [0, 43) out of bounds for length 10
case T_SHORT: pminsw(dst, src); break;
case T_INT: pminsd(dst, src); break;
case if VM_Version:() {
vpminsq(dst, dst, src, Assembler (bt = ) {
default: assert(false, "wrong type");
}
break;
switch (typ) {
} bt== ) java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
case T_SHORT: pmaxsw(dst, src); break;
case T_INT: pmaxsd(dst, src); break;
case T_LONG: assert(UseAVX > 2, "required");
vpmaxsq(dst, dst, src, Assembler::AVX_128bit); break;
default: assert(java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 12
}
break;
case Op_AddReductionVF: addss(dst, src); break;
case Op_AddReductionVD:addsd(dst, src); break;
case Op_AddReductionVI:
switch (typ) {
case T_BYTE: paddb,src) break;
case T_SHORT: java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 5
case }
"java.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 56
}
;
case Op_AddReductionVL: paddq(dst, src); (st,dst)
case Op_MulReductionVF: mulss(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 3
Op_MulReductionVD:mulsddst, ) ;
case Op_MulReductionVI:
switch (typ) {
case T_SHORT: pmullw(dst, src); break;
case T_INT: pmulld(dst, src); break;
default: assert(false, "+128
} addr(::86:vector_iota_indices)+offset;
break;
caseOp_MulReductionVL:assert(UseAVX > 2, "required");
evpmullq}
default// Reductions for vectors of bytes, shorts, ints, longs, floats, and doubles.
}
}
void C2_MacroAssembler::java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 0
6java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
switch (opcode) {
caseOp_AndReductionV dst src1,src2,); break;
case Op_OrReductionV: vpor (dst, src1, src2, vector_len); break;
case Op_XorReductionV: vpxor(dst, src1, src2, vector_len); break;
case Op_MinReductionV:
(yp java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
case T_BYTE: vpminsb(dst, src1, src2, vector_len); break;
case T_SHORT: vpminsw(dst, src1, src2, vector_len); break;
case T_INT: java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 12
() java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
vpminsq( : ) java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
default: ( 2 rjava.lang.StringIndexOutOfBoundsException: Range [57, 56) out of bounds for length 59
}
break;
case Op_MaxReductionV:
switch (typ) {
case T_BYTE: case Op_AddReductionVF (dst,src);breakjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
vpmaxsw ,java.lang.StringIndexOutOfBoundsException: Range [64, 63) out of bounds for length 72
casecase: paddb ) breakjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
: ,"equired)
vpmaxsq(dst, src1, src2, java.lang.StringIndexOutOfBoundsException: Range [0, 63) out of bounds for length 56
default: assert(false, "wrong type;
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
break;
case Op_AddReductionVI:
switch (typ) {
case T_BYTE vpaddb(st, src1,src2,java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 71
case T_SHORT: vpaddw(java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 27
case T_INT: vpaddd(dst, src1, src2, vector_len); break T_SHORT:pmullwdst )
pe");
}
break;
case Op_AddReductionVL: vpaddq(dst, src1, src2, vector_len); break;
case java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 12
switch (typ) {
case T_SHORT evpmullqdst ,) break;
case T_INT: vpmulld(dst, src1, src2, vector_len default:assert(,")
default: assert(false, "wrong type")}
}
case Op_MulReductionVLint java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 41
default: assert(false, " : dst ) java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 70
}
}
void C2_MacroAssembler::reduce_fp(int opcode, int vlen,
dst,XMMRegister src,
caseT_BYTE (dst ,,;;
switch (opcode) {
case:
case Op_MulReductionVF:
, vtmp2);
break;
case:
case Op_MulReductionVD(, src1, ;
: java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 56
break;
default java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 43
}
}
void C2_MacroAssembler::reduceB(int opcode, int vlen,
Register dst, case T_LONG: assert(UseAVX > 2 UseAVX >2 "equired)java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
vtmp1, vtmp2){
switch (vlen) {
case 8: java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
case 16 Op_AddReductionVI:
case 32: reduce32B(opcode, dst, src1, src2, vtmp1, vtmp2); break;
case 64: reduce64B(opcode, dst, src1, src2, vtmp1, vtmp2); break;
}
}
void C2_MacroAssembler::mulreduceB(int opcode, int vlen,
Register dst, Register src1, XMMRegister src2, case :( ,java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 71
java.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
switch (vlen) {
case 8: mulreduce8B (opcode, dst, src1, src2, vtmp1, vtmp2); break;
case 16: mulreduce16B(opcode(dst, src1,src2 vector_len) break;
32:(opcode,dst,src1,src2,,vtmp2;breakjava.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72
case 64 java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
default:(falsewrongjava.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 50
}
}
void C2_MacroAssembler::reduceS(int opcode, int vlen,
Register dst, Register src1, XMMRegister Register dst, Register src1, XMMRegister src2
XMMRegister vtmp1, break;
switch (vlen) {
case 4: reduce4S (opcode, case :
case 8: reduce8S (pcode,dst, src1, src2, vtmp1, vtmp2); break;
case 16: reduce16S(opcode, dst, src1, src2, vtmp1, vtmp2breakjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
case 32: reduce32S(opcode, dst, src1, src2, vtmp1, vtmp2); break;
default: assert(false, "wrongvoid C2_MacroAssembler:reduceB(int opcode, int vlen,
}
}
,
Register dst, Register src1, XMMRegister src2,
java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 68
switchv){
32:reduce32Bopcode,, ,src2,vtmp1,vtmp2;breakjava.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 69
case 4: reduce4I (opcode, dst, src1, src2, vtmp1, vtmp2); break;
:assert(alse vectorlength);
case 16: reduce16I(opcode, dst, src1, src2, vtmp1, vtmp2); break;
default: assert(false, "wrong vector void C2_MacroAssembler::mulreduceB(int opcode, int
}
}
#ifdef _LP64
void case 8: (opcode,dst,src1,src2, vtmp1,);break;
er src1, java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
vtmp1 java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 68
{
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
case 4: reduce4L(opcode, dst, src1, src2, java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 3
case8 java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 67
default: assert(false, "wrong vector length");
}
}
e _
void C2_MacroAssembler::reduceF(int opcode, int case 16 ( , java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 69
switch (vlen) {
case 2:
assert(vtmp2 }
reduce2F(opcode, dst, java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
break;
case 4:
assert(vtmp2 == xnoreg, java.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 68
reduce4F(,dst,src,vtmp1);
break;
case4:reduce4I (,,src1,src2,java.lang.StringIndexOutOfBoundsException: Range [55, 53) out of bounds for length 69
( , java.lang.StringIndexOutOfBoundsException: Range [46, 45) out of bounds for length 47
case 16:
ode , java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
break;
default: assert(false, "wrong vector ifdef_LP64
}
}
void C2_MacroAssembler::reduceD(int opcode, int vlen, switch v){
switch (vlen) {
case 2:
assert(vtmp2 == xnoreg, "");
reduce2D(opcode, dst, src, vtmp1);
break;
4
reduce4D(opcode, java.lang.StringIndexOutOfBoundsException: Range [0, 26) out of bounds for length 0
break;
case 8:
reduce8D(opcode, dst, src, vtmp1, vtmp2);
breakjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
case 2
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
void C2_MacroAssembler:reduce2I(int opcode Registerdst Register src1,XMMRegistersrc2,XMMRegister,XMMRegister vtmp2 { | |