| OLD | NEW | 
|---|
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. | 
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be | 
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. | 
| 4 | 4 | 
| 5 #include <stdarg.h> | 5 #include <stdarg.h> | 
| 6 #include <sys/stat.h> | 6 #include <sys/stat.h> | 
| 7 | 7 | 
| 8 #include "src/v8.h" | 8 #include "src/v8.h" | 
| 9 | 9 | 
| 10 #include "src/base/functional.h" | 10 #include "src/base/functional.h" | 
| (...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 401   memcopy_uint16_uint8_function = | 401   memcopy_uint16_uint8_function = | 
| 402       CreateMemCopyUint16Uint8Function(&MemCopyUint16Uint8Wrapper); | 402       CreateMemCopyUint16Uint8Function(&MemCopyUint16Uint8Wrapper); | 
| 403 #elif V8_OS_POSIX && V8_HOST_ARCH_MIPS | 403 #elif V8_OS_POSIX && V8_HOST_ARCH_MIPS | 
| 404   memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper); | 404   memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper); | 
| 405 #endif | 405 #endif | 
| 406 } | 406 } | 
| 407 | 407 | 
| 408 | 408 | 
| 409 bool DoubleToBoolean(double d) { | 409 bool DoubleToBoolean(double d) { | 
| 410   // NaN, +0, and -0 should return the false object | 410   // NaN, +0, and -0 should return the false object | 
| 411 #if __BYTE_ORDER == __LITTLE_ENDIAN | 411 #if V8_TARGET_LITTLE_ENDIAN | 
| 412   union IeeeDoubleLittleEndianArchType u; | 412   union IeeeDoubleLittleEndianArchType u; | 
| 413 #elif __BYTE_ORDER == __BIG_ENDIAN | 413 #else | 
| 414   union IeeeDoubleBigEndianArchType u; | 414   union IeeeDoubleBigEndianArchType u; | 
| 415 #endif | 415 #endif | 
| 416   u.d = d; | 416   u.d = d; | 
| 417   if (u.bits.exp == 2047) { | 417   if (u.bits.exp == 2047) { | 
| 418     // Detect NaN for IEEE double precision floating point. | 418     // Detect NaN for IEEE double precision floating point. | 
| 419     if ((u.bits.man_low | u.bits.man_high) != 0) return false; | 419     if ((u.bits.man_low | u.bits.man_high) != 0) return false; | 
| 420   } | 420   } | 
| 421   if (u.bits.exp == 0) { | 421   if (u.bits.exp == 0) { | 
| 422     // Detect +0, and -0 for IEEE double precision floating point. | 422     // Detect +0, and -0 for IEEE double precision floating point. | 
| 423     if ((u.bits.man_low | u.bits.man_high) == 0) return false; | 423     if ((u.bits.man_low | u.bits.man_high) == 0) return false; | 
| 424   } | 424   } | 
| 425   return true; | 425   return true; | 
| 426 } | 426 } | 
| 427 | 427 | 
| 428 | 428 | 
| 429 } }  // namespace v8::internal | 429 } }  // namespace v8::internal | 
| OLD | NEW | 
|---|