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 2272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2283 | 2283 |
2284 Isolate::Isolate(bool enable_serializer) | 2284 Isolate::Isolate(bool enable_serializer) |
2285 : embedder_data_(), | 2285 : embedder_data_(), |
2286 entry_stack_(NULL), | 2286 entry_stack_(NULL), |
2287 stack_trace_nesting_level_(0), | 2287 stack_trace_nesting_level_(0), |
2288 incomplete_message_(NULL), | 2288 incomplete_message_(NULL), |
2289 bootstrapper_(NULL), | 2289 bootstrapper_(NULL), |
2290 runtime_profiler_(NULL), | 2290 runtime_profiler_(NULL), |
2291 compilation_cache_(NULL), | 2291 compilation_cache_(NULL), |
2292 logger_(NULL), | 2292 logger_(NULL), |
2293 stats_table_(NULL), | |
2294 load_stub_cache_(NULL), | 2293 load_stub_cache_(NULL), |
2295 store_stub_cache_(NULL), | 2294 store_stub_cache_(NULL), |
2296 code_aging_helper_(NULL), | 2295 code_aging_helper_(NULL), |
2297 deoptimizer_data_(NULL), | 2296 deoptimizer_data_(NULL), |
2298 deoptimizer_lazy_throw_(false), | 2297 deoptimizer_lazy_throw_(false), |
2299 materialized_object_store_(NULL), | 2298 materialized_object_store_(NULL), |
2300 capture_stack_trace_for_uncaught_exceptions_(false), | 2299 capture_stack_trace_for_uncaught_exceptions_(false), |
2301 stack_trace_for_uncaught_exceptions_frame_limit_(0), | 2300 stack_trace_for_uncaught_exceptions_frame_limit_(0), |
2302 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), | 2301 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), |
2303 context_slot_cache_(NULL), | 2302 context_slot_cache_(NULL), |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2537 descriptor_lookup_cache_ = NULL; | 2536 descriptor_lookup_cache_ = NULL; |
2538 delete context_slot_cache_; | 2537 delete context_slot_cache_; |
2539 context_slot_cache_ = NULL; | 2538 context_slot_cache_ = NULL; |
2540 | 2539 |
2541 delete load_stub_cache_; | 2540 delete load_stub_cache_; |
2542 load_stub_cache_ = NULL; | 2541 load_stub_cache_ = NULL; |
2543 delete store_stub_cache_; | 2542 delete store_stub_cache_; |
2544 store_stub_cache_ = NULL; | 2543 store_stub_cache_ = NULL; |
2545 delete code_aging_helper_; | 2544 delete code_aging_helper_; |
2546 code_aging_helper_ = NULL; | 2545 code_aging_helper_ = NULL; |
2547 stats_table_ = NULL; | |
2548 | 2546 |
2549 delete materialized_object_store_; | 2547 delete materialized_object_store_; |
2550 materialized_object_store_ = NULL; | 2548 materialized_object_store_ = NULL; |
2551 | 2549 |
2552 delete logger_; | 2550 delete logger_; |
2553 logger_ = NULL; | 2551 logger_ = NULL; |
2554 | 2552 |
2555 delete handle_scope_implementer_; | 2553 delete handle_scope_implementer_; |
2556 handle_scope_implementer_ = NULL; | 2554 handle_scope_implementer_ = NULL; |
2557 | 2555 |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2845 } | 2843 } |
2846 | 2844 |
2847 initialized_from_snapshot_ = (des != NULL); | 2845 initialized_from_snapshot_ = (des != NULL); |
2848 | 2846 |
2849 if (!FLAG_inline_new) heap_.DisableInlineAllocation(); | 2847 if (!FLAG_inline_new) heap_.DisableInlineAllocation(); |
2850 | 2848 |
2851 return true; | 2849 return true; |
2852 } | 2850 } |
2853 | 2851 |
2854 | 2852 |
2855 // Initialized lazily to allow early | |
2856 // v8::V8::SetAddHistogramSampleFunction calls. | |
2857 StatsTable* Isolate::stats_table() { | |
2858 if (stats_table_ != nullptr) return stats_table_; | |
2859 InitializeCounters(); | |
2860 stats_table_ = counters_shared_->stats_table(); | |
2861 return stats_table_; | |
2862 } | |
2863 | |
2864 | |
2865 void Isolate::Enter() { | 2853 void Isolate::Enter() { |
2866 Isolate* current_isolate = NULL; | 2854 Isolate* current_isolate = NULL; |
2867 PerIsolateThreadData* current_data = CurrentPerIsolateThreadData(); | 2855 PerIsolateThreadData* current_data = CurrentPerIsolateThreadData(); |
2868 if (current_data != NULL) { | 2856 if (current_data != NULL) { |
2869 current_isolate = current_data->isolate_; | 2857 current_isolate = current_data->isolate_; |
2870 DCHECK(current_isolate != NULL); | 2858 DCHECK(current_isolate != NULL); |
2871 if (current_isolate == this) { | 2859 if (current_isolate == this) { |
2872 DCHECK(Current() == this); | 2860 DCHECK(Current() == this); |
2873 DCHECK(entry_stack_ != NULL); | 2861 DCHECK(entry_stack_ != NULL); |
2874 DCHECK(entry_stack_->previous_thread_data == NULL || | 2862 DCHECK(entry_stack_->previous_thread_data == NULL || |
(...skipping 906 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3781 // Then check whether this scope intercepts. | 3769 // Then check whether this scope intercepts. |
3782 if ((flag & intercept_mask_)) { | 3770 if ((flag & intercept_mask_)) { |
3783 intercepted_flags_ |= flag; | 3771 intercepted_flags_ |= flag; |
3784 return true; | 3772 return true; |
3785 } | 3773 } |
3786 return false; | 3774 return false; |
3787 } | 3775 } |
3788 | 3776 |
3789 } // namespace internal | 3777 } // namespace internal |
3790 } // namespace v8 | 3778 } // namespace v8 |
OLD | NEW |