Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Side by Side Diff: src/utils.cc

Issue 231073002: WIP: Parser: delay string internalization. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: more cleanup Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/utils.h ('k') | src/variables.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "v8.h" 8 #include "v8.h"
9 9
10 #include "checks.h" 10 #include "checks.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 #elif V8_OS_POSIX && V8_HOST_ARCH_ARM 368 #elif V8_OS_POSIX && V8_HOST_ARCH_ARM
369 memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper); 369 memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper);
370 memcopy_uint16_uint8_function = 370 memcopy_uint16_uint8_function =
371 CreateMemCopyUint16Uint8Function(&MemCopyUint16Uint8Wrapper); 371 CreateMemCopyUint16Uint8Function(&MemCopyUint16Uint8Wrapper);
372 #elif V8_OS_POSIX && V8_HOST_ARCH_MIPS 372 #elif V8_OS_POSIX && V8_HOST_ARCH_MIPS
373 memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper); 373 memcopy_uint8_function = CreateMemCopyUint8Function(&MemCopyUint8Wrapper);
374 #endif 374 #endif
375 } 375 }
376 376
377 377
378 bool DoubleToBoolean(double d) {
379 // NaN, +0, and -0 should return the false object
380 #if __BYTE_ORDER == __LITTLE_ENDIAN
381 union IeeeDoubleLittleEndianArchType u;
382 #elif __BYTE_ORDER == __BIG_ENDIAN
383 union IeeeDoubleBigEndianArchType u;
384 #endif
385 u.d = d;
386 if (u.bits.exp == 2047) {
387 // Detect NaN for IEEE double precision floating point.
388 if ((u.bits.man_low | u.bits.man_high) != 0) return false;
389 }
390 if (u.bits.exp == 0) {
391 // Detect +0, and -0 for IEEE double precision floating point.
392 if ((u.bits.man_low | u.bits.man_high) == 0) return false;
393 }
394 return true;
395 }
396
397
378 } } // namespace v8::internal 398 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/utils.h ('k') | src/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698