| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 struct DoubleConstant BASE_EMBEDDED { | 95 struct DoubleConstant BASE_EMBEDDED { |
| 96 double min_int; | 96 double min_int; |
| 97 double one_half; | 97 double one_half; |
| 98 double minus_one_half; | 98 double minus_one_half; |
| 99 double minus_zero; | 99 double minus_zero; |
| 100 double zero; | 100 double zero; |
| 101 double uint8_max_value; | 101 double uint8_max_value; |
| 102 double negative_infinity; | 102 double negative_infinity; |
| 103 double canonical_non_hole_nan; | 103 double canonical_non_hole_nan; |
| 104 double the_hole_nan; | 104 double the_hole_nan; |
| 105 double uint32_bias; |
| 105 }; | 106 }; |
| 106 | 107 |
| 107 static DoubleConstant double_constants; | 108 static DoubleConstant double_constants; |
| 108 | 109 |
| 109 const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING"; | 110 const char* const RelocInfo::kFillerCommentString = "DEOPTIMIZATION PADDING"; |
| 110 | 111 |
| 111 static bool math_exp_data_initialized = false; | 112 static bool math_exp_data_initialized = false; |
| 112 static Mutex* math_exp_data_mutex = NULL; | 113 static Mutex* math_exp_data_mutex = NULL; |
| 113 static double* math_exp_constants_array = NULL; | 114 static double* math_exp_constants_array = NULL; |
| 114 static double* math_exp_log_table_array = NULL; | 115 static double* math_exp_log_table_array = NULL; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 CpuFeatureScope::~CpuFeatureScope() { | 207 CpuFeatureScope::~CpuFeatureScope() { |
| 207 assembler_->set_enabled_cpu_features(old_enabled_); | 208 assembler_->set_enabled_cpu_features(old_enabled_); |
| 208 } | 209 } |
| 209 #endif | 210 #endif |
| 210 | 211 |
| 211 | 212 |
| 212 // ----------------------------------------------------------------------------- | 213 // ----------------------------------------------------------------------------- |
| 213 // Implementation of PlatformFeatureScope | 214 // Implementation of PlatformFeatureScope |
| 214 | 215 |
| 215 PlatformFeatureScope::PlatformFeatureScope(CpuFeature f) | 216 PlatformFeatureScope::PlatformFeatureScope(CpuFeature f) |
| 216 : old_supported_(CpuFeatures::supported_), | 217 : old_cross_compile_(CpuFeatures::cross_compile_) { |
| 217 old_found_by_runtime_probing_only_( | 218 // CpuFeatures is a global singleton, therefore this is only safe in |
| 218 CpuFeatures::found_by_runtime_probing_only_) { | 219 // single threaded code. |
| 220 ASSERT(Serializer::enabled()); |
| 219 uint64_t mask = static_cast<uint64_t>(1) << f; | 221 uint64_t mask = static_cast<uint64_t>(1) << f; |
| 220 CpuFeatures::supported_ |= mask; | 222 CpuFeatures::cross_compile_ |= mask; |
| 221 CpuFeatures::found_by_runtime_probing_only_ &= ~mask; | |
| 222 } | 223 } |
| 223 | 224 |
| 224 | 225 |
| 225 PlatformFeatureScope::~PlatformFeatureScope() { | 226 PlatformFeatureScope::~PlatformFeatureScope() { |
| 226 CpuFeatures::supported_ = old_supported_; | 227 CpuFeatures::cross_compile_ = old_cross_compile_; |
| 227 CpuFeatures::found_by_runtime_probing_only_ = | |
| 228 old_found_by_runtime_probing_only_; | |
| 229 } | 228 } |
| 230 | 229 |
| 231 | 230 |
| 232 // ----------------------------------------------------------------------------- | 231 // ----------------------------------------------------------------------------- |
| 233 // Implementation of Label | 232 // Implementation of Label |
| 234 | 233 |
| 235 int Label::pos() const { | 234 int Label::pos() const { |
| 236 if (pos_ < 0) return -pos_ - 1; | 235 if (pos_ < 0) return -pos_ - 1; |
| 237 if (pos_ > 0) return pos_ - 1; | 236 if (pos_ > 0) return pos_ - 1; |
| 238 UNREACHABLE(); | 237 UNREACHABLE(); |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 void ExternalReference::SetUp() { | 905 void ExternalReference::SetUp() { |
| 907 double_constants.min_int = kMinInt; | 906 double_constants.min_int = kMinInt; |
| 908 double_constants.one_half = 0.5; | 907 double_constants.one_half = 0.5; |
| 909 double_constants.minus_one_half = -0.5; | 908 double_constants.minus_one_half = -0.5; |
| 910 double_constants.minus_zero = -0.0; | 909 double_constants.minus_zero = -0.0; |
| 911 double_constants.uint8_max_value = 255; | 910 double_constants.uint8_max_value = 255; |
| 912 double_constants.zero = 0.0; | 911 double_constants.zero = 0.0; |
| 913 double_constants.canonical_non_hole_nan = OS::nan_value(); | 912 double_constants.canonical_non_hole_nan = OS::nan_value(); |
| 914 double_constants.the_hole_nan = BitCast<double>(kHoleNanInt64); | 913 double_constants.the_hole_nan = BitCast<double>(kHoleNanInt64); |
| 915 double_constants.negative_infinity = -V8_INFINITY; | 914 double_constants.negative_infinity = -V8_INFINITY; |
| 915 double_constants.uint32_bias = |
| 916 static_cast<double>(static_cast<uint32_t>(0xFFFFFFFF)) + 1; |
| 916 | 917 |
| 917 math_exp_data_mutex = new Mutex(); | 918 math_exp_data_mutex = new Mutex(); |
| 918 } | 919 } |
| 919 | 920 |
| 920 | 921 |
| 921 void ExternalReference::InitializeMathExpData() { | 922 void ExternalReference::InitializeMathExpData() { |
| 922 // Early return? | 923 // Early return? |
| 923 if (math_exp_data_initialized) return; | 924 if (math_exp_data_initialized) return; |
| 924 | 925 |
| 925 LockGuard<Mutex> lock_guard(math_exp_data_mutex); | 926 LockGuard<Mutex> lock_guard(math_exp_data_mutex); |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1083 } | 1084 } |
| 1084 | 1085 |
| 1085 | 1086 |
| 1086 ExternalReference ExternalReference::get_make_code_young_function( | 1087 ExternalReference ExternalReference::get_make_code_young_function( |
| 1087 Isolate* isolate) { | 1088 Isolate* isolate) { |
| 1088 return ExternalReference(Redirect( | 1089 return ExternalReference(Redirect( |
| 1089 isolate, FUNCTION_ADDR(Code::MakeCodeAgeSequenceYoung))); | 1090 isolate, FUNCTION_ADDR(Code::MakeCodeAgeSequenceYoung))); |
| 1090 } | 1091 } |
| 1091 | 1092 |
| 1092 | 1093 |
| 1094 ExternalReference ExternalReference::get_mark_code_as_executed_function( |
| 1095 Isolate* isolate) { |
| 1096 return ExternalReference(Redirect( |
| 1097 isolate, FUNCTION_ADDR(Code::MarkCodeAsExecuted))); |
| 1098 } |
| 1099 |
| 1100 |
| 1093 ExternalReference ExternalReference::date_cache_stamp(Isolate* isolate) { | 1101 ExternalReference ExternalReference::date_cache_stamp(Isolate* isolate) { |
| 1094 return ExternalReference(isolate->date_cache()->stamp_address()); | 1102 return ExternalReference(isolate->date_cache()->stamp_address()); |
| 1095 } | 1103 } |
| 1096 | 1104 |
| 1097 | 1105 |
| 1098 ExternalReference ExternalReference::stress_deopt_count(Isolate* isolate) { | 1106 ExternalReference ExternalReference::stress_deopt_count(Isolate* isolate) { |
| 1099 return ExternalReference(isolate->stress_deopt_count_address()); | 1107 return ExternalReference(isolate->stress_deopt_count_address()); |
| 1100 } | 1108 } |
| 1101 | 1109 |
| 1102 | 1110 |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1331 reinterpret_cast<void*>(&double_constants.canonical_non_hole_nan)); | 1339 reinterpret_cast<void*>(&double_constants.canonical_non_hole_nan)); |
| 1332 } | 1340 } |
| 1333 | 1341 |
| 1334 | 1342 |
| 1335 ExternalReference ExternalReference::address_of_the_hole_nan() { | 1343 ExternalReference ExternalReference::address_of_the_hole_nan() { |
| 1336 return ExternalReference( | 1344 return ExternalReference( |
| 1337 reinterpret_cast<void*>(&double_constants.the_hole_nan)); | 1345 reinterpret_cast<void*>(&double_constants.the_hole_nan)); |
| 1338 } | 1346 } |
| 1339 | 1347 |
| 1340 | 1348 |
| 1349 ExternalReference ExternalReference::record_object_allocation_function( |
| 1350 Isolate* isolate) { |
| 1351 return ExternalReference( |
| 1352 Redirect(isolate, |
| 1353 FUNCTION_ADDR(HeapProfiler::RecordObjectAllocationFromMasm))); |
| 1354 } |
| 1355 |
| 1356 |
| 1357 ExternalReference ExternalReference::address_of_uint32_bias() { |
| 1358 return ExternalReference( |
| 1359 reinterpret_cast<void*>(&double_constants.uint32_bias)); |
| 1360 } |
| 1361 |
| 1362 |
| 1341 #ifndef V8_INTERPRETED_REGEXP | 1363 #ifndef V8_INTERPRETED_REGEXP |
| 1342 | 1364 |
| 1343 ExternalReference ExternalReference::re_check_stack_guard_state( | 1365 ExternalReference ExternalReference::re_check_stack_guard_state( |
| 1344 Isolate* isolate) { | 1366 Isolate* isolate) { |
| 1345 Address function; | 1367 Address function; |
| 1346 #if V8_TARGET_ARCH_X64 | 1368 #if V8_TARGET_ARCH_X64 |
| 1347 function = FUNCTION_ADDR(RegExpMacroAssemblerX64::CheckStackGuardState); | 1369 function = FUNCTION_ADDR(RegExpMacroAssemblerX64::CheckStackGuardState); |
| 1348 #elif V8_TARGET_ARCH_IA32 | 1370 #elif V8_TARGET_ARCH_IA32 |
| 1349 function = FUNCTION_ADDR(RegExpMacroAssemblerIA32::CheckStackGuardState); | 1371 function = FUNCTION_ADDR(RegExpMacroAssemblerIA32::CheckStackGuardState); |
| 1350 #elif V8_TARGET_ARCH_A64 | 1372 #elif V8_TARGET_ARCH_A64 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1701 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); | 1723 assembler_->RecordRelocInfo(RelocInfo::POSITION, state_.current_position); |
| 1702 state_.written_position = state_.current_position; | 1724 state_.written_position = state_.current_position; |
| 1703 written = true; | 1725 written = true; |
| 1704 } | 1726 } |
| 1705 | 1727 |
| 1706 // Return whether something was written. | 1728 // Return whether something was written. |
| 1707 return written; | 1729 return written; |
| 1708 } | 1730 } |
| 1709 | 1731 |
| 1710 } } // namespace v8::internal | 1732 } } // namespace v8::internal |
| OLD | NEW |