OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include <fstream> // NOLINT(readability/streams) | 7 #include <fstream> // NOLINT(readability/streams) |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/v8.h" | 10 #include "src/v8.h" |
(...skipping 1718 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1729 random_number_generator_(NULL), | 1729 random_number_generator_(NULL), |
1730 store_buffer_hash_set_1_address_(NULL), | 1730 store_buffer_hash_set_1_address_(NULL), |
1731 store_buffer_hash_set_2_address_(NULL), | 1731 store_buffer_hash_set_2_address_(NULL), |
1732 serializer_enabled_(enable_serializer), | 1732 serializer_enabled_(enable_serializer), |
1733 has_fatal_error_(false), | 1733 has_fatal_error_(false), |
1734 initialized_from_snapshot_(false), | 1734 initialized_from_snapshot_(false), |
1735 cpu_profiler_(NULL), | 1735 cpu_profiler_(NULL), |
1736 heap_profiler_(NULL), | 1736 heap_profiler_(NULL), |
1737 function_entry_hook_(NULL), | 1737 function_entry_hook_(NULL), |
1738 deferred_handles_head_(NULL), | 1738 deferred_handles_head_(NULL), |
1739 optimizing_compiler_thread_(NULL), | 1739 optimizing_compile_dispatcher_(NULL), |
1740 stress_deopt_count_(0), | 1740 stress_deopt_count_(0), |
1741 next_optimization_id_(0), | 1741 next_optimization_id_(0), |
1742 #if TRACE_MAPS | 1742 #if TRACE_MAPS |
1743 next_unique_sfi_id_(0), | 1743 next_unique_sfi_id_(0), |
1744 #endif | 1744 #endif |
1745 use_counter_callback_(NULL), | 1745 use_counter_callback_(NULL), |
1746 basic_block_profiler_(NULL) { | 1746 basic_block_profiler_(NULL) { |
1747 { | 1747 { |
1748 base::LockGuard<base::Mutex> lock_guard(thread_data_table_mutex_.Pointer()); | 1748 base::LockGuard<base::Mutex> lock_guard(thread_data_table_mutex_.Pointer()); |
1749 CHECK(thread_data_table_); | 1749 CHECK(thread_data_table_); |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1826 | 1826 |
1827 | 1827 |
1828 void Isolate::Deinit() { | 1828 void Isolate::Deinit() { |
1829 TRACE_ISOLATE(deinit); | 1829 TRACE_ISOLATE(deinit); |
1830 | 1830 |
1831 debug()->Unload(); | 1831 debug()->Unload(); |
1832 | 1832 |
1833 FreeThreadResources(); | 1833 FreeThreadResources(); |
1834 | 1834 |
1835 if (concurrent_recompilation_enabled()) { | 1835 if (concurrent_recompilation_enabled()) { |
1836 optimizing_compiler_thread_->Stop(); | 1836 optimizing_compile_dispatcher_->Stop(); |
1837 delete optimizing_compiler_thread_; | 1837 delete optimizing_compile_dispatcher_; |
1838 optimizing_compiler_thread_ = NULL; | 1838 optimizing_compile_dispatcher_ = NULL; |
1839 } | 1839 } |
1840 | 1840 |
1841 if (heap_.mark_compact_collector()->sweeping_in_progress()) { | 1841 if (heap_.mark_compact_collector()->sweeping_in_progress()) { |
1842 heap_.mark_compact_collector()->EnsureSweepingCompleted(); | 1842 heap_.mark_compact_collector()->EnsureSweepingCompleted(); |
1843 } | 1843 } |
1844 | 1844 |
1845 DumpAndResetCompilationStats(); | 1845 DumpAndResetCompilationStats(); |
1846 | 1846 |
1847 if (FLAG_print_deopt_stress) { | 1847 if (FLAG_print_deopt_stress) { |
1848 PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_); | 1848 PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_); |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2126 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults | 2126 // TODO(yangguo): move this to ResourceConstraints::ConfigureDefaults |
2127 // once ResourceConstraints becomes an argument to the Isolate constructor. | 2127 // once ResourceConstraints becomes an argument to the Isolate constructor. |
2128 if (max_available_threads_ < 1) { | 2128 if (max_available_threads_ < 1) { |
2129 // Choose the default between 1 and 4. | 2129 // Choose the default between 1 and 4. |
2130 max_available_threads_ = | 2130 max_available_threads_ = |
2131 Max(Min(base::SysInfo::NumberOfProcessors(), 4), 1); | 2131 Max(Min(base::SysInfo::NumberOfProcessors(), 4), 1); |
2132 } | 2132 } |
2133 | 2133 |
2134 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { | 2134 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { |
2135 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 2135 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
2136 } else if (OptimizingCompilerThread::Enabled(max_available_threads_)) { | 2136 } else if (OptimizingCompileDispatcher::Enabled(max_available_threads_)) { |
2137 optimizing_compiler_thread_ = new OptimizingCompilerThread(this); | 2137 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); |
2138 optimizing_compiler_thread_->Start(); | |
2139 } | 2138 } |
2140 | 2139 |
2141 // Initialize runtime profiler before deserialization, because collections may | 2140 // Initialize runtime profiler before deserialization, because collections may |
2142 // occur, clearing/updating ICs. | 2141 // occur, clearing/updating ICs. |
2143 runtime_profiler_ = new RuntimeProfiler(this); | 2142 runtime_profiler_ = new RuntimeProfiler(this); |
2144 | 2143 |
2145 // If we are deserializing, read the state into the now-empty heap. | 2144 // If we are deserializing, read the state into the now-empty heap. |
2146 if (!create_heap_objects) { | 2145 if (!create_heap_objects) { |
2147 des->Deserialize(this); | 2146 des->Deserialize(this); |
2148 } | 2147 } |
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2659 if (prev_ && prev_->Intercept(flag)) return true; | 2658 if (prev_ && prev_->Intercept(flag)) return true; |
2660 // Then check whether this scope intercepts. | 2659 // Then check whether this scope intercepts. |
2661 if ((flag & intercept_mask_)) { | 2660 if ((flag & intercept_mask_)) { |
2662 intercepted_flags_ |= flag; | 2661 intercepted_flags_ |= flag; |
2663 return true; | 2662 return true; |
2664 } | 2663 } |
2665 return false; | 2664 return false; |
2666 } | 2665 } |
2667 | 2666 |
2668 } } // namespace v8::internal | 2667 } } // namespace v8::internal |
OLD | NEW |