Commit f50d8c78 authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

[cleanup] Remove 'RT' suffix on Runtime ToString function

Bug: v8:10933
Change-Id: I4db540cf47ce5cfa25757d776a2bf988ce3ed554
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2432072Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70147}
parent 19874806
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
namespace string { namespace string {
// TODO(bbudge) Remove the 'RT' suffix on this runtime function. namespace runtime {
extern transitioning runtime ToStringRT(Context, JSAny): String; extern transitioning runtime ToString(Context, JSAny): String;
}
@export @export
transitioning macro ToStringImpl(context: Context, o: JSAny): String { transitioning macro ToStringImpl(context: Context, o: JSAny): String {
...@@ -31,7 +32,7 @@ transitioning macro ToStringImpl(context: Context, o: JSAny): String { ...@@ -31,7 +32,7 @@ transitioning macro ToStringImpl(context: Context, o: JSAny): String {
ThrowTypeError(MessageTemplate::kSymbolToString); ThrowTypeError(MessageTemplate::kSymbolToString);
} }
case (JSAny): { case (JSAny): {
return ToStringRT(context, o); return runtime::ToString(context, o);
} }
} }
} }
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// found in the LICENSE file. // found in the LICENSE file.
namespace runtime { namespace runtime {
extern transitioning runtime ToStringRT(Context, BigInt): String; extern transitioning runtime ToString(Context, BigInt): String;
} }
extern enum OrdinaryToPrimitiveHint { kString, kNumber } extern enum OrdinaryToPrimitiveHint { kString, kNumber }
...@@ -90,7 +90,7 @@ transitioning builtin ToName(implicit context: Context)(input: JSAny): Name { ...@@ -90,7 +90,7 @@ transitioning builtin ToName(implicit context: Context)(input: JSAny): Name {
case (b: BigInt): { case (b: BigInt): {
// We don't have a fast-path for BigInt currently, so just // We don't have a fast-path for BigInt currently, so just
// tail call to the %ToString runtime function here for now. // tail call to the %ToString runtime function here for now.
tail runtime::ToStringRT(context, b); tail runtime::ToString(context, b);
} }
case (o: Oddball): { case (o: Oddball): {
return o.to_string; return o.to_string;
......
...@@ -82,7 +82,7 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) { ...@@ -82,7 +82,7 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceToLength(node); return ReduceToLength(node);
case Runtime::kInlineToObject: case Runtime::kInlineToObject:
return ReduceToObject(node); return ReduceToObject(node);
case Runtime::kInlineToStringRT: case Runtime::kInlineToString:
return ReduceToString(node); return ReduceToString(node);
case Runtime::kInlineCall: case Runtime::kInlineCall:
return ReduceCall(node); return ReduceCall(node);
......
...@@ -1826,7 +1826,7 @@ Type Typer::Visitor::TypeJSCallRuntime(Node* node) { ...@@ -1826,7 +1826,7 @@ Type Typer::Visitor::TypeJSCallRuntime(Node* node) {
return TypeUnaryOp(node, ToNumber); return TypeUnaryOp(node, ToNumber);
case Runtime::kInlineToObject: case Runtime::kInlineToObject:
return TypeUnaryOp(node, ToObject); return TypeUnaryOp(node, ToObject);
case Runtime::kInlineToStringRT: case Runtime::kInlineToString:
return TypeUnaryOp(node, ToString); return TypeUnaryOp(node, ToString);
case Runtime::kHasInPrototypeChain: case Runtime::kHasInPrototypeChain:
return Type::Boolean(); return Type::Boolean();
......
...@@ -261,7 +261,7 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) { ...@@ -261,7 +261,7 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) {
V(ToLength) \ V(ToLength) \
V(ToNumber) \ V(ToNumber) \
V(ToObject) \ V(ToObject) \
V(ToStringRT) \ V(ToString) \
/* Type checks */ \ /* Type checks */ \
V(IsArray) \ V(IsArray) \
V(IsFunction) \ V(IsFunction) \
......
...@@ -213,7 +213,7 @@ TNode<Object> IntrinsicsGenerator::HasProperty( ...@@ -213,7 +213,7 @@ TNode<Object> IntrinsicsGenerator::HasProperty(
args, context, Builtins::CallableFor(isolate(), Builtins::kHasProperty)); args, context, Builtins::CallableFor(isolate(), Builtins::kHasProperty));
} }
TNode<Object> IntrinsicsGenerator::ToStringRT( TNode<Object> IntrinsicsGenerator::ToString(
const InterpreterAssembler::RegListNodePair& args, TNode<Context> context) { const InterpreterAssembler::RegListNodePair& args, TNode<Context> context) {
return IntrinsicAsStubCall( return IntrinsicAsStubCall(
args, context, Builtins::CallableFor(isolate(), Builtins::kToString)); args, context, Builtins::CallableFor(isolate(), Builtins::kToString));
......
...@@ -36,7 +36,7 @@ namespace interpreter { ...@@ -36,7 +36,7 @@ namespace interpreter {
V(IsArray, is_array, 1) \ V(IsArray, is_array, 1) \
V(IsJSReceiver, is_js_receiver, 1) \ V(IsJSReceiver, is_js_receiver, 1) \
V(IsSmi, is_smi, 1) \ V(IsSmi, is_smi, 1) \
V(ToStringRT, to_string, 1) \ V(ToString, to_string, 1) \
V(ToLength, to_length, 1) \ V(ToLength, to_length, 1) \
V(ToObject, to_object, 1) V(ToObject, to_object, 1)
......
...@@ -655,7 +655,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) { ...@@ -655,7 +655,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
if (expr->IsStringLiteral()) return expr; if (expr->IsStringLiteral()) return expr;
ScopedPtrList<Expression> args(pointer_buffer()); ScopedPtrList<Expression> args(pointer_buffer());
args.Add(expr); args.Add(expr);
return factory()->NewCallRuntime(Runtime::kInlineToStringRT, args, return factory()->NewCallRuntime(Runtime::kInlineToString, args,
expr->position()); expr->position());
} }
......
...@@ -1147,7 +1147,7 @@ RUNTIME_FUNCTION(Runtime_ToLength) { ...@@ -1147,7 +1147,7 @@ RUNTIME_FUNCTION(Runtime_ToLength) {
RETURN_RESULT_OR_FAILURE(isolate, Object::ToLength(isolate, input)); RETURN_RESULT_OR_FAILURE(isolate, Object::ToLength(isolate, input));
} }
RUNTIME_FUNCTION(Runtime_ToStringRT) { RUNTIME_FUNCTION(Runtime_ToString) {
HandleScope scope(isolate); HandleScope scope(isolate);
DCHECK_EQ(1, args.length()); DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, input, 0); CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);
......
...@@ -342,7 +342,7 @@ namespace internal { ...@@ -342,7 +342,7 @@ namespace internal {
I(ToNumber, 1, 1) \ I(ToNumber, 1, 1) \
F(ToNumeric, 1, 1) \ F(ToNumeric, 1, 1) \
I(ToObject, 1, 1) \ I(ToObject, 1, 1) \
I(ToStringRT, 1, 1) \ I(ToString, 1, 1) \
F(TryMigrateInstance, 1, 1) F(TryMigrateInstance, 1, 1)
#define FOR_EACH_INTRINSIC_OPERATORS(F, I) \ #define FOR_EACH_INTRINSIC_OPERATORS(F, I) \
......
...@@ -4,51 +4,51 @@ ...@@ -4,51 +4,51 @@
// Flags: --allow-natives-syntax // Flags: --allow-natives-syntax
assertEquals("1", %ToStringRT(1)); assertEquals("1", %ToString(1));
assertEquals("1", %_ToStringRT(1)); assertEquals("1", %_ToString(1));
assertEquals("0.5", %ToStringRT(.5)); assertEquals("0.5", %ToString(.5));
assertEquals("0.5", %_ToStringRT(.5)); assertEquals("0.5", %_ToString(.5));
assertEquals("null", %ToStringRT(null)); assertEquals("null", %ToString(null));
assertEquals("null", %_ToStringRT(null)); assertEquals("null", %_ToString(null));
assertEquals("true", %ToStringRT(true)); assertEquals("true", %ToString(true));
assertEquals("true", %_ToStringRT(true)); assertEquals("true", %_ToString(true));
assertEquals("false", %ToStringRT(false)); assertEquals("false", %ToString(false));
assertEquals("false", %_ToStringRT(false)); assertEquals("false", %_ToString(false));
assertEquals("undefined", %ToStringRT(undefined)); assertEquals("undefined", %ToString(undefined));
assertEquals("undefined", %_ToStringRT(undefined)); assertEquals("undefined", %_ToString(undefined));
assertEquals("random text", %ToStringRT("random text")); assertEquals("random text", %ToString("random text"));
assertEquals("random text", %_ToStringRT("random text")); assertEquals("random text", %_ToString("random text"));
assertThrows(function() { %ToStringRT(Symbol.toPrimitive) }, TypeError); assertThrows(function() { %ToString(Symbol.toPrimitive) }, TypeError);
assertThrows(function() { %_ToStringRT(Symbol.toPrimitive) }, TypeError); assertThrows(function() { %_ToString(Symbol.toPrimitive) }, TypeError);
var a = { toString: function() { return "xyz" }}; var a = { toString: function() { return "xyz" }};
assertEquals("xyz", %ToStringRT(a)); assertEquals("xyz", %ToString(a));
assertEquals("xyz", %_ToStringRT(a)); assertEquals("xyz", %_ToString(a));
var b = { valueOf: function() { return 42 }}; var b = { valueOf: function() { return 42 }};
assertEquals("[object Object]", %ToStringRT(b)); assertEquals("[object Object]", %ToString(b));
assertEquals("[object Object]", %_ToStringRT(b)); assertEquals("[object Object]", %_ToString(b));
var c = { var c = {
toString: function() { return "x"}, toString: function() { return "x"},
valueOf: function() { return 123 } valueOf: function() { return 123 }
}; };
assertEquals("x", %ToStringRT(c)); assertEquals("x", %ToString(c));
assertEquals("x", %_ToStringRT(c)); assertEquals("x", %_ToString(c));
var d = { var d = {
[Symbol.toPrimitive]: function(hint) { return hint } [Symbol.toPrimitive]: function(hint) { return hint }
}; };
assertEquals("string", %ToStringRT(d)); assertEquals("string", %ToString(d));
assertEquals("string", %_ToStringRT(d)); assertEquals("string", %_ToString(d));
var e = new Date(0); var e = new Date(0);
assertEquals(e.toString(), %ToStringRT(e)); assertEquals(e.toString(), %ToString(e));
assertEquals(e.toString(), %_ToStringRT(e)); assertEquals(e.toString(), %_ToString(e));
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment