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/bootstrapper.h" | 5 #include "src/bootstrapper.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api-natives.h" | 8 #include "src/api-natives.h" |
9 #include "src/base/ieee754.h" | 9 #include "src/base/ieee754.h" |
10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1327 JSObject::ForceSetPrototype(array_iterator_prototype, iterator_prototype); | 1327 JSObject::ForceSetPrototype(array_iterator_prototype, iterator_prototype); |
1328 | 1328 |
1329 JSObject::AddProperty( | 1329 JSObject::AddProperty( |
1330 array_iterator_prototype, factory->to_string_tag_symbol(), | 1330 array_iterator_prototype, factory->to_string_tag_symbol(), |
1331 factory->ArrayIterator_string(), | 1331 factory->ArrayIterator_string(), |
1332 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 1332 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
1333 | 1333 |
1334 Handle<JSFunction> next = InstallFunction( | 1334 Handle<JSFunction> next = InstallFunction( |
1335 array_iterator_prototype, "next", JS_OBJECT_TYPE, JSObject::kHeaderSize, | 1335 array_iterator_prototype, "next", JS_OBJECT_TYPE, JSObject::kHeaderSize, |
1336 MaybeHandle<JSObject>(), Builtins::kArrayIteratorPrototypeNext); | 1336 MaybeHandle<JSObject>(), Builtins::kArrayIteratorPrototypeNext); |
| 1337 next->shared()->set_builtin_function_id(kArrayIteratorNext); |
1337 | 1338 |
1338 // Set the expected parameters for %ArrayIteratorPrototype%.next to 0 (not | 1339 // Set the expected parameters for %ArrayIteratorPrototype%.next to 0 (not |
1339 // including the receiver), as required by the builtin. | 1340 // including the receiver), as required by the builtin. |
1340 next->shared()->set_internal_formal_parameter_count(0); | 1341 next->shared()->set_internal_formal_parameter_count(0); |
1341 | 1342 |
1342 // Set the length for the function to satisfy ECMA-262. | 1343 // Set the length for the function to satisfy ECMA-262. |
1343 next->shared()->set_length(0); | 1344 next->shared()->set_length(0); |
1344 | 1345 |
1345 Handle<JSFunction> array_iterator_function = CreateFunction( | 1346 Handle<JSFunction> array_iterator_function = CreateFunction( |
1346 isolate, factory->ArrayIterator_string(), | 1347 isolate, factory->ArrayIterator_string(), |
(...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2181 kTypedArrayByteLength); | 2182 kTypedArrayByteLength); |
2182 SimpleInstallGetter(prototype, factory->byte_offset_string(), | 2183 SimpleInstallGetter(prototype, factory->byte_offset_string(), |
2183 Builtins::kTypedArrayPrototypeByteOffset, true, | 2184 Builtins::kTypedArrayPrototypeByteOffset, true, |
2184 kTypedArrayByteOffset); | 2185 kTypedArrayByteOffset); |
2185 SimpleInstallGetter(prototype, factory->length_string(), | 2186 SimpleInstallGetter(prototype, factory->length_string(), |
2186 Builtins::kTypedArrayPrototypeLength, true, | 2187 Builtins::kTypedArrayPrototypeLength, true, |
2187 kTypedArrayLength); | 2188 kTypedArrayLength); |
2188 | 2189 |
2189 // Install "keys", "values" and "entries" methods on the {prototype}. | 2190 // Install "keys", "values" and "entries" methods on the {prototype}. |
2190 SimpleInstallFunction(prototype, factory->entries_string(), | 2191 SimpleInstallFunction(prototype, factory->entries_string(), |
2191 Builtins::kTypedArrayPrototypeEntries, 0, true); | 2192 Builtins::kTypedArrayPrototypeEntries, true, |
| 2193 kTypedArrayEntries); |
2192 SimpleInstallFunction(prototype, factory->keys_string(), | 2194 SimpleInstallFunction(prototype, factory->keys_string(), |
2193 Builtins::kTypedArrayPrototypeKeys, 0, true); | 2195 Builtins::kTypedArrayPrototypeKeys, true, |
2194 Handle<JSFunction> iterator = | 2196 kTypedArrayKeys); |
2195 SimpleInstallFunction(prototype, factory->values_string(), | 2197 Handle<JSFunction> iterator = SimpleInstallFunction( |
2196 Builtins::kTypedArrayPrototypeValues, 0, true); | 2198 prototype, factory->values_string(), |
| 2199 Builtins::kTypedArrayPrototypeValues, true, kTypedArrayValues); |
2197 JSObject::AddProperty(prototype, factory->iterator_symbol(), iterator, | 2200 JSObject::AddProperty(prototype, factory->iterator_symbol(), iterator, |
2198 DONT_ENUM); | 2201 DONT_ENUM); |
2199 } | 2202 } |
2200 | 2203 |
2201 { // -- T y p e d A r r a y s | 2204 { // -- T y p e d A r r a y s |
2202 #define INSTALL_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ | 2205 #define INSTALL_TYPED_ARRAY(Type, type, TYPE, ctype, size) \ |
2203 { \ | 2206 { \ |
2204 Handle<JSFunction> fun; \ | 2207 Handle<JSFunction> fun; \ |
2205 InstallTypedArray(#Type "Array", TYPE##_ELEMENTS, &fun); \ | 2208 InstallTypedArray(#Type "Array", TYPE##_ELEMENTS, &fun); \ |
2206 InstallWithIntrinsicDefaultProto(isolate, fun, \ | 2209 InstallWithIntrinsicDefaultProto(isolate, fun, \ |
(...skipping 2333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4540 } | 4543 } |
4541 | 4544 |
4542 | 4545 |
4543 // Called when the top-level V8 mutex is destroyed. | 4546 // Called when the top-level V8 mutex is destroyed. |
4544 void Bootstrapper::FreeThreadResources() { | 4547 void Bootstrapper::FreeThreadResources() { |
4545 DCHECK(!IsActive()); | 4548 DCHECK(!IsActive()); |
4546 } | 4549 } |
4547 | 4550 |
4548 } // namespace internal | 4551 } // namespace internal |
4549 } // namespace v8 | 4552 } // namespace v8 |
OLD | NEW |