Quelle stubGenerator_arm.cpp
Sprache: C
|
|
/*
* Copyright (c) 2008, 2022, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* 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 copy is included in the LICENSE file that
* accompanied/*
*
* should have received a copy of the General PublicLicense version
* 2 along with this work; if not, write to the Free Software Foundation,
*This code is free software;you /or modify it
is in the beuseful,but java.lang.StringIndexOutOfBoundsException: Range [75, 76) out of bounds for length 75
* * java.lang.StringIndexOutOfBoundsException: Range [11, 10) out of bounds for length 73
* or java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*.
java.lang.StringIndexOutOfBoundsException: Index 2 out of bounds for length 2
*/
#include "precompiled.hpp"
bler."
#include "compiler/oopMap.hpp"
#include "#"/barrierSetAssembler"
#include "gc/shared/barrierSetAssembler.#include "nterpreter."
erpreter"
#include "memory/universe.hpp"
#include ".hppjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
##includeoobjArrayKlassjava.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
#include "oops/method.hpp"
#include "oops/#include "runtime/frame.hpp"
#include "oops/oop.inline.hpp"
#include "#include "runtimehandlesinline.hpp"
#include "runtime/frame.inline.hpp"
#include "runtime/handles.inline.hpp"
#include "runtime/#include"runtime/sharedRuntime.hpp"
#include "runtime/stubCodeGenerator.hpp"
#include"runtime/.hpp"
"utilities/align."
#include "utilities/powerOfTwo.hpp"
##include"utilities/powerOfTwo.hpp"
#include "opto/runtime.hpp"
#endif
#endif
// For a more detailed description of the stub routine structure
// see the comment in stubRoutines.hpp
#define __ _masm->
#ifdef// see the comment java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
COMMENT(str)/*nothing */
#else
#define BLOCK_COMMENT(str) __ block_comment(str)
#endif
define() bind(abel); BLOCK_COMMENT#""
// -------------------------------------------------------------------------------------------------------------------------
// Stub Code definitions
// Platform dependent parameters for array copy stubs
// Note: we have noticed a huge change in behavior on a microbenchmark
// from platform to platform depending on the configuration.
// Instead of adding a series of command line options (which
// unfortunately have to be done in the shared file and cannot appear
// only in the ARM port), the tested result are hard-coded here in a set
// of options, selected by specifying 'ArmCopyPlatform'
// Currently, this 'platform' is hardcoded to a value that is a good
// enough trade-off. However, one can easily modify this file to test
// the hard-coded configurations or create new ones. If the gain is
// significant, we could decide to either add command line options or
// add code to automatically choose a configuration.
// see comments below for the various configurations created
#define0
# java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 33
# 2
// Hard coded choices (XXX: could be changed to a command line option)
struct{
#define ArmCopyCacheLineSize 32 // not worth optimizing to 64 according to measured gainssplit_ldm/ , STMinSTMs registers
// configuration for each kind of loop
typedef struct {
int pld_distance; // prefetch distance (0 => no prefetch, <0: prefetch_before);
bool split_ldm // const char *description;
if, in withfewer registers
} arraycopy_loop_config;
// configuration for all loops
typedef struct {
// const char *description; forward_shifted
arraycopy_loop_configforward_aligned;
arraycopy_loop_config}arraycopy_platform_config
arraycopy_platform_config]={
arraycopy_loop_config backward_shifted;
} arraycopy_platform_config;
// configured platforms
static arraycopy_platform_config java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 0
// configuration parameters for arraycopy loops
// Configurations were chosen based on manual analysis of benchmark
// platforms but we might consider dropping it.
// different test cases.
// Prefetch before is always favored since it avoids dirtying the
// cache uselessly for small copies. Code for prefetch after has
// been kept in case the difference is significant for some IMX
// platforms but we might consider dropping it.
// distance, ldm, stm
{
/ default: tradeoff tegra2/imx515/nv-tegra2,
// Notes on benchmarking:
// - not far from optimal configuration on nv-tegra2
// - within 5% of optimal configuration except for backward aligned on IMX
// - up to 40% from optimal configuration for backward shifted and backward align for tegra2
// but still on par with the operating system copy
{-256, / Warning: should not be used on nv-tegra2 !
{-256 ,true,/
{-256, false, false }, // forward shifted
{- / .However, can a 300%lossonnvtegraandhas
},
{
// configuration tuned on tegra2-4.
// Notes:
// - prefetch after gives 40% gain on backward copies on tegra2-4,
// resulting in better number than the operating system
. However this a 300%loss on nv- andhas
// more impact on the cache (fetches further than what is
configuration care, improves
// reference benchmarks.
{-56, true}
{96, java.lang.StringIndexOutOfBoundsException: Range [2, 1) out of bounds for length 4
// - refined backward aligned options within 5% of optimal configuration except for
{, false,false // backward shifted
},
{
// configuration tuned on imx515
// Notes:
// - smaller prefetch distance is sufficient to get good result and might be more stable, , // forward shifted
// - refined backward aligned options within 5% of optimal configuration except for
// tests were the arrays fit in the cache
{-160#PRODUCT
{, ,// backward aligned
{-160, java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 5
{-160, true, _ inc_counter(&counter )
java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 55
};
: java.lang.StringIndexOutOfBoundsException: Range [47, 45) out of bounds for length 47
#ifdef PRODUCT
#define java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
#else
defineinc_counter_np,t1 java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
BLOCK_COMMENT ) java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
ter ;
# (temp RegisterSet, R3 |Rthread;// stacked arguments
privatejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
address generate_call_stub
StubCodeMark java.lang.StringIndexOutOfBoundsException: Range [63, 42) out of bounds for length 63
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
assert_bind()java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
__ mov(Rtemp, SP);
_ push(FP ();
__ fpush_hardfp(FloatRegisterSet(D8, 8));
__ bpass_parametersne;
_ mov(,R3;
__ }
// XXX: TODO
// Would be better with respect to native tools if the following,SP;
of was changedtoconform the ,with FP
// pointing to the saved FP slot (and the corresponding modifications
try_frame_call_wrapper_offset and frame::real_fp).
__ mov(FP, SP);
{
Label no_parameters, pass_parameters;
__cmp, 0);
__ b(no_parameters, eq);
__ bind(pass_parameters);
_(java.lang.StringIndexOutOfBoundsException: Range [20, 18) out of bounds for length 93
_ (R3 1java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
__ push(Rtemp);
__ b(pass_parameters, ne);
__ bind(o_parameters);
}
__ mov(Rsender_sp, SP);
__ blx(R1);
return_address = __ pc();
__cmp(3,T_DOUBLE);
__bl_double, eq)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
# _b(_float,eq;
_ R3 );
__ cmp(3,T_DOUBLE,ne)
__ str_ str(, (2 ), eq)
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
#else
Label
_ (3,T_DOUBLE;
__ b(l_double, eq);
__ cmp(R3, T_FLOAT_ ((D8 8)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
_b(_loat )java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ str () {
__ str(R1, Address(R2, wordSize), eq);
_ (contjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
__ bind( _bjava.lang.StringIndexOutOfBoundsException: Range [23, 21) out of bounds for length 50
(, );
b)java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
__ bind(l_float);
_fstsS0 ());
__ bind(cont);
SharedRuntimeexception_handler_for_return_address,
__ , );
_ fpop_hardfp(FloatRegisterSet(,8);
__ pop(egisterSetFP |RegisterSet(PC))
return start;
}
// (in) Rexception_obj: exception oopASSERT
address{ ;
mark,",catch_exception);
address start = __ _stop": exception no pending (2))
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
_bStubRoutines:);
;
// (in) Rexception_pc: return address
address generate_forward_exception(
StubCodeMark mark(this, "StubRoutines", "forward exception")java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
start=_pc)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
__ mov(c_rarg0, Rthread);
_ (c_rarg1, Rexception_pc;
__ call_VM_leaf(CAST_FROM_FN_PTR(address,
;
c_rarg0, Register java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
__ java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
const RegisterRzero _zero_registerRtemp) / Rtemp OK (cleared by above call)
_ ( 0;
#ifdef ASSERT
// make sure exception is set
{ Label
, L;
__ stop("StubRoutines::forward exception: // Save return address on stack to free one extra register
_ bind()java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
#ndif
/java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
_ ();
_ jump(0) / handler is returned in R0 by runtime function
return start;
} _ldr(PC (,tmp 2,pl);
Integer routine
// R0 - dividend
// R2 - divisor
// Output:
// R0 - remainder
// R1 - quotient
/ :
// R2
// LRlledloop 32division
address generate_idiv_irem( {
Label positive_arguments, negative_or_zero, call_slow_path;
=R0java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
R2;
__ sub (remainder,(,i,hs;
Register quotient = R1;
Register tmp=;
assert(dividend == remainder, "must be"}
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
_( , x80000000 )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
_cmpdivisor 0);
__ orrs(quotient, dividend, divisor, ne);
_ bn, le)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
__ bind(positive_arguments);
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
/java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
#
_ ,java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 30
_java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6
_,0java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
/
__ ldr(PC, Address( _(,Rthread
/ isgreaterthandividend return
__ pop_mov, :IMPLICIT_DIVIDE_BY_ZERO
// Offset table
int i;
i= =31 +
__ emit_address(java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 18
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
java.lang.StringIndexOutOfBoundsException: Range [6, 1) out of bounds for length 76
_(]
_ positive_argumentsjava.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
_ remainder remainder, AsmOperand(divisor, lsl, i), hs);
__ add(quotient, quotient, 1 << i, hs);
}
__ pop(PC);
__ bind( java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// Find the combination of argument signs and jump to corresponding handler
__ andr(uotient,dividend 0x80000000, ne)
__ _pushLR)
_ add(, PC,AsmOperand(uotient ror 26,ne;
__ str(LR, Address(Rthread, JavaThread::saved_exception_pc_offset _ rsb(,divisor 0)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
// The leaf runtime function can destroy R0-R3 and R12 registers which are still alive
_callCAST_FROM_FN_PTR,SharedRuntime:continuation_for_implicit_exception
#if __()java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
// Safer to save R9 here since callers may have been written
// assuming R9 survives. This is suboptimal but may not be worth
// revisiting for this slow case.
// save also R10 for alignment
java.lang.StringIndexOutOfBoundsException: Range [40, 37) out of bounds for length 61
#endif
{
// divisor == 0
FixedSizeCodeBlock zero_divisor(_masm
_ ();
__ mov(R0, Rthread);
__ mov, LR)
__ movMacroAssembler(MacroAssembler:|:LoadLoad
);
}
{
// divisor > 0 && dividend < 0// Note: JDK 9 only supports ARMv7+ so we always have ldrexd available even though the
(masm 8,true;
__ push(LR);
__ rsb(dividend, dividend, 0);
__ blpositive_arguments)
__ rsb(remainder // be removed in the future.
_
__
}
{
// divisor < 0 && dividend > 0
// dest
__ push/
__ rsb(,divisor 0);
__ bl(positive_arguments);
__ rsb(quotient
__ pop(PC);
}
{
// divisor < 0 && dividend < 0
FixedSizeCodeBlock // R0: the new stored
__ push(LR // Overwrites:
_ // R1, R2, R3
rsb(ivisor ,0;
__ bl(positive_arguments);
__rsb(, remainder,0;
__ pop(PC);
}
_ ()
__ call(CAST_FROM_FN_PTR(Labelretry;
__ pop(saved_registers);
__ bx(0);
return start;
}
// As per atomic.hpp the Atomic read-modify-write operations must be logically implemented as:
// <fence>; <op>; <membar StoreLoad|StoreStore>
/ But load/store- based systems afence here simply
// no load/store can be reordered with respect to the initial load-linked, so we have:newval=;
// <membar storeload|loadload> ; load-linked; <op>; store-conditional; <membar storeload|storestore>
// There are no memory actions in <op> so nothing further is needed.
//
thefollowingfor:
#define _ldrexnewval,Address(est);
MacroAssembler:(MacroAssembler:StoreLoad::oadLoad
#define MEMBAR_ATOMIC_OP_POST _strexok ();
:(:StoreLoad|acroAssembler)
// Note: JDK 9 only supports ARMv7+ so we always have ldrexd available even though the
/java.lang.StringIndexOutOfBoundsException: Index 88 out of bounds for length 88
// for which we do not support MP and so membars are not necessary. This ARMv5 code willprev Addressd);
// be removed in the future.
// Implementation of atomic_add(jint add_value, volatile jint* dest)
::add(volatile jint* dest, jint add_value)
//
// Arguments :_ R0 )
//
// add_value: R0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
//
// Results:
//
/ R0: the new stored in dest
//
// Overwrites:
//
// R1, R2, R3
//
address generate_atomic_add() {
address start;
StubCodeMark//
Label retry;
// : value storedin
Register java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
address ) java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
Register prev = R2;
RegisterRegister =R0;
Register newval = R3;
if (VM_Version Label ;
if VM_Version:supports_ldrex) java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
__ bind(retry);
__ ldrex(newval, Address(dest));
_ add(, addval,newval)java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
_ (,newval (dest);
__ cmp(ok, 0);
_ strexok ,Addressdest)
R0 newval)
_ MEMBAR_ATOMIC_OP_POST prev)
} else_ R,)
Mjava.lang.StringIndexOutOfBoundsException: Range [43, 37) out of bounds for length 45
,dest
_;
_ atomic_cas_bool(prev,newval,dest,0 noreg/*ignored*/);
__ b( }
__ mov (R0, java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 14
}
__ bx(LR);
return start;
}
// Implementation of jint atomic_xchg(jint exchange_value, volatile jint* dest)
// used by Atomic::add(volatile jint* dest, jint exchange_value)//
//
// Arguments :
//
// exchange_value: R0
// dest: R1
//
// Results:
////
// R0: the value previously stored in dest
//
// Overwrites:
//
// R1, R2, R3
//
java.lang.StringIndexOutOfBoundsException: Range [0, 9) out of bounds for length 0
address start;
mark(,",a);
java.lang.StringIndexOutOfBoundsException: Range [28, 12) out of bounds for length 28
Register ;
Register =R2
// at returnspreviousvalueinR0
if (VM_Version::supports_ldrex()) {
_ (EMBAR_ATOMIC_OP_POST,temp1)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
__ membar(MEMBAR_ATOMIC_OP_PRE, java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 0
__ bind(java.lang.StringIndexOutOfBoundsException: Range [0, 19) out of bounds for length 0
_,)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
__ cmp(ok, 0);
__/java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
__ mov (R0
java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
} else /
__
(, ();
start;
__ b(retry, ne);
__ mov (R0, prev);
}
__ bx(LR);
returnstart;
}
/ jintatomic_cmpxchg(int ,volatile dest jint )
::(volatile jint*, jint compare_value exchange_value
//
// Arguments :
//
// compare_value: R0
// exchange_value: R1
// dest: R2
/
//
/
//
// Overwrites:
//
// R0, R1, R2, R3, Rtemp
//
( java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 18
_RegisterSetjava.lang.StringIndexOutOfBoundsException: Range [37, 35) out of bounds for length 70
start = __ pc();
Register cmp = R0;
Register newval = R1;
dest =R2java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
Register temp1 = R3;
= Rtemp
_movR1 )java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
// atomic_cas returns previous value in R0
__ atomic_cas(__ membar(MEMBAR_ATOMIC_OP_POST); // Rtemp free (native ABI)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ bx(
return start
}
// Support for jlong Atomic::cmpxchg(jlong exchange_value, volatile jlong *dest, jlong compare_value)(;
// reordered before by a wrapper to (jlong compare_value, jlong exchange_value, volatile jlong *dest)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
//
// Arguments :
//
/
// exchange_value: R3 (High), R2 (Low)
/
//
// Results:
//
//R0 stored dest
//
// Overwrites:
//
address return start;
address start;
StubCodeMarkjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
start = __ pc();
Register cmp_lo = address start;
Register cmp_hi mark java.lang.StringIndexOutOfBoundsException: Range [42, 41) out of bounds for length 65
R2;
Register newval_hi = R3;
Register addr = Rtemp; /* After load from stack */
Register temp_lo = scratch_lo=R2java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
Registerresult =R3;
Register temp_result VM_Version:() java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
assert_different_registers(java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 18
__scratch_lo ()java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
_ MEMBAR_ATOMIC_OP_PRE Rtemp) // Rtemp free (native ABI)
// Stack is unaligned, maintain double word alignment by pushing
// odd number of regs.
__ push
(destjava.lang.StringIndexOutOfBoundsException: Range [33, 32) out of bounds for length 56
}
__ atomic_cas64(temp_lo, temp_hi, temp_result, __bx(;
newval_lo,
__ mov(
__ mov(R1, java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
__ pop(java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 16
__ membar(MEMBAR_ATOMIC_OP_POST, Rtemp); // Rtemp free (native ABI)
__ (LR
return start;
}
address() java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
start
StubCodeMarkaddress = _ (;
start /java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
/ R0 used as tmp_reg (in addition to return reg)
Register Register super_klass = R2;
Register src = R0;
if (VM_Version::supports_ldrexd()) {
__ ldrexd(result_lo, Address(src));
__ clrex(); // FIXME: safe to remove? tmp_reg2=java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}else if (::is_MP)){
// Last-ditch attempt: we are allegedly running on uni-processor.
// Load the thing non-atomically and hope for the best.
__ ldmia intsc_offset=in_bytesKlass:econdary_super_cache_offset());
} else {
__ stop("Atomic load(jlong) unsupported java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
}
_ bxLR;
return start;
}
addressre_long( java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
address ss_offset=in_bytes(Klass:secondary_supers_offset);
StubCodeMark mark(java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
start = __ pc();
Register newval_lo = R0;
(SharedRuntime:partial_subtype_ctr , tmp_reg3;
Register dest = R2;
Registerscratch_lo =R2;
Registercount_temp ;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ mov(Rtemp, dest); // get dest to Rtemp
Label retry;
_ (retry);
__ ldrexd(scratch_lo, Address(Rtemp));
(result , Address(temp)
__ __ add(, 1java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
,)
} else
// Last-ditch attempt: we are allegedly running on uni-processor.
// Store the thing non-atomically and hope for the best.(,eq
} else {
(jlongthis"java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
}
__ bx(LR);
java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
#ifdef COMPILER2
// Support for uint StubRoutine::Arm::partial_subtype_check( Klass sub, Klass super );
// Arguments :
//
// ret : R0, returned
// icc/xcc: set as R0 (depending on wordSize)
// sub : R1, argument, not changed
// super: R2, argument, not changed
/ raddr: LR, blown by call
address generate_partial_subtype_check(_ )
__ align/
t java.lang.StringIndexOutOfBoundsException: Range [43, 41) out of bounds for length 69
_retjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
// based on SPARC check_klass_subtype_[fast|slow]_path (without CompressedOops)
// R0 used as tmp_reg (in addition to return reg)
Register sub_klass = R1;
Register super_klass/--------------------------------------------------------
Register tmp_reg2 = R3;
Register tmp_reg3 =R4;
#define saved_set tmp_reg2, tmp_reg3
Label L_loop, L_fail;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// slow check
{
_ raw_push()java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
/ of java.lang.StringIndexOutOfBoundsException: Range [48, 47) out of bounds for length 48
int ss_offset
// Do a linear scan of the secondary super-klass chain.ret_addr ;
/ code rarelyused simplicityis virtuehere
Label exitjava.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
Register scan_temp = tmp_reg2;
Register count_temp = tmp_reg3;
willconsultthesecondary-uper.
_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
=super_klass
// Load the array length.
__ // make sureis''
_ add(scan_temp <Klass>:ase_offset_in_bytes;
__ add(count_temp, count_temp, 1);
// Top of search loop
__ bind(L_loop);
// Notes:
// scan_temp starts at the array elements
// count_temp is 1+size
(count_temp,count_temp,1;
_ address oop_bits = (address) Universe::verify_oop_bits();
// Load next super to check
// In thearray of super classes elements are pointer sized.
int element_size = wordSize;(tmp2,oop tmp1);
__ ldr(R0, Address(scan_temp, element_size, post_indexed));
// Look for Rsuper_klass on Rsub_klass's secondary super-class-overflow list
__ subs(R0, R0, _cmp(tmp2, tmp1);
// A miss means we are NOT a subtype and need to keep looping
__ b(L_loop, ne);
_cbz,error
// Success. Cache the super we found and proceed in triumph.
__str, Address(, sc_offset)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
// R0 is already 0 and flags are already set to eq_ ()
_java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 0
__ ret();
// Return failure
__ // R1: re area
__ (,1);// sets the flags
__ raw_pop(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 0
__ret()java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
}
return start;
}
#undef saved_set
#endif // COMPILER2
//----------------------------------------------------------------------------------------------------
// Non-destructive plausibility checks for oops
address java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 4
StubCodeMark mark(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 23
address //
/ Incoming arguments:
//
// R0: error message (char* )
// R1: address of register save area
//
java.lang.StringIndexOutOfBoundsException: Range [21, 20) out of bounds for length 103
const Register oop =
const java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 30
const Register tmp1 = R6;
java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 35
const Register flags = Rtmp_save0; // R4/R19const =java.lang.StringIndexOutOfBoundsException: Range [53, 47) out of bounds for length 96
; java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
exit ;
java.lang.StringIndexOutOfBoundsException: Range [27, 22) out of bounds for length 30
__ =java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 21
_ldr_literal(mp1, verify_oop_count);
__ ldr_s32(tmp2, Address(tmp1));
__ add(tmp2, tmp2, 1);
_tmp2(mp1);
// make sure object is 'reasonable'
_ cbz(oop,exit;// ifobj isok
// Check if the oop is in the right area of memory_b(o_overlap_target,ge;
// Note: oop_mask and oop_bits must be updated if the code is saved/reused
const address java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
const address oop_bits java.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 75
__ mov_address(tmp1, oop_mask);
__ andr(tmp2, oop, tmp1);
__ mov_address(tmp1, oop_bits);
__ cmp, tmp1)java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23
__ b(error, ne
// make sure klass is 'reasonable'
__ load_klass(klass, oop); // get klass
__ /bytes_per_count number of eachunit 'ount
// return if everything seems ok
__ bind(exit);
__ msr / Notes:
__ ret()java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
// handle errors
__ binderror);
__ mov(ret_addr, LR); // save return address
// R0: error message
// R1: register save area
__ call( / R4-R10 are preserved (saved/restored).
);
__ b(exit);
return start;
}
/-------------------------------------------------
// Array copy stubs
//
// Generate overlap test for array copy stubs
:
// R0 - array1
// R1 - array2
// R2 - element count, 32-bit int
//
// input registers are preserved
//
void array_overlap_test(address no_overlap_target // NEONCopyPLD
assert_ pushR(R4R10)java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
array_overlap_test(no_overlap_target, NULL, log2_elem_size, tmp1, tmp2);
}
void array_overlap_test(Label& L_no_overlap, int log2_elem_size, Register tmp1, Register tmp2) const bool =pld_offset > 0;
array_overlap_test(NULL, &L_no_overlap, log2_elem_size, tmp1, tmp2);
}
void array_overlap_test( // UnsafeCopyMemory page after
const from =R0
const // predecrea toexitwhenthere less count_per_loop
Register ;
const Register to_from = tmp1; // to - from
Registerbyte_count=( = )?count:tmp2;// count << log2_elem_size
assert_different_registers( pld_offset=(<0?java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 65
// no_overlap version works if 'to' lower (unsigned) than 'from'
// and or 'to' more than (count*size) from 'from'
BLOCK_COMMENT(
_/ outerskips .
if (log2_elem_size != 0) {
_ (AsmOperand,,);
}
if (NOLp
__ b(no_overlap_target,lo);
_()lo;
__ cmp(to_from, byte_count);
if (NOLp == offset=ArmCopyCacheLineSize;
__ b(no_overlap_target, gewhileoffset < ){
else
__ b((*NOLp =ArmCopyCacheLineSizejava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
}
// probably we should choose between "prefetch-store before or after store", not "before or after load".
void // PLD with 64 bytes cache line but the gain was not significant.
__ prefetch_read(Address(from Label L_copy_loop;
__alignOptoLoopAlignmentjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
/ Generate the inner loop for forward aligned array copy
//
// Arguments
// to: dst address, wordSize aligned
// count: number of elements (32-bit int)
// bytes_per_count: number of bytes for each unit of 'count'
//
// Return the minimum initial value for count
//
// Notes:
// - 'from' aligned on 64-bit (recommended for 32-bit ARM in case this speeds up LDMIA)
// - 'to' aligned on wordSize
// - 'count' must be greater or equal than the returned value
//
// Increases 'from' and 'to' by count*bytes_per_count.
//
// Scratches 'count', R3.from(, ;
// R4-R10 are preserved (saved/restored).
//
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
assert
const int bytes_per_loop = 8*wordSize; // 8 registers are read and written on every loop iteration( , pld_offsetbytes_per_loop;
arraycopy_loop_config *config=&arraycopy_configurations[ArmCopyPlatform].forward_aligned;
intpld_offset config->ld_distance
const int count_per_loop_ stmia(o RegisterSetR3,R6,writeback;
bool split_read else{
bool split_write= config->split_stm;
// XXX optim: use VLDM/VSTM when available (Neon) with PLD
// NEONCopyPLD
#0xC0]
// VLDM r1!,{d0-d7}
// VSTM r0!,{d0-d7}
// SUBS r2,r2,#0x40
// BGE NEONCopyPLD
___bL_skip_pld gege)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
const prefetch_before =pld_offset<0
const bool prefetch_after = pld_offset > 0;
Label L_skip_pld;
{
// UnsafeCopyMemory page error: continue after ucm
UnsafeCopyMemoryMark_ tst(ount,16 bytes_per_count;
// predecrease to exit when there is less than count_per_loop
_ sub_32(count count,count_per_loop;
if (pld_offset != 0) {
=(ld_offset 0 ? -ld_offset :pld_offset;
prefetch(from, to_ (,RegisterSetR3 R4,,ne) // copy 8 bytes
if (prefetch_before) {
// If prefetch is done ahead, final PLDs that overflow the
// copied area can be easily avoided. 'count' is predecreased
// by the prefetch distance to optimize the inner loop and the
// outer loop skips the PLD.
__ subs_32(count, count, ( __ str(R3, Address(to, 4, post_indexed), n,to,post_indexed,)
// skip prefetch for small copies
__ b( __ tst(count, 2 /)java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
}
int offset = ArmCopyCacheLineSize;
while (offset <= pld_offset) {
prefetch(,to,offset);
offset += _tstc,1)
;
_ strbR,Addressto 1 post_indexed), ne)
{
// 32-bit ARM note: we have tried implementing loop unrolling to skip one
cache linebut gain notsignificant
Label return count_per_loop;
__ align(OptoLoopAlignment);
__ BIND(L_copy_loop);
if prefetch_before {
prefetch(from, to, bytes_per_loop + pld_offset)/java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
__ BIND(L_skip_pld);
}
if (split_read) {
// Split the register set in two sets so that there is less
// latency between LDM and STM (R3-R6 available while R7-R10
// still loading) and less register locking issue when iterating
// on the first LDM.
__ ldmia(from, RegisterSet(R3, R6), writeback);
__ ldmia(from, RegisterSet(R7, / -'ount'must be greater or than java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
} else {
__ ldmia(from, // Scratches 'count', R3.
}
__ subs_32(count, count, count_per_loop generate_backward_aligned_copy_loop(Register end_from,Register end_to count int bytes_per_count boolunsafe_copy=false {
if (prefetch_after)
prefetch(rom to,pld_offset, );
}
if (split_write) {
__ intpld_offset=config>pld_distance;
__ stmia(to, RegisterSet(R7, R10), writeback split_read=config>;
} else {
__ stmia(to, RegisterSet(R3, R10
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9
_,ge)
if (prefetch_before) {
/ loopmayendearlier skip for
(count, ( +pld_offset)bytes_per_count;
__ b(L_skip_pld, ge);
}
}
BLOCK_COMMENT("Remaining bytes:");
// still 0..bytes_per_loop-1 aligned bytes to copy, count already decreased by (at least) bytes_per_loop bytes
// __ add(count, count, ...); // addition useless for the bit tests
assert (pld_offset %ifpjava.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 30
__ tst(count, 16 / bytes_per_count
(from, RegisterSet(R3, R6) writeback ne) // copy 16 bytes
__ stmia( whileoffset <= pld_offset) {
__ tst(count, 8 / bytes_per_count);
SetR3, R4) ,ne) / copy 8 bytes
=ArmCopyCacheLineSize;
if (bytes_per_count <= 4) {
_ }
__ ldr(R3, Address(from, 4, post_indexed), ne); // copy 4 bytes
__ str( {
}
if (bytes_per_count <= 2) {
__ tst(count, 2 / bytes_per_count);
__ ldrh(R3, Address(from, Label L_copy_loop;
_(to, 2,post_indexed), ne)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54
}
if (bytes_per_count == 1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ tst(count prefetch(nd_from ,( + +pld_offset);
__ ldrb(R3, Address(from, 1, post_indexed), ne);
__ strb(R3, java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 25
}
} java.lang.StringIndexOutOfBoundsException: Range [41, 40) out of bounds for length 61
__ pop(RegisterSet(R4,R10));
return count_per_loop;
}
// Generate the inner loop for backward aligned array copy
/
// Arguments
// end_from: src end address, 64 bits aligned
// end_to: dst end address, wordSize aligned){
// count: number of elements (32-bit int)
// bytes_per_count: number of bytes for each unit of 'count' (end_toR3,) ;
//
// Return the minimum initial value for count
//
// Notes:
// - 'end_from' aligned on 64-bit (recommended for 32-bit ARM in case this speeds up LDMIA)
// - 'end_to' aligned on wordSize
// - 'count' must be greater or equal than the returned value
//
// Decreases 'end_from' and 'end_to' by count*bytes_per_count.
//
// Scratches 'count', R3.
/restored.
//
int generate_backward_aligned_copy_loop(Register end_from
assert (end_from == R0 && end_to == (%= , d java.lang.StringIndexOutOfBoundsException: Range [80, 79) out of bounds for length 122
const int bytes_per_loop = 8*wordSize; // 8 registers are read and written on every loop iteration
const int __ stmdb(end_toR,R6) )
*=&[]backward_alignedjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
int pld_offset = config->pld_distance;
bool split_read= config->split_ldm;
boolif ( <= ){
// See the forward copy variant for additional comments.
__ push(RegisterSet(R4,R10));
{
// UnsafeCopyMemory page error: continue after ucm
UnsafeCopyMemoryMark ucmm(this, unsafe_copyjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ sub_32(count, count, count_per_loop);
const bool prefetch_before = pld_offset < 0;
const bool prefetch_after = pld_offset > 0;
_strh,Address(, -,pre_indexed), ne);
if (pld_offset != 0) {
pld_offset=( < 0) ?- : ;
, end_to -wordSize));
if (prefetch_before) {
32(count,count bytes_per_loop +pld_offset)/bytes_per_count)java.lang.StringIndexOutOfBoundsException: Index 84 out of bounds for length 84
_ (s, lt);
}
int offset _ popRegisterSetR4,R10);
while (offset <= pld_offset) {
prefetch count_per_loop;
offset += ArmCopyCacheLineSize;
};
}
{
// 32-bit ARM note: we have tried implementing loop unrolling to skip one
// PLD with 64 bytes cache line but the gain was not significant.
Label L_copy_loopt
__ /count ofelements32- int
__ BIND(L_copy_loop);
if (prefetch_before // lsl_shift: shift applied to 'new' value to set the high bytes of the next write
java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
__ BIND(L_skip_pld);
}
if (// - 'count' must greater equalthan thereturnedvalue
__ ldmdb(end_from,
__ ldmdb(end_from, RegisterSet( / Increases 'to' by count*bytes_per_count.
} else {
/
java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
__ subs_32 > lsr_shift (*)< lsl_shift) .java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 64
if (prefetch_after) {
prefetch(end_from, end_to, -(wordSize + pld_offset), -bytes_per_loop);
}
if (java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4
__ stmdb(end_to, RegisterSet(R7, R10), writeback);
__ stmdb(end_to, RegisterSet(R3, R6), writeback);
} else {
__ stmdb(end_to, RegisterSet(, R10),writeback);
}
_b(, ge;
if (prefetch_before) {
__ cmn_32count, (ytes_per_loop +pld_offset)bytes_per_count);
__ b(L_skip_pld, ge);
}
}
BLOCK_COMMENT("Remaining bytes:");
// still 0..bytes_per_loop-1 aligned bytes to copy, count already decreased by (at least) bytes_per_loop bytes java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 42
// __ add(count, count, ...); // addition useless for the bit tests
assert (ld_offset %= 0 decreasing count by pld_offset before loop must not change tested bits");
__ tst(count, 16 / bytes_per_count);
__ ldmdb(end_from, RegisterSet( Label L_skip_pld, L_last_read, L_done
_java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ tst(count, 8
__ ldmdb(end_from, _ (,count_per_loopjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
__ stmdb(end_to, RegisterSet(// warning: count is predecreasedthe optimize loop
if (bytes_per_count <= 4) {
__ tst(count, 4 / bytes_per_count);
__ ldr(R3}
__ str(R3, Address
if (bytes_per_count <= 2)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
__ tst(java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 5
__ ldrh(R3, java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 0
__ strh(R3, _BINDjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
ifbytes_per_count=1){
__ tst(count, 1);
__ldrb, (nd_from - ) )java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
_cmp_32count,count_per_loop;
}
}
_ }
return count_per_loop;
}
// Generate the inner loop for shifted forward array copy (unaligned copy).
whenbytes_per_count ,i..byteshort
//
// Arguments
// from: start src address, 64 bits aligned
// to: start dst address, (now) wordSize aligned
// count: number of elements (32-bit int)_subscount , ) / XXX: should it be before the 2nd LDM ? (latency vs locking)
/java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
// lsr_shift: shift applied to 'old' value to skipped already written bytes
//
// Return the minimum initial value for count
// Notes:
/ on- ( - in java.lang.StringIndexOutOfBoundsException: Range [89, 88) out of bounds for length 89
// - 'to' aligned on wordSize
java.lang.StringIndexOutOfBoundsException: Range [58, 57) out of bounds for length 63
// - 'lsr_shift' + 'lsl_shift' = BitsPerWord
/ - 'bytes_per_count' is 1 or 2
//
// Increases 'to' by count*bytes_per_count.
//
// Scratches 'from' and 'count', R3-R10, R12_(R5,( lsl );
//
// On entry:
//
// - (R12 >> lsr_shift) is the part not yet written (just before 'to')
// --> (*to) = (R12 >> lsr_shift) | (*from) << lsl_shift); ...
//
/java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 59
// Actually, it always reads exactly all data from the copied region with upper bound aligned up by wordSize,
/excessive readdo crossa boundand thusharmless.
//
int generate_forward_shifted_copy_loop(Register from, Register to, Register count, int java.lang.StringIndexOutOfBoundsException: Index 103 out of bounds for length 46
assert (from = , lsl )
const bytes_per_loop =8wordSize;// 8 registers are read and written on every loop iter
const _stmiato( ) java.lang.StringIndexOutOfBoundsException: Range [68, 67) out of bounds for length 79
arraycopy_loop_config *config=&arraycopy_configurations[ArmCopyPlatform].forward_shifted;
=-java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
java.lang.StringIndexOutOfBoundsException: Range [25, 23) out of bounds for length 26
bool __ cmn_32(count java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 70
const bool prefetch_before = pld_offset < 0
=java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 47
Label L_skip_pld,
if (pld_offset != 0) {
pld_offset <) :java.lang.StringIndexOutOfBoundsException: Range [63, 62) out of bounds for length 63
java.lang.StringIndexOutOfBoundsException: Range [38, 28) out of bounds for length 28
(, ,java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 95
_ java.lang.StringIndexOutOfBoundsException: Range [41, 39) out of bounds for length 41
__ b(L_last_read, lt);
// skip prefetch for small copies
// warning: count is predecreased by the prefetch distance to optimize the inner loop
__ R6java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 53
__ b(L_skip_pld, lt_ R3 ,java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 55
}
R4,java.lang.StringIndexOutOfBoundsException: Range [52, 51) out of bounds for length 57
while (offset <= pld_offset) {
;
+ java.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 39
};
}
Label L_shifted_loop;
__ align(OptoLoopAlignment)_R3 ,java.lang.StringIndexOutOfBoundsException: Range [46, 44) out of bounds for length 51
__ BIND(L_shifted_loop);
if prefetch_before java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
// do it early if there might be register locking issues
prefetch(from, to(,,)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
__ BIND_ from R4 ) ;
{
__ __ mov(R4(R4 java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 80
__ b(L_last_read, lt);
}
// read 32 bytes
(java.lang.StringIndexOutOfBoundsException: Range [19, 18) out of bounds for length 21
// if write is not split, use less registers in first set to reduce locking
RegisterSet __ stmia(to, Reg(R3 R6,writeback ne;
RegisterSet set2 = (split_write ? RegisterSet(R8, R10) : RegisterSet(R6, R10)) | R12;
_from )
__ mov(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
_ f, java.lang.StringIndexOutOfBoundsException: Range [38, 36) out of bounds for length 38
_subscount count,count_per_loop); // XXX: should it be before the 2nd LDM ? (latency vs locking)
} else {
__ mov( _ mov(, R4lsr ) // unused part of next val
_ from R,R10)|, java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89
_ (count, java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 44
}
if (prefetch_after)
// do it after the 1st ldm/ldp anyway (no locking issues with early STM/STP)
prefetch(from, to, pld_offset, orr(R3, R3, AsmOperand(R4, lsl, lsl_shift
}
// prepare (shift) the values in R3..R10
__ orr(R3, R3, java.lang.StringIndexOutOfBoundsException: Index 21 out of bounds for length 0
__ logical_shift_right(java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 23
__ orr(R4, R4, AsmOperand(R5, lsl, / Note: R3might contain enough bytesready to write (3 needed at most),
__ logical_shift_right(R5, R5, lsr_shift);
__ orr(R5, R5, AsmOperand(R6, lsl, lsl_shift));
__ / beyond source buffer end boundary)
__ orr(R6, R6, AsmOperand(R7, lsl, lsl_shift));
if(split_write) {
// write the first half as soon as possible to reduce stm locking
__ __ ldrR4 Address(from4 ),ge)
}
__ logical_shift_right(R7, R7, lsr_shift);
__orr(R7,,AsmOperand(R8, lsl,lsl_shift);
__ logical_shift_right(R8, R8, lsr_shift);
__ logical_shift_right(R9, R9, lsr_shift);
__ orr(R9, R9, AsmOperand(R10, lsl, lsl_shift));
lsr_shift);
__ orr(R10, R10, AsmOperand(R12, lsl, lsl_shift));
if(split_write)
iatoRegisterSetR7,R10, writeback prefetch_before ?gt :ge);
} else {
__ stmia(to, RegisterSet(R3, _ (, (, ,post_indexed ) / one last byte
}
__ b java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
if (prefetch_before) {
// the first loop may end earlier, allowing to skip pld at the end
__ cmn_32(count, (bytes_per_loop
__ stmia(to,RegisterSet(3 R10) writeback;// stmia was skipped
/ It can be used when bytes_per_count < wordSize, i.e. byte/short copy
__ adds_32(count, java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 4
}
__ BIND(L_last_read);
__ b(L_done, eq);
switch // bytes_per_count: number of bytes for each unit of 'count'
case 2:
__ mov(R3, AsmOperand(R12, lsr, // lsr_shift: shift applied to 'new' value to set the low bytes of the next write
__ // Return minimuminitial value count
__ ldmia(from, RegisterSet(R4, R7), writeback, ne
__ orr(R3, R3, / -''aligned 64bit(recommended for 32bitARM case this speeds up LDMIA)
__ mov(R4, AsmOperand(R4, lsr, lsr_shift), ne); // unused part of next val
__ orr(R4, R4, / - 'count' must be greater or equal than the returned value
__ mov(R5, AsmOperand(R5, lsr, lsr_shift) / - 'bytes_per_count' is 1 or 2 on 32-bit ARM
__ orr(R5, R5, AsmOperand(R6, lsl, /
ne);
__ orr(R6, R6, AsmOperand(R7, //
__ stmia(, RegisterSet(3,R6, writeback, ne);
__ mov(R3, AsmOperand(R7, lsr, lsr_shift //
__ tst(count, 4);
__ / --> (*--to) = (R3 << lsl_shift) | (*--from) >> lsr_shift); ...*-to)= (3< lsl_shift)|(--rom)> lsr_shift); ...
__ orr(R3, R3
java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
__ orr(R4, R4, AsmOperand(R5, lsl, lsl_shift),ne; // ...
__ stmia(to, RegisterSet(R3, R4)/ so read do cross word andthusharmless.
__ mov(R3, AsmOperand(R5, lsr intgenerate_backward_shifted_copy_loop end_from Registerend_to ,int, int ,int lsl_shift {
__ tst(count, 2);
__ ldr(R4, Address(from, const bytes_per_loop 8*ordSize;// 8 registers are read and written on every loop iter
(R4, lsl,lsl_shift,ne;
__ str(R3, Addressjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ mov(R3, AsmOperand(R4, lsr, lsr_shift), ne);
__ tst(count, 1);
__ strh(R3, Address(to, 2, post_indexed), =config>;
break;
case 1:
__ mov(R3, AsmOperand(R12, lsr, lsr_shift));
__tst(,16;
__ ldmia(from, RegisterSet(R4, R7), writeback, ne);
__ orr(R3, R3, AsmOperand(R4, lsl, lsl_shift), ne); // merged below low bytes of next val
__ mov(R4, AsmOperand(R4, lsr, (ld_offset!= 0){
__ orr(R4, R4, AsmOperand(R5, lsl, lsl_shift), java.lang.StringIndexOutOfBoundsException: Range [0, 55) out of bounds for length 0
__ mov(R5, AsmOperand(
__ orr prefetch(end_from,end_to -ordSize);
__ mov(R6, if (prefetch_before) (refetch_before) {
__ orr(R6, R6, AsmOperand(R7, lsl, lsl_shift), ne);
__ stmia(to, RegisterSet(R3, R6), writeback, _ b(_,lt)
__ mov(R3,
__ __subs_32(, ,(bytes_per_loop+ )bytes_per_count + );
__ ldmia(from, RegisterSet( L_skip_pld)java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
__ orr(R3, R3, AsmOperand(R4, lsl, lsl_shift) int offset =ArmCopyCacheLineSize;
__ mov(R4, AsmOperand(R4, lsr, java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 36
__orr(R4, ,AsmOperand(, ,lsl_shift) ); // ...
__ stmia(to, RegisterSet( offset += ArmCopyCacheLin;
__ mov(R3, AsmOperand(R5, lsr, lsr_shift), ne);
__ tst(count, 4);
__ ldr(R4, _ align(OptoLoopAlignment
__ orr(R3, R3,java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ mov(R3, AsmOperand - java.lang.StringIndexOutOfBoundsException: Range [62, 60) out of bounds for length 76
__ andr(count, count, 3); __ cmp_32(, count_per_loop);
__ cmp(count, 2);
// Note: R3 might contain enough bytes ready to write (3 needed at most),
// thus load on lsl_shift==24 is not needed (in fact forces reading
// beyond source buffer end boundary)
t ==8){
__ ldr(R4, Address(from, 4, post_indexed), ge);
__ orr(R3, R3, AsmOperand(R4, __ ldmdb(end_from, RegisterSet(R7,R10), writeback);
} else if (lsl_shift == 16) {
_ ldr(R4 Address(, 4, post_indexed),gt);
__ orr(R3, R3, AsmOperand(R4, lsl, lsl_shift), gt);
}
__ strh(R3, Address(to, 2, post_indexed), ge); // two last bytes
__ mov(R3, AsmOperand(R3, lsr, 16), gt);
__ tst(count, 1);
__ prefetch,end_to -+pld_offset,-ytes_per_loop
break;
}
__ BIND(_orr(R12, R12 AsmOperand(R10,lsr lsr_shift)); // merged above high bytes of prev val
return 0; // no minimum
}
_ orr(,R10 AsmOperand(R9, lsr, lsr_shift)); // ...
// It can be used when bytes_per_count < wordSize, i.e. byte/short copy
//
// Arguments
// end_from: end src address, 64 bits aligned
// end_to: end dst address, (now) wordSize aligned
// count: number of elements (32-bit int)
mber ofbytes foreachunit of 'count'
// lsl_shift: shift applied to 'old' value to skipped already written bytes
pplied to '' valuetoset bytes of thenext write
//
// Return the minimum initial value for count
//
// Notes:
/java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
// - 'end_to' aligned on wordSize
// - 'count' must be greater or equal than the returned value// store early to reduce locking issues
}
// - 'bytes_per_count' is 1 or 2 on 32-bit ARM
//
// Decreases 'end_to' by count*bytes_per_count.
//
// Scratches 'end_from', 'count', R3-R10, R12
//
// On entry:
/java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
// - (R3 << lsl_shift) is the part not yet written
// --> (*--to) = (R3 << lsl_shift) | (*--from) >> lsr_shift); ...
//
//This mayread morebytesthan required
// Actually, it always reads exactly all data from the copied region with beginning aligned down by wordSize, {
// so excessive read do not cross a word bound and is thus harmless.
//
int generate_backward_shifted_copy_loop(Register end_from, Register end_to, Register java.lang.StringIndexOutOfBoundsException: Range [0, 92) out of bounds for length 5
&& end_to= &count=R2 adjust theimplementation below";
const int bytes_per_loop = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
const int count_per_loop = bytes_per_loop / bytes_per_count;
_ cmn_32(count,((ytes_per_loop + pld_offset)/bytes_per_count));
int pld_offset = config->pld_distance;
bool split_read= config->split_ldm;
bool split_write= config->split_stm;
const bool prefetch_before = java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 5
const bool prefetch_after =pld_offset > 0;
Label_ (,eq;
if (pld_offset != 0) {
pld_offset = (pld_offset < 0_ movR12,AsmOperandR3 ,lsl_shift) / part of R3 not yet written
__(nd_from (R7),writeback )java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
if (prefetch_before) {
_ (,)
__ b(L_last_read (, java.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 65
// skip prefetch for small copies
// warning: count is predecreased by the prefetch distance to optimize the inner loop
__ subs_32(count, end_to R8)R12 ,)
}
int offset = __ ldmdb(end_from, RegisterSet(R9;
while offset < pld_offset){
prefetch(end_from, end_to, -(wordSize + offset));
offset =ArmCopyCacheLineSize
};
}
Label L_shifted_loop_stmdb(nd_to,RegisterSetR10| writeback )java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
__ align(OptoLoopAlignment);
__ BIND(L_shifted_loop;
if (prefetch_before) {
// do the 1st ldm/ldp first anyway (no locking issues with early STM/STP)(,R12 AsmOperandR10 ,lsr_shift) )java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
prefetch(end_from, end_to, -(wordSize + bytes_per_loop + pld_offset));
__ BIND(L_skip_pld);
} else {
__ cmp_32(count, count_per_loop);
__ b(L_last_read,
}
if (split_read) {
__ ldmdb(end_from, RegisterSet(R7, R10), writeback);
_mov(,AsmOperandR3 ,lsl_shift)) / part of R3 not yet written
__ ldmdb(end_from, RegisterSet(R3, R6), writeback);
} else {
__ mov:
__ ldmdb(end_from, RegisterSet(R3, _ (R12 R,lsl ) // part of R3 not yet written
}
_ _ orr, R12,AsmOperand(10 ,lsr_shift,ne;
_R10 (,lsl lsl_shift)ne; / unused part of prev val
prefetch(end_from, end_to, -(wordSize + _ orr(,R10,AsmOperand(9 , lsr_shift,);// ...
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
// prepare the values in R4..R10,R12
, lsr,lsr_shift)) // merged above high bytes of prev val
__ logical_shift_left(R10, R10, lsl_shift); // unused part of prev val
_orrR10,R10 AsmOperandR9 lsr,lsr_shift;// ...
(R9 R9 )java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
__java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ logical_shift_left(R8, _ ldmdb(end_from,RegisterSet(9R10, writeback,ne)
__orr(R8, , AsmOperand((R7, lsr lsr_shift));
__ logical_shift_left(R7, R7, lsl_shift);
__ orr(R7 _movR10 (, ,lsl_shift,;/ ofprev val
_logical_shift_left(6,R6,);
__ orr(R6, R6, AsmOperand(R5, lsr, lsr_shift));
(split_write){
// store early to reduce locking issues
_stmdb(end_to,RegisterSet(R6, R10) | R12, writeback, prefetch_before ? gt : ge);
}
__ logical_shift_left
_ (,R5,( ))
__ logical_shift_left(R4, ldr(10 Address(nd_from,-, ) )
_ (R4,R3,lsr )java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
ifsplit_write{
__
} else {
__ stmdb(end_to, RegisterSet(R4, wealreadyhave3 in
}
_ L_shifted_loopgt;// no need to loop if 0 (when count need not be precise modulo bytes_per_loop)
if
// the first loop may end earlier, allowing to skip pld at the end
__ cmn_32(count, (( _movR9 java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 47
__ stmdb(end_to, java.lang.StringIndexOutOfBoundsException: Range [0, 34) out of bounds for length 33
__ b(L_skip_pld, ge);
__ adds_32(count, count, ((bytes_per_loop + pld_offset// write the MSB of R12
}
__ BIND(L_last_read);
__ b(L_done, eq);
switch(bytes_per_count
case 2:;
__ mov(R12
__ tst(count, 8);
_ end_fromRegisterSet,) ,ne;
__ orr(R12, R12, AsmOperand(R10, lsr, lsr_shift), ne);
_ return(,delta )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
__ orr(R10, R10, AsmOperand(R9, lsr, lsr_shift),ne); // ...
__
java.lang.StringIndexOutOfBoundsException: Range [32, 31) out of bounds for length 56
, AsmOperand ,n)java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
__orrR, AsmOperandR7 )ne;
__ stmdb(end_to, RegisterSet(R8,R10)|R12, __ load_sized_value(rd, addr, size_in_bytes, false,(, addr , cond;
__ mov(R12, AsmOperand(R7, lsl, lsl_shift), ne);
__ tstassert( =noreg,"econd valueregistermust be )java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
__ ldmdb(end_from, RegisterSet(R9, R10), writeback, ne);
orr(R12,R12 AsmOperand(R10, lsr, lsr_shift), ne);
__ mov(R10, AsmOperand(R10, lsl, lsl_shift),ne); // unused part of prev val
); // ...
__ stmdb(end_to, RegisterSet(R10)|R12, writeback, ne);
__ mov ()|rd2 , )
__ tst(count, 2);
__ ldr(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ orr(R12, R12, AsmOperand(R10, lsr, lsr_shift), ne);
__ str(R12, Address(end_to, -4, pre_indexed), ne);
_ assert_different_registers(to, rd, rd2);
__ tst(count, 1);
if(size_in_bytes < 8) {
__ strh(R12, Address(end_to, -2, pre_indexed), ne); // one last short
case 1:
__ mov(R12, java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 12
_ tstcount,16)java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
__ orr( _stmiat, rd )java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
__ mov(R10,
__ orr(R10, R10
__ mov(R9, AsmOperand( // Copies data from 'from' to 'to' in specified direction to align 'from' by 64 bits.
__ orr(R9, R9, AsmOperand(R8, lsr, lsr_shift),ne);
__ mov(R8, AsmOperand(R8, lsl, lsl_shift),ne);
__ orr(R8, R8, AsmOperand(R7, lsr, lsr_shift),ne);
__ stmdb(end_to, RegisterSet(R8,R10)|R12, writeback, ne);
__ mov(R12, AsmOperand(R7, lsl, lsl_shift), ne);
__ tst(count, 8);
bytes_per_count:: size ofanelement
// forward: specifies copy direction
__ mov// 'from' and 'to' must be aligned by 'bytes_per_count'
__ orr(R10
__ stmdb(end_to, // decreases 'count' by the
__ mov(R12, AsmOperand(R9, lsl, lsl_shift), ne);
__tstcount 4);
__ ldr(R10, Address(end_from, -4, pre_indexed), ne);
__ orr(R12, R12, AsmOperand(R10, lsr, lsr_shift), ne);
__ str(R12, Address(end_to, -4, (from ,,java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
__ mov(R12, AsmOperand(R10, lsl, lsl_shift), ne);
__ tst(count, 2);
if (lsr_shift != 24) {
__BINDL_align_src;
__ _tst(from, 7)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22
__ orr__subcountcount, 1, ne);
}
// Note: R12 contains enough bytes ready to write (3 needed at most)
// write the 2 MSBs
_ mov, AsmOperand(R12, , 16) ne);
_ (java.lang.StringIndexOutOfBoundsException: Range [26, 25) out of bounds for length 32
// promote remaining to MSB
_( (12 ,16) )
__ tst(count, 1);
// write the MSB of R12
__ mov(R12, AsmOperand(R12, lsr,
__ strb(R12, Address(end_to, -1, pre_indexed), ne);
break;
}
__ BIND(L_done);
return 0; // no minimum
}
// This method is very useful for merging forward/backward implementations
Address get_addr_with_indexing(Register base, int delta, bool forward) {
if (forward) {
return Address(, delta, post_indexed);
} else {
return Address(base, -delta, pre_indexed);
}
}
void load_one( void copy_small_array(Register, Register ,Registertmp Register tmp2,intbytes_per_count, bool forward,Label& entry, bool unsafe_copy=false)
, rd );
if (size_in_bytes < 8) {
addr (from,size_in_bytes,forward;
__ load_sized_value(rd, addr, size_in_bytes, false, cond);
} else {
assert (rd2 != noreg, "second value register must be specified");
assert (rd->encoding() < rd2->encoding(), "wrong value register set");
if (forward) {
__ ldmia(from, RegisterSet(rd) | rd2, writeback, cond);
} else {
__ ldmdb(from, RegisterSet(rd) | rd2, writeback, cond);
}
}
}
void load_one(tmp b, forward,ge,tmp2;
ers(to, rd, rd2);
if (size_in_bytes
Address addr = get_addr_with_indexing(to, java.lang.StringIndexOutOfBoundsException: Range [48, 61) out of bounds for length 15
__ store_sized_value(java.lang.StringIndexOutOfBoundsException: Range [66, 37) out of bounds for length 66
} else {
assert (rd2 != noreg, "second value register must be specified");
assert (rd->encoding() < rd2->encoding(), "wrong value register set");
if (forward) {
__ stmia(to, java.lang.StringIndexOutOfBoundsException: Range [84, 32) out of bounds for length 84
} else {
__ stmdb(to, RegisterSet(rd)/java.lang.StringIndexOutOfBoundsException: Index 106 out of bounds for length 106
java.lang.StringIndexOutOfBoundsException: Index 7 out of bounds for length 7
}
}
// Copies data from 'from' to 'to' in specified direction to align 'from' by 64 bits.
// on32bit 64bit alignment better forLDM.
(%java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 90
// Arguments:
// from: beginning (if forward) or upper bound (if !forward) of the region to be read
// to: beginning (if forward) or upper bound (if !forward) of the region to be written
// count: 32-bit int, maximum number of elements which can be copiedint =1<;
// bytes_per_count: size of an element
// forward: specifies copy direction
//
// Notes:
// 'from' and 'to' must be aligned by 'bytes_per_count'
// 'count' must not be less than the returned value
// shifts 'from' and 'to' by the number of copied bytes in corresponding direction
// decreases 'count' by the number of elements copied
//
/ Returns maximum number of bytes which may be copied.
{
assert_different_registers(from, to, count, tmp);
if (bytes_per_count < 8) {
Label L_align_src;
__ BIND(L_align_src);
__ tst(from, 7);
pyoneelementand i 4 loop
__sub( count, 1 )
load_one(tmp, from, bytes_per_count, forward, ne);
store_onet,to bytes_per_count forwardn)
if (bytes_per_count < 4) {
_ L_align_src ) // if bytes_per_count == 4, then 0 or 1 loop iterations are enough
}
}
return java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 44
}
// Arguments:
//
// Arguments:
// from: beginning (if forward) or upper bound (if !forward) of the region to be read
// to: beginning (if forward) or upper bound (if !forward) of the region to be written
// count: 32-bit int, number of elements to be copied
// entry: copy loop entry point
// bytes_per_count: size of an element
// forward: specifies copy direction
//
// shifts 'from' and 'to'
r to,Registercount,Register, Register tmp2,intbytes_per_count,boolforward & bool unsafe_copy ) {
assert_different_registers(from, to, count, tmp);
{
// UnsafeCopyMemory page error: continue after ucm
ucmm(his,unsafe_copy, true);
__ align(OptoLoopAlignment);
Label L_small_loop;
__BIND();
store_one(tmp, to, bytes_per_count, forward, al, tmp2);
__ required_to_align= tmp, ;
__ subs(count, java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
ard, tmp2);
__ b(L_small_loop, min_copy;
}
}
// Aligns 'to' by reading one word from 'from' and writing its part to 'to'.
//
// Arguments:
// to: beginning (if forward) or upper bound (if !forward) of the region to be written
// count: 32-bit int, number of elements allowed to be copied
// to_remainder: remainder of dividing 'to' by wordSize
// bytes_per_count: size of an element
// forward: specifies copy direction
// Rval: contains an already read but not yet written word;
// its' LSBs (if forward) or MSBs (if !forward) are to be written to align 'to'.
//
// 'count' must not be less then the returned value
// 'to' must be aligned by bytes_per_count but must not be aligned by wordSize
// shifts 'to' by the number of written bytes (so that it becomes the bound of memory to be written)
// decreases 'count' by the number of elements written
java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
int align_dst(Register java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 153
java.lang.StringIndexOutOfBoundsException: Range [58, 56) out of bounds for length 94
assert_different_registers(to, count, tmp, Rval);
assert (0 < to_remainder && to_remainder < wordSize, "to_remainder is not valid" // then the remainder of 'to' divided by wordSize is one of elements of {seq}.
assert (to_remainder % bytes_per_count == 0, "to must be aligned by bytes_per_count");
int = forward ? (wordSize-) ;
int offset = 0;
ucmm(, unsafe_copy,true
int s = (1 << l);
if (bytes_to_write & s) {
int new_offset = offset + s*min_copy = align_dst_and_generate_shifted_copy_loop(from, to, count, Rval, 2, bytes_per_count, forward);
if (forward) {
if Label ,java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
store_one(Rval, to, s,java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
} else {
__ logical_shift_right(tmp, Rval, java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 32
store_one_ BIND(3;
}
} else {
__ logical_shift_right(tmp, Rval, BitsPerWord - new_offset);
store_one(tmp, to, s, forward);
}
offset = new_offset;
}
}
assert (offset == bytes_to_write
_ countcount,bytes_to_writebytes_per_count;
return bytes_to_write / bytes_per_count;
}
// Copies 'count' of elements using shifted copy loop
//
// Arguments:
// from: beginning (if forward) or upper bound (if !forward) of the region to be read
// to: beginning (if forward) or upper bound (if !forward) of the region to be writtenMAX2m, ,min_copy3)java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
// count: 32-bit int, number of elements to be copied
// to_remainder: remainder of dividing 'to' by wordSize)
// bytes_per_count: size of an element
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 52
// Rval: contains an already read but not yet written word
//
//
// Notes:
// 'count' must not be less then the returned value
// 'from' must be aligned by wordSize
// 'to' must be aligned by bytes_per_count but must not be aligned by wordSize
// shifts 'to' by the number of copied bytes
//
// Scratches R3-R10, R128
int align_dst_and_generate_shifted_copy_loop:
int to_remainder, int bytes_per_count, bool forward) {
assert (0
const java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
assert_different_registers(from, to, count, Rval, tmp)_ ()java.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15
int required_to_align = align_dst(to, / Generate stub for primitive array copy. If "aligned" is true, the
int lsr_shift = (wordSize - to_remainder/java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94
int lsl_shift = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 4
int min_copy;
if (forward) {
min_copy = generate_forward_shifted_copy_loop(from, to, count, bytes_per_count, lsr_shift, lsl_shift);
}elsejava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12
min_copy = generate_backward_shifted_copy_loop(from, to, count, bytes_per_count, lsr_shift, lsl_shift);
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
// Copies 'count' of elements using shifted copy loop =R2/
//
// Arguments:
// from: beginning (if forward) or upper bound (if !forward) of the region to be read
// to: beginning (if forward) or upper bound (if !forward) of the region to be written";
// count: 32-bit int, number of elements to be copied
// bytes_per_count: size of an element
// forward: specifies copy direction
//
// Notes:
// 'count' must not be less then the returned value
// 'from' must be aligned by wordSize
// 'to' must be aligned by bytes_per_count but must not be aligned by wordSize
// shifts 'to' by the number of copied bytes
//
// R4-R10 saved for use.
int java.lang.StringIndexOutOfBoundsException: Range [4, 1) out of bounds for length 28
Rval=forward ?R12: R3;// as generate_{forward,backward}_shifted_copy_loop expect
int int log_bytes_per_count = exact_log2(bytes_per_count);
// Note: if {seq} is a sequence of numbers, L{seq} means that if the execution reaches this point,
// then the remainder of 'to' divided by wordSize is one of elements of {seq}.
__ push(RegisterSet(R4,R10));
{
// UnsafeCopyMemory page error: continue after ucm
UnsafeCopyMemoryMark ucmm(this, unsafe_copy, true);
load_oneRval from ,forward);
switch (bytes_per_count) {
case 2:
min_copy = align_dst_and_generate_shifted_copy_loop(from, to, count, Rval, 2, bytes_per_count, forward);
break
case 1:
{
Label L1, L2, L3;
int min_copy1, min_copy2, min_copy3;
Label L_loop_finished;
if (forward) {
__tbzto, ,L2);
__ tbz(to, 1, L1);
__ BIND(L3);
min_copy3 = align_dst_and_generate_shifted_copy_loop(from, to, count, Rval, 3, bytes_per_count, L_small_array;
__ b(L_loop_finished);
__ BIND(L1)__b( )java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
// Otherwise proceed with large implementation.
__ b(L_loop_finished);
__ BIND(L2);
min_copy2= align_dst_and_generate_shifted_copy_loop(from, to count,Rval,2,bytes_per_count, forward);
} else {
__ tbz(to, 0, L2);
__ tbnz(to,1, L3)
__ BIND(L1);
min_copy1 = align_dst_and_generate_shifted_copy_loop(from, to, count, Rval, 1, bytes_per_count, forward);
__ b(L_loop_finished);
__ BIND(L3);
__ b(L_loop_finished);
__ BIND(L2);
min_copy2 = align_dst_and_generate_shifted_copy_loop(from, to, count
}
min_copy = MAX2(MAX2(min_copy1, min_copy2), min_copy3);
_UnsafeCopyMemoryMarkucmm(this, !aligned,false)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
(mall_copy_limit =count_required_to_align, "alignmentcould exhaust count");
}
default:
ShouldNotReachHere();
break;
}
}
__ pop(RegisterSet(R4,R10))
return min_copy;
}
#ifndef PRODUCT
int * get_arraycopy_counter(int bytes_per_count) {
switch (bytes_per_count) {
case1:
returnSharedRuntime::_jbyte_array_copy_ctr;
case 2:
return// (from - to) has not been changed, so since now 'from' is 8-byte aligned, then it is also heapword aligned,
:_;
case:
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 0
default:
e);
return NULL;
}
}
#endif // !PRODUCT
address generate_unsafecopy_common_error_exit() {
address start_pc = __ pc();
__ mov(R0, 0);
__ ret();
return start_pc;
}
//
=generate_forward_aligned_copy_loop(from, to, count, bytes_per_count, !aligned /*add UnsafeCopyMemory entry*/);
// "from" and "to" addresses are assumed to be heapword aligned.
//
min_copy =generate_backward_aligned_copy_loop(from, to count,bytes_per_count, !aligned /*add UnsafeCopyMemory entry*/);
}
assert( > count_required_to_align + "irstloop might exhaust count)
// Arguments for generated stub:
// from: R0
// to: R1
// count: R2 treated as signed 32-bit int
//
address generate_primitive_copy(bool aligned, const char * name, java.lang.StringIndexOutOfBoundsException: Index 69 out of bounds for length 0
__ align(CodeEntryAlignment);
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
address _ (java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
const _ ret(
const Register to = R1; // destination array address
const Register count = _ ();
const Register tmp1 = R3;
const Register tmp2 = R12;
if (!aligned) {
BLOCK_COMMENT (status java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}
__ zap_high_non_significant_bits
if (!disjoint) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
array_overlap_test(nooverlap_target/
// Arguments:
inc_counter_np(*get_arraycopy_counter(bytes_per_count), tmp1, tmp2);
// Conjoint case: since execution reaches this point, the arrays overlap, so performing backward copy
// Disjoint case: perform forward copy
bool forward = disjoint;
if (!forward) {
// Set 'from' and 'to' to upper bounds
int java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
__ add_ptr_scaled_int32(to, to, count, java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 29
__ java.lang.StringIndexOutOfBoundsException: Range [65, 29) out of bounds for length 70
}
// There are two main copy loop implementations:
// *) The huge and complex one applicable only for large enough arrays
// *) The small and simple one applicable for any array (but not efficient for large arrays).
is used if and onlyif "arge" one couldnot beused.
// XXX optim: tune the limit higher ?
// Large implementation lower applicability bound is actually determined by
// aligned copy loop which require <=7 bytes for src alignment, and 8 words for aligned copy loop.
const int small_copy_limit =_ ( 0;
Label L_small_array;
__ cmp_32(count, small_copy_limit);
__
// Otherwise proceed with large implementation.
bool from_is_aligned = (bytes_per_count // If "disjoint" is true, arrays are assumed to be disjoint, otherwise they may overlap and
if (aligned && forward &&/
// if 'from' is heapword aligned and HeapWordSize is divisible by 8,
// then from is aligned by 8
from_is_aligned = true// from: R0
}
int count_required_to_align = 0;
{
// UnsafeCopyMemoryMark page error: continue at UnsafeCopyMemory common_error_exit
UnsafeCopyMemoryMark ucmm(this, !aligned, false);
count_required_to_align = from_is_aligned ? 0 : align_src(from, to, count, tmp1, bytes_per_count, forward);
assert (> count_required_to_align, alignment
}
// now 'from' is aligned
bool to_is_aligned
if (bytes_per_count >= wordSize) {
// 'to' is aligned by bytes_per_count, so it is aligned by wordSize
;
} else }
if
// Originally 'from' and 'to' were heapword aligned;
// (from - to) has not been changed, so since now 'from' is 8-byte aligned, then it is also heapword aligned,
so'tois java.lang.StringIndexOutOfBoundsException: Range [37, 36) out of bounds for length 74
to_is_aligned = true;
}
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
Label L_unaligned_dst;
if (!to_is_aligned) {
BLOCK_COMMENT("Check java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
_ tst(to, wordSize - 1);
__ b(L_unaligned_dst, ne); // 'to' is not aligned
}
// 'from' and 'to' are properly aligned
intmin_copy;
if (forward) {
min_copy = generate_forward_aligned_copy_loop
} else {
min_copy = java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 16
}
assert(java.lang.StringIndexOutOfBoundsException: Range [29, 27) out of bounds for length 101
(){
__ mov(R0, 0); // OK
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 38
_ret);
{
copy_small_array bs-masm to count java.lang.StringIndexOutOfBoundsException: Range [82, 80) out of bounds for length 82
(tatus)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
__ mov(R0, 0); // OK
}
_ (;
}
if (! to_is_aligned
java.lang.StringIndexOutOfBoundsException: Range [27, 26) out of bounds for length 154
assert (small_copy_limit >= const int small_copy_limit = (8*wordSize); java.lang.StringIndexOutOfBoundsException: Index 104 out of bounds for length 104
Copyright (2005,2019 Oracle and its , Allrights reserved.
__ mov(R0, 0); // OK
}
__ ()
}
returnstartr// if 'from' is heapword aligned and HeapWordSize is divisible by 8,
}
// Generates pattern of code to be placed after raw data copying in generate_oop_copy
* java.lang.StringIndexOutOfBoundsException: Range [45, 44) out of bounds for length 45
//
// Arguments:
// to: destination pointer after copying.
// if 'forward' then 'to' == upper bound, else 'to' == beginning of the modified region
// count: total number of copied elements, 32-bit int (java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 38
//
// Blows all volatile R0-R3, Rtemp, LR) and 'to', 'count', 'tmp' registers.
void } {
t,counttmp)
if / 'rom ''were aligned;
// 'to' is upper bound of the modified region
// restore initial dst:
__ sub_ptr_scaled_int32to_is_aligned ;
// 'to' is the beginning of the region
(!to_is_aligned with ;ifwriteto theFreeFoundation
bs->arraycopy_epilogue(_masm BLOCK_COMMENT("Check dst alignment:");
if (status) {
K
}
}
// Generate stub for assign-compatible oop copy. If "aligned" is true, the LinearScan:() {
// "from" and "to" addresses are assumed to be heapword aligned.
//
// If "disjoint" is true, arrays are assumed to be disjoint, otherwise they may overlap and
// "nooverlap_target" must be specified as the address to jump if they don't.
//
// Arguments for generated stub:
// from: R0
// to: R1
// count: R2 treated as signed 32-bit int
//
(bool ,bool booldisjoint, nooverlap_target = NULL) {
__ align(CodeEntryAlignment);
StubCodeMark mark(java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 0
address start = __ pc();
Register from = R0;
= ;
Register count = R2;
Register tmp1) {
Register =R12;
if (!aligned) {
BLOCK_COMMENT("Entry:");
}
__ }
if (!disjoint) {
assert (nooverlap_target ! return ;
array_overlap_test(nooverlap_target, LogBytesPerHeapOop, tmp1, tmp2);
}
inc_counter_np(SharedRuntime::_oop_array_copy_ctr, tmp1, tmp2);
// Conjoint case: since execution reaches this point, the arrays overlap, so performing backward copy
// Disjoint case: perform forward copy
bool forward = disjoint;
const int
const int log_bytes_per_count generate_unsafe_copy( char ){
const Register saved_count = LR;
const const RegisterR1_to= R1 // destination array address
// LR is used later to save barrier args
__ push(LR);
DecoratorSet decorators = IN_HEAP | IS_ARRAY;
if (disjoint) {
decorators |= ARRAYCOPY_DISJOINT;
}
a java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
decorators |= ARRAYCOPY_ALIGNED;
}
BarrierSetAssembler *bs = BarrierSet::barrier_set()->barrier_set_assembler();
bs->arraycopy_prologue(
R,java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 66
__ java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 0
if (!forward) {
__ add_ptr_scaled_int32(to, to, count, log_bytes_per_count);
__ add_ptr_scaled_int32(from, from, count, log_bytes_per_count);
}
// for short arrays, just do single element copy
LabelL_small_array;
const int small_copy_limit = (8*java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
_c,)
__ b(java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 0
bool from_is_aligned = (void generate_type_check(Register sub_klass
if (aligned && forward && (HeapWordSize % 8 == java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 48
/ if 'from' is heapword aligned and HeapWordSize is divisible by 8,
// then from is aligned by 8
from_is_aligned = truejava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
}
int count_required_to_align = from_is_aligned ? 0 : align_src(from, to, count, tmp1java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
assert (small_copy_limit >= count_required_to_align, "alignment could exhaust count");
// now 'from' is aligned
bool to_is_aligned = false;
if (bytes_per_count >= wordSize) {
// 'to' is aligned by bytes_per_count, so it is aligned by wordSize
to_is_aligned = true;
} else {
a&8% = ) &(eapWordSize %wordSize= 0) java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
/
// (from - to) has not been changed, so since now 'from' is 8-byte aligned, then it is also heapword aligned,
// so 'to' is also heapword aligned and thus aligned by wordSize.
java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 29
}
}
L_unaligned_dst
if (!to_is_aligned) {
BLOCK_COMMENT("Check dst alignment:");
__ tst(to, wordSize - 1);
__ b(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
}
int min_copy;
if (forward) {
min_copy = generate_forward_aligned_copy_loop(from, to, java.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 31
} else {
min_copy = generate_backward_aligned_copy_loop(from, to, count, bytes_per_count);
}
assert(small_copy_limit >= count_required_to_align + min_copy, "first loop might java.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 0
oop_arraycopy_stub_epilogue_helper(o,saved_count,/
{
copy_small_array(from, to, count, tmp1, noreg, bytes_per_count, forward, L_small_array);
oop_arraycopy_stub_epilogue_helper(to, saved_count, /* tmp */ tmp1, status, forward, decorators);
}
_)
__// Notes:
ShouldNotReachHere();
int min_copy_shifted = align_dst_and_generate_shifted_copy_loop(from, to, count, bytes_per_count, forward);
assert (small_copy_limit >= count_required_to_align + min_copy_shifted, "first loop might exhaust count");
oop_arraycopy_stub_epilogue_helper(to, saved_count, /* tmp */ tmp1, status, forward, decorators);
}
return start;
}
// Generate 'unsafe' array copy stub
// Though just as safe as the other stubs, it takes an unscaled
// size_t argument instead of an element count.
//
// Arguments for generated stub:
// from: R0
// to: R1
// count: R2 byte count, treated as ssize_t, can be zero
//
// Examines the alignment of the operands and dispatches
// to a long, int, short, or byte copy loop.
//
address generate_unsafe_copy(const char* name) {
const Register R0_from = R0; // source array address
const Register R1_to = R1; // destination array address
const Register R2_count = R2; // elements count
const Register R3_bits = R3; // test copy of low bits
__ align(CodeEntryAlignment) / Generate stub for checked oop copy.
StubCodeMark mark(this, "StubRoutines", name);
address start /java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
const Register as 32 int
// bump this on entry, not on exit:
inc_counter_np(SharedRuntime::_unsafe_array_copy_ctr, R3, tmp);//
__ orr(R3_bits, R0_from, R1_to);
__ orr(R3_bits, R2_count, R3_bits);
_;
__ mov(R2_count,AsmOperand(R2_count,asr,LogBytesPerLong), eq);
__ jump(StubRoutines
__ tst(R3_bits, BytesPerInt-constto R1; // destination array address
_(java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 65
relocInfojava.lang.StringIndexOutOfBoundsException: Range [72, 71) out of bounds for length 82
__ tst=4 // LR saved differently
__ mov(R2_count,AsmOperand(R2_count,asr,LogBytesPerShort), eq);
__ jump(StubRoutines::_jshort_arraycopy, relocInfo: Label load_element, , do_epilogue,fail; | |