Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1425)

Unified Diff: src/isolate.cc

Issue 2919953003: Clean up issues raised on previous CL. (Closed)
Patch Set: Fix nits. Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.h ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index f2564f9f3eb83cfb1042b2d583b1295c03e88332..79a348b6e48d5914228945b7f2ac4cece59e7ecf 100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -2288,7 +2288,6 @@ Isolate::Isolate(bool enable_serializer)
bootstrapper_(NULL),
runtime_profiler_(NULL),
compilation_cache_(NULL),
- counters_(NULL),
logger_(NULL),
stats_table_(NULL),
load_stub_cache_(NULL),
@@ -2552,8 +2551,6 @@ Isolate::~Isolate() {
delete logger_;
logger_ = NULL;
- counters_ = NULL;
-
delete handle_scope_implementer_;
handle_scope_implementer_ = NULL;
@@ -2637,14 +2634,9 @@ bool Isolate::PropagatePendingExceptionToExternalTryCatch() {
return true;
}
-static base::LazyMutex initialize_counters_mutex = LAZY_MUTEX_INITIALIZER;
-
bool Isolate::InitializeCounters() {
- if (counters_ != nullptr) return false;
- base::LockGuard<base::Mutex> guard(initialize_counters_mutex.Pointer());
- if (counters_ != nullptr) return false;
+ if (counters_shared_) return false;
counters_shared_ = std::make_shared<Counters>(this);
- counters_ = counters_shared_.get();
return true;
}
@@ -2864,7 +2856,8 @@ bool Isolate::Init(Deserializer* des) {
StatsTable* Isolate::stats_table() {
if (stats_table_ != nullptr) return stats_table_;
InitializeCounters();
- return stats_table_ = counters_->stats_table();
+ stats_table_ = counters_shared_->stats_table();
+ return stats_table_;
}
« no previous file with comments | « src/isolate.h ('k') | src/wasm/wasm-module.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698