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

Unified Diff: src/builtins/builtins-intl.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 | « src/builtins/builtins.h ('k') | src/i18n.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/builtins/builtins-intl.cc
diff --git a/src/builtins/builtins-intl.cc b/src/builtins/builtins-intl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7e162c764a308cf422d8c6775b11371b775dc295
--- /dev/null
+++ b/src/builtins/builtins-intl.cc
@@ -0,0 +1,32 @@
+// Copyright 2017 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifdef V8_I18N_SUPPORT
+
+#include "src/builtins/builtins-utils.h"
+#include "src/builtins/builtins.h"
+#include "src/i18n.h"
+#include "src/objects-inl.h"
+
+namespace v8 {
+namespace internal {
+
+BUILTIN(StringPrototypeToLowerCaseI18N) {
+ HandleScope scope(isolate);
+ TO_THIS_STRING(string, "String.prototype.toLowerCase");
+ string = String::Flatten(string);
+ return ConvertCase(string, false, isolate);
+}
+
+BUILTIN(StringPrototypeToUpperCaseI18N) {
+ HandleScope scope(isolate);
+ TO_THIS_STRING(string, "String.prototype.toUpperCase");
+ string = String::Flatten(string);
+ return ConvertCase(string, true, isolate);
+}
+
+} // namespace internal
+} // namespace v8
+
+#endif // V8_I18N_SUPPORT
« no previous file with comments | « src/builtins/builtins.h ('k') | src/i18n.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698