Commit 33e0ded0 authored by Peter Marshall's avatar Peter Marshall Committed by Commit Bot

[cleanup] Only accept TNodes in CSA StringToNumber.

Change-Id: Idf3a38c0750071263c6450a17d311cbab632523c
Reviewed-on: https://chromium-review.googlesource.com/924141Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Commit-Queue: Peter Marshall <petermarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51327}
parent e249dd87
......@@ -99,7 +99,7 @@ TF_BUILTIN(NonPrimitiveToPrimitive_String, ConversionBuiltinsAssembler) {
}
TF_BUILTIN(StringToNumber, CodeStubAssembler) {
Node* input = Parameter(Descriptor::kArgument);
TNode<String> input = CAST(Parameter(Descriptor::kArgument));
Return(StringToNumber(input));
}
......
......@@ -5328,8 +5328,7 @@ TNode<String> CodeStubAssembler::StringFromCodePoint(TNode<Int32T> codepoint,
return CAST(var_result.value());
}
TNode<Number> CodeStubAssembler::StringToNumber(SloppyTNode<String> input) {
CSA_SLOW_ASSERT(this, IsString(input));
TNode<Number> CodeStubAssembler::StringToNumber(TNode<String> input) {
Label runtime(this, Label::kDeferred);
Label end(this);
......@@ -5510,7 +5509,8 @@ Node* CodeStubAssembler::NonNumberToNumberOrNumeric(
BIND(&if_inputisstring);
{
// The {input} is a String, use the fast stub to convert it to a Number.
var_result.Bind(StringToNumber(input));
TNode<String> string_input = CAST(input);
var_result.Bind(StringToNumber(string_input));
Goto(&end);
}
......
......@@ -1227,7 +1227,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler : public compiler::CodeAssembler {
// Type conversion helpers.
enum class BigIntHandling { kConvertToNumber, kThrow };
// Convert a String to a Number.
TNode<Number> StringToNumber(SloppyTNode<String> input);
TNode<Number> StringToNumber(TNode<String> input);
// Convert a Number to a String.
Node* NumberToString(Node* input);
// Convert an object to a name.
......
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