| 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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 namespace v8 { | 98 namespace v8 { |
| 99 namespace internal { | 99 namespace internal { |
| 100 | 100 |
| 101 // ----------------------------------------------------------------------------- | 101 // ----------------------------------------------------------------------------- |
| 102 // Common double constants. | 102 // Common double constants. |
| 103 | 103 |
| 104 struct DoubleConstant BASE_EMBEDDED { | 104 struct DoubleConstant BASE_EMBEDDED { |
| 105 double min_int; | 105 double min_int; |
| 106 double one_half; | 106 double one_half; |
| 107 double minus_one_half; | 107 double minus_one_half; |
| 108 double minus_zero; | |
| 109 double zero; | |
| 110 double uint8_max_value; | |
| 111 double negative_infinity; | 108 double negative_infinity; |
| 112 double canonical_non_hole_nan; | 109 double canonical_non_hole_nan; |
| 113 double the_hole_nan; | 110 double the_hole_nan; |
| 114 double uint32_bias; | 111 double uint32_bias; |
| 115 }; | 112 }; |
| 116 | 113 |
| 117 static DoubleConstant double_constants; | 114 static DoubleConstant double_constants; |
| 118 | 115 |
| 119 const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING"; | 116 const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING"; |
| 120 | 117 |
| (...skipping 777 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 898 #endif // VERIFY_HEAP | 895 #endif // VERIFY_HEAP |
| 899 | 896 |
| 900 | 897 |
| 901 // ----------------------------------------------------------------------------- | 898 // ----------------------------------------------------------------------------- |
| 902 // Implementation of ExternalReference | 899 // Implementation of ExternalReference |
| 903 | 900 |
| 904 void ExternalReference::SetUp() { | 901 void ExternalReference::SetUp() { |
| 905 double_constants.min_int = kMinInt; | 902 double_constants.min_int = kMinInt; |
| 906 double_constants.one_half = 0.5; | 903 double_constants.one_half = 0.5; |
| 907 double_constants.minus_one_half = -0.5; | 904 double_constants.minus_one_half = -0.5; |
| 908 double_constants.minus_zero = -0.0; | |
| 909 double_constants.uint8_max_value = 255; | |
| 910 double_constants.zero = 0.0; | |
| 911 double_constants.canonical_non_hole_nan = base::OS::nan_value(); | 905 double_constants.canonical_non_hole_nan = base::OS::nan_value(); |
| 912 double_constants.the_hole_nan = BitCast<double>(kHoleNanInt64); | 906 double_constants.the_hole_nan = BitCast<double>(kHoleNanInt64); |
| 913 double_constants.negative_infinity = -V8_INFINITY; | 907 double_constants.negative_infinity = -V8_INFINITY; |
| 914 double_constants.uint32_bias = | 908 double_constants.uint32_bias = |
| 915 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1; | 909 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1; |
| 916 | 910 |
| 917 math_exp_data_mutex = new base::Mutex(); | 911 math_exp_data_mutex = new base::Mutex(); |
| 918 } | 912 } |
| 919 | 913 |
| 920 | 914 |
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1158 isolate->heap()->NewSpaceMask())); | 1152 isolate->heap()->NewSpaceMask())); |
| 1159 } | 1153 } |
| 1160 | 1154 |
| 1161 | 1155 |
| 1162 ExternalReference ExternalReference::new_space_allocation_top_address( | 1156 ExternalReference ExternalReference::new_space_allocation_top_address( |
| 1163 Isolate* isolate) { | 1157 Isolate* isolate) { |
| 1164 return ExternalReference(isolate->heap()->NewSpaceAllocationTopAddress()); | 1158 return ExternalReference(isolate->heap()->NewSpaceAllocationTopAddress()); |
| 1165 } | 1159 } |
| 1166 | 1160 |
| 1167 | 1161 |
| 1168 ExternalReference ExternalReference::heap_always_allocate_scope_depth( | |
| 1169 Isolate* isolate) { | |
| 1170 Heap* heap = isolate->heap(); | |
| 1171 return ExternalReference(heap->always_allocate_scope_depth_address()); | |
| 1172 } | |
| 1173 | |
| 1174 | |
| 1175 ExternalReference ExternalReference::new_space_allocation_limit_address( | 1162 ExternalReference ExternalReference::new_space_allocation_limit_address( |
| 1176 Isolate* isolate) { | 1163 Isolate* isolate) { |
| 1177 return ExternalReference(isolate->heap()->NewSpaceAllocationLimitAddress()); | 1164 return ExternalReference(isolate->heap()->NewSpaceAllocationLimitAddress()); |
| 1178 } | 1165 } |
| 1179 | 1166 |
| 1180 | 1167 |
| 1181 ExternalReference ExternalReference::old_pointer_space_allocation_top_address( | 1168 ExternalReference ExternalReference::old_pointer_space_allocation_top_address( |
| 1182 Isolate* isolate) { | 1169 Isolate* isolate) { |
| 1183 return ExternalReference( | 1170 return ExternalReference( |
| 1184 isolate->heap()->OldPointerSpaceAllocationTopAddress()); | 1171 isolate->heap()->OldPointerSpaceAllocationTopAddress()); |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1257 return ExternalReference(reinterpret_cast<void*>(&double_constants.one_half)); | 1244 return ExternalReference(reinterpret_cast<void*>(&double_constants.one_half)); |
| 1258 } | 1245 } |
| 1259 | 1246 |
| 1260 | 1247 |
| 1261 ExternalReference ExternalReference::address_of_minus_one_half() { | 1248 ExternalReference ExternalReference::address_of_minus_one_half() { |
| 1262 return ExternalReference( | 1249 return ExternalReference( |
| 1263 reinterpret_cast<void*>(&double_constants.minus_one_half)); | 1250 reinterpret_cast<void*>(&double_constants.minus_one_half)); |
| 1264 } | 1251 } |
| 1265 | 1252 |
| 1266 | 1253 |
| 1267 ExternalReference ExternalReference::address_of_minus_zero() { | |
| 1268 return ExternalReference( | |
| 1269 reinterpret_cast<void*>(&double_constants.minus_zero)); | |
| 1270 } | |
| 1271 | |
| 1272 | |
| 1273 ExternalReference ExternalReference::address_of_zero() { | |
| 1274 return ExternalReference(reinterpret_cast<void*>(&double_constants.zero)); | |
| 1275 } | |
| 1276 | |
| 1277 | |
| 1278 ExternalReference ExternalReference::address_of_uint8_max_value() { | |
| 1279 return ExternalReference( | |
| 1280 reinterpret_cast<void*>(&double_constants.uint8_max_value)); | |
| 1281 } | |
| 1282 | |
| 1283 | |
| 1284 ExternalReference ExternalReference::address_of_negative_infinity() { | 1254 ExternalReference ExternalReference::address_of_negative_infinity() { |
| 1285 return ExternalReference( | 1255 return ExternalReference( |
| 1286 reinterpret_cast<void*>(&double_constants.negative_infinity)); | 1256 reinterpret_cast<void*>(&double_constants.negative_infinity)); |
| 1287 } | 1257 } |
| 1288 | 1258 |
| 1289 | 1259 |
| 1290 ExternalReference ExternalReference::address_of_canonical_non_hole_nan() { | 1260 ExternalReference ExternalReference::address_of_canonical_non_hole_nan() { |
| 1291 return ExternalReference( | 1261 return ExternalReference( |
| 1292 reinterpret_cast<void*>(&double_constants.canonical_non_hole_nan)); | 1262 reinterpret_cast<void*>(&double_constants.canonical_non_hole_nan)); |
| 1293 } | 1263 } |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1646 r2 = r2 - ad; | 1616 r2 = r2 - ad; |
| 1647 } | 1617 } |
| 1648 delta = ad - r2; | 1618 delta = ad - r2; |
| 1649 } while (q1 < delta || (q1 == delta && r1 == 0)); | 1619 } while (q1 < delta || (q1 == delta && r1 == 0)); |
| 1650 int32_t mul = static_cast<int32_t>(q2 + 1); | 1620 int32_t mul = static_cast<int32_t>(q2 + 1); |
| 1651 multiplier_ = (d < 0) ? -mul : mul; | 1621 multiplier_ = (d < 0) ? -mul : mul; |
| 1652 shift_ = p - 32; | 1622 shift_ = p - 32; |
| 1653 } | 1623 } |
| 1654 | 1624 |
| 1655 } } // namespace v8::internal | 1625 } } // namespace v8::internal |
| OLD | NEW |