Index: src/arm/stub-cache-arm.cc |
diff --git a/src/arm/stub-cache-arm.cc b/src/arm/stub-cache-arm.cc |
index 97097c8478129f5db27df5da2d41c5bfc814e425..c7fef2fa428b4dd8e7c23e6348a9a580db1519aa 100644 |
--- a/src/arm/stub-cache-arm.cc |
+++ b/src/arm/stub-cache-arm.cc |
@@ -3128,7 +3128,9 @@ MaybeObject* KeyedLoadStubCompiler::CompileLoadFunctionPrototype(String* name) { |
} |
-MaybeObject* KeyedLoadStubCompiler::CompileLoadSpecialized(JSObject* receiver) { |
+MaybeObject* KeyedLoadStubCompiler::CompileLoadSpecialized( |
+ JSObject* receiver, |
+ ZoneMapList* receiver_maps) { |
// ----------- S t a t e ------------- |
// -- lr : return address |
// -- r0 : key |
@@ -3457,21 +3459,21 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedLoadStub( |
// -- r0 : key |
// -- r1 : receiver |
// ----------------------------------- |
- Label slow, failed_allocation; |
+ Label slow, failed_allocation, miss; |
Register key = r0; |
Register receiver = r1; |
// Check that the object isn't a smi |
- __ JumpIfSmi(receiver, &slow); |
+ __ JumpIfSmi(receiver, &miss); |
// Check that the key is a smi. |
- __ JumpIfNotSmi(key, &slow); |
+ __ JumpIfNotSmi(key, &miss); |
// Make sure that we've got the right map. |
__ ldr(r2, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
__ cmp(r2, Operand(Handle<Map>(receiver_object->map()))); |
- __ b(ne, &slow); |
+ __ b(ne, &miss); |
__ ldr(r3, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
// r3: elements array |
@@ -3480,7 +3482,7 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedLoadStub( |
__ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset)); |
__ cmp(ip, Operand(key, ASR, kSmiTagSize)); |
// Unsigned comparison catches both negative and too-large values. |
- __ b(lo, &slow); |
+ __ b(lo, &miss); |
__ ldr(r3, FieldMemOperand(r3, ExternalArray::kExternalPointerOffset)); |
// r3: base pointer of external storage |
@@ -3753,9 +3755,19 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedLoadStub( |
// -- r1 : receiver |
// ----------------------------------- |
- __ Push(r1, r0); |
+ Handle<Code> ic = isolate()->builtins()->KeyedLoadIC_Slow(); |
+ __ Jump(ic, RelocInfo::CODE_TARGET); |
- __ TailCallRuntime(Runtime::kKeyedGetProperty, 2, 1); |
+ // Slow case: Jump to runtime. |
+ __ bind(&miss); |
+ // ----------- S t a t e ------------- |
+ // -- lr : return address |
+ // -- r0 : key |
+ // -- r1 : receiver |
+ // ----------------------------------- |
+ |
+ Handle<Code> miss_ic = isolate()->builtins()->KeyedLoadIC_Miss(); |
+ __ Jump(miss_ic, RelocInfo::CODE_TARGET); |
return GetCode(flags); |
} |
@@ -3771,7 +3783,7 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub( |
// -- r2 : receiver |
// -- lr : return address |
// ----------------------------------- |
- Label slow, check_heap_number; |
+ Label slow, check_heap_number, miss; |
// Register usage. |
Register value = r0; |
@@ -3780,24 +3792,24 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub( |
// r3 mostly holds the elements array or the destination external array. |
// Check that the object isn't a smi. |
- __ JumpIfSmi(receiver, &slow); |
+ __ JumpIfSmi(receiver, &miss); |
// Make sure that we've got the right map. |
__ ldr(r3, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
__ cmp(r3, Operand(Handle<Map>(receiver_object->map()))); |
- __ b(ne, &slow); |
+ __ b(ne, &miss); |
__ ldr(r3, FieldMemOperand(receiver, JSObject::kElementsOffset)); |
// Check that the key is a smi. |
- __ JumpIfNotSmi(key, &slow); |
+ __ JumpIfNotSmi(key, &miss); |
// Check that the index is in range |
__ SmiUntag(r4, key); |
__ ldr(ip, FieldMemOperand(r3, ExternalArray::kLengthOffset)); |
__ cmp(r4, ip); |
// Unsigned comparison catches both negative and too-large values. |
- __ b(hs, &slow); |
+ __ b(hs, &miss); |
// Handle both smis and HeapNumbers in the fast path. Go to the |
// runtime for all other kinds of values. |
@@ -4074,8 +4086,11 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub( |
} |
} |
- // Slow case: call runtime. |
+ // Slow case, key and receiver still in r0 and r1. |
__ bind(&slow); |
+ __ IncrementCounter( |
+ masm()->isolate()->counters()->keyed_store_external_array_slow(), |
+ 1, r3, r4); |
// Entry registers are intact. |
// ---------- S t a t e -------------- |
@@ -4085,15 +4100,23 @@ MaybeObject* ExternalArrayStubCompiler::CompileKeyedStoreStub( |
// -- lr : return address |
// ----------------------------------- |
- // Push receiver, key and value for runtime call. |
- __ Push(r2, r1, r0); |
+ bool strict = (Code::ExtractExtraICStateFromFlags(flags) & kStrictMode) != 0; |
+ Handle<Code> ic = strict |
+ ? isolate()->builtins()->KeyedStoreIC_Slow_Strict() |
+ : isolate()->builtins()->KeyedStoreIC_Slow_NonStrict(); |
+ __ Jump(ic, RelocInfo::CODE_TARGET); |
- __ mov(r1, Operand(Smi::FromInt(NONE))); // PropertyAttributes |
- __ mov(r0, Operand(Smi::FromInt( |
- Code::ExtractExtraICStateFromFlags(flags) & kStrictMode))); |
- __ Push(r1, r0); |
+ // Miss case: call runtime. |
+ __ bind(&miss); |
+ // ----------- S t a t e ------------- |
+ // -- r0 : value |
+ // -- r1 : key |
+ // -- r2 : receiver |
+ // -- lr : return address |
+ // ----------------------------------- |
- __ TailCallRuntime(Runtime::kSetProperty, 5, 1); |
+ Handle<Code> miss_ic = isolate()->builtins()->KeyedStoreIC_Miss(); |
+ __ Jump(miss_ic, RelocInfo::CODE_TARGET); |
return GetCode(flags); |
} |