Chromium Code Reviews| Index: src/runtime.cc |
| diff --git a/src/runtime.cc b/src/runtime.cc |
| index 0726b3d68aea560e6603f98980a61070e42d458f..7f835f67c35cd554af352d2080be62e5699bb930 100644 |
| --- a/src/runtime.cc |
| +++ b/src/runtime.cc |
| @@ -4669,7 +4669,7 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StoreArrayLiteralElement) { |
| HandleScope scope; |
| Object* raw_boilerplate_object = literals->get(literal_index); |
| - Handle<JSArray> boilerplate_object(JSArray::cast(raw_boilerplate_object)); |
| + Handle<JSArray> boilerplate(JSArray::cast(raw_boilerplate_object)); |
| #if DEBUG |
| ElementsKind elements_kind = object->GetElementsKind(); |
| #endif |
| @@ -4680,19 +4680,25 @@ RUNTIME_FUNCTION(MaybeObject*, Runtime_StoreArrayLiteralElement) { |
| if (value->IsNumber()) { |
| ASSERT(elements_kind == FAST_SMI_ONLY_ELEMENTS); |
| JSObject::TransitionElementsKind(object, FAST_DOUBLE_ELEMENTS); |
| - JSObject::TransitionElementsKind(boilerplate_object, FAST_DOUBLE_ELEMENTS); |
| + if (IsMoreGeneralElementsKindTransition(boilerplate->GetElementsKind(), |
| + FAST_DOUBLE_ELEMENTS)) { |
| + ASSERT(elements_kind == boilerplate->GetElementsKind()); |
|
danno
2012/04/03 16:38:10
This assertion isn't needed and misleading now (si
Michael Starzinger
2012/04/03 16:55:03
Done.
|
| + JSObject::TransitionElementsKind(boilerplate, FAST_DOUBLE_ELEMENTS); |
| + } |
| ASSERT(object->GetElementsKind() == FAST_DOUBLE_ELEMENTS); |
| - FixedDoubleArray* double_array = |
| - FixedDoubleArray::cast(object->elements()); |
| + FixedDoubleArray* double_array = FixedDoubleArray::cast(object->elements()); |
| HeapNumber* number = HeapNumber::cast(*value); |
| double_array->set(store_index, number->Number()); |
| } else { |
| ASSERT(elements_kind == FAST_SMI_ONLY_ELEMENTS || |
| elements_kind == FAST_DOUBLE_ELEMENTS); |
| JSObject::TransitionElementsKind(object, FAST_ELEMENTS); |
| - JSObject::TransitionElementsKind(boilerplate_object, FAST_ELEMENTS); |
| - FixedArray* object_array = |
| - FixedArray::cast(object->elements()); |
| + if (IsMoreGeneralElementsKindTransition(boilerplate->GetElementsKind(), |
| + FAST_ELEMENTS)) { |
| + ASSERT(elements_kind == boilerplate->GetElementsKind()); |
|
danno
2012/04/03 16:38:10
This will assert when elements_kind is FAST_SMI_ON
Michael Starzinger
2012/04/03 16:55:03
Done.
|
| + JSObject::TransitionElementsKind(boilerplate, FAST_ELEMENTS); |
| + } |
| + FixedArray* object_array = FixedArray::cast(object->elements()); |
| object_array->set(store_index, *value); |
| } |
| return *object; |