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( ...@@ -112,8 +112,8 @@ transitioning javascript builtin NumberPrototypeToString(
// ES6 #sec-number.isfinite // ES6 #sec-number.isfinite
javascript builtin NumberIsFinite( javascript builtin NumberIsFinite(
js-implicit context: NativeContext, js-implicit context: NativeContext,
receiver: JSAny)(...arguments): Boolean { receiver: JSAny)(value: JSAny): Boolean {
typeswitch (arguments[0]) { typeswitch (value) {
case (Smi): { case (Smi): {
return True; return True;
} }
...@@ -130,14 +130,14 @@ javascript builtin NumberIsFinite( ...@@ -130,14 +130,14 @@ javascript builtin NumberIsFinite(
// ES6 #sec-number.isinteger // ES6 #sec-number.isinteger
javascript builtin NumberIsInteger(js-implicit context: NativeContext)( javascript builtin NumberIsInteger(js-implicit context: NativeContext)(
...arguments): Boolean { value: JSAny): Boolean {
return SelectBooleanConstant(IsInteger(arguments[0])); return SelectBooleanConstant(IsInteger(value));
} }
// ES6 #sec-number.isnan // ES6 #sec-number.isnan
javascript builtin NumberIsNaN(js-implicit context: NativeContext)( javascript builtin NumberIsNaN(js-implicit context: NativeContext)(
...arguments): Boolean { value: JSAny): Boolean {
typeswitch (arguments[0]) { typeswitch (value) {
case (Smi): { case (Smi): {
return False; return False;
} }
...@@ -153,23 +153,22 @@ javascript builtin NumberIsNaN(js-implicit context: NativeContext)( ...@@ -153,23 +153,22 @@ javascript builtin NumberIsNaN(js-implicit context: NativeContext)(
// ES6 #sec-number.issafeinteger // ES6 #sec-number.issafeinteger
javascript builtin NumberIsSafeInteger(js-implicit context: NativeContext)( javascript builtin NumberIsSafeInteger(js-implicit context: NativeContext)(
...arguments): Boolean { value: JSAny): Boolean {
return SelectBooleanConstant(IsSafeInteger(arguments[0])); return SelectBooleanConstant(IsSafeInteger(value));
} }
// ES6 #sec-number.prototype.valueof // ES6 #sec-number.prototype.valueof
transitioning javascript builtin NumberPrototypeValueOf( transitioning javascript builtin NumberPrototypeValueOf(
js-implicit context: NativeContext, receiver: JSAny)(...arguments): JSAny { js-implicit context: NativeContext, receiver: JSAny)(): JSAny {
return ToThisValue( return ToThisValue(
receiver, PrimitiveType::kNumber, 'Number.prototype.valueOf'); receiver, PrimitiveType::kNumber, 'Number.prototype.valueOf');
} }
// ES6 #sec-number.parsefloat // ES6 #sec-number.parsefloat
transitioning javascript builtin NumberParseFloat( transitioning javascript builtin NumberParseFloat(
js-implicit context: NativeContext)(...arguments): Number { js-implicit context: NativeContext)(value: JSAny): Number {
const input: JSAny = arguments[0];
try { try {
typeswitch (input) { typeswitch (value) {
case (s: Smi): { case (s: Smi): {
return s; return s;
} }
...@@ -182,7 +181,7 @@ transitioning javascript builtin NumberParseFloat( ...@@ -182,7 +181,7 @@ transitioning javascript builtin NumberParseFloat(
goto String(s); goto String(s);
} }
case (HeapObject): { case (HeapObject): {
goto String(string::ToString(context, input)); goto String(string::ToString(context, value));
} }
} }
} label String(s: String) { } label String(s: String) {
...@@ -253,10 +252,8 @@ transitioning builtin ParseInt(implicit context: Context)( ...@@ -253,10 +252,8 @@ transitioning builtin ParseInt(implicit context: Context)(
// ES6 #sec-number.parseint // ES6 #sec-number.parseint
transitioning javascript builtin NumberParseInt( transitioning javascript builtin NumberParseInt(
js-implicit context: NativeContext)(...arguments): Number { js-implicit context: NativeContext)(value: JSAny, radix: JSAny): Number {
const input: JSAny = arguments[0]; return ParseInt(value, radix);
const radix: JSAny = arguments[1];
return ParseInt(input, radix);
} }
extern builtin NonNumberToNumeric(implicit context: Context)(JSAny): Numeric; 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