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

Unified Diff: src/bootstrapper.cc

Issue 2728763006: Migrate some case conversion functions from JS to CPP builtins (Closed)
Patch Set: more specific #include 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') | src/builtins/builtins.h » ('J')
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 803ac37bdebcf3be08f3e65843ba9181b4a7af63..cabee9cf6420e254faa9468811c6604525f1b3f4 100644
--- a/src/bootstrapper.cc
+++ b/src/bootstrapper.cc
@@ -3883,21 +3883,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') | src/builtins/builtins.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698