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 #ifndef V8_ISOLATE_H_ | 5 #ifndef V8_ISOLATE_H_ |
6 #define V8_ISOLATE_H_ | 6 #define V8_ISOLATE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
859 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR) | 859 ISOLATE_INIT_ARRAY_LIST(GLOBAL_ARRAY_ACCESSOR) |
860 #undef GLOBAL_ARRAY_ACCESSOR | 860 #undef GLOBAL_ARRAY_ACCESSOR |
861 | 861 |
862 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ | 862 #define NATIVE_CONTEXT_FIELD_ACCESSOR(index, type, name) \ |
863 inline Handle<type> name(); \ | 863 inline Handle<type> name(); \ |
864 inline bool is_##name(type* value); | 864 inline bool is_##name(type* value); |
865 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) | 865 NATIVE_CONTEXT_FIELDS(NATIVE_CONTEXT_FIELD_ACCESSOR) |
866 #undef NATIVE_CONTEXT_FIELD_ACCESSOR | 866 #undef NATIVE_CONTEXT_FIELD_ACCESSOR |
867 | 867 |
868 Bootstrapper* bootstrapper() { return bootstrapper_; } | 868 Bootstrapper* bootstrapper() { return bootstrapper_; } |
869 // Use for updating counters on a foreground thread. | |
869 Counters* counters() { | 870 Counters* counters() { |
jochen (gone - plz use gerrit)
2017/06/12 09:18:34
why not have counters() always return the shared_p
kschimpf
2017/06/12 16:47:05
Because too much code accesses it like this:
C
| |
870 // Call InitializeLoggingAndCounters() if logging is needed before | 871 DCHECK(!IsIsolateInBackground()); |
871 // the isolate is fully initialized. | 872 // Make sure InitializeCounters() has been called. |
872 DCHECK_NOT_NULL(counters_shared_.get()); | 873 DCHECK_NOT_NULL(counters_shared_.get()); |
873 return counters_shared_.get(); | 874 return counters_shared_.get(); |
874 } | 875 } |
875 std::shared_ptr<Counters> counters_shared() { return counters_shared_; } | 876 // Use for updating counters on a background thread. |
877 std::shared_ptr<Counters> counters_shared() { | |
878 DCHECK(!IsIsolateInBackground()); | |
879 // Make sure InitializeCounters() has been called. | |
880 DCHECK_NOT_NULL(counters_shared_.get()); | |
881 return counters_shared_; | |
882 } | |
876 RuntimeProfiler* runtime_profiler() { return runtime_profiler_; } | 883 RuntimeProfiler* runtime_profiler() { return runtime_profiler_; } |
877 CompilationCache* compilation_cache() { return compilation_cache_; } | 884 CompilationCache* compilation_cache() { return compilation_cache_; } |
878 Logger* logger() { | 885 Logger* logger() { |
879 // Call InitializeLoggingAndCounters() if logging is needed before | 886 // Call InitializeLoggingAndCounters() if logging is needed before |
880 // the isolate is fully initialized. | 887 // the isolate is fully initialized. |
881 DCHECK_NOT_NULL(logger_); | 888 DCHECK_NOT_NULL(logger_); |
882 return logger_; | 889 return logger_; |
883 } | 890 } |
884 StackGuard* stack_guard() { return &stack_guard_; } | 891 StackGuard* stack_guard() { return &stack_guard_; } |
885 Heap* heap() { return &heap_; } | 892 Heap* heap() { return &heap_; } |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1817 | 1824 |
1818 EmbeddedVector<char, 128> filename_; | 1825 EmbeddedVector<char, 128> filename_; |
1819 FILE* file_; | 1826 FILE* file_; |
1820 int scope_depth_; | 1827 int scope_depth_; |
1821 }; | 1828 }; |
1822 | 1829 |
1823 } // namespace internal | 1830 } // namespace internal |
1824 } // namespace v8 | 1831 } // namespace v8 |
1825 | 1832 |
1826 #endif // V8_ISOLATE_H_ | 1833 #endif // V8_ISOLATE_H_ |
OLD | NEW |