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 1422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1433 | 1433 |
1434 Handle<JSObject> string_iterator_prototype = | 1434 Handle<JSObject> string_iterator_prototype = |
1435 factory->NewJSObject(isolate->object_function(), TENURED); | 1435 factory->NewJSObject(isolate->object_function(), TENURED); |
1436 JSObject::ForceSetPrototype(string_iterator_prototype, iterator_prototype); | 1436 JSObject::ForceSetPrototype(string_iterator_prototype, iterator_prototype); |
1437 | 1437 |
1438 JSObject::AddProperty( | 1438 JSObject::AddProperty( |
1439 string_iterator_prototype, factory->to_string_tag_symbol(), | 1439 string_iterator_prototype, factory->to_string_tag_symbol(), |
1440 factory->NewStringFromAsciiChecked("String Iterator"), | 1440 factory->NewStringFromAsciiChecked("String Iterator"), |
1441 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); | 1441 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); |
1442 | 1442 |
1443 Handle<JSFunction> next = | 1443 InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE, |
1444 InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE, | 1444 JSObject::kHeaderSize, MaybeHandle<JSObject>(), |
1445 JSObject::kHeaderSize, MaybeHandle<JSObject>(), | 1445 Builtins::kStringIteratorPrototypeNext); |
1446 Builtins::kStringIteratorPrototypeNext); | |
1447 | |
1448 // Set the expected parameters for %StringIteratorPrototype%.next to 0 (not | |
1449 // including the receiver), as required by the builtin. | |
1450 next->shared()->set_internal_formal_parameter_count(0); | |
1451 | |
1452 // Set the length for the function to satisfy ECMA-262. | |
1453 next->shared()->set_length(0); | |
1454 | 1446 |
1455 Handle<JSFunction> string_iterator_function = CreateFunction( | 1447 Handle<JSFunction> string_iterator_function = CreateFunction( |
1456 isolate, factory->NewStringFromAsciiChecked("StringIterator"), | 1448 isolate, factory->NewStringFromAsciiChecked("StringIterator"), |
1457 JS_STRING_ITERATOR_TYPE, JSStringIterator::kSize, | 1449 JS_STRING_ITERATOR_TYPE, JSStringIterator::kSize, |
1458 string_iterator_prototype, Builtins::kIllegal); | 1450 string_iterator_prototype, Builtins::kIllegal); |
1459 native_context()->set_string_iterator_map( | 1451 native_context()->set_string_iterator_map( |
1460 string_iterator_function->initial_map()); | 1452 string_iterator_function->initial_map()); |
1461 } | 1453 } |
1462 | 1454 |
1463 { | 1455 { |
(...skipping 2728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4192 } | 4184 } |
4193 | 4185 |
4194 | 4186 |
4195 // Called when the top-level V8 mutex is destroyed. | 4187 // Called when the top-level V8 mutex is destroyed. |
4196 void Bootstrapper::FreeThreadResources() { | 4188 void Bootstrapper::FreeThreadResources() { |
4197 DCHECK(!IsActive()); | 4189 DCHECK(!IsActive()); |
4198 } | 4190 } |
4199 | 4191 |
4200 } // namespace internal | 4192 } // namespace internal |
4201 } // namespace v8 | 4193 } // namespace v8 |
OLD | NEW |