OLD | NEW |
(Empty) | |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // Flags: --allow-natives-syntax |
| 6 |
| 7 function assertDoubleBits(hi, lo, x) { |
| 8 assertEquals(x, %_ConstructDouble(hi, lo)); |
| 9 assertEquals(hi | 0, %_DoubleHi(x)); |
| 10 assertEquals(lo | 0, %_DoubleLo(x)); |
| 11 } |
| 12 |
| 13 function test() { |
| 14 assertDoubleBits(0x7ff80000, 0x00000000, NaN); |
| 15 assertDoubleBits(0x7ff00000, 0x00000000, Infinity); |
| 16 assertDoubleBits(0xfff00000, 0x00000000, -Infinity); |
| 17 assertDoubleBits(0x80000000, 0x00000000, -0); |
| 18 assertDoubleBits(0x400921fb, 0x54442d18, Math.PI); |
| 19 assertDoubleBits(0xc005bf0a, 0x8b145769, -Math.E); |
| 20 assertDoubleBits(0xbfe80000, 0x00000000, -0.75); |
| 21 } |
| 22 |
| 23 test(); |
| 24 test(); |
| 25 %OptimizeFunctionOnNextCall(test); |
| 26 test(); |
OLD | NEW |