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

Unified Diff: src/compilation-statistics.cc

Issue 2572713003: [turbofan] Add a mutex for recording compilation statistics (Closed)
Patch Set: Created 4 years 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/compilation-statistics.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compilation-statistics.cc
diff --git a/src/compilation-statistics.cc b/src/compilation-statistics.cc
index d4ca39d6112a53ba2298d2fe626696d080cbf961..654807cc31c35419880177ef0edb093af732fc97 100644
--- a/src/compilation-statistics.cc
+++ b/src/compilation-statistics.cc
@@ -14,6 +14,8 @@ namespace internal {
void CompilationStatistics::RecordPhaseStats(const char* phase_kind_name,
const char* phase_name,
const BasicStats& stats) {
+ base::LockGuard<base::Mutex> guard(&record_mutex_);
+
std::string phase_name_str(phase_name);
auto it = phase_map_.find(phase_name_str);
if (it == phase_map_.end()) {
@@ -26,6 +28,8 @@ void CompilationStatistics::RecordPhaseStats(const char* phase_kind_name,
void CompilationStatistics::RecordPhaseKindStats(const char* phase_kind_name,
const BasicStats& stats) {
+ base::LockGuard<base::Mutex> guard(&record_mutex_);
+
std::string phase_kind_name_str(phase_kind_name);
auto it = phase_kind_map_.find(phase_kind_name_str);
if (it == phase_kind_map_.end()) {
@@ -39,6 +43,8 @@ void CompilationStatistics::RecordPhaseKindStats(const char* phase_kind_name,
void CompilationStatistics::RecordTotalStats(size_t source_size,
const BasicStats& stats) {
+ base::LockGuard<base::Mutex> guard(&record_mutex_);
+
source_size += source_size;
total_stats_.Accumulate(stats);
}
« no previous file with comments | « src/compilation-statistics.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698