| Index: src/hydrogen.cc
|
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc
|
| index b3f428cb3a793ffbb2c940fd7040cda7d65b1c54..dc60756bdad4198626c75d0cae436983c60459bc 100644
|
| --- a/src/hydrogen.cc
|
| +++ b/src/hydrogen.cc
|
| @@ -3901,7 +3901,9 @@ HInstruction* HGraphBuilder::BuildMonomorphicElementAccess(HValue* object,
|
| bool is_store) {
|
| ASSERT(expr->IsMonomorphic());
|
| Handle<Map> map = expr->GetMonomorphicReceiverType();
|
| - if (!map->has_fast_elements() && !map->has_external_array_elements()) {
|
| + if (!map->has_fast_elements() &&
|
| + !map->has_fast_double_elements() &&
|
| + !map->has_external_array_elements()) {
|
| return is_store ? BuildStoreKeyedGeneric(object, key, val)
|
| : BuildLoadKeyedGeneric(object, key);
|
| }
|
| @@ -3920,7 +3922,7 @@ HInstruction* HGraphBuilder::BuildMonomorphicElementAccess(HValue* object,
|
| return BuildExternalArrayElementAccess(external_elements, checked_key,
|
| val, map->elements_kind(), is_store);
|
| }
|
| - ASSERT(map->has_fast_elements());
|
| + ASSERT(map->has_fast_elements() || map->has_fast_double_elements());
|
| if (map->instance_type() == JS_ARRAY_TYPE) {
|
| length = AddInstruction(new(zone()) HJSArrayLength(object));
|
| checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length));
|
| @@ -3930,10 +3932,21 @@ HInstruction* HGraphBuilder::BuildMonomorphicElementAccess(HValue* object,
|
| length = AddInstruction(new(zone()) HFixedArrayLength(elements));
|
| checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length));
|
| }
|
| + bool fast_double_elements = map->has_fast_double_elements();
|
| if (is_store) {
|
| - return new(zone()) HStoreKeyedFastElement(elements, checked_key, val);
|
| + if (fast_double_elements) {
|
| + return new(zone()) HStoreKeyedFastDoubleElement(elements,
|
| + checked_key,
|
| + val);
|
| + } else {
|
| + return new(zone()) HStoreKeyedFastElement(elements, checked_key, val);
|
| + }
|
| } else {
|
| - return new(zone()) HLoadKeyedFastElement(elements, checked_key);
|
| + if (fast_double_elements) {
|
| + return new(zone()) HLoadKeyedFastDoubleElement(elements, checked_key);
|
| + } else {
|
| + return new(zone()) HLoadKeyedFastElement(elements, checked_key);
|
| + }
|
| }
|
| }
|
|
|
| @@ -3966,8 +3979,6 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
|
| todo_external_array = true;
|
| }
|
| }
|
| - // Support for FAST_DOUBLE_ELEMENTS isn't implemented yet, so we deopt.
|
| - type_todo[JSObject::FAST_DOUBLE_ELEMENTS] = false;
|
|
|
| HBasicBlock* join = graph()->CreateBasicBlock();
|
|
|
| @@ -4016,7 +4027,8 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
|
|
|
| set_current_block(if_true);
|
| HInstruction* access;
|
| - if (elements_kind == JSObject::FAST_ELEMENTS) {
|
| + if (elements_kind == JSObject::FAST_ELEMENTS ||
|
| + elements_kind == JSObject::FAST_DOUBLE_ELEMENTS) {
|
| HBasicBlock* if_jsarray = graph()->CreateBasicBlock();
|
| HBasicBlock* if_fastobject = graph()->CreateBasicBlock();
|
| HHasInstanceTypeAndBranch* typecheck =
|
| @@ -4032,12 +4044,26 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
|
| checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length));
|
| elements = AddInstruction(new(zone()) HLoadElements(object));
|
| elements->ClearFlag(HValue::kUseGVN);
|
| + bool fast_double_elements =
|
| + elements_kind == JSObject::FAST_DOUBLE_ELEMENTS;
|
| if (is_store) {
|
| - access = AddInstruction(
|
| - new(zone()) HStoreKeyedFastElement(elements, checked_key, val));
|
| + if (fast_double_elements) {
|
| + access = AddInstruction(
|
| + new(zone()) HStoreKeyedFastDoubleElement(elements,
|
| + checked_key,
|
| + val));
|
| + } else {
|
| + access = AddInstruction(
|
| + new(zone()) HStoreKeyedFastElement(elements, checked_key, val));
|
| + }
|
| } else {
|
| - access = AddInstruction(
|
| - new(zone()) HLoadKeyedFastElement(elements, checked_key));
|
| + if (fast_double_elements) {
|
| + access = AddInstruction(
|
| + new(zone()) HLoadKeyedFastDoubleElement(elements, checked_key));
|
| + } else {
|
| + access = AddInstruction(
|
| + new(zone()) HLoadKeyedFastElement(elements, checked_key));
|
| + }
|
| Push(access);
|
| }
|
| *has_side_effects |= access->HasSideEffects();
|
| @@ -4052,11 +4078,23 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object,
|
| length = AddInstruction(new(zone()) HFixedArrayLength(elements));
|
| checked_key = AddInstruction(new(zone()) HBoundsCheck(key, length));
|
| if (is_store) {
|
| - access = AddInstruction(
|
| - new(zone()) HStoreKeyedFastElement(elements, checked_key, val));
|
| + if (fast_double_elements) {
|
| + access = AddInstruction(
|
| + new(zone()) HStoreKeyedFastDoubleElement(elements,
|
| + checked_key,
|
| + val));
|
| + } else {
|
| + access = AddInstruction(
|
| + new(zone()) HStoreKeyedFastElement(elements, checked_key, val));
|
| + }
|
| } else {
|
| - access = AddInstruction(
|
| - new(zone()) HLoadKeyedFastElement(elements, checked_key));
|
| + if (fast_double_elements) {
|
| + access = AddInstruction(
|
| + new(zone()) HLoadKeyedFastDoubleElement(elements, checked_key));
|
| + } else {
|
| + access = AddInstruction(
|
| + new(zone()) HLoadKeyedFastElement(elements, checked_key));
|
| + }
|
| }
|
| } else if (elements_kind == JSObject::DICTIONARY_ELEMENTS) {
|
| if (is_store) {
|
|
|