Commit 34ab998f authored by Bill Budge's avatar Bill Budge Committed by Commit Bot

[torque] Fix NumberParseFloat regression.

- Changes javascript builtins to use explicit parameters rather than
  variadic, where possible.

tbr=tebbi@chromium.org

Bug: chromium:1085370
Change-Id: I84f01684729b32a9d27df3d021e72c34cc3a8aaf
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2215225
Commit-Queue: Bill Budge <bbudge@chromium.org>
Reviewed-by: 's avatarSantiago Aboy Solanes <solanes@chromium.org>
Reviewed-by: 's avatarJakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#68079}
parent 7a80c7e1
......@@ -112,8 +112,8 @@ transitioning javascript builtin NumberPrototypeToString(
// ES6 #sec-number.isfinite
javascript builtin NumberIsFinite(
js-implicit context: NativeContext,
receiver: JSAny)(...arguments): Boolean {
typeswitch (arguments[0]) {
receiver: JSAny)(value: JSAny): Boolean {
typeswitch (value) {
case (Smi): {
return True;
}
......@@ -130,14 +130,14 @@ javascript builtin NumberIsFinite(
// ES6 #sec-number.isinteger
javascript builtin NumberIsInteger(js-implicit context: NativeContext)(
...arguments): Boolean {
return SelectBooleanConstant(IsInteger(arguments[0]));
value: JSAny): Boolean {
return SelectBooleanConstant(IsInteger(value));
}
// ES6 #sec-number.isnan
javascript builtin NumberIsNaN(js-implicit context: NativeContext)(
...arguments): Boolean {
typeswitch (arguments[0]) {
value: JSAny): Boolean {
typeswitch (value) {
case (Smi): {
return False;
}
......@@ -153,23 +153,22 @@ javascript builtin NumberIsNaN(js-implicit context: NativeContext)(
// ES6 #sec-number.issafeinteger
javascript builtin NumberIsSafeInteger(js-implicit context: NativeContext)(
...arguments): Boolean {
return SelectBooleanConstant(IsSafeInteger(arguments[0]));
value: JSAny): Boolean {
return SelectBooleanConstant(IsSafeInteger(value));
}
// ES6 #sec-number.prototype.valueof
transitioning javascript builtin NumberPrototypeValueOf(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny {
js-implicit context: NativeContext, receiver: JSAny)(): JSAny {
return ToThisValue(
receiver, PrimitiveType::kNumber, 'Number.prototype.valueOf');
}
// ES6 #sec-number.parsefloat
transitioning javascript builtin NumberParseFloat(
js-implicit context: NativeContext)(...arguments): Number {
const input: JSAny = arguments[0];
js-implicit context: NativeContext)(value: JSAny): Number {
try {
typeswitch (input) {
typeswitch (value) {
case (s: Smi): {
return s;
}
......@@ -182,7 +181,7 @@ transitioning javascript builtin NumberParseFloat(
goto String(s);
}
case (HeapObject): {
goto String(string::ToString(context, input));
goto String(string::ToString(context, value));
}
}
} label String(s: String) {
......@@ -253,10 +252,8 @@ transitioning builtin ParseInt(implicit context: Context)(
// ES6 #sec-number.parseint
transitioning javascript builtin NumberParseInt(
js-implicit context: NativeContext)(...arguments): Number {
const input: JSAny = arguments[0];
const radix: JSAny = arguments[1];
return ParseInt(input, radix);
js-implicit context: NativeContext)(value: JSAny, radix: JSAny): Number {
return ParseInt(value, radix);
}
extern builtin NonNumberToNumeric(implicit context: Context)(JSAny): Numeric;
......
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