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) { ...@@ -316,5 +316,20 @@ RUNTIME_FUNCTION(Runtime_GetRootNaN) {
return isolate->heap()->nan_value(); 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 internal
} // namespace v8 } // namespace v8
...@@ -420,7 +420,9 @@ namespace internal { ...@@ -420,7 +420,9 @@ namespace internal {
F(SmiLexicographicCompare, 2, 1) \ F(SmiLexicographicCompare, 2, 1) \
F(MaxSmi, 0, 1) \ F(MaxSmi, 0, 1) \
F(IsSmi, 1, 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) \ #define FOR_EACH_INTRINSIC_OBJECT(F) \
......
...@@ -27,9 +27,11 @@ ...@@ -27,9 +27,11 @@
// Flags: --allow-natives-syntax // Flags: --allow-natives-syntax
var bytes = new Uint8Array([ var ab = new ArrayBuffer(8);
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7f]); // kHoleNaN var i_view = new Int32Array(ab);
var doubles = new Float64Array(bytes.buffer); i_view[0] = %GetHoleNaNUpper()
i_view[1] = %GetHoleNaNLower();
var doubles = new Float64Array(ab); // kHoleNaN
assertTrue(isNaN(doubles[0])); assertTrue(isNaN(doubles[0]));
var prototype = [2.5, 2.5]; var prototype = [2.5, 2.5];
......
...@@ -10,8 +10,8 @@ function loader(dst, src, i) { ...@@ -10,8 +10,8 @@ function loader(dst, src, i) {
var ab = new ArrayBuffer(8); var ab = new ArrayBuffer(8);
var i_view = new Int32Array(ab); var i_view = new Int32Array(ab);
i_view[0] = 0xFFF7FFFF; i_view[0] = %GetHoleNaNUpper()
i_view[1] = 0xFFF7FFFF; i_view[1] = %GetHoleNaNLower();
var f_view = new Float64Array(ab); var f_view = new Float64Array(ab);
var fixed_double_elements = new Float64Array(1); var fixed_double_elements = new Float64Array(1);
......
...@@ -6,8 +6,8 @@ ...@@ -6,8 +6,8 @@
var ab = new ArrayBuffer(8); var ab = new ArrayBuffer(8);
var i_view = new Int32Array(ab); var i_view = new Int32Array(ab);
i_view[0] = 0xFFF7FFFF; i_view[0] = %GetHoleNaNUpper()
i_view[1] = 0xFFF7FFFF; i_view[1] = %GetHoleNaNLower();
var f_view = new Float64Array(ab); var f_view = new Float64Array(ab);
var fixed_double_elements = new Float64Array(1); 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