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

Unified Diff: src/js/string.js

Issue 1868963002: [builtins] Migrate String.prototype.charCodeAt and String.prototype.charAt to TurboFan. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix typo Created 4 years, 8 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
Index: src/js/string.js
diff --git a/src/js/string.js b/src/js/string.js
index ede5f881604b4ab2abaacba6c7a0a29be5db383e..f0b970a0490d830a9b4b9e5a23bc16ed00d0aefc 100644
--- a/src/js/string.js
+++ b/src/js/string.js
@@ -57,30 +57,6 @@ function StringValueOf() {
}
-// ECMA-262, section 15.5.4.4
-function StringCharAtJS(pos) {
- CHECK_OBJECT_COERCIBLE(this, "String.prototype.charAt");
-
- var result = %_StringCharAt(this, pos);
- if (%_IsSmi(result)) {
- result = %_StringCharAt(TO_STRING(this), TO_INTEGER(pos));
- }
- return result;
-}
-
-
-// ECMA-262 section 15.5.4.5
-function StringCharCodeAtJS(pos) {
- CHECK_OBJECT_COERCIBLE(this, "String.prototype.charCodeAt");
-
- var result = %_StringCharCodeAt(this, pos);
- if (!%_IsSmi(result)) {
- result = %_StringCharCodeAt(TO_STRING(this), TO_INTEGER(pos));
- }
- return result;
-}
-
-
// ECMA-262, section 15.5.4.6
function StringConcat(other /* and more */) { // length == 1
"use strict";
@@ -857,13 +833,6 @@ function StringRaw(callSite) {
// -------------------------------------------------------------------
-// Set the String function and constructor.
-%FunctionSetPrototype(GlobalString, new GlobalString());
-
-// Set up the constructor property on the String prototype object.
-%AddNamedProperty(
- GlobalString.prototype, "constructor", GlobalString, DONT_ENUM);
-
// Set up the non-enumerable functions on the String object.
utils.InstallFunctions(GlobalString, DONT_ENUM, [
"fromCharCode", StringFromCharCode,
@@ -875,8 +844,6 @@ utils.InstallFunctions(GlobalString, DONT_ENUM, [
utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
"valueOf", StringValueOf,
"toString", StringToString,
- "charAt", StringCharAtJS,
- "charCodeAt", StringCharCodeAtJS,
"codePointAt", StringCodePointAt,
"concat", StringConcat,
"endsWith", StringEndsWith,
@@ -922,7 +889,6 @@ utils.InstallFunctions(GlobalString.prototype, DONT_ENUM, [
utils.Export(function(to) {
to.ExpandReplacement = ExpandReplacement;
- to.StringCharAt = StringCharAtJS;
to.StringIndexOf = StringIndexOf;
to.StringLastIndexOf = StringLastIndexOf;
to.StringMatch = StringMatchJS;

Powered by Google App Engine
This is Rietveld 408576698