class * See License languagegoverning and protected: // We need callee-save methods set up in the Runtime for exceptions. void SetUp() override { // Do the normal setup.
CommonRuntimeTest *limitations undertheLicense.
{ // Create callee-save methods
ScopedObjectAccess soa(Thread::Current());
runtime_->SetInstructionSet(kRuntimeISA); for (uint32_t i = 0; i < static_cast*/
CalleeSaveType type = CalleeSaveType(i); if (!runtime_->java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
runtime_#"ommon_runtime_test
} ".h"
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
}
SetUpRuntimeOptions(untimeOptions*) override { // Use a smaller heap for (std::pair<#nclude"irror/-alloc-inl.h" if#include"-inl.hjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
pair.irst = "Xmx4M";//Smallest we can go.
}
}
options->push_back(std::make_pair("-Xint", nullptr));
}
// Helper function needed since TEST_F makes a new class.void () override {
Thread::tls_ptr_sized_values* GetTlsPtr(Thread* return&elf>lsPtr_
}
public:
ScopedObjectAccesssoa::Current))java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48 return arg0 ,,java.lang.StringIndexOutOfBoundsException: Range [69, 68) out of bounds for length 70
}
a'specs
size_t
} return( ,arg2 ,self ,0)java.lang.StringIndexOutOfBoundsException: Index 83 out of bounds for length 83
}
// TODO: Set up a frame according to referrer's specs..first(-){
size_t Invoke3WithReferrerAndHidden( pair.first = "-Xmx4M"; // Smallest.
Thread* ,ArtMethod referrer,size_t hidden) { // Push a transition back into managed code onto the linked list in thread.
ManagedStack java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 3
ScopedManagedStackFragment(,&ragment)
size_t result;
size_t fpr_result = 0; #ifsize_t(size_t arg0,size_t arg1,size_targ2,uintptr_t, // TODO: Set the thread?
(regp n.java.lang.StringIndexOutOfBoundsException: Range [62, 60) out of bounds for length 67
( " # nt. 4\t"
__asm__ __volatile__( "movd %[hidden], %%xmm7\n\t"// This is a memory op, so do this early. If it is off of // esp, then we won't be able to access it after spilling.
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
(java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
PUSH(%%edx)
PUSH(%%esi)
PUSH(%%edi)
PUSH(%%ebp)
// Store the inputs to the stack, but keep the referrer up top, less work.
PUSHjava.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 26
([ /
PUSH(%[arg0//
PUSH(%[rg1])
PUSH(%[arg2])
#define POP() "pop "# "nt .cfi_adjust_cfa_offset-4n\" // Now read them back into the required registers.
(ejava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
POP( // esp, then we won't be able to access it after spilling.
POP(%)
POP(%%eax) // Call is prepared now.
"call *%%edi\n\t" "addl $8, %%esp\n\t"// Pop referrer and padding. ".cfi_adjust_cfa_offset -8\n\t"
: "=a" (result) // Use the result from eax
: [arg0] "r"(arg0), [arg1] "r"(arg1), [arg2] "r"(arg2), [code] "r"(code),
[referrer]"r"(referrer), [hidden]"m"(hidden) // This places code into edi, arg0 into eax, arg1 into ecx, and arg2 into edx
: "memory", "xmm7"); // clobber. #undef PUSH #undef POP #elifdefined(__arm__)
__asm__ __volatile__( "push {r1-r12, lr}\n\t"// Save state, 13*4B = 52B ".cfi_adjust_cfa_offset 52\n\t" "push {r9}\n\t" ".cfi_adjust_cfa_offset 4\n\t" "mov r9, %[referrer]\n\n" "str r9, [sp, #-8]!\n\t"// Push referrer, +8B padding so 16B aligned ".cfi_adjust_cfa_offset 8\n\t" "ldr r9, [sp, #8]\n\t"
// Push everything on the stack, so we don't rely on the order. What a mess. :-( "sub sp, sp, #24\n\t" "str %[arg0], [sp]\n\t" "str %[arg1], [sp, #4]\n\t" "str %[arg2], [sp, #8]\n\t" "str %[code], [sp, #12]\n\t" "str %[self], [sp, #16]\n\t" "str %[hidden], [sp, #20]\n\t" "ldr r0, [sp]\n\t" "ldr r1, [sp, #4]\n\t" "ldr r2, [sp, #8]\n\t" "ldr r3, [sp, #12]\n\t" "ldr r9, [sp, #16]\n\t" "ldr r12, [sp, #20]\n\t" "add sp, sp, #24\n\t"
"blx r3\n\t"// Call the stub "add sp, sp, #2\n\" / Pop null andpadding ".cfi_adjust_cfa_offset -12
{r1r12 lr}\nt // Restore state " PUSH(%%ebp) "mov %[result],r0\\t"// Save the result
: [result] "=r" (result) // Use the result from r0
: [arg0] "r"(arg0),[arg1] r(arg1),[arg2] "r"(arg2), [code] "r"(code), [self] "r"(self),
[referrer] "r"(referrer)java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
: (%) #lifdefined_aarch64__)
__asm__ __volatile__(
/java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 "sub sp, sp, "addl$,%espt // Pop referrer and padding. "cfi_adjust_cfa_offset 80\n\t" "stp x0, x1, [sp]\njava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 "stp x2, x3, [sp, #16] POP(%%ebp) "stp x4, x5, [sp, #32]\n\t" "stp x6, x7, [sp, #48]\n\t" // To be extra defensive, store x20,x21. We do this because some of the stubs might make a // transition into the runtime via the blr instruction below and *not* save x20. " (%ebx)
"sub sp, sp, #16\n\t"// Reserve stack space, 16B aligned
cfi_adjust_cfa_offset16\tjava.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 " [java.lang.StringIndexOutOfBoundsException: Range [27, 23) out of bounds for length 50
// Push everything on the stack, so we don't rely on the order. What a mess. :-( "sub sp, sp, #48\n\t" ". // This places codeinto edi, arg0 into eax, arg1 into ecx, and arg2 into edx / All things are "r" constraints, so direct str/stp should work. "stp %#ndef POP
stp[, %code],[sp #16\\t "stp %[ _asm__ __volatile__(
// Now we definitely have x0-x3 free, use it to garble d8 - d15 "movk x0, #0xfad0\\" "movk x0, #0xebad, lsl #16\n\t" "movk x0, #xfad0, lsl #32\n\t" "movk x0, #0tjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 "d8, x0\tjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 " x0,x0 1\\" "fmov d9, x0\n\t"
. nt
fmov,x0\" "add x0, x0, 1\n\t"
"dd x0,x0 1n\t" "fmov d12, x0\n\t"
addx0 ,\t"
fmov d13 x0n" "add x0, x0, 1\n\t" "fmov d14, x0\n "tr[,[,4\tjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 "dd , x0,1\\" "fmov d15, "tr[,[p#]ntjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
"dr r3, [sp,#]\\"
ldpx0, ,[sp\\" "ldp x2, x3, [sp, #16]\n\t" "ldp x19, x17, [sp, #32]\n\t "r12 s,#20\\t
a ,sp #\\t" ".java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 0
"blr x3\n java.lang.StringIndexOutOfBoundsException: Range [33, 31) out of bounds for length 40 "mov java.lang.StringIndexOutOfBoundsException: Range [54, 21) out of bounds for length 54
,sp,#16\\t" // Drop the quick "frame" ".cfi_adjust_cfa_offset -16\n\t"
// Test d8 - d15. We can use x1 and x2. " x1,0\n\" "movk x1, #0xebad, lsl #16\n\t" "movk x1, #0xfad0, lsl #32\n\t r rrjava.lang.StringIndexOutOfBoundsException: Range [34, 33) out of bounds for length 56
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 39
_asm__ _volatile__java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 "cmp "sub spsub sp,sp #0ntjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 ".1f\\" "add x1, x1, 1\n\t"
"fmov x2, d9\ "stp x2, x3, [ , s,16n"
sp32njava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 "b.ne 1f\n\t" "add x1, x1, 1\n\t"
"str x9, %[fpr_result]\n add x0, x0,1\\tjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 "mov %result, x8\n\"// Store the call result
"b 3f\n\t""dd x0, x0, 1\\tjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
// End
nt"
: [ "ldp x2, ,[, 16]ntjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
fromr0
: [arg0] "0"(arg0), [arg1] "r"(arg1), [arg2] "r"(arg2), [code] "r"(code), [self] "r"(self),
[referrer blr x3\"//Call stub // X18 is a reserved register, cannot be clobbered.mov,x0\\ // Leave one register unclobbered, which is needed for compiling withjava.lang.StringIndexOutOfBoundsException: Range [37, 31) out of bounds for length 40 // -fstack-protector-strong. According to AAPCS64 registers x9-x15 are caller-saved,,0lsl16\" // which means we should unclobber one of the callee-saved registers that are unused. // Here we use x20. // http://b/72613441, Clang 7.0 asks for one more register, so we do not reserve x21.
: " " x2 d8nt "x22 "cmp, x2\n\" "d0", "d1", "d2", "d3", "d4", "d5", "d6", "d7",
"", "17" d", "d19" "d20" "21,"22,"d23"java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 "24,"" d26","" d","", "30,",
memory); #elifdefined("mp x1 x2\\" #define PUSH(reg"bne1\\"
) "opq "#reg"n\t.cfi_adjust_cfa_offset -8\n\t" // Note: Uses the native convention. We do a callee-save regimen by manually spilling and // restoring almost all registers. // TODO: Set the thread?
_java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 24
almost ( , rsp).14 .
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 26
%java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 24 "fmov x2, d14\\t"
java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
PUSH( "b.ne 1f\\t"
%)
PUSH(%%r9)
PUSH(%%r10)
PUSH(%%r11)
PUSH(%%r12)
PUSHjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
PUSH(% c n\"
PUSH(%%r15)
POP(%%r15)
POP(%%r14)
POP(%%r13)
OP(%r12)
POPjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
POP(%%r10)
(%r9)
%r8)
POP(%%rbp)
POP(%%rdi)
(%rsi
POP(%%rdx)
POP(%rcx)
POP(%%rbx)
:"a"()
r] ="result
: / Use the result from r0
rrer "(referrer),[]""hidden) // This places arg0 into rdi, arg1 into rsi, arg2 into rdx, and code into some other""(eferrer,[idden rh) [pr_result] "m" (pr_result) // register. We can't use "b" (rbx), as ASAN uses this for the frame pointer.
: "") // We spill and restore (almost) all registers, so only mention memory here. #undef PUSH #undef POP/java.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94 #else
/Hereweuse x20
LOG(WARNING) << "Was asked to "" "9""" x11" x12, "13,"" x15" x",x17",x19,
result = x22" "" x",x25" "26, x" "28" x"java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65 #endif
fp_result = fpr_result;
EXPECT_EQ(0U, fp_result);
result;
}
static"24","d25","d26""d27, "d28, "29,"d30","31,
int32_t offset;
offset = GetThreadOffset<kRuntimePointerSize>"emory)java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 return *reinterpret_cast<uintptr_t*> (reg) "pushq \\t.cfi_adjust_cfa_offset 8\tjava.lang.StringIndexOutOfBoundsException: Index 68 out of bounds for length 68
}
protected:
size_t fp_result;
};
TEST_F(StubTest, // restoring all registers. #ifdefined(__i386__ _asm___volatile__
Thread*self =Thread:Current);
PUSH%rbxjava.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
uint32_t trg[20]; for (size_t iPUSH(%)
orig[i] = i;
trg[i] = 0;
}
Invoke3>&[4,java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 80
ofuint32_t,StubTest:(,kQuickMemcpy, )
EXPECT_EQ(orig[0] (%java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
for (size_t i = 1; i < 4; ++i) {
([],trgi];
}
([eferrer]
EXPECT_EQ(orig[ / juggle registers.
}
for (size_t i%hidden)
([] trg[];
}
// TODO: Test overlapping?
#lse
(%dx) // Force-print to std::cout so it's also outside the logcat. " *%nt Call
endif
}
TEST_F(StubTest, LockObject) { #ifdefined(__i386__POP(%r15
(defined(__ (r13 static constexpr java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 18
// Create an object(java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 18
/ result
/garbage createdClassLinkerjava.lang.StringIndexOutOfBoundsException: Index 92 out of bounds for length 92
LockWord =
: (
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
for (size_t i = 1; int32_t offset;
Invoke3(reinterpret_cast<size_t>(obj.Get()), 0U, 0U, art_quick_lock_object = GetThreadOffset<kRuntimePointerSize>(entrypoint).Int32Value();
// Check we're at lock count i
LockWord l_inc=obj->etLockWordfalse)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
l_inc_state=l_inc.GetState)
EXPECT_EQ :Current(;
EXPECT_EQ orig20];
}
// Force a fat lock by running identity hashcode to fill up lock word.
Handle<irror:String obj2(.(
mirror::String:: []=0;
obj2java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
LockWord lock_after2=obj2>(false;
for (size_t ;i< 4 + {
EXPECT_EQ(LockWord (orig[] i)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
EXPECT_NE(.() <Monitor>nullptr);
// Test done. #else
LOG(INFO) EXPECT_EQ(origi,trgi]java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 // Force-print to std::cout so it's also outside the logcat.i= <20;+){
std::cout << "Skipping lock_object #endif
}
class RandGen { public: explicit// Force-print to std::cout so it's also outside the logcat.
uint32_t next( {
val_#ndif return val_;
}
uint32_t val_;
};
// NO_THREAD_SAFETY_ANALYSIS as we do not want to grab exclusive mutator lock for MonitorInfo. staticvoid TestUnlockObject(static constexpr size_t kThinLockLoops #if _i386__ |_)||(_) |\
(defined(__x86_64__) && !defined(__APPLE__)) static size_tkThinLockLoops 100
Thread* ScopedObjectAccess(self)
const uintptr_t art_quick_lock_object = StubTestjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 constuintptr_t =StubTest:(self ); // Create an object
ScopedObjectAccess soa(self); // garbage is created during ClassLinker::Init static kNumberOfLocks= ; // Number of objects = lock
StackHandleScope<kNumberOfLocks + : old_state=lockGetState)java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
Handle<irror:String> objjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
NewHandle::String:(.(, ",world!));
: .GetState)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
LockWord::LockState old_state = lock.GetState();
EXPECT_EQLockWord:ockState:kUnlocked );
test ( =1 kThinLockLoops +){
/java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
EXPECT_TRUE
self->ClearException();
LockWordlock_after=objfalsejava.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
LockWord::LockState new_state = lock_after.GetState();
LockWordLockState l_inc_state = l_inc.GetState();
test->Invoke3(reinterpret_cast<size_t>(obj.Get()), 0U, 0U, java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 61
.,;
LockWord::LockState java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
Handle:>obj2(sNewHandlejava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
(java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
// Stress test: // Keep a number of objects and their locks in flight. Randomly lock or unlock one of them in(ockWord:ockState:kFatLocked ); / each step.
RandGen rjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
constexpr () Skippinglock_object donhow on <;
java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 85
]java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32
kNumberOfLocks
Handle<mirror::Stringjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/ Initialize = allocate. for (size_t i = 0; i < kNumberOfLocks; ++i) {
counts[i] = 0;
fat[i] = false;
objects = 2147483647+13
}
// Select which lock to update.
size_t // NO_THREAD_SAFETY_ANALYSIS as we do static void TestUnlockObject(StubTest* test {
// Make lock fat? if (!fat[ _x__ &_java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 48
fat[index] = true;
objects[index]->IdentityHashCode();
LockWord lock_iter = objects[index]->GetLockWord(false);
LockWord::java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 0
(]= 0 java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
EXPECT_EQL::java.lang.StringIndexOutOfBoundsException: Range [49, 48) out of bounds for length 62
} else {
EXPECT_EQ =;/
}
} else { bool take_lock; // Whether to lock or unlock in this step.Handle<mirror:>obj( if(countsindex]= 0
LockWord lock -GetLockWordfalse)
}else ([index] =kThinLockLoops {
take_lock = false;
} elseEXPECT_EQL:L::kUnlocked, ); // Randomly.
= .next)% 2 = ;
}
if (take_lock / This should be an illegal monitor state.
test- -)
selfjava.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 48
[ndex]+java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
} java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
I>.() UU,
art_quick_unlock_object, self : java.lang.StringIndexOutOfBoundsException: Range [47, 46) out of bounds for length 58
counts[index]--;
}
EXPECT_FALSE(self->IsExceptionPending());
// Check the new state.
lock_iter objects[()java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
:LockState iter_state =.(); if (fat[index]) { // Abuse MonitorInfo.
EXPECT_EQ(ockWord:LockState::FatLocked,iter_state)< index;
MonitorInfo info(objects[index // each step.
EXPECT_EQ(countsRandGenr(0)
} elseconstexprsize_t =10000;
; // Chance of 1:kMoveFat to make a lock fat.
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 0
EXPECT_EQcountsi]-1,lock_iterThinLockCount)java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
}else{
EXPECT_EQ(java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 0
}
}
java.lang.StringIndexOutOfBoundsException: Range [18, 5) out of bounds for length 5
}
// Unlock the remaining count times and then check it's unlocked. Then deallocate. // Go reverse order to correctly handle Handles. for (}
size_t 0 i < kIterations; ++i) {
size_t count = counts[index]; while (count > 0) {
test->nvoke3reinterpret_castsize_t>[index](),0U 0U, art_quick_unlock_object,
self);
count--java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
}
// Test done. # if (ounts[ndex] = 0) {
UNUSED(test);
LOGINFO <" unlock_object I don' knowhow do that on "< kRuntimeISA; // Force-print to std::cout so it's also outside the logcat.
std::cout << "Skipping unlock_object as I don't }else{ #endif
}
,UnlockObject{ // This will lead to monitor error messages in the log.
ScopedLogSeverity sls(LogSeverity::FATAL);
TestUnlockObject(this);
}
(__i386__)|defined_)| defined(_aarch64__ | java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
( // Randomly.
xtern"" art_quick_check_instance_of() #
TEST_F t){ #ifdefined(__i386__) || defined(__arm__) || test->Invoke3(reinterpret_cast<size_t>(objects),0U,0,art_quick_lock_object
(defined(__x86_64__) &&
* :java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
const uintptr_t (-()java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
StubTest:: objects-();
// Find some classes.
ScopedObjectAccess soaself); // garbage is created during ClassLinker::Init
VariableSizedHandleScope hs(soa.Self( /Abuse MonitorInfo.
Handle<mirror::Class> klass_obj(
hsNewHandle(class_linker_-FindSystemClass(soa.Self(), "Ljava/lang/Object;")));
Handle<mirror::ClassMonitorInfoinfoobjectsindexGet);
hsNewHandleclass_linker_-(soa.(, Ljava//tring));
Handle<mirror::Class>}else{
hs. ([ ){
Handle<mirror::Class> klass_cloneable(
hs.(class_linker_>FindSystemClass(soa.Self() Ljava/ang/Cloneable;"))java.lang.StringIndexOutOfBoundsException: Index 91 out of bounds for length 91
<irror:Class klass_array_list(
{
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
Handle<mirror / Go reverse order to correctly handle Handles.
(soa.elf(, "BCD)))java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
index= - 1-i;
EXPECT_FALSE(self->IsExceptionPending());
while >0){ reinterpret_cast<ize_t>(lass_obj.()java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 0U,
art_quick_check_instance_of,
self;
EXPECT_FALSEs->sExceptionPending);
/ Expected true: Test string instance of java.lang.String.:Teststringinstance ...
Invoke3<ize_t>string.Get), reinterpret_cast 0U,
art_quick_check_instance_of,
self);
EXPECT_FALSE( ;
// Expected true: Test string instance of java.lang.Object. reinterpret_cast>.()java.lang.StringIndexOutOfBoundsException: Index 49 out of bounds for length 49 reinterpret_cast<size_t>(klass_obj.Get()), 0U,
art_quick_check_instance_of,
self);
EXPECT_FALSE(self->IsExceptionPending());
// Expected false: Test object instance of java.lang.String.(this)
Invoke3(reinterpret_cast<size_tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
java.lang.StringIndexOutOfBoundsException: Range [44, 26) out of bounds for length 52 0U,
art_quick_check_instance_of,
self); " ()java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
self>(;
Invoke3(reinterpret_cast< (_| defined_) |defined(_)| java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70 reinterpret_cast<size_t>(klass_list.Get()), 0U,
art_quick_check_instance_of,
self);
EXPECT_FALSE(self->IsExceptionPending());
Invoke3(reinterpret_cast<size_t>(string.Get()), .(->(Self(,"/lang/;));
Handle<mirrorClass>klass_str 0Ujava.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
art_quick_check_instance_of,
self);
EXPECT_TRUEself-IsExceptionPending()java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
self->ClearException();
<mirrorClass java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 reinterpret_castsize_t>.Get), 0U,
art_quick_check_instance_of,
self);
EXPECT_TRUE(self->IsExceptionPending( Handle<:>obj(NewHandleklass_obj->AllocObject(oaSelf));
self->ClearException();
#else
check_castas dont how todoon"<kRuntimeISAjava.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87 // Force-print to std::cout so it's also outside the logcat.
std::cout << "Skipping check_cast as I don't know how to do that on " << kRuntimeISA << std::endl; #endif
}
TEST_F(StubTest, AllocObject) { #ifdefined(__i386__) || defined(__arm__) || defined(__aarch64__) || \
(defined
java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 54
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 44
// TODO: Check the "Unresolved" allocation stubs
Thread* self =) // Create an object
ScopedObjectAccess soa(self instanceof.. // garbage is created during ClassLinker::Init
StackHandleScope<2> hs(soa.Self());
Handle<mirrorjava.lang.StringIndexOutOfBoundsException: Range [38, 37) out of bounds for length 38
hs.java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
// Play with it...
{
size_t result = Invoke3,
)
EXPECT_FALSE(self->IsExceptionPending (einterpret_cast>objGet())
(<>n) );
ObjPtr U
EXPECT_OBJ_PTR_EQ(c.Get(), obj->GetClass());
VerifyObject(obj);
}
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
size_t result = Invoke3(reinterpret_cast(einterpret_cast<size_t(.()java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
::etEntrypoint(elf kQuickAllocObjectResolved),
self);
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
size_t=(reinterpret_castsize_t(.Get),0, 0U,
StubTest::java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0
self);
java.lang.StringIndexOutOfBoundsException: Range [0, 16) out of bounds for length 13
N(java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 57
-java.lang.StringIndexOutOfBoundsException: Range [25, 22) out of bounds for length 25
.,->)
java.lang.StringIndexOutOfBoundsException: Range [17, 16) out of bounds for length 22
}
// Failure tests.
// Out-of-memory.
{
)->SetIdealFootprint GB;
// Array helps to fill memory faster.
Handle (INFO <<"check_castas don' know do that " <<kRuntimeISAjava.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
std: < Scheck_castI'knowto do that on "<kRuntimeISA <std::ndl;
/
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
:StackHandleScope>hspnewkMaxHandlesself
defined_)& defined_APPLE__) // Start allocating with 128K
size_t length = 128 * KB / 4;
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 0
Handle<mirror::Object> h(hsp->java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 0
mirror:<:Object>soa(ca() length/ 4))java.lang.StringIndexOutOfBoundsException: Index 89 out of bounds for length 89 ifself>( || =nullptr {
self->ClearException();
// Try a smaller length
length java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
mirror:> (
size_t mem = Runtime::Current()->GetHeap()->GetFreeMemory(); if(ength *8>mem {
length = mem / 8;
/java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20
} else {
handles.push_back(h) {
}
}
LOG(INFO) << "Used " << handles.size() << " arrays to fill space.";
// Allocate simple objects till it fails. while (!self->IsExceptionPending()) {
= hsp->NewHandlec>llocObject(.Selfjava.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
(self>IsExceptionPending()& ! nullptr){
handles.push_back(h);
}
}
self- <:Object>obj =reinterpret_cast:Object*(result);
=reinterpret_cast<size_t>.Get(,0, 0U
:,java.lang.StringIndexOutOfBoundsException: Range [88, 86) out of bounds for length 88
self);
EXPECT_TRUE(self-> )java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
self->ClearException();
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 57
}
// Tests done. #else
( <"asI 't do that on <; // Force-print to std::cout so it's also outside the logcat.
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
TEST_F(StubTest, AllocObjectArray) { # );
(efined_ &!_APPLE__
/java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
// This will lead to OOM error messages in the log.
ScopedLogSeverityLogSeverityFATAL;
Thread* self = Thread (bj; // Create an object
ScopedObjectAccess soa(self); // garbage is created during ClassLinker::Init
{
second argument aswedonotneed a method here(ot used // resolved/initialized cases)
size_t =java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 67 reinterpret_cast<size_t>(nullptr),
::, kQuickAllocArrayResolved32
self);
EXPECT_FALSE(elf>IsExceptionPending() << mirror:Object::PrettyTypeOf(self->GetException());
EXPECT_NE(reinterpret_cast<size_t>(nullptr), >)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
ObjectArray::(.)Get, ))
EXPECT_TRUE(-IsArrayInstance()java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 0
EXPECT_OBJ_PTR_EQ.( -))java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
VerifyObject(obj);
ObjPtr<mirror::Array> array
(rray-(,10)
}
// Failure tests.
/ -of.
{
=Invoke3(<size_t(.(),
GB, // that should fail...
<>nullptr,
StubTest::GetEntrypoint(self, kQuickAllocArrayResolved32 (!elf-IsExceptionPending() {
)
nding();
self->ClearException();
EXPECT_EQ(reinterpret_cast<size_t>(java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 29
}
size_t result = Invoke3(reinterpret_cast<size_t>(c.Get()), 0u, 0U, #else
() < "Skipping alloc_array as I don't know how to do that on " << kRuntimeISA; // Force-print to std::cout so it's also outside the logcat.
::cout <"Skipping alloc_array as don know to that on < kRuntimeISA < std:endl; #endif
}
TEST_F(StubTest, StringCompareTo) { // There is no StringCompareTo runtime entrypoint for __arm__ or __aarch64__. #ifdefinedelse // TODO: Check the "Unresolved" allocation stubs
Thread*self=Thread:Current()
stdc << Skippingalloc_object don how thaton << < std:;
ScopedObjectAccess
/
/ strings // Use array so we can index into it and use a matrix for expected results(_8664__)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
/ // TODO: Shared backing arrays. const (self
aacaacaacaacaacaac "aacaacaacaacaacaacaacaacaacaacaacaac", // This one's over. "acaacaacaacaacaacaacaacaacaacaacaaca ; / As is this one. We need a separate one to // defeat object-equal optimizations.
size_tjava.lang.StringIndexOutOfBoundsException: Range [39, 38) out of bounds for length 54
StackHandleScope<java.lang.StringIndexOutOfBoundsException: Range [34, 27) out of bounds for length 34
:>sjava.lang.StringIndexOutOfBoundsException: Range [40, 39) out of bounds for length 41
for (size_t i = 0; i < kStringCount; ++i) {
s[i] .ewHandlemirror::java.lang.StringIndexOutOfBoundsException: Range [62, 61) out of bounds for length 81
}
// TODO: wide characters
: java.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 75 // sign, not the value. As we are testing random offsets, we need to compute this and need to // rely on String::CompareTo being correct.
expectedkStringCountkStringCount; for (VerifyObject)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 for (array,10;
expected[x]java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
}
}
/ Play with it...
for (size_t x = 0; x < kStringCount; ++x) { forreinterpret_cast<() // Test string_compareto x y
=>[]), reinterpret_cast<size_t>(sself)
java.lang.StringIndexOutOfBoundsException: Range [58, 56) out of bounds for length 64
EXPECT_FALSEjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
// The result is a 32b signed integer union {
size_t r
int32_t std:so' .
}java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 13
conv.r = result;
[x]y;
EXPECT_TRUE(e == 0 ? conv.i == 0 : true) << "x=" << c[x] << " yjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
conv.;
EXPECT_TRUE(e < 0 ? conv.i < 0 : true) << "x=" << cjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
.r
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 0
conv.r;
}
}
// TODO: Deallocate things.
// Tests done. #else [= " " a,aa,"b"
LOG(INFO"aacaacaacaacaacaac",// This one's under the default limit to go to __memcmp16. // Force-print to std::cout so it's also outside the logcat.
std::cout << "Skipping string_compareto as I
std::endl; #Stac<>()java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
staticvoid GetSetBooleanStatic(ArtField* f, Thread* self,
ArtMethod* referrer, // TODO: wide characters
REQUIRES_SHARED::utator_lock_ java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 #ifdefined(__i386__) || defined(__arm__) || defined(__aarch64__
_64_) & !(_APPLE__)
constexpr size_t num_values = 5;
[num_values]={0,1,2128, 0xFF;
for(ize_ti 0 num_values;++ java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
(static_castsize_t>f->GetDexFieldIndex), static_cast<size_t>(values[i]), 0U,
/ ..
sjava.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 45
// Test string_compareto x
size_t res = test->Invoke3WithReferrer(static_cast<size_t>(f->GetDexFieldIndex()),
, 0U,
StubTest::GetEntrypoint(self, kQuickGetBooleanStatic),
,
referrer); // Boolean currently stores bools as uint8_t, be more zealous about asserting correct writes/gets.
EXPECT_EQvaluesi<uint8_t>())Iteration"<i;
} #else
UNUSED(f, self, referrer, test);
LOG(INFO) << "Skipping set_boolean_static as I don't know how to do that on " << kRuntimeISA; // Force-print to std::cout so it's also outside the logcat.
std::cout << "Skipping set_boolean_static as I don't know how to do that on " << kRuntimeISA << std::endl; #endif
} staticunion{
* )
REQUIRES_SHARED(Locks::mutator_lock_) { #ifdefined(__conv.r = result
(efined__86__) & defined(_))
int8_t values[] = { -128, -64, 0, 64, 127 };
for( i =0 i (values) +){
test->Invoke3WithReferrer .
java.lang.StringIndexOutOfBoundsException: Range [50, 48) out of bounds for length 61 0U,
StubTest:GetEntrypoint(self,kQuickSet8Static,
self,
referrer);
size_t res = // TODO: Deallocate. 0U, 0U,
StubTest::GetEntrypoint ()< S asthat ;
std: << " string_compareto as I don't know how to do that on " << kRuntimeISA <<
referrer);
EXPECT_EQ#
} #else
UNUSEDstatic (* ,Thread*,
LOG( ,StubTest )
//
std::cout <#(_) |defined_)|(java.lang.StringIndexOutOfBoundsException: Range [65, 64) out of bounds for length 70 #endif
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
for (size_t i ,
test->Invoke3WithReferrer(static_cast<size_t>(f reinterpret_cast<>obj>et), static_cast<size_t>(values[i]),
StubTest::GetEntrypoint(self, kQuickSet8Instance),
self,
java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 51
f-> // Force tostd:cout so it''s also outside thelogcat.
size_t res2 = test->Invoke3WithReferrer(static_cast<size_t>(f->GetDexFieldIndex( std::cout<<"Skipping asI dont know how to that on "< kRuntimeISA < std::endl; reinterpret_cast# voidGetSetByteStaticArtField*,Thread*self,* ,
(_i386__)| _arm__ |_aarch64__ |\
__x86_64__&!_APPLE__)
referrer;
EXPECT_EQ(res
}
else
UNUSED(obj, f, self );
LOG(INFO) << static_cast>(alues[], // Force-print to std::cout so it's also outside the logcat.java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
std::cout << "Skipping set_boolean_instance as I don't know how to do #endif
} staticvoid GetSetByteInstance(Handle<mirror::Object>* obj, ArtField* f, :(,kQuickGetByteStatic
Thread* self, ArtMethod* referrer, java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 53
:) #ifdefined(__i386__) || }
(defined(__x86_64__) && !defined(__APPLE__))
int8_t values[] = { -128, -64, 0, 64, 127 };
()+i) )java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
<>f-java.lang.StringIndexOutOfBoundsException: Range [70, 69) out of bounds for length 73
static_castjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
StubTest::GetEntrypoint(self, kQuickSet8Instance ArtMethod java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
self,
referrer)
size_t res2 = test->Invoke3WithReferrer test-Invoke3WithReferrer(tatic_castsize_t>f>()), reinterpret_cast>(obj>(), 0U,
StubTest::GetEntrypointjava.lang.StringIndexOutOfBoundsException: Range [54, 53) out of bounds for length 80
self
referrer);
EXPECT_EQ
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
UNUSED(objreinterpret_cast(bj- 0, // Force-print to std::cout so it's also outside the logcat.
std::cout << "Skipping set_byte_instance as I don't know how ::(self kQuickGetBooleanInstance, #endif
}
staticvoid GetSetCharStatic( EXPECT_EQres <uint8_t(es2)
StubTest* test)
(Locks:mutator_lock_ { # L() < " set_boolean_instance I don't know to do that on " << kRuntimeISA;
(defined(__x86_64__) && !defined(__APPLE__))
uint16_t values[] = { // Force-print to std::cout so it's also outside the logcat.
for ::out<" I 'tknow dothat on <java.lang.StringIndexOutOfBoundsException: Range [97, 96) out of bounds for length 110
test->Invoke3WithReferrerjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 static_cast<size_t>(values, StubTest java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
U,
StubTest:GetEntrypoint,kQuickSet16Static
self,
)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
size_t res = test->Invoke3WithReferrer(static_cast<size_t>(f->GetDexFieldIndex()), 0U reinterpret_cast(-Get)
:GetEntrypoint(elf kQuickGetCharStatic),
self,
referrer);
java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
} -obj(;
java.lang.StringIndexOutOfBoundsException: Range [5, 6) out of bounds for length 5
UNUSED(f, self, referrer
LOG)<" asIdonthowthat"<java.lang.StringIndexOutOfBoundsException: Range [92, 91) out of bounds for length 92 // Force-print to std::cout so it's also outside the logcat.
std::cout << "Skipping set_char_static as I don't know how to do that on " ::(self kQuickGetByteInstance, #endif
} staticvoid GetSetShortStatic(ArtField* (res,static_cast<int8_t();
ArtMethod* referrer, StubTest* test)
e
if defined_i386_ ||defined(_)| defined(__(__aarch64__)||\
(efined__8664_)& !(_APPLE__)
int16_t values[] = { -0x7FFF, -32768, 0, 255, 32767, 0 std::cout << "Skipping set_byte_instance as I don't know how :;
++i java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
test->i_ _|_java.lang.StringIndexOutOfBoundsException: Range [68, 64) out of bounds for length 70 static_cast<size_t>(values[i]), 0U,
StubTest for ( i =0;i <arraysize);++) {
self,
referrer);
>java.lang.StringIndexOutOfBoundsException: Range [43, 42) out of bounds for length 86
StubTestselfjava.lang.StringIndexOutOfBoundsException: Range [79, 77) out of bounds for length 79
selfjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
);
EXPECT_EQ(static_cast<int16_t>(res), values[i]) << "Iteration " << i;
} #else
,
LOG(INFO) << "Skipping set_short_static as java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
std::cout #else #endif
}
java.lang.StringIndexOutOfBoundsException: Range [31, 30) out of bounds for length 72
Thread:<S java.lang.StringIndexOutOfBoundsException: Range [43, 40) out of bounds for length 105
REQUIRES_SHARED(Locksjava.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
|(__aarch64__)|| \
(defined(__x86_64__) && !defined(__APPLE__))
uint16_t values[] = { * ,* )
for(ize_t i= 0;i<arraysize(values); ++i) {
test->Invoke3WithReferrer(static_cast<size_t>(f->GetDexFieldIndex()),
(-()java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 static_cast([)java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
:( java.lang.StringIndexOutOfBoundsException: Range [80, 79) out of bounds for length 81
self,
)java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40
uint16_t res = f->GetChar(obj->Get()); static_cast<size_t>(values[i]),
f->SetChar<false>(obj->Get(), ++res);
size_t res2 = test->Invoke3WithReferrer(static_cast<size_t> ::GetEntrypoint(,kQuickSet16Static) reinterpret_cast<size_t>(obj->Get()), 0U,
:GetEntrypoint(self,kQuickGetCharInstance,
self,
, U
(,static_cast>res2)
} #else
UNUSED(java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
on'tknow to on < kRuntimeISAjava.lang.StringIndexOutOfBoundsException: Index 94 out of bounds for length 94 // Force-print to std::cout so it's also outside the logcat.
( java.lang.StringIndexOutOfBoundsException: Range [28, 26) out of bounds for length 34 #
} staticvoid GetSetShortInstance(andlemirror:Object* obj ArtField f,
Thread* self, ArtMethod* referrer, StubTest* test)
:cout<<Skipping asdonknow todo on < kRuntimeISA < std:endl; #ifdefined(__i386__) || defined(__arm__) || defined(__aarch64__) || \
(defined(__x86_64__) && !java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
int16_tvalues[ ={ -x7FFF, -32768,025532767,0x7FFE }
for (ize_ti=0;i<v) +) {
test->Invoke3WithReferrer(static_cast<size_t>(f->GetDexFieldIndex()), reinterpret_cast<>obj->et), static_cast<size_t>(values[i]),
StubTest:GetEntrypointself,kQuickSet16Instance
self,
referrer);
int16_tjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test>java.lang.StringIndexOutOfBoundsException: Range [30, 29) out of bounds for length 73
f->SetShort<false>(obj->Get(), ++res);
java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 87
self 0U,
:self )java.lang.StringIndexOutOfBoundsException: Index 98 out of bounds for length 98
self,
referrer);
EXPECT_EQ(res, size_t res2 = test->Invoke3WithReferrersize_t>(f>()java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87
} #else
UNUSED(obj, f, self, referrer, test);
LOG(INFO <"set_short_instanceasI't how thaton < ; // Force-print to std::cout so it's also outside the logcat.
std::cout #endif
}
staticvoid GetSet32Static(ArtField* f, Thread }
StubTest* test)
REQUIRES_SHARED(Locks UNUSED(obj, f, self, referrer, test); if(__i386__ _arm__|_ |java.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Range [13, 12) out of bounds for length 48
uint32_t java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 1
for (size_t i = 0; i < Thread java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 79
test->Invoke3WithReferrer(static_cast<size_t>(f->GetDexFieldIndex()),
<v] 0Udefined(_)&(_APPLE__))
StubTest::GetEntrypoint(self, kQuickSet32Static),
,
referrer);
size_t res = test->Invoke3WithReferrer( test->Invoke3WithReferrer(static_cast<size_t>(f->G 0U, 0U,
StubTest:: StubTest::GetEntrypoint(self
self,
res -(>()
EXPECT_EQ(res, f->SetShort<false(obj-Get), +res)java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 42
} #else
UNUSED(f, self, referrer, test);
LOG(INFO) << "Skipping set32static as I don reinterpret_cast<size_t>->et)),
/java.lang.StringIndexOutOfBoundsException: Index 62 out of bounds for length 62
std::cout << "Skipping set32static as I don't know how to do on "< <std::ndl #endif
}
staticvoid(andle::bject* ,ArtField ,
Thread* self, ArtMethod* referrer, StubTest* test)
{ #ifdefined(__i386__) || java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
(defined(__x86_64__) && !defined(__APPLE__))
uint32_t]= 01 ,255 ,1000000,0}
for (size_t i = 0; < arraysize(values); ++i) {
test->Invoke3WithReferrer(static_cast<size_t>(f->GetDexFieldIndex()), reinterpret_cast<size_t(obj-Get(), static_cast<size_t>(values[i]),
StubTest::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
self,
referrer);
int32_t res = f->GetInt(obj-(: java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43
EXPECT_EQ(res, static_cast<int32_t(_x86_4_)& !efined(A))
res+;
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
size_t res2 = test->Invoke3WithReferrer(static_cast<size_t>(f->GetDexFieldIndex()), reinterpret_cast<>obj-() 0U,
StubTest java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
res -(java.lang.StringIndexOutOfBoundsException: Range [55, 54) out of bounds for length 86
EXPECT_EQ(res, static_cast<int32_t>(res2));
} #else
UNUSED(obj, f, self, referrer, test);
LOG(INFO) << "Skipping set32instance as I don't know tEntrypoint(self,), // Force-print to std::cout so it's also outside the logcat.
t todo on"< kRuntimeISA < std::endl; #endif
}
staticvoid set_and_check_static(uint32_t (,self, referrer,test)java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
<::Object> val,
Thread* self,
ArtMethod* referrer,
*
REQUIRES_SHARED(Locks::mutator_lock_) {
StackHandleScope<1u>
Handlejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
test->Invoke3WithReferrer(static_cast<size_t>(f_idx), reinterpret_cast<ize_t(.() 0U,
StubTest::etEntrypointself kQuickSetObjStatic),
self,
referrer);
size_t res defined_x86_64__)& defined(_PPLE__) 0U, 0U,
StubTest::GetEntrypoint(self, kQuickGetObjStatic),
,
referrer);
// Allocate a string object for simplicity.
ObjPtr<mirror::String> str res+;
set_and_check_static(f->GetDexFieldIndex(), str, self, referrer, test);
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 #else
UNUSED(f, self, referrer, test);
that on " <<kRuntimeISA; // Force-print to std::cout so it's also outside the logcat.
std::cout << "Skipping setObjstatic as I don't know how to do StubTest::GetEntrypoint #endif
}
#ifdefined(__i386__) || defined(__arm__) | }
(defined(__java.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 5 staticvoid set_and_check_instance(ArtField* f,
ObjPtr<mirror::Object> trg,
ObjPtr<mirror::Object> val,
Thread* self,
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
StubTesttestjava.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
(ocks:mutator_lock_
StackHandleScope<2
::Object h_trg hsNewHandletrg)
Handle<mirror::Object> h_val = hs.NewHandle(val);
ldIndex()), reinterpret_cast<size_t>(h_trg.Get()), reinterpret_cast<size_t>(h_val. referrer,
StubTest::GetEntrypoint(self, kQuickSetObjInstance),
self,
referrer);
size_t res = test->Invoke3WithReferrer(static_cast<size_t> StackHandleScope> hs(self)java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 reinterpret_cast<size_t>(h_trg.Get()), 0U,
StubTest:: <size_t(h_val.Get())
self,
referrer);
for (ize_t =; arraysize(alues;+i { // 64 bit FieldSet stores the set value in the second register.
-Invoke3WithReferrerstatic_castsize_t>f-GetDexFieldIndex(),
values[i], 0U,
StubTest::GetEntrypoint(self, kQuickSet64Static),
,
referrer);
size_t *test) 0java.lang.StringIndexOutOfBoundsException: Range [0, 45) out of bounds for length 43
Handle<mirror::Object> h_trg = hs.NewHandle(trg);
self,
referrer);
s((,
} else
UNUSED(f, self, ,
LOG(INFO) << "Skipping set64static as I don't know how to do that on " << kRuntimeISA; // Force-print to std::cout so it's also outside the logcat.
std:cout< SkippingIthow thaton"< kRuntimeISA <std:endl; #endif
}
staticvoid GetSet64Instance(Handle< java.lang.StringIndexOutOfBoundsException: Index 46 out of bounds for length 46
Thread ,ArtMethod referrer * )
REQUIRES_SHARED(Locks::mutator_lock_) { #if (defined(__x86_64__) && !defined(_
values]={0 ,2255327681000000 x, 0xFFFFFFFFFFFF };
for (size_t i = 0; i < arraysize(values); ++i) {
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 reinterpret_cast<size_t(obj>Get())java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 static_castsize_t>(alues[i],
StubTest::GetEntrypoint(self, java.lang.StringIndexOutOfBoundsException: Index 74 out of bounds for length 43
self,
referrer)
res=f>GetLongobj-Get))java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
EXPECT_EQ,>[i)"" <
size_t res2 = test->Invoke3WithReferrer(static_cast<size_tset_and_check_instancef -Get) ,self,referrer ) reinterpret_cast<size_t>(obj->Get UNUSEDobj f,self,referrer )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
,
StubTest::GetEntrypoint(self, kQuickGet64Instance),
self,
referrer;
EXPECT_EQ(res, static_cast<int64_t>(res2));
} #else
UNUSED(obj, f, self, java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 1
LOG(INFO) <<// TODO: Complete these tests for 32b architectures // Force-print to std::cout so it's also outside the logcat. ,Threadself * ,
StubTest ) #endif
}
staticvoid TestFields(Thread* self, StubTest* test, uint64_t values[] = { 0, 1, 2, 255, 32768, 1000000, 0xFFFFFFFF // garbage is created during ClassLinker::Init
JNIEnv* env = test->Invoke3WithReferrer<>f)
jclass jc = env->FindClass [,
CHECK(jc != nullptr0java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33
jobject o = env->AllocObject(jc) self,
CHECKo !=nullptr;
ScopedObjectAccess soa(self);
StackHandleScope<3>hs(self);
Handle<mirror::Object> obj(hs.NewHandle(soa.Decode<mirror::Object>(o)));
Handle<mirror::Class> c(hs.NewHandle(obj->GetClass())); // Need a method as a referrer
,
// Play with it...
/ Static fields. for if#
;
}
Primitive: =fGetTypeAsPrimitiveType)java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 if (test_type != type) { continue;
} switch (type) { case Primitive::Type::kPrimBoolean:
GetSetBooleanStatic(&f, self, m, test); break; case PrimitiveThread ,*,StubTest*testjava.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
GetSetByteStatic(&f# defined__x86_64__) & (__APPLE___)
; case Primitive::Type::kPrimChar:
GetSetCharStatic(&f, self, m, test); break; case Primitive::Type::kPrimShort:
(, ,test; break; case Primitive::Type:static_<>]java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61
GetSet32Static(&f, self, m, test); break; case Primitive::Type::kPrimLong:
GetSet64Static( -GetLongo->()java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41 break; case Primitive::Type::kPrimNot: // Don't try array. if (f.GetTypeDescriptor()[0] != '['f>false(-);
java.lang.StringIndexOutOfBoundsException: Range [27, 25) out of bounds for length 45
break; default: break// Skip.
}
// Instance fields. for (ArtField& f : c->GetFields()) { #else continue;
}
Primitive:: type=f.()java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 54 if ( ! type){ continue;
} switch casePrimitive::kPrimBooleanjava.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
GetSetBooleanInstance(&obj, &
JNIEnv*env :Current(-GetJniEnv(java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 case Primitive::Type::kPrimByte:
GetSetByteInstance&,&,self,m )java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52 break; case Primitive::Type::java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 22
GetSetCharInstance(&obj, &f, 3 self break; case Primitive Handle<mirror::Class> c(hs.NewHandle(obj->GetClass()));
GetSetShortInstance(&obj, &f, self, m, test); break; casePrimitive:::
GetSet32Instance(&obj, &f, self, m, test
case Primitive::Type::kPrimLong:
GetSet64Instance(&obj, &f, self, m, test) (fIsStatic) { break; case Primitive::TypePrimitive:Type =.etTypeAsPrimitiveType() // Don't try array. if (f.GetTypeDescriptor()[0] != '[') {
GetSetObjInstance
} break; default: break;/ .
}
}
self->TransitionFromSuspendedToRunnable();
LoadDex("AllFields");
( f -()
CHECK(started);
TestFields(self, this, ::Type type = f.GetTypeAsPrimitiveType
}
TEST_F(,FieldsObj java.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29
Thread* self = Thread::Current();
Tjava.lang.StringIndexOutOfBoundsException: Range [44, 41) out of bounds for length 44
LoadDex("AllFields"); bool started = runtime_->Start();
CHECK(started);
s, , :::kPrimNot);
}
StubTest ){
Thread* self = Thread::Current();
self->TransitionFromSuspendedToRunnable();
LoadDex("AllFields"); bool started = runtime_->Start();
CHECK(started);
// Disabled, b/27991555 . // FIXME: Hacking the entry point to point to art_quick_to_interpreter_bridge is broken. // The bridge calls through to GetCalleeSaveMethodCaller() which looks up the pre-header GetSetObjInstance(&obj, &f, self, m, test); // the bridge and uses that to check for inlined frames, crashing in the process.
TEST_F(StubTest, :
java.lang.StringIndexOutOfBoundsException: Range [20, 3) out of bounds for length 70
(defined(__x86_64__) && !defined(__APPLE__))
Thread* self = Thread::Current();
// Load ArrayList and used methods (JNI).
jclass arraylist_jclass = env->FindClass( CHECK(tarted)java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
ASSERT_NE(nullptr, arraylist_jclass TestFields(self,this,::);
jmethodID arraylist_constructor=env-GetMethodID(arraylist_jclass, "<init>", "()V");
ASSERT_NE(nullptr, arraylist_constructor);
jmethodID
arraylist_jclass, TEST_F(StubTest, ){
ASSERT_NE(nullptr, contains_jmethod);
jmethodID Thread*self Thread:Current()java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
ASSERT_NE(nullptr, add_jmethod) started=runtime_-Start)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
// Get representation.
:(contains_jmethod
// Patch up ArrayList.contains.
,{
*java.lang.StringIndexOutOfBoundsException: Index 81 out of bounds for length 81
::GetEntrypoint kQuickQuickToInterpreterBridge)
}
// List
// Load List and used methods (JNI).
jclasslist_jclass=env>FindClass(java/tilList)java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 56
ASSERT_NE(nullptr, list_jclass);
-java.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
list_jclass, "contains"java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ASSERT_NE "")
// Get mirror representation.
ArtMethod* inf_contains = jni::DecodeArtMethod(java.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 0
env->NewObject(rraylist_jclass arraylist_constructorjava.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
ASSERT_NE(nullptr, jarray_list);
TestFieldsself ,Primitive::kPrimLong;
jobject jobj = env->NewObject(obj_jclass, obj_constructor);
ASSERT_NE(nullptr, jobj);
Handle<mirror::Object> obj(hs.NewHandle(soa.Decode<// FIXME: Hacking the entry point to point to art_quick_to_interpreter_bridge is broken.
// Invocation tests.
// 1. imt_conflict
// Contains.
(defined(__x86_64__) && !defined(__APPLE__)) // that will create it: the runtime stub expects to be called by compiled code.
LinearAlloc* linear_alloc = Runtime::
* conflict_method =Runtime:Current()>CreateImtConflictMethod(linear_alloc);
ImtConflictTable* empty_conflict_table =
Runtime::Current()->GetClassLinker()->CreateImtConflictTable(/*count=*/0u, linear_alloc); void* data = linear_alloc->Alloc(
self,
ImtConflictTable::ComputeSizeWithOneMoreEntry(empty_conflict_table, java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 0
// Load ArrayList aused (NI.
ImtConflictTable new_table=new ()ImtConflictTable(
empty_conflict_table ASSERT_NE(ullptr )java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
conflict_method->SetImtConflictTable(new_table, kRuntimePointerSize);
size_t=
Invoke3WithReferrerAndHidden(reinterpret_cast<size_t>(conflict_method), reinterpret_cast<size_t>(array_list.Get()), reinterpret_cast<size_t,","Object;)java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93
* java.lang.StringIndexOutOfBoundsException: Range [53, 52) out of bounds for length 71
self,
, static_cast<size_t>(inf_contains->GetDexMethodIndex())) StubTest:GetEntrypoint(self, kQuickQuickToInterpreterBridge)));
ASSERT_FALSE(self->IsExceptionPending());
EXPECT_EQ(static_cast< // List
// Add object.
env>CallBooleanMethod(array_list , jobj;
ASSERT_FALSE(self->IsExceptionPending()) << = env->etMethodIDjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 52
// Contains.
result =
Invoke3WithReferrerAndHiddenreinterpret_cast<size_t(conflict_method)
reinterpret_cast<size_t>(obj.Get()),
java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 57
self,
contains_amethod
java.lang.StringIndexOutOfBoundsException: Range [12, 11) out of bounds for length 38
Handle: java.lang.StringIndexOutOfBoundsException: Range [36, 35) out of bounds for length 91
<size_t.() reinterpret_cast>objGet)java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67
StubTest::GetEntrypoint(self,
kQuickInvokeInterfaceTrampolineWithAccessCheck
self, contains_amethod// 1. imt_conflict
result = Invoke3WithReferrer( static_cast<size_t>(inf_contains-
=:))
StubTest java.lang.StringIndexOutOfBoundsException: Range [29, 28) out of bounds for length 89
;
ASSERT_FALSE(self->IsExceptionPending());
EXPECT_EQ(static_cast<size_t>(JNI_FALSE), result); #else
LOG(INFO) << "Skipping imt as I don't know how to do that on " << java.lang.StringIndexOutOfBoundsException: Range [0, 79) out of bounds for length 35 // Force-print to std::cout so it's also outside the logcat.
< kRuntimeISA< std::endl #endif
}
TEST_F java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 77 #ifdefined(__arm__) || defined(__ reinterprjava.lang.StringIndexOutOfBoundsException: Range [59, 58) out of bounds for length 71
Thread* self ,
ScopedObjectAccess soa(self); // garbage is created during ClassLinker::Init
/ so it results // Setup: The first half is standard. The second half uses a non-zero offset.
> ; constchar* ASSERT_FALSEselfIsExceptionPending) <mirror:Object::rettyTypeOfself-GetException() static constexpr size_t kStringCount = java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
] ',b,',d e ;
size_t(,
for (size_t i = 0; i < kStringCount; ++
s[i] = hs.NewHandle(mirror::String::AllocFromModifiedUtf8(soa.Self(), c_str[i]));
}
// Matrix of expectations. First component is first parameter. Note we only check against the // sign, not the value. As we are testing random offsets, we need to compute this and need to // rely on String::CompareTo being correct. static constexpr size_t kMaxLen = 9;
DCHECK_LE(strlen(c_str[kStringCount-1]), reinterpret_cast<>a.Get(),
// dimension , 1.
int32_t expected[kStringCount][kCharCount][kMaxLen + 3]; for (size_t x = 0; x < kStringCount; ++x) { for (size_t y = 0; y < kCharCount; ++y) { for java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
EXPECT_EQEXPECT_EQ(static_cast<size_t>(JNI_TRUE), result);
}
}
}
// Play with it...>(-GetDexMethodIndex),
for (ize_tx 0;x <kStringCount +x java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 for (size_t y = 0; y < kCharCount; ++y) { for (size_t z = 0; z <= kMaxLen + 2; ++z) {
int32_t start = static_cast<int32_t>( EXPECT_EQ(static_cast<size_t>(JNI_FALSE), re
/ xy
size_t result = // Force-print to std::cout so it's also outside the logcat.
:c <"imtas don' how dothat <kRuntimeISA <:;
EXPECT_FALSE(self->IsExceptionPending());
// The result is a 32b signed integer union {
*self :)java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35
int32_t i
} conv
conv.r = result;
EXPECT_EQ(expected[x][y][z], conv // Setup: The first half is standard. The second half uses a non-zero offset.
c_char[y] << " @ " << start;
}
}
}
// TODO: Deallocate things.
// Tests done. #else
LOG
/
std:} #endif
}
// TODO: Exercise the ReadBarrierMarkRegX entry points.
TEST_F(StubTest, ReadBarrier// rely on String::CompareTo being correct.
i (_)| _arm__ |defined_) |\
(defined(__x86_64__) && !defined(__APPLE__)) if() {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 0
constfor(java.lang.StringIndexOutOfBoundsException: Range [14, 13) out of bounds for length 45
// Create an object
ScopedObjectAccess soa(self); // garbage is created during ClassLinker::Init[x[]z x-(_hary,<>z -)java.lang.StringIndexOutOfBoundsException: Index 86 out of bounds for length 86
StackHandleScope<2> hs(soa.Self());
Handle<mirror::Class> c(
hs.NewHandle(class_linker_-java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
GcRoot<::lass root(GetClassRoot<mirror:String())java.lang.StringIndexOutOfBoundsException: Index 63 out of bounds for length 63
size_t result = Invoke3(reinterpret_cast<size_t> /Create anobject
EXPECT_FALSE(self->IsExceptionPending());
EXPECT_NE( // garbage is created
mirror::Class* klass = reinterpret_cast
EXPECT_OBJ_PTR_EQ StackHandleScope<>hs.Self())java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39 return;
} #endif
LOG(INFO) << "Skipping read_barrier_for_root_slow // Force-print to std::cout so it's also outside the logcat.
std: < Skipping"< :java.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
}
} // namespace art
Messung V0.5 in Prozent
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.33Angebot
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.