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

Side by Side Diff: src/bootstrapper.cc

Issue 2663803002: [string] Migrate String.prototype.{split,replace} to TF (Closed)
Patch Set: Rebase Created 3 years, 10 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
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 1568 matching lines...) Expand 10 before | Expand all | Expand 10 after
1579 SimpleInstallFunction(prototype, "includes", 1579 SimpleInstallFunction(prototype, "includes",
1580 Builtins::kStringPrototypeIncludes, 1, false); 1580 Builtins::kStringPrototypeIncludes, 1, false);
1581 SimpleInstallFunction(prototype, "indexOf", 1581 SimpleInstallFunction(prototype, "indexOf",
1582 Builtins::kStringPrototypeIndexOf, 1, false); 1582 Builtins::kStringPrototypeIndexOf, 1, false);
1583 SimpleInstallFunction(prototype, "lastIndexOf", 1583 SimpleInstallFunction(prototype, "lastIndexOf",
1584 Builtins::kStringPrototypeLastIndexOf, 1, false); 1584 Builtins::kStringPrototypeLastIndexOf, 1, false);
1585 SimpleInstallFunction(prototype, "localeCompare", 1585 SimpleInstallFunction(prototype, "localeCompare",
1586 Builtins::kStringPrototypeLocaleCompare, 1, true); 1586 Builtins::kStringPrototypeLocaleCompare, 1, true);
1587 SimpleInstallFunction(prototype, "normalize", 1587 SimpleInstallFunction(prototype, "normalize",
1588 Builtins::kStringPrototypeNormalize, 0, false); 1588 Builtins::kStringPrototypeNormalize, 0, false);
1589 SimpleInstallFunction(prototype, "split", Builtins::kStringPrototypeSplit,
1590 2, true);
1591 SimpleInstallFunction(prototype, "replace",
1592 Builtins::kStringPrototypeReplace, 2, true);
1589 SimpleInstallFunction(prototype, "substr", Builtins::kStringPrototypeSubstr, 1593 SimpleInstallFunction(prototype, "substr", Builtins::kStringPrototypeSubstr,
1590 2, true); 1594 2, true);
1591 SimpleInstallFunction(prototype, "substring", 1595 SimpleInstallFunction(prototype, "substring",
1592 Builtins::kStringPrototypeSubstring, 2, true); 1596 Builtins::kStringPrototypeSubstring, 2, true);
1593 SimpleInstallFunction(prototype, "startsWith", 1597 SimpleInstallFunction(prototype, "startsWith",
1594 Builtins::kStringPrototypeStartsWith, 1, false); 1598 Builtins::kStringPrototypeStartsWith, 1, false);
1595 SimpleInstallFunction(prototype, "toString", 1599 SimpleInstallFunction(prototype, "toString",
1596 Builtins::kStringPrototypeToString, 0, true); 1600 Builtins::kStringPrototypeToString, 0, true);
1597 SimpleInstallFunction(prototype, "trim", Builtins::kStringPrototypeTrim, 0, 1601 SimpleInstallFunction(prototype, "trim", Builtins::kStringPrototypeTrim, 0,
1598 false); 1602 false);
(...skipping 2189 matching lines...) Expand 10 before | Expand all | Expand 10 after
3788 isolate()->factory()->null_value()); 3792 isolate()->factory()->null_value());
3789 native_context()->set_slow_object_with_null_prototype_map( 3793 native_context()->set_slow_object_with_null_prototype_map(
3790 *slow_object_with_null_prototype_map); 3794 *slow_object_with_null_prototype_map);
3791 3795
3792 // Store the map for the %StringPrototype% after the natives has been compiled 3796 // Store the map for the %StringPrototype% after the natives has been compiled
3793 // and the String function has been set up. 3797 // and the String function has been set up.
3794 Handle<JSFunction> string_function(native_context()->string_function()); 3798 Handle<JSFunction> string_function(native_context()->string_function());
3795 DCHECK(JSObject::cast( 3799 DCHECK(JSObject::cast(
3796 string_function->initial_map()->prototype())->HasFastProperties()); 3800 string_function->initial_map()->prototype())->HasFastProperties());
3797 native_context()->set_string_function_prototype_map( 3801 native_context()->set_string_function_prototype_map(
3798 HeapObject::cast(string_function->initial_map()->prototype())->map()); 3802 HeapObject::cast(string_function->map()->prototype())->map());
3799 3803
3800 Handle<JSGlobalObject> global_object = 3804 Handle<JSGlobalObject> global_object =
3801 handle(native_context()->global_object()); 3805 handle(native_context()->global_object());
3802 3806
3803 // Install Global.decodeURI. 3807 // Install Global.decodeURI.
3804 SimpleInstallFunction(global_object, "decodeURI", Builtins::kGlobalDecodeURI, 3808 SimpleInstallFunction(global_object, "decodeURI", Builtins::kGlobalDecodeURI,
3805 1, false, kGlobalDecodeURI); 3809 1, false, kGlobalDecodeURI);
3806 3810
3807 // Install Global.decodeURIComponent. 3811 // Install Global.decodeURIComponent.
3808 SimpleInstallFunction(global_object, "decodeURIComponent", 3812 SimpleInstallFunction(global_object, "decodeURIComponent",
(...skipping 1017 matching lines...) Expand 10 before | Expand all | Expand 10 after
4826 } 4830 }
4827 4831
4828 4832
4829 // Called when the top-level V8 mutex is destroyed. 4833 // Called when the top-level V8 mutex is destroyed.
4830 void Bootstrapper::FreeThreadResources() { 4834 void Bootstrapper::FreeThreadResources() {
4831 DCHECK(!IsActive()); 4835 DCHECK(!IsActive());
4832 } 4836 }
4833 4837
4834 } // namespace internal 4838 } // namespace internal
4835 } // namespace v8 4839 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/builtins/builtins.h » ('j') | src/builtins/builtins-string.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698