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

Side by Side Diff: src/bootstrapper.cc

Issue 2663803002: [string] Migrate String.prototype.{split,replace} to TF (Closed)
Patch Set: Remove debug-evaluate whitelisting 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
« no previous file with comments | « BUILD.gn ('k') | 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 1569 matching lines...) Expand 10 before | Expand all | Expand 10 after
1580 SimpleInstallFunction(prototype, "includes", 1580 SimpleInstallFunction(prototype, "includes",
1581 Builtins::kStringPrototypeIncludes, 1, false); 1581 Builtins::kStringPrototypeIncludes, 1, false);
1582 SimpleInstallFunction(prototype, "indexOf", 1582 SimpleInstallFunction(prototype, "indexOf",
1583 Builtins::kStringPrototypeIndexOf, 1, false); 1583 Builtins::kStringPrototypeIndexOf, 1, false);
1584 SimpleInstallFunction(prototype, "lastIndexOf", 1584 SimpleInstallFunction(prototype, "lastIndexOf",
1585 Builtins::kStringPrototypeLastIndexOf, 1, false); 1585 Builtins::kStringPrototypeLastIndexOf, 1, false);
1586 SimpleInstallFunction(prototype, "localeCompare", 1586 SimpleInstallFunction(prototype, "localeCompare",
1587 Builtins::kStringPrototypeLocaleCompare, 1, true); 1587 Builtins::kStringPrototypeLocaleCompare, 1, true);
1588 SimpleInstallFunction(prototype, "normalize", 1588 SimpleInstallFunction(prototype, "normalize",
1589 Builtins::kStringPrototypeNormalize, 0, false); 1589 Builtins::kStringPrototypeNormalize, 0, false);
1590 SimpleInstallFunction(prototype, "split", Builtins::kStringPrototypeSplit,
1591 2, true);
1592 SimpleInstallFunction(prototype, "replace",
1593 Builtins::kStringPrototypeReplace, 2, true);
1590 SimpleInstallFunction(prototype, "substr", Builtins::kStringPrototypeSubstr, 1594 SimpleInstallFunction(prototype, "substr", Builtins::kStringPrototypeSubstr,
1591 2, true); 1595 2, true);
1592 SimpleInstallFunction(prototype, "substring", 1596 SimpleInstallFunction(prototype, "substring",
1593 Builtins::kStringPrototypeSubstring, 2, true); 1597 Builtins::kStringPrototypeSubstring, 2, true);
1594 SimpleInstallFunction(prototype, "startsWith", 1598 SimpleInstallFunction(prototype, "startsWith",
1595 Builtins::kStringPrototypeStartsWith, 1, false); 1599 Builtins::kStringPrototypeStartsWith, 1, false);
1596 SimpleInstallFunction(prototype, "toString", 1600 SimpleInstallFunction(prototype, "toString",
1597 Builtins::kStringPrototypeToString, 0, true); 1601 Builtins::kStringPrototypeToString, 0, true);
1598 SimpleInstallFunction(prototype, "trim", Builtins::kStringPrototypeTrim, 0, 1602 SimpleInstallFunction(prototype, "trim", Builtins::kStringPrototypeTrim, 0,
1599 false); 1603 false);
(...skipping 2193 matching lines...) Expand 10 before | Expand all | Expand 10 after
3793 isolate()->factory()->null_value()); 3797 isolate()->factory()->null_value());
3794 native_context()->set_slow_object_with_null_prototype_map( 3798 native_context()->set_slow_object_with_null_prototype_map(
3795 *slow_object_with_null_prototype_map); 3799 *slow_object_with_null_prototype_map);
3796 3800
3797 // Store the map for the %StringPrototype% after the natives has been compiled 3801 // Store the map for the %StringPrototype% after the natives has been compiled
3798 // and the String function has been set up. 3802 // and the String function has been set up.
3799 Handle<JSFunction> string_function(native_context()->string_function()); 3803 Handle<JSFunction> string_function(native_context()->string_function());
3800 DCHECK(JSObject::cast( 3804 DCHECK(JSObject::cast(
3801 string_function->initial_map()->prototype())->HasFastProperties()); 3805 string_function->initial_map()->prototype())->HasFastProperties());
3802 native_context()->set_string_function_prototype_map( 3806 native_context()->set_string_function_prototype_map(
3803 HeapObject::cast(string_function->initial_map()->prototype())->map()); 3807 HeapObject::cast(string_function->map()->prototype())->map());
3804 3808
3805 Handle<JSGlobalObject> global_object = 3809 Handle<JSGlobalObject> global_object =
3806 handle(native_context()->global_object()); 3810 handle(native_context()->global_object());
3807 3811
3808 // Install Global.decodeURI. 3812 // Install Global.decodeURI.
3809 SimpleInstallFunction(global_object, "decodeURI", Builtins::kGlobalDecodeURI, 3813 SimpleInstallFunction(global_object, "decodeURI", Builtins::kGlobalDecodeURI,
3810 1, false, kGlobalDecodeURI); 3814 1, false, kGlobalDecodeURI);
3811 3815
3812 // Install Global.decodeURIComponent. 3816 // Install Global.decodeURIComponent.
3813 SimpleInstallFunction(global_object, "decodeURIComponent", 3817 SimpleInstallFunction(global_object, "decodeURIComponent",
(...skipping 1026 matching lines...) Expand 10 before | Expand all | Expand 10 after
4840 } 4844 }
4841 4845
4842 4846
4843 // Called when the top-level V8 mutex is destroyed. 4847 // Called when the top-level V8 mutex is destroyed.
4844 void Bootstrapper::FreeThreadResources() { 4848 void Bootstrapper::FreeThreadResources() {
4845 DCHECK(!IsActive()); 4849 DCHECK(!IsActive());
4846 } 4850 }
4847 4851
4848 } // namespace internal 4852 } // namespace internal
4849 } // namespace v8 4853 } // namespace v8
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/builtins/builtins.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698