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

Bug: v8:10933
Change-Id: I4db540cf47ce5cfa25757d776a2bf988ce3ed554
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2432072
Reviewed-by: Adam Klein <adamk@chromium.org>
Commit-Queue: Bill Budge <bbudge@chromium.org>
Cr-Commit-Position: refs/heads/master@{#70147}
This commit is contained in:
Bill Budge 2020-09-25 13:29:34 -07:00 committed by Commit Bot
parent 1987480671
commit f50d8c7840
11 changed files with 40 additions and 39 deletions

View File

@ -6,8 +6,9 @@
namespace string {
// TODO(bbudge) Remove the 'RT' suffix on this runtime function.
extern transitioning runtime ToStringRT(Context, JSAny): String;
namespace runtime {
extern transitioning runtime ToString(Context, JSAny): String;
}
@export
transitioning macro ToStringImpl(context: Context, o: JSAny): String {
@ -31,7 +32,7 @@ transitioning macro ToStringImpl(context: Context, o: JSAny): String {
ThrowTypeError(MessageTemplate::kSymbolToString);
}
case (JSAny): {
return ToStringRT(context, o);
return runtime::ToString(context, o);
}
}
}

View File

@ -3,7 +3,7 @@
// found in the LICENSE file.
namespace runtime {
extern transitioning runtime ToStringRT(Context, BigInt): String;
extern transitioning runtime ToString(Context, BigInt): String;
}
extern enum OrdinaryToPrimitiveHint { kString, kNumber }
@ -90,7 +90,7 @@ transitioning builtin ToName(implicit context: Context)(input: JSAny): Name {
case (b: BigInt): {
// We don't have a fast-path for BigInt currently, so just
// tail call to the %ToString runtime function here for now.
tail runtime::ToStringRT(context, b);
tail runtime::ToString(context, b);
}
case (o: Oddball): {
return o.to_string;

View File

@ -82,7 +82,7 @@ Reduction JSIntrinsicLowering::Reduce(Node* node) {
return ReduceToLength(node);
case Runtime::kInlineToObject:
return ReduceToObject(node);
case Runtime::kInlineToStringRT:
case Runtime::kInlineToString:
return ReduceToString(node);
case Runtime::kInlineCall:
return ReduceCall(node);

View File

@ -1826,7 +1826,7 @@ Type Typer::Visitor::TypeJSCallRuntime(Node* node) {
return TypeUnaryOp(node, ToNumber);
case Runtime::kInlineToObject:
return TypeUnaryOp(node, ToObject);
case Runtime::kInlineToStringRT:
case Runtime::kInlineToString:
return TypeUnaryOp(node, ToString);
case Runtime::kHasInPrototypeChain:
return Type::Boolean();

View File

@ -261,7 +261,7 @@ bool IntrinsicHasNoSideEffect(Runtime::FunctionId id) {
V(ToLength) \
V(ToNumber) \
V(ToObject) \
V(ToStringRT) \
V(ToString) \
/* Type checks */ \
V(IsArray) \
V(IsFunction) \

View File

@ -213,7 +213,7 @@ TNode<Object> IntrinsicsGenerator::HasProperty(
args, context, Builtins::CallableFor(isolate(), Builtins::kHasProperty));
}
TNode<Object> IntrinsicsGenerator::ToStringRT(
TNode<Object> IntrinsicsGenerator::ToString(
const InterpreterAssembler::RegListNodePair& args, TNode<Context> context) {
return IntrinsicAsStubCall(
args, context, Builtins::CallableFor(isolate(), Builtins::kToString));

View File

@ -36,7 +36,7 @@ namespace interpreter {
V(IsArray, is_array, 1) \
V(IsJSReceiver, is_js_receiver, 1) \
V(IsSmi, is_smi, 1) \
V(ToStringRT, to_string, 1) \
V(ToString, to_string, 1) \
V(ToLength, to_length, 1) \
V(ToObject, to_object, 1)

View File

@ -655,7 +655,7 @@ class V8_EXPORT_PRIVATE Parser : public NON_EXPORTED_BASE(ParserBase<Parser>) {
if (expr->IsStringLiteral()) return expr;
ScopedPtrList<Expression> args(pointer_buffer());
args.Add(expr);
return factory()->NewCallRuntime(Runtime::kInlineToStringRT, args,
return factory()->NewCallRuntime(Runtime::kInlineToString, args,
expr->position());
}

View File

@ -1147,7 +1147,7 @@ RUNTIME_FUNCTION(Runtime_ToLength) {
RETURN_RESULT_OR_FAILURE(isolate, Object::ToLength(isolate, input));
}
RUNTIME_FUNCTION(Runtime_ToStringRT) {
RUNTIME_FUNCTION(Runtime_ToString) {
HandleScope scope(isolate);
DCHECK_EQ(1, args.length());
CONVERT_ARG_HANDLE_CHECKED(Object, input, 0);

View File

@ -342,7 +342,7 @@ namespace internal {
I(ToNumber, 1, 1) \
F(ToNumeric, 1, 1) \
I(ToObject, 1, 1) \
I(ToStringRT, 1, 1) \
I(ToString, 1, 1) \
F(TryMigrateInstance, 1, 1)
#define FOR_EACH_INTRINSIC_OPERATORS(F, I) \

View File

@ -4,51 +4,51 @@
// Flags: --allow-natives-syntax
assertEquals("1", %ToStringRT(1));
assertEquals("1", %_ToStringRT(1));
assertEquals("1", %ToString(1));
assertEquals("1", %_ToString(1));
assertEquals("0.5", %ToStringRT(.5));
assertEquals("0.5", %_ToStringRT(.5));
assertEquals("0.5", %ToString(.5));
assertEquals("0.5", %_ToString(.5));
assertEquals("null", %ToStringRT(null));
assertEquals("null", %_ToStringRT(null));
assertEquals("null", %ToString(null));
assertEquals("null", %_ToString(null));
assertEquals("true", %ToStringRT(true));
assertEquals("true", %_ToStringRT(true));
assertEquals("true", %ToString(true));
assertEquals("true", %_ToString(true));
assertEquals("false", %ToStringRT(false));
assertEquals("false", %_ToStringRT(false));
assertEquals("false", %ToString(false));
assertEquals("false", %_ToString(false));
assertEquals("undefined", %ToStringRT(undefined));
assertEquals("undefined", %_ToStringRT(undefined));
assertEquals("undefined", %ToString(undefined));
assertEquals("undefined", %_ToString(undefined));
assertEquals("random text", %ToStringRT("random text"));
assertEquals("random text", %_ToStringRT("random text"));
assertEquals("random text", %ToString("random text"));
assertEquals("random text", %_ToString("random text"));
assertThrows(function() { %ToStringRT(Symbol.toPrimitive) }, TypeError);
assertThrows(function() { %_ToStringRT(Symbol.toPrimitive) }, TypeError);
assertThrows(function() { %ToString(Symbol.toPrimitive) }, TypeError);
assertThrows(function() { %_ToString(Symbol.toPrimitive) }, TypeError);
var a = { toString: function() { return "xyz" }};
assertEquals("xyz", %ToStringRT(a));
assertEquals("xyz", %_ToStringRT(a));
assertEquals("xyz", %ToString(a));
assertEquals("xyz", %_ToString(a));
var b = { valueOf: function() { return 42 }};
assertEquals("[object Object]", %ToStringRT(b));
assertEquals("[object Object]", %_ToStringRT(b));
assertEquals("[object Object]", %ToString(b));
assertEquals("[object Object]", %_ToString(b));
var c = {
toString: function() { return "x"},
valueOf: function() { return 123 }
};
assertEquals("x", %ToStringRT(c));
assertEquals("x", %_ToStringRT(c));
assertEquals("x", %ToString(c));
assertEquals("x", %_ToString(c));
var d = {
[Symbol.toPrimitive]: function(hint) { return hint }
};
assertEquals("string", %ToStringRT(d));
assertEquals("string", %_ToStringRT(d));
assertEquals("string", %ToString(d));
assertEquals("string", %_ToString(d));
var e = new Date(0);
assertEquals(e.toString(), %ToStringRT(e));
assertEquals(e.toString(), %_ToStringRT(e));
assertEquals(e.toString(), %ToString(e));
assertEquals(e.toString(), %_ToString(e));