| 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" |
| 11 | 11 |
| 12 #include "src/ast.h" | 12 #include "src/ast.h" |
| 13 #include "src/base/platform/platform.h" | 13 #include "src/base/platform/platform.h" |
| 14 #include "src/base/sys-info.h" | 14 #include "src/base/sys-info.h" |
| 15 #include "src/base/utils/random-number-generator.h" | 15 #include "src/base/utils/random-number-generator.h" |
| 16 #include "src/basic-block-profiler.h" | 16 #include "src/basic-block-profiler.h" |
| 17 #include "src/bootstrapper.h" | 17 #include "src/bootstrapper.h" |
| 18 #include "src/codegen.h" | 18 #include "src/codegen.h" |
| 19 #include "src/compilation-cache.h" | 19 #include "src/compilation-cache.h" |
| 20 #include "src/compilation-statistics.h" | 20 #include "src/compilation-statistics.h" |
| 21 #include "src/cpu-profiler.h" | 21 #include "src/cpu-profiler.h" |
| 22 #include "src/debug.h" | 22 #include "src/debug.h" |
| 23 #include "src/deoptimizer.h" | 23 #include "src/deoptimizer.h" |
| 24 #include "src/heap/spaces.h" | 24 #include "src/heap/spaces.h" |
| 25 #include "src/heap-profiler.h" | 25 #include "src/heap-profiler.h" |
| 26 #include "src/hydrogen.h" | 26 #include "src/hydrogen.h" |
| 27 #include "src/ic/stub-cache.h" | 27 #include "src/ic/stub-cache.h" |
| 28 #include "src/interpreter/interpreter.h" |
| 28 #include "src/lithium-allocator.h" | 29 #include "src/lithium-allocator.h" |
| 29 #include "src/log.h" | 30 #include "src/log.h" |
| 30 #include "src/messages.h" | 31 #include "src/messages.h" |
| 31 #include "src/prototype.h" | 32 #include "src/prototype.h" |
| 32 #include "src/regexp-stack.h" | 33 #include "src/regexp-stack.h" |
| 33 #include "src/runtime-profiler.h" | 34 #include "src/runtime-profiler.h" |
| 34 #include "src/sampler.h" | 35 #include "src/sampler.h" |
| 35 #include "src/scopeinfo.h" | 36 #include "src/scopeinfo.h" |
| 36 #include "src/simulator.h" | 37 #include "src/simulator.h" |
| 37 #include "src/snapshot/serialize.h" | 38 #include "src/snapshot/serialize.h" |
| (...skipping 1846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1884 DumpAndResetCompilationStats(); | 1885 DumpAndResetCompilationStats(); |
| 1885 | 1886 |
| 1886 if (FLAG_print_deopt_stress) { | 1887 if (FLAG_print_deopt_stress) { |
| 1887 PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_); | 1888 PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_); |
| 1888 } | 1889 } |
| 1889 | 1890 |
| 1890 // We must stop the logger before we tear down other components. | 1891 // We must stop the logger before we tear down other components. |
| 1891 Sampler* sampler = logger_->sampler(); | 1892 Sampler* sampler = logger_->sampler(); |
| 1892 if (sampler && sampler->IsActive()) sampler->Stop(); | 1893 if (sampler && sampler->IsActive()) sampler->Stop(); |
| 1893 | 1894 |
| 1895 delete interpreter_; |
| 1896 interpreter_ = NULL; |
| 1897 |
| 1894 delete deoptimizer_data_; | 1898 delete deoptimizer_data_; |
| 1895 deoptimizer_data_ = NULL; | 1899 deoptimizer_data_ = NULL; |
| 1896 builtins_.TearDown(); | 1900 builtins_.TearDown(); |
| 1897 bootstrapper_->TearDown(); | 1901 bootstrapper_->TearDown(); |
| 1898 | 1902 |
| 1899 if (runtime_profiler_ != NULL) { | 1903 if (runtime_profiler_ != NULL) { |
| 1900 delete runtime_profiler_; | 1904 delete runtime_profiler_; |
| 1901 runtime_profiler_ = NULL; | 1905 runtime_profiler_ = NULL; |
| 1902 } | 1906 } |
| 1903 | 1907 |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2114 handle_scope_implementer_ = new HandleScopeImplementer(this); | 2118 handle_scope_implementer_ = new HandleScopeImplementer(this); |
| 2115 stub_cache_ = new StubCache(this); | 2119 stub_cache_ = new StubCache(this); |
| 2116 materialized_object_store_ = new MaterializedObjectStore(this); | 2120 materialized_object_store_ = new MaterializedObjectStore(this); |
| 2117 regexp_stack_ = new RegExpStack(); | 2121 regexp_stack_ = new RegExpStack(); |
| 2118 regexp_stack_->isolate_ = this; | 2122 regexp_stack_->isolate_ = this; |
| 2119 date_cache_ = new DateCache(); | 2123 date_cache_ = new DateCache(); |
| 2120 call_descriptor_data_ = | 2124 call_descriptor_data_ = |
| 2121 new CallInterfaceDescriptorData[CallDescriptors::NUMBER_OF_DESCRIPTORS]; | 2125 new CallInterfaceDescriptorData[CallDescriptors::NUMBER_OF_DESCRIPTORS]; |
| 2122 cpu_profiler_ = new CpuProfiler(this); | 2126 cpu_profiler_ = new CpuProfiler(this); |
| 2123 heap_profiler_ = new HeapProfiler(heap()); | 2127 heap_profiler_ = new HeapProfiler(heap()); |
| 2128 interpreter_ = new interpreter::Interpreter(this); |
| 2124 | 2129 |
| 2125 // Enable logging before setting up the heap | 2130 // Enable logging before setting up the heap |
| 2126 logger_->SetUp(this); | 2131 logger_->SetUp(this); |
| 2127 | 2132 |
| 2128 // Initialize other runtime facilities | 2133 // Initialize other runtime facilities |
| 2129 #if defined(USE_SIMULATOR) | 2134 #if defined(USE_SIMULATOR) |
| 2130 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS || \ | 2135 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS || \ |
| 2131 V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC | 2136 V8_TARGET_ARCH_MIPS64 || V8_TARGET_ARCH_PPC |
| 2132 Simulator::Initialize(this); | 2137 Simulator::Initialize(this); |
| 2133 #endif | 2138 #endif |
| (...skipping 27 matching lines...) Expand all Loading... |
| 2161 if (create_heap_objects) { | 2166 if (create_heap_objects) { |
| 2162 // Terminate the cache array with the sentinel so we can iterate. | 2167 // Terminate the cache array with the sentinel so we can iterate. |
| 2163 partial_snapshot_cache_.Add(heap_.undefined_value()); | 2168 partial_snapshot_cache_.Add(heap_.undefined_value()); |
| 2164 } | 2169 } |
| 2165 | 2170 |
| 2166 InitializeThreadLocal(); | 2171 InitializeThreadLocal(); |
| 2167 | 2172 |
| 2168 bootstrapper_->Initialize(create_heap_objects); | 2173 bootstrapper_->Initialize(create_heap_objects); |
| 2169 builtins_.SetUp(this, create_heap_objects); | 2174 builtins_.SetUp(this, create_heap_objects); |
| 2170 | 2175 |
| 2176 if (FLAG_ignition) { |
| 2177 interpreter_->Initialize(create_heap_objects); |
| 2178 } |
| 2179 |
| 2171 if (FLAG_log_internal_timer_events) { | 2180 if (FLAG_log_internal_timer_events) { |
| 2172 set_event_logger(Logger::DefaultEventLoggerSentinel); | 2181 set_event_logger(Logger::DefaultEventLoggerSentinel); |
| 2173 } | 2182 } |
| 2174 | 2183 |
| 2175 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { | 2184 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs) { |
| 2176 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 2185 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
| 2177 } else if (OptimizingCompileDispatcher::Enabled()) { | 2186 } else if (OptimizingCompileDispatcher::Enabled()) { |
| 2178 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); | 2187 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); |
| 2179 } | 2188 } |
| 2180 | 2189 |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2829 // Then check whether this scope intercepts. | 2838 // Then check whether this scope intercepts. |
| 2830 if ((flag & intercept_mask_)) { | 2839 if ((flag & intercept_mask_)) { |
| 2831 intercepted_flags_ |= flag; | 2840 intercepted_flags_ |= flag; |
| 2832 return true; | 2841 return true; |
| 2833 } | 2842 } |
| 2834 return false; | 2843 return false; |
| 2835 } | 2844 } |
| 2836 | 2845 |
| 2837 } // namespace internal | 2846 } // namespace internal |
| 2838 } // namespace v8 | 2847 } // namespace v8 |
| OLD | NEW |