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

Unified Diff: src/bootstrapper.cc

Issue 2728763006: Migrate some case conversion functions from JS to CPP builtins (Closed)
Patch Set: rebase Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « BUILD.gn ('k') | src/builtins/builtins.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/bootstrapper.cc
diff --git a/src/bootstrapper.cc b/src/bootstrapper.cc
index 2ae03256df22d6650e76ed19c565e1d822511e29..c0ea79caab5b7a2db264441078f31ee026731b7f 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3879,21 +3879,22 @@ void Genesis::InitializeGlobal_icu_case_mapping() {
Handle<JSObject> string_prototype(
JSObject::cast(native_context()->string_function()->prototype()));
- Handle<JSFunction> to_lower_case = Handle<JSFunction>::cast(
- JSReceiver::GetProperty(
- exports_container,
- factory()->InternalizeUtf8String("ToLowerCaseI18N"))
- .ToHandleChecked());
- SetFunction(string_prototype, to_lower_case,
- factory()->InternalizeUtf8String("toLowerCase"));
-
- Handle<JSFunction> to_upper_case = Handle<JSFunction>::cast(
- JSReceiver::GetProperty(
- exports_container,
- factory()->InternalizeUtf8String("ToUpperCaseI18N"))
- .ToHandleChecked());
- SetFunction(string_prototype, to_upper_case,
- factory()->InternalizeUtf8String("toUpperCase"));
+ {
+ Handle<String> name = factory()->InternalizeUtf8String("toLowerCase");
+ SetFunction(string_prototype,
+ SimpleCreateFunction(isolate(), name,
+ Builtins::kStringPrototypeToLowerCaseI18N,
+ 0, false),
+ name);
+ }
+ {
+ Handle<String> name = factory()->InternalizeUtf8String("toUpperCase");
+ SetFunction(string_prototype,
+ SimpleCreateFunction(isolate(), name,
+ Builtins::kStringPrototypeToUpperCaseI18N,
+ 0, false),
+ name);
+ }
Handle<JSFunction> to_locale_lower_case = Handle<JSFunction>::cast(
JSReceiver::GetProperty(
« 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