Index: src/isolate.h |
diff --git a/src/isolate.h b/src/isolate.h |
index aad853dc0851fe670179a8fab4ebe720744e40a0..7a376b1a3a3003f385d7513a9a7bb814d1bae6ce 100644 |
--- a/src/isolate.h |
+++ b/src/isolate.h |
@@ -866,13 +866,20 @@ class Isolate { |
#undef NATIVE_CONTEXT_FIELD_ACCESSOR |
Bootstrapper* bootstrapper() { return bootstrapper_; } |
+ // Use for updating counters on a foreground thread. |
Counters* counters() { |
kschimpf
2017/06/09 20:03:37
Added check that this is only called on the foregr
|
- // Call InitializeLoggingAndCounters() if logging is needed before |
- // the isolate is fully initialized. |
+ DCHECK(!IsIsolateInBackground()); |
+ // Make sure InitializeCounters() has been called. |
DCHECK_NOT_NULL(counters_shared_.get()); |
return counters_shared_.get(); |
} |
- std::shared_ptr<Counters> counters_shared() { return counters_shared_; } |
+ // Use for updating counters on a background thread. |
+ std::shared_ptr<Counters> counters_shared() { |
+ DCHECK(!IsIsolateInBackground()); |
kschimpf
2017/06/09 20:03:37
Same here.
|
+ // Make sure InitializeCounters() has been called. |
+ DCHECK_NOT_NULL(counters_shared_.get()); |
+ return counters_shared_; |
+ } |
RuntimeProfiler* runtime_profiler() { return runtime_profiler_; } |
CompilationCache* compilation_cache() { return compilation_cache_; } |
Logger* logger() { |