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

Side by Side Diff: src/conversions-inl.h

Issue 8055009: Port r9428 to 3.5 branch. (Closed) Base URL: https://v8.googlecode.com/svn/branches/3.5
Patch Set: Created 9 years, 2 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/conversions.h ('k') | src/globals.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 26 matching lines...) Expand all
37 // Extra POSIX/ANSI functions for Win32/MSVC. 37 // Extra POSIX/ANSI functions for Win32/MSVC.
38 38
39 #include "conversions.h" 39 #include "conversions.h"
40 #include "strtod.h" 40 #include "strtod.h"
41 #include "platform.h" 41 #include "platform.h"
42 42
43 namespace v8 { 43 namespace v8 {
44 namespace internal { 44 namespace internal {
45 45
46 static inline double JunkStringValue() { 46 static inline double JunkStringValue() {
47 return std::numeric_limits<double>::quiet_NaN(); 47 return BitCast<double, uint64_t>(kQuietNaNMask);
48 } 48 }
49 49
50 50
51 // The fast double-to-unsigned-int conversion routine does not guarantee 51 // The fast double-to-unsigned-int conversion routine does not guarantee
52 // rounding towards zero, or any reasonable value if the argument is larger 52 // rounding towards zero, or any reasonable value if the argument is larger
53 // than what fits in an unsigned 32-bit integer. 53 // than what fits in an unsigned 32-bit integer.
54 static inline unsigned int FastD2UI(double x) { 54 static inline unsigned int FastD2UI(double x) {
55 // There is no unsigned version of lrint, so there is no fast path 55 // There is no unsigned version of lrint, so there is no fast path
56 // in this function as there is in FastD2I. Using lrint doesn't work 56 // in this function as there is in FastD2I. Using lrint doesn't work
57 // for values of 2^31 and above. 57 // for values of 2^31 and above.
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 ASSERT(buffer_pos < kBufferSize); 655 ASSERT(buffer_pos < kBufferSize);
656 buffer[buffer_pos] = '\0'; 656 buffer[buffer_pos] = '\0';
657 657
658 double converted = Strtod(Vector<const char>(buffer, buffer_pos), exponent); 658 double converted = Strtod(Vector<const char>(buffer, buffer_pos), exponent);
659 return negative ? -converted : converted; 659 return negative ? -converted : converted;
660 } 660 }
661 661
662 } } // namespace v8::internal 662 } } // namespace v8::internal
663 663
664 #endif // V8_CONVERSIONS_INL_H_ 664 #endif // V8_CONVERSIONS_INL_H_
OLDNEW
« no previous file with comments | « src/conversions.h ('k') | src/globals.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698