| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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 <stdlib.h> | 5 #include <stdlib.h> |
| 6 #include <limits> | 6 #include <limits> |
| 7 | 7 |
| 8 #include "src/v8.h" | 8 #include "src/v8.h" |
| 9 | 9 |
| 10 #include "src/accessors.h" | 10 #include "src/accessors.h" |
| (...skipping 5542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5553 boilerplate_object->GetElementsKind(), | 5553 boilerplate_object->GetElementsKind(), |
| 5554 transitioned_kind)) { | 5554 transitioned_kind)) { |
| 5555 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind); | 5555 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind); |
| 5556 } | 5556 } |
| 5557 JSObject::TransitionElementsKind(object, transitioned_kind); | 5557 JSObject::TransitionElementsKind(object, transitioned_kind); |
| 5558 ASSERT(IsFastDoubleElementsKind(object->GetElementsKind())); | 5558 ASSERT(IsFastDoubleElementsKind(object->GetElementsKind())); |
| 5559 FixedDoubleArray* double_array = FixedDoubleArray::cast(object->elements()); | 5559 FixedDoubleArray* double_array = FixedDoubleArray::cast(object->elements()); |
| 5560 HeapNumber* number = HeapNumber::cast(*value); | 5560 HeapNumber* number = HeapNumber::cast(*value); |
| 5561 double_array->set(store_index, number->Number()); | 5561 double_array->set(store_index, number->Number()); |
| 5562 } else { | 5562 } else { |
| 5563 if (!IsFastObjectElementsKind(elements_kind)) { | 5563 ASSERT(IsFastSmiElementsKind(elements_kind) || |
| 5564 ElementsKind transitioned_kind = IsFastHoleyElementsKind(elements_kind) | 5564 IsFastDoubleElementsKind(elements_kind)); |
| 5565 ? FAST_HOLEY_ELEMENTS | 5565 ElementsKind transitioned_kind = IsFastHoleyElementsKind(elements_kind) |
| 5566 : FAST_ELEMENTS; | 5566 ? FAST_HOLEY_ELEMENTS |
| 5567 JSObject::TransitionElementsKind(object, transitioned_kind); | 5567 : FAST_ELEMENTS; |
| 5568 ElementsKind boilerplate_elements_kind = | 5568 JSObject::TransitionElementsKind(object, transitioned_kind); |
| 5569 boilerplate_object->GetElementsKind(); | 5569 if (IsMoreGeneralElementsKindTransition( |
| 5570 if (IsMoreGeneralElementsKindTransition(boilerplate_elements_kind, | 5570 boilerplate_object->GetElementsKind(), |
| 5571 transitioned_kind)) { | 5571 transitioned_kind)) { |
| 5572 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind); | 5572 JSObject::TransitionElementsKind(boilerplate_object, transitioned_kind); |
| 5573 } | |
| 5574 } | 5573 } |
| 5575 FixedArray* object_array = FixedArray::cast(object->elements()); | 5574 FixedArray* object_array = FixedArray::cast(object->elements()); |
| 5576 object_array->set(store_index, *value); | 5575 object_array->set(store_index, *value); |
| 5577 } | 5576 } |
| 5578 return *object; | 5577 return *object; |
| 5579 } | 5578 } |
| 5580 | 5579 |
| 5581 | 5580 |
| 5582 // Check whether debugger and is about to step into the callback that is passed | 5581 // Check whether debugger and is about to step into the callback that is passed |
| 5583 // to a built-in function such as Array.forEach. | 5582 // to a built-in function such as Array.forEach. |
| (...skipping 9560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15144 } | 15143 } |
| 15145 return NULL; | 15144 return NULL; |
| 15146 } | 15145 } |
| 15147 | 15146 |
| 15148 | 15147 |
| 15149 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15148 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15150 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15149 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15151 } | 15150 } |
| 15152 | 15151 |
| 15153 } } // namespace v8::internal | 15152 } } // namespace v8::internal |
| OLD | NEW |