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

Unified Diff: src/runtime.js

Issue 1323543002: [runtime] Replace %to_string_fun with %_ToString. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@ToStringStub
Patch Set: Created 5 years, 4 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/runtime.js
diff --git a/src/runtime.js b/src/runtime.js
index 89a3f2241dd9e95beefe7733fc282b42a1b5fd83..18efec36f5ee4703d03555d94d92ac1442539446 100644
--- a/src/runtime.js
+++ b/src/runtime.js
@@ -165,7 +165,7 @@ function ADD(x) {
var b = %to_primitive(x, NO_HINT);
if (IS_STRING(a)) {
- return %_StringAdd(a, %to_string_fun(b));
+ return %_StringAdd(a, TO_STRING(b));
} else if (IS_STRING(b)) {
return %_StringAdd(%non_string_to_string(a), b);
} else {
@@ -191,7 +191,7 @@ function STRING_ADD_LEFT(y) {
} else {
y = IS_NUMBER(y)
? %_NumberToString(y)
- : %to_string_fun(%to_primitive(y, NO_HINT));
+ : TO_STRING(%to_primitive(y, NO_HINT));
}
}
return %_StringAdd(this, y);
@@ -207,7 +207,7 @@ function STRING_ADD_RIGHT(y) {
} else {
x = IS_NUMBER(x)
? %_NumberToString(x)
- : %to_string_fun(%to_primitive(x, NO_HINT));
+ : TO_STRING(%to_primitive(x, NO_HINT));
}
}
return %_StringAdd(x, y);
@@ -495,7 +495,7 @@ function APPLY_PREPARE(args) {
if (length > kSafeArgumentsLength) throw %make_range_error(kStackOverflow);
if (!IS_SPEC_FUNCTION(this)) {
- throw %make_type_error(kApplyNonFunction, %to_string_fun(this), typeof this);
+ throw %make_type_error(kApplyNonFunction, TO_STRING(this), typeof this);
}
// Make sure the arguments list has the right type.
@@ -523,7 +523,7 @@ function REFLECT_APPLY_PREPARE(args) {
}
if (!IS_SPEC_FUNCTION(this)) {
- throw %make_type_error(kCalledNonCallable, %to_string_fun(this));
+ throw %make_type_error(kCalledNonCallable, TO_STRING(this));
}
if (!IS_SPEC_OBJECT(args)) {
@@ -562,17 +562,17 @@ function REFLECT_CONSTRUCT_PREPARE(
if (!ctorOk) {
if (!IS_SPEC_FUNCTION(this)) {
- throw %make_type_error(kCalledNonCallable, %to_string_fun(this));
+ throw %make_type_error(kCalledNonCallable, TO_STRING(this));
} else {
- throw %make_type_error(kNotConstructor, %to_string_fun(this));
+ throw %make_type_error(kNotConstructor, TO_STRING(this));
}
}
if (!newTargetOk) {
if (!IS_SPEC_FUNCTION(newTarget)) {
- throw %make_type_error(kCalledNonCallable, %to_string_fun(newTarget));
+ throw %make_type_error(kCalledNonCallable, TO_STRING(newTarget));
} else {
- throw %make_type_error(kNotConstructor, %to_string_fun(newTarget));
+ throw %make_type_error(kNotConstructor, TO_STRING(newTarget));
}
}
@@ -609,12 +609,6 @@ function TO_NUMBER() {
}
-// Convert the receiver to a string - forward to ToString.
-function TO_STRING() {
- return %to_string_fun(this);
-}
-
-
/* -------------------------------------
- - - C o n v e r s i o n s - - -
-------------------------------------
@@ -873,7 +867,6 @@ $toString = ToString;
"to_length_fun", ToLength,
"to_number_fun", ToNumber,
"to_primitive", ToPrimitive,
- "to_string_fun", ToString,
]);
utils.Export(function(to) {

Powered by Google App Engine
This is Rietveld 408576698