Index: src/objects.cc |
diff --git a/src/objects.cc b/src/objects.cc |
index c764b33e6793ee169d0866318e19483a888e4b08..987d88139742c85065d16d1013780504423779af 100644 |
--- a/src/objects.cc |
+++ b/src/objects.cc |
@@ -11231,6 +11231,7 @@ MaybeObject* JSObject::SetFastDoubleElementsCapacityAndLength( |
} |
ElementsKind elements_kind = GetElementsKind(); |
+ CHECK(elements_kind != SLOPPY_ARGUMENTS_ELEMENTS); |
ElementsKind new_elements_kind = elements_kind; |
if (IsHoleyElementsKind(elements_kind)) { |
new_elements_kind = FAST_HOLEY_DOUBLE_ELEMENTS; |
@@ -11250,13 +11251,9 @@ MaybeObject* JSObject::SetFastDoubleElementsCapacityAndLength( |
accessor->CopyElements(this, elems, elements_kind); |
if (maybe_obj->IsFailure()) return maybe_obj; |
} |
- if (elements_kind != SLOPPY_ARGUMENTS_ELEMENTS) { |
- ValidateElements(); |
- set_map_and_elements(new_map, elems); |
- } else { |
- FixedArray* parameter_map = FixedArray::cast(old_elements); |
- parameter_map->set(1, elems); |
- } |
+ |
+ ValidateElements(); |
+ set_map_and_elements(new_map, elems); |
if (FLAG_trace_elements_transitions) { |
PrintElementsTransition(stdout, elements_kind, old_elements, |
@@ -13122,6 +13119,7 @@ bool JSObject::ShouldConvertToFastElements() { |
bool JSObject::ShouldConvertToFastDoubleElements( |
bool* has_smi_only_elements) { |
*has_smi_only_elements = false; |
+ if (HasSloppyArgumentsElements()) return false; |
if (FLAG_unbox_double_arrays) { |
ASSERT(HasDictionaryElements()); |
SeededNumberDictionary* dictionary = element_dictionary(); |