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 "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/arguments.h" | 7 #include "src/arguments.h" |
8 #include "src/conversions.h" | 8 #include "src/conversions.h" |
9 #include "src/elements.h" | 9 #include "src/elements.h" |
| 10 #include "src/messages.h" |
10 #include "src/objects.h" | 11 #include "src/objects.h" |
11 #include "src/utils.h" | 12 #include "src/utils.h" |
12 | 13 |
13 // Each concrete ElementsAccessor can handle exactly one ElementsKind, | 14 // Each concrete ElementsAccessor can handle exactly one ElementsKind, |
14 // several abstract ElementsAccessor classes are used to allow sharing | 15 // several abstract ElementsAccessor classes are used to allow sharing |
15 // common code. | 16 // common code. |
16 // | 17 // |
17 // Inheritance hierarchy: | 18 // Inheritance hierarchy: |
18 // - ElementsAccessorBase (abstract) | 19 // - ElementsAccessorBase (abstract) |
19 // - FastElementsAccessor (abstract) | 20 // - FastElementsAccessor (abstract) |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
134 key->IsString() && String::cast(element)->Equals(String::cast(key))) { | 135 key->IsString() && String::cast(element)->Equals(String::cast(key))) { |
135 return true; | 136 return true; |
136 } | 137 } |
137 } | 138 } |
138 return false; | 139 return false; |
139 } | 140 } |
140 | 141 |
141 | 142 |
142 MUST_USE_RESULT | 143 MUST_USE_RESULT |
143 static MaybeHandle<Object> ThrowArrayLengthRangeError(Isolate* isolate) { | 144 static MaybeHandle<Object> ThrowArrayLengthRangeError(Isolate* isolate) { |
144 THROW_NEW_ERROR(isolate, NewRangeError("invalid_array_length", | 145 THROW_NEW_ERROR(isolate, NewRangeError(MessageTemplate::kInvalidArrayLength), |
145 HandleVector<Object>(NULL, 0)), | |
146 Object); | 146 Object); |
147 } | 147 } |
148 | 148 |
149 | 149 |
150 static void CopyObjectToObjectElements(FixedArrayBase* from_base, | 150 static void CopyObjectToObjectElements(FixedArrayBase* from_base, |
151 ElementsKind from_kind, | 151 ElementsKind from_kind, |
152 uint32_t from_start, | 152 uint32_t from_start, |
153 FixedArrayBase* to_base, | 153 FixedArrayBase* to_base, |
154 ElementsKind to_kind, uint32_t to_start, | 154 ElementsKind to_kind, uint32_t to_start, |
155 int raw_copy_size) { | 155 int raw_copy_size) { |
(...skipping 1695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 UNREACHABLE(); | 1851 UNREACHABLE(); |
1852 break; | 1852 break; |
1853 } | 1853 } |
1854 | 1854 |
1855 array->set_elements(*elms); | 1855 array->set_elements(*elms); |
1856 array->set_length(Smi::FromInt(number_of_elements)); | 1856 array->set_length(Smi::FromInt(number_of_elements)); |
1857 return array; | 1857 return array; |
1858 } | 1858 } |
1859 | 1859 |
1860 } } // namespace v8::internal | 1860 } } // namespace v8::internal |
OLD | NEW |