OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/runtime/runtime-utils.h" | 5 #include "src/runtime/runtime-utils.h" |
6 | 6 |
7 #include "src/allocation-site-scopes.h" | 7 #include "src/allocation-site-scopes.h" |
8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
9 #include "src/ast.h" | 9 #include "src/ast.h" |
10 #include "src/isolate-inl.h" | 10 #include "src/isolate-inl.h" |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 DCHECK(IsFastDoubleElementsKind(object->GetElementsKind())); | 417 DCHECK(IsFastDoubleElementsKind(object->GetElementsKind())); |
418 FixedDoubleArray* double_array = FixedDoubleArray::cast(object->elements()); | 418 FixedDoubleArray* double_array = FixedDoubleArray::cast(object->elements()); |
419 HeapNumber* number = HeapNumber::cast(*value); | 419 HeapNumber* number = HeapNumber::cast(*value); |
420 double_array->set(store_index, number->Number()); | 420 double_array->set(store_index, number->Number()); |
421 } else { | 421 } else { |
422 if (!IsFastObjectElementsKind(elements_kind)) { | 422 if (!IsFastObjectElementsKind(elements_kind)) { |
423 ElementsKind transitioned_kind = IsFastHoleyElementsKind(elements_kind) | 423 ElementsKind transitioned_kind = IsFastHoleyElementsKind(elements_kind) |
424 ? FAST_HOLEY_ELEMENTS | 424 ? FAST_HOLEY_ELEMENTS |
425 : FAST_ELEMENTS; | 425 : FAST_ELEMENTS; |
426 JSObject::TransitionElementsKind(object, transitioned_kind); | 426 JSObject::TransitionElementsKind(object, transitioned_kind); |
427 ElementsKind boilerplate_elements_kind = | 427 if (IsMoreGeneralElementsKindTransition( |
428 boilerplate_object->GetElementsKind(); | 428 boilerplate_object->GetElementsKind(), transitioned_kind)) { |
429 if (IsMoreGeneralElementsKindTransition(boilerplate_elements_kind, | |
430 transitioned_kind)) { | |
431 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind); | 429 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind); |
432 } | 430 } |
433 } | 431 } |
434 FixedArray* object_array = FixedArray::cast(object->elements()); | 432 FixedArray* object_array = FixedArray::cast(object->elements()); |
435 object_array->set(store_index, *value); | 433 object_array->set(store_index, *value); |
436 } | 434 } |
437 return *object; | 435 return *object; |
438 } | 436 } |
439 } // namespace internal | 437 } // namespace internal |
440 } // namespace v8 | 438 } // namespace v8 |
OLD | NEW |