Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(390)

Side by Side Diff: src/bootstrapper.cc

Issue 2381053002: Reland "[builtins] migrate C++ String Iterator builtins to baseline TurboFan" (Closed)
Patch Set: Add the fix and test Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1426 matching lines...) Expand 10 before | Expand all | Expand 10 after
1437 1437
1438 Handle<JSObject> string_iterator_prototype = 1438 Handle<JSObject> string_iterator_prototype =
1439 factory->NewJSObject(isolate->object_function(), TENURED); 1439 factory->NewJSObject(isolate->object_function(), TENURED);
1440 JSObject::ForceSetPrototype(string_iterator_prototype, iterator_prototype); 1440 JSObject::ForceSetPrototype(string_iterator_prototype, iterator_prototype);
1441 1441
1442 JSObject::AddProperty( 1442 JSObject::AddProperty(
1443 string_iterator_prototype, factory->to_string_tag_symbol(), 1443 string_iterator_prototype, factory->to_string_tag_symbol(),
1444 factory->NewStringFromAsciiChecked("String Iterator"), 1444 factory->NewStringFromAsciiChecked("String Iterator"),
1445 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY)); 1445 static_cast<PropertyAttributes>(DONT_ENUM | READ_ONLY));
1446 1446
1447 InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE, 1447 Handle<JSFunction> next =
1448 JSObject::kHeaderSize, MaybeHandle<JSObject>(), 1448 InstallFunction(string_iterator_prototype, "next", JS_OBJECT_TYPE,
1449 Builtins::kStringIteratorPrototypeNext); 1449 JSObject::kHeaderSize, MaybeHandle<JSObject>(),
1450 Builtins::kStringIteratorPrototypeNext);
1451
1452 // Set the expected parameters for %StringIteratorPrototype%.next to 0 (not
1453 // including the receiver), as required by the builtin.
1454 next->shared()->set_internal_formal_parameter_count(0);
1455
1456 // Set the length for the function to satisfy ECMA-262.
1457 next->shared()->set_length(0);
1450 1458
1451 Handle<JSFunction> string_iterator_function = CreateFunction( 1459 Handle<JSFunction> string_iterator_function = CreateFunction(
1452 isolate, factory->NewStringFromAsciiChecked("StringIterator"), 1460 isolate, factory->NewStringFromAsciiChecked("StringIterator"),
1453 JS_STRING_ITERATOR_TYPE, JSStringIterator::kSize, 1461 JS_STRING_ITERATOR_TYPE, JSStringIterator::kSize,
1454 string_iterator_prototype, Builtins::kIllegal); 1462 string_iterator_prototype, Builtins::kIllegal);
1455 native_context()->set_string_iterator_map( 1463 native_context()->set_string_iterator_map(
1456 string_iterator_function->initial_map()); 1464 string_iterator_function->initial_map());
1457 } 1465 }
1458 1466
1459 { 1467 {
(...skipping 2723 matching lines...) Expand 10 before | Expand all | Expand 10 after
4183 } 4191 }
4184 4192
4185 4193
4186 // Called when the top-level V8 mutex is destroyed. 4194 // Called when the top-level V8 mutex is destroyed.
4187 void Bootstrapper::FreeThreadResources() { 4195 void Bootstrapper::FreeThreadResources() {
4188 DCHECK(!IsActive()); 4196 DCHECK(!IsActive());
4189 } 4197 }
4190 4198
4191 } // namespace internal 4199 } // namespace internal
4192 } // namespace v8 4200 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698