Commit 9597b019 authored by balazs.kilvady's avatar balazs.kilvady Committed by Commit bot

MIPS: Fix NaN tests.

BUG=
TEST=mjsunit/regress/regress-undefined-nan, mjsunit/regress/regress-undefined-nan3, mjsunit/regress/regress-2596

Review URL: https://codereview.chromium.org/1507363002

Cr-Commit-Position: refs/heads/master@{#32741}
parent 1e9c4b44
......@@ -316,5 +316,20 @@ RUNTIME_FUNCTION(Runtime_GetRootNaN) {
return isolate->heap()->nan_value();
}
RUNTIME_FUNCTION(Runtime_GetHoleNaNUpper) {
HandleScope scope(isolate);
DCHECK(args.length() == 0);
return *isolate->factory()->NewNumberFromUint(kHoleNanUpper32);
}
RUNTIME_FUNCTION(Runtime_GetHoleNaNLower) {
HandleScope scope(isolate);
DCHECK(args.length() == 0);
return *isolate->factory()->NewNumberFromUint(kHoleNanLower32);
}
} // namespace internal
} // namespace v8
......@@ -420,7 +420,9 @@ namespace internal {
F(SmiLexicographicCompare, 2, 1) \
F(MaxSmi, 0, 1) \
F(IsSmi, 1, 1) \
F(GetRootNaN, 0, 1)
F(GetRootNaN, 0, 1) \
F(GetHoleNaNUpper, 0, 1) \
F(GetHoleNaNLower, 0, 1)
#define FOR_EACH_INTRINSIC_OBJECT(F) \
......
......@@ -27,9 +27,11 @@
// Flags: --allow-natives-syntax
var bytes = new Uint8Array([
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f]); // kHoleNaN
var doubles = new Float64Array(bytes.buffer);
var ab = new ArrayBuffer(8);
var i_view = new Int32Array(ab);
i_view[0] = %GetHoleNaNUpper()
i_view[1] = %GetHoleNaNLower();
var doubles = new Float64Array(ab); // kHoleNaN
assertTrue(isNaN(doubles[0]));
var prototype = [2.5, 2.5];
......
......@@ -10,8 +10,8 @@ function loader(dst, src, i) {
var ab = new ArrayBuffer(8);
var i_view = new Int32Array(ab);
i_view[0] = 0xFFF7FFFF;
i_view[1] = 0xFFF7FFFF;
i_view[0] = %GetHoleNaNUpper()
i_view[1] = %GetHoleNaNLower();
var f_view = new Float64Array(ab);
var fixed_double_elements = new Float64Array(1);
......
......@@ -6,8 +6,8 @@
var ab = new ArrayBuffer(8);
var i_view = new Int32Array(ab);
i_view[0] = 0xFFF7FFFF;
i_view[1] = 0xFFF7FFFF;
i_view[0] = %GetHoleNaNUpper()
i_view[1] = %GetHoleNaNLower();
var f_view = new Float64Array(ab);
var fixed_double_elements = new Float64Array(1);
......
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