OLD | NEW |
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 716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
727 | 727 |
728 double StringToDouble(UnicodeCache* unicode_cache, | 728 double StringToDouble(UnicodeCache* unicode_cache, |
729 Vector<const char> str, | 729 Vector<const char> str, |
730 int flags, | 730 int flags, |
731 double empty_string_val) { | 731 double empty_string_val) { |
732 const char* end = str.start() + str.length(); | 732 const char* end = str.start() + str.length(); |
733 return InternalStringToDouble(unicode_cache, str.start(), end, flags, | 733 return InternalStringToDouble(unicode_cache, str.start(), end, flags, |
734 empty_string_val); | 734 empty_string_val); |
735 } | 735 } |
736 | 736 |
| 737 double StringToDouble(UnicodeCache* unicode_cache, |
| 738 Vector<const uc16> str, |
| 739 int flags, |
| 740 double empty_string_val) { |
| 741 const uc16* end = str.start() + str.length(); |
| 742 return InternalStringToDouble(unicode_cache, str.start(), end, flags, |
| 743 empty_string_val); |
| 744 } |
| 745 |
737 | 746 |
738 const char* DoubleToCString(double v, Vector<char> buffer) { | 747 const char* DoubleToCString(double v, Vector<char> buffer) { |
739 switch (fpclassify(v)) { | 748 switch (fpclassify(v)) { |
740 case FP_NAN: return "NaN"; | 749 case FP_NAN: return "NaN"; |
741 case FP_INFINITE: return (v < 0.0 ? "-Infinity" : "Infinity"); | 750 case FP_INFINITE: return (v < 0.0 ? "-Infinity" : "Infinity"); |
742 case FP_ZERO: return "0"; | 751 case FP_ZERO: return "0"; |
743 default: { | 752 default: { |
744 StringBuilder builder(buffer.start(), buffer.length()); | 753 StringBuilder builder(buffer.start(), buffer.length()); |
745 int decimal_point; | 754 int decimal_point; |
746 int sign; | 755 int sign; |
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1113 (n == 0 ? v8::internal::dtoa_lock_zero : v8::internal::dtoa_lock_one)->Lock(); | 1122 (n == 0 ? v8::internal::dtoa_lock_zero : v8::internal::dtoa_lock_one)->Lock(); |
1114 } | 1123 } |
1115 | 1124 |
1116 | 1125 |
1117 void FREE_DTOA_LOCK(int n) { | 1126 void FREE_DTOA_LOCK(int n) { |
1118 ASSERT(n == 0 || n == 1); | 1127 ASSERT(n == 0 || n == 1); |
1119 (n == 0 ? v8::internal::dtoa_lock_zero : v8::internal::dtoa_lock_one)-> | 1128 (n == 0 ? v8::internal::dtoa_lock_zero : v8::internal::dtoa_lock_one)-> |
1120 Unlock(); | 1129 Unlock(); |
1121 } | 1130 } |
1122 } | 1131 } |
OLD | NEW |