Index: src/x64/stub-cache-x64.cc |
diff --git a/src/x64/stub-cache-x64.cc b/src/x64/stub-cache-x64.cc |
index 45d610bc4c018c7c420989834fb4a49c9a23a060..f63a92521952766ae9657874a67332d0e034bbda 100644 |
--- a/src/x64/stub-cache-x64.cc |
+++ b/src/x64/stub-cache-x64.cc |
@@ -2530,24 +2530,15 @@ MaybeObject* KeyedStoreStubCompiler::CompileStoreField(JSObject* object, |
} |
-MaybeObject* KeyedStoreStubCompiler::CompileStoreElement( |
- Map* receiver_map) { |
+MaybeObject* KeyedStoreStubCompiler::CompileStoreElement(Map* receiver_map) { |
// ----------- S t a t e ------------- |
// -- rax : value |
// -- rcx : key |
// -- rdx : receiver |
// -- rsp[0] : return address |
// ----------------------------------- |
- MaybeObject* maybe_stub; |
- if (receiver_map->has_fast_elements()) { |
- bool is_js_array = receiver_map->instance_type() == JS_ARRAY_TYPE; |
- maybe_stub = KeyedStoreFastElementStub(is_js_array).TryGetCode(); |
- } else { |
- ASSERT(receiver_map->has_external_array_elements()); |
- JSObject::ElementsKind elements_kind = receiver_map->elements_kind(); |
- maybe_stub = KeyedStoreExternalArrayStub(elements_kind).TryGetCode(); |
- } |
Code* stub; |
+ MaybeObject* maybe_stub = ComputeSharedKeyedStoreElementStub(receiver_map); |
if (!maybe_stub->To(&stub)) return maybe_stub; |
__ DispatchMap(rdx, |
Handle<Map>(receiver_map), |
@@ -3002,15 +2993,8 @@ MaybeObject* KeyedLoadStubCompiler::CompileLoadElement(Map* receiver_map) { |
// -- rdx : receiver |
// -- rsp[0] : return address |
// ----------------------------------- |
- MaybeObject* maybe_stub; |
- if (receiver_map->has_fast_elements()) { |
- maybe_stub = KeyedLoadFastElementStub().TryGetCode(); |
- } else { |
- ASSERT(receiver_map->has_external_array_elements()); |
- JSObject::ElementsKind elements_kind = receiver_map->elements_kind(); |
- maybe_stub = KeyedLoadExternalArrayStub(elements_kind).TryGetCode(); |
- } |
Code* stub; |
+ MaybeObject* maybe_stub = ComputeSharedKeyedLoadElementStub(receiver_map); |
if (!maybe_stub->To(&stub)) return maybe_stub; |
__ DispatchMap(rdx, |
Handle<Map>(receiver_map), |