Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index da27fdf0509088cd0caf56ce00e8a20997579ef6..71ce856169ad6bcf185b3c02b9b9d9aaec1fbd20 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -2538,7 +2538,10 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreElement(Map* receiver_map) { |
// -- rsp[0] : return address |
// ----------------------------------- |
Code* stub; |
- MaybeObject* maybe_stub = ComputeSharedKeyedStoreElementStub(receiver_map); |
+ JSObject::ElementsKind elements_kind = receiver_map->elements_kind(); |
+ bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
+ MaybeObject* maybe_stub = |
+ KeyedStoreElementStub(is_js_array, elements_kind).TryGetCode(); |
if (!maybe_stub->To(&stub)) return maybe_stub; |
__ DispatchMap(rdx, |
Handle<Map>(receiver_map), |
@@ -2994,7 +2997,8 @@ MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) { |
// -- rsp[0] : return address |
// ----------------------------------- |
Code* stub; |
- MaybeObject* maybe_stub = ComputeSharedKeyedLoadElementStub(receiver_map); |
+ JSObject::ElementsKind elements_kind = receiver_map->elements_kind(); |
+ MaybeObject* maybe_stub = KeyedLoadElementStub(elements_kind).TryGetCode(); |
if (!maybe_stub->To(&stub)) return maybe_stub; |
__ DispatchMap(rdx, |
Handle<Map>(receiver_map), |
@@ -3177,6 +3181,51 @@ MaybeObject* ConstructStubCompiler::CompileConstructStub(JSFunction* function) { |
#define __ ACCESS_MASM(masm) |
+void KeyedLoadStubCompiler::GenerateLoadDictionaryElement( |
+ MacroAssembler* masm) { |
+ // ----------- S t a t e ------------- |
+ // -- rax : key |
+ // -- rdx : receiver |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ Label slow, miss_force_generic; |
+ |
+ // This stub is meant to be tail-jumped to, the receiver must already |
+ // have been verified by the caller to not be a smi. |
+ |
+ __ JumpIfNotSmi(rax, &miss_force_generic); |
+ __ SmiToInteger32(rbx, rax); |
+ __ movq(rcx, FieldOperand(rdx, JSObject::kElementsOffset)); |
+ |
+ // Check whether the elements is a number dictionary. |
+ // rdx: receiver |
+ // rax: key |
+ // rbx: key as untagged int32 |
+ // rcx: elements |
+ __ LoadFromNumberDictionary(&slow, rcx, rax, rbx, r9, rdi, rax); |
+ __ ret(0); |
+ |
+ __ bind(&slow); |
+ // ----------- S t a t e ------------- |
+ // -- rax : key |
+ // -- rdx : receiver |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ Handle<Code> slow_ic = |
+ masm->isolate()->builtins()->KeyedLoadIC_Slow(); |
+ __ jmp(slow_ic, RelocInfo::CODE_TARGET); |
+ |
+ __ bind(&miss_force_generic); |
+ // ----------- S t a t e ------------- |
+ // -- rax : key |
+ // -- rdx : receiver |
+ // -- rsp[0] : return address |
+ // ----------------------------------- |
+ Handle<Code> miss_ic = |
+ masm->isolate()->builtins()->KeyedLoadIC_MissForceGeneric(); |
+ __ jmp(miss_ic, RelocInfo::CODE_TARGET); |
+} |
+ |
void KeyedLoadStubCompiler::GenerateLoadExternalArray( |
MacroAssembler* masm, |
JSObject::ElementsKind elements_kind) { |