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 "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 26 matching lines...) Expand all Loading... |
37 #include "src/interpreter/interpreter.h" | 37 #include "src/interpreter/interpreter.h" |
38 #include "src/isolate-inl.h" | 38 #include "src/isolate-inl.h" |
39 #include "src/libsampler/sampler.h" | 39 #include "src/libsampler/sampler.h" |
40 #include "src/log.h" | 40 #include "src/log.h" |
41 #include "src/messages.h" | 41 #include "src/messages.h" |
42 #include "src/objects/frame-array-inl.h" | 42 #include "src/objects/frame-array-inl.h" |
43 #include "src/profiler/cpu-profiler.h" | 43 #include "src/profiler/cpu-profiler.h" |
44 #include "src/prototype.h" | 44 #include "src/prototype.h" |
45 #include "src/regexp/regexp-stack.h" | 45 #include "src/regexp/regexp-stack.h" |
46 #include "src/runtime-profiler.h" | 46 #include "src/runtime-profiler.h" |
47 #include "src/setup-isolate.h" | |
48 #include "src/simulator.h" | 47 #include "src/simulator.h" |
49 #include "src/snapshot/deserializer.h" | 48 #include "src/snapshot/deserializer.h" |
50 #include "src/tracing/tracing-category-observer.h" | 49 #include "src/tracing/tracing-category-observer.h" |
51 #include "src/v8.h" | 50 #include "src/v8.h" |
52 #include "src/version.h" | 51 #include "src/version.h" |
53 #include "src/vm-state-inl.h" | 52 #include "src/vm-state-inl.h" |
54 #include "src/wasm/wasm-module.h" | 53 #include "src/wasm/wasm-module.h" |
55 #include "src/wasm/wasm-objects.h" | 54 #include "src/wasm/wasm-objects.h" |
56 #include "src/zone/accounting-allocator.h" | 55 #include "src/zone/accounting-allocator.h" |
57 | 56 |
(...skipping 2163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2221 descriptor_lookup_cache_(NULL), | 2220 descriptor_lookup_cache_(NULL), |
2222 handle_scope_implementer_(NULL), | 2221 handle_scope_implementer_(NULL), |
2223 unicode_cache_(NULL), | 2222 unicode_cache_(NULL), |
2224 allocator_(FLAG_trace_gc_object_stats ? new VerboseAccountingAllocator( | 2223 allocator_(FLAG_trace_gc_object_stats ? new VerboseAccountingAllocator( |
2225 &heap_, 256 * KB, 128 * KB) | 2224 &heap_, 256 * KB, 128 * KB) |
2226 : new AccountingAllocator()), | 2225 : new AccountingAllocator()), |
2227 inner_pointer_to_code_cache_(NULL), | 2226 inner_pointer_to_code_cache_(NULL), |
2228 global_handles_(NULL), | 2227 global_handles_(NULL), |
2229 eternal_handles_(NULL), | 2228 eternal_handles_(NULL), |
2230 thread_manager_(NULL), | 2229 thread_manager_(NULL), |
2231 setup_delegate_(NULL), | |
2232 regexp_stack_(NULL), | 2230 regexp_stack_(NULL), |
2233 date_cache_(NULL), | 2231 date_cache_(NULL), |
2234 call_descriptor_data_(NULL), | 2232 call_descriptor_data_(NULL), |
2235 // TODO(bmeurer) Initialized lazily because it depends on flags; can | 2233 // TODO(bmeurer) Initialized lazily because it depends on flags; can |
2236 // be fixed once the default isolate cleanup is done. | 2234 // be fixed once the default isolate cleanup is done. |
2237 random_number_generator_(NULL), | 2235 random_number_generator_(NULL), |
2238 rail_mode_(PERFORMANCE_ANIMATION), | 2236 rail_mode_(PERFORMANCE_ANIMATION), |
2239 promise_hook_or_debug_is_active_(false), | 2237 promise_hook_or_debug_is_active_(false), |
2240 promise_hook_(NULL), | 2238 promise_hook_(NULL), |
2241 load_start_time_ms_(0), | 2239 load_start_time_ms_(0), |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2661 } | 2659 } |
2662 | 2660 |
2663 if (create_heap_objects) { | 2661 if (create_heap_objects) { |
2664 // Terminate the partial snapshot cache so we can iterate. | 2662 // Terminate the partial snapshot cache so we can iterate. |
2665 partial_snapshot_cache_.Add(heap_.undefined_value()); | 2663 partial_snapshot_cache_.Add(heap_.undefined_value()); |
2666 } | 2664 } |
2667 | 2665 |
2668 InitializeThreadLocal(); | 2666 InitializeThreadLocal(); |
2669 | 2667 |
2670 bootstrapper_->Initialize(create_heap_objects); | 2668 bootstrapper_->Initialize(create_heap_objects); |
2671 if (setup_delegate_ == nullptr) { | 2669 builtins_.SetUp(this, create_heap_objects); |
2672 setup_delegate_ = new SetupIsolateDelegate(); | |
2673 } | |
2674 setup_delegate_->SetupBuiltins(this, create_heap_objects); | |
2675 if (create_heap_objects) heap_.CreateFixedStubs(); | 2670 if (create_heap_objects) heap_.CreateFixedStubs(); |
2676 | 2671 |
2677 if (FLAG_log_internal_timer_events) { | 2672 if (FLAG_log_internal_timer_events) { |
2678 set_event_logger(Logger::DefaultEventLoggerSentinel); | 2673 set_event_logger(Logger::DefaultEventLoggerSentinel); |
2679 } | 2674 } |
2680 | 2675 |
2681 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs || FLAG_trace_turbo || | 2676 if (FLAG_trace_hydrogen || FLAG_trace_hydrogen_stubs || FLAG_trace_turbo || |
2682 FLAG_trace_turbo_graph) { | 2677 FLAG_trace_turbo_graph) { |
2683 PrintF("Concurrent recompilation has been disabled for tracing.\n"); | 2678 PrintF("Concurrent recompilation has been disabled for tracing.\n"); |
2684 } else if (OptimizingCompileDispatcher::Enabled()) { | 2679 } else if (OptimizingCompileDispatcher::Enabled()) { |
2685 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); | 2680 optimizing_compile_dispatcher_ = new OptimizingCompileDispatcher(this); |
2686 } | 2681 } |
2687 | 2682 |
2688 // Initialize runtime profiler before deserialization, because collections may | 2683 // Initialize runtime profiler before deserialization, because collections may |
2689 // occur, clearing/updating ICs. | 2684 // occur, clearing/updating ICs. |
2690 runtime_profiler_ = new RuntimeProfiler(this); | 2685 runtime_profiler_ = new RuntimeProfiler(this); |
2691 | 2686 |
2692 // If we are deserializing, read the state into the now-empty heap. | 2687 // If we are deserializing, read the state into the now-empty heap. |
2693 { | 2688 { |
2694 AlwaysAllocateScope always_allocate(this); | 2689 AlwaysAllocateScope always_allocate(this); |
2695 | 2690 |
2696 if (!create_heap_objects) { | 2691 if (!create_heap_objects) { |
2697 des->Deserialize(this); | 2692 des->Deserialize(this); |
2698 } | 2693 } |
2699 load_stub_cache_->Initialize(); | 2694 load_stub_cache_->Initialize(); |
2700 store_stub_cache_->Initialize(); | 2695 store_stub_cache_->Initialize(); |
2701 setup_delegate_->SetupInterpreter(interpreter_, create_heap_objects); | 2696 interpreter_->Initialize(); |
2702 | 2697 |
2703 heap_.NotifyDeserializationComplete(); | 2698 heap_.NotifyDeserializationComplete(); |
2704 } | 2699 } |
2705 delete setup_delegate_; | |
2706 setup_delegate_ = nullptr; | |
2707 | 2700 |
2708 // Finish initialization of ThreadLocal after deserialization is done. | 2701 // Finish initialization of ThreadLocal after deserialization is done. |
2709 clear_pending_exception(); | 2702 clear_pending_exception(); |
2710 clear_pending_message(); | 2703 clear_pending_message(); |
2711 clear_scheduled_exception(); | 2704 clear_scheduled_exception(); |
2712 | 2705 |
2713 // Deserializing may put strange things in the root array's copy of the | 2706 // Deserializing may put strange things in the root array's copy of the |
2714 // stack guard. | 2707 // stack guard. |
2715 heap_.SetStackLimits(); | 2708 heap_.SetStackLimits(); |
2716 | 2709 |
(...skipping 941 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3658 // Then check whether this scope intercepts. | 3651 // Then check whether this scope intercepts. |
3659 if ((flag & intercept_mask_)) { | 3652 if ((flag & intercept_mask_)) { |
3660 intercepted_flags_ |= flag; | 3653 intercepted_flags_ |= flag; |
3661 return true; | 3654 return true; |
3662 } | 3655 } |
3663 return false; | 3656 return false; |
3664 } | 3657 } |
3665 | 3658 |
3666 } // namespace internal | 3659 } // namespace internal |
3667 } // namespace v8 | 3660 } // namespace v8 |
OLD | NEW |