| 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 "v8.h" | 8 #include "v8.h" |
| 9 | 9 |
| 10 #include "accessors.h" | 10 #include "accessors.h" |
| (...skipping 10022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10033 } | 10033 } |
| 10034 | 10034 |
| 10035 bool exceeds_array_limit() { | 10035 bool exceeds_array_limit() { |
| 10036 return exceeds_array_limit_; | 10036 return exceeds_array_limit_; |
| 10037 } | 10037 } |
| 10038 | 10038 |
| 10039 Handle<JSArray> ToArray() { | 10039 Handle<JSArray> ToArray() { |
| 10040 Handle<JSArray> array = isolate_->factory()->NewJSArray(0); | 10040 Handle<JSArray> array = isolate_->factory()->NewJSArray(0); |
| 10041 Handle<Object> length = | 10041 Handle<Object> length = |
| 10042 isolate_->factory()->NewNumber(static_cast<double>(index_offset_)); | 10042 isolate_->factory()->NewNumber(static_cast<double>(index_offset_)); |
| 10043 Handle<Map> map; | 10043 Handle<Map> map = JSObject::GetElementsTransitionMap( |
| 10044 if (fast_elements_) { | 10044 array, |
| 10045 map = JSObject::GetElementsTransitionMap(array, FAST_HOLEY_ELEMENTS); | 10045 fast_elements_ ? FAST_HOLEY_ELEMENTS : DICTIONARY_ELEMENTS); |
| 10046 } else { | |
| 10047 map = JSObject::GetElementsTransitionMap(array, DICTIONARY_ELEMENTS); | |
| 10048 } | |
| 10049 array->set_map(*map); | 10046 array->set_map(*map); |
| 10050 array->set_length(*length); | 10047 array->set_length(*length); |
| 10051 array->set_elements(*storage_); | 10048 array->set_elements(*storage_); |
| 10052 return array; | 10049 return array; |
| 10053 } | 10050 } |
| 10054 | 10051 |
| 10055 private: | 10052 private: |
| 10056 // Convert storage to dictionary mode. | 10053 // Convert storage to dictionary mode. |
| 10057 void SetDictionaryMode(uint32_t index) { | 10054 void SetDictionaryMode(uint32_t index) { |
| 10058 ASSERT(fast_elements_); | 10055 ASSERT(fast_elements_); |
| (...skipping 5120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 15179 } | 15176 } |
| 15180 return NULL; | 15177 return NULL; |
| 15181 } | 15178 } |
| 15182 | 15179 |
| 15183 | 15180 |
| 15184 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { | 15181 const Runtime::Function* Runtime::FunctionForId(Runtime::FunctionId id) { |
| 15185 return &(kIntrinsicFunctions[static_cast<int>(id)]); | 15182 return &(kIntrinsicFunctions[static_cast<int>(id)]); |
| 15186 } | 15183 } |
| 15187 | 15184 |
| 15188 } } // namespace v8::internal | 15185 } } // namespace v8::internal |
| OLD | NEW |