OLD | NEW |
---|---|
1 // Copyright (c) 1994-2006 Sun Microsystems Inc. | 1 // Copyright (c) 1994-2006 Sun Microsystems Inc. |
2 // All Rights Reserved. | 2 // All Rights Reserved. |
3 // | 3 // |
4 // Redistribution and use in source and binary forms, with or without | 4 // Redistribution and use in source and binary forms, with or without |
5 // modification, are permitted provided that the following conditions are | 5 // modification, are permitted provided that the following conditions are |
6 // met: | 6 // met: |
7 // | 7 // |
8 // - Redistributions of source code must retain the above copyright notice, | 8 // - Redistributions of source code must retain the above copyright notice, |
9 // this list of conditions and the following disclaimer. | 9 // this list of conditions and the following disclaimer. |
10 // | 10 // |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
84 | 84 |
85 namespace v8 { | 85 namespace v8 { |
86 namespace internal { | 86 namespace internal { |
87 | 87 |
88 // ----------------------------------------------------------------------------- | 88 // ----------------------------------------------------------------------------- |
89 // Common double constants. | 89 // Common double constants. |
90 | 90 |
91 struct DoubleConstant BASE_EMBEDDED { | 91 struct DoubleConstant BASE_EMBEDDED { |
92 double min_int; | 92 double min_int; |
93 double one_half; | 93 double one_half; |
94 double minus_one_half; | |
94 double minus_zero; | 95 double minus_zero; |
95 double zero; | 96 double zero; |
96 double uint8_max_value; | 97 double uint8_max_value; |
97 double negative_infinity; | 98 double negative_infinity; |
98 double canonical_non_hole_nan; | 99 double canonical_non_hole_nan; |
99 double the_hole_nan; | 100 double the_hole_nan; |
100 }; | 101 }; |
101 | 102 |
102 static DoubleConstant double_constants; | 103 static DoubleConstant double_constants; |
103 | 104 |
(...skipping 742 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
846 } | 847 } |
847 #endif // VERIFY_HEAP | 848 #endif // VERIFY_HEAP |
848 | 849 |
849 | 850 |
850 // ----------------------------------------------------------------------------- | 851 // ----------------------------------------------------------------------------- |
851 // Implementation of ExternalReference | 852 // Implementation of ExternalReference |
852 | 853 |
853 void ExternalReference::SetUp() { | 854 void ExternalReference::SetUp() { |
854 double_constants.min_int = kMinInt; | 855 double_constants.min_int = kMinInt; |
855 double_constants.one_half = 0.5; | 856 double_constants.one_half = 0.5; |
857 double_constants.minus_one_half = -0.5; | |
856 double_constants.minus_zero = -0.0; | 858 double_constants.minus_zero = -0.0; |
857 double_constants.uint8_max_value = 255; | 859 double_constants.uint8_max_value = 255; |
858 double_constants.zero = 0.0; | 860 double_constants.zero = 0.0; |
859 double_constants.canonical_non_hole_nan = OS::nan_value(); | 861 double_constants.canonical_non_hole_nan = OS::nan_value(); |
860 double_constants.the_hole_nan = BitCast<double>(kHoleNanInt64); | 862 double_constants.the_hole_nan = BitCast<double>(kHoleNanInt64); |
861 double_constants.negative_infinity = -V8_INFINITY; | 863 double_constants.negative_infinity = -V8_INFINITY; |
862 | 864 |
863 math_exp_data_mutex = OS::CreateMutex(); | 865 math_exp_data_mutex = OS::CreateMutex(); |
864 } | 866 } |
865 | 867 |
(...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1202 ExternalReference ExternalReference::address_of_min_int() { | 1204 ExternalReference ExternalReference::address_of_min_int() { |
1203 return ExternalReference(reinterpret_cast<void*>(&double_constants.min_int)); | 1205 return ExternalReference(reinterpret_cast<void*>(&double_constants.min_int)); |
1204 } | 1206 } |
1205 | 1207 |
1206 | 1208 |
1207 ExternalReference ExternalReference::address_of_one_half() { | 1209 ExternalReference ExternalReference::address_of_one_half() { |
1208 return ExternalReference(reinterpret_cast<void*>(&double_constants.one_half)); | 1210 return ExternalReference(reinterpret_cast<void*>(&double_constants.one_half)); |
1209 } | 1211 } |
1210 | 1212 |
1211 | 1213 |
1214 ExternalReference ExternalReference::address_of_minus_one_half() { | |
1215 return ExternalReference(reinterpret_cast<void*>( | |
1216 &double_constants.minus_one_half)); | |
Jakob Kummerow
2013/02/27 14:40:07
nit: for consistency with the code below, please b
| |
1217 } | |
1218 | |
1219 | |
1212 ExternalReference ExternalReference::address_of_minus_zero() { | 1220 ExternalReference ExternalReference::address_of_minus_zero() { |
1213 return ExternalReference( | 1221 return ExternalReference( |
1214 reinterpret_cast<void*>(&double_constants.minus_zero)); | 1222 reinterpret_cast<void*>(&double_constants.minus_zero)); |
1215 } | 1223 } |
1216 | 1224 |
1217 | 1225 |
1218 ExternalReference ExternalReference::address_of_zero() { | 1226 ExternalReference ExternalReference::address_of_zero() { |
1219 return ExternalReference(reinterpret_cast<void*>(&double_constants.zero)); | 1227 return ExternalReference(reinterpret_cast<void*>(&double_constants.zero)); |
1220 } | 1228 } |
1221 | 1229 |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1600 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1608 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
1601 state_.written_position = state_.current_position; | 1609 state_.written_position = state_.current_position; |
1602 written = true; | 1610 written = true; |
1603 } | 1611 } |
1604 | 1612 |
1605 // Return whether something was written. | 1613 // Return whether something was written. |
1606 return written; | 1614 return written; |
1607 } | 1615 } |
1608 | 1616 |
1609 } } // namespace v8::internal | 1617 } } // namespace v8::internal |
OLD | NEW |