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

Unified Diff: src/heap/heap.h

Issue 1605813004: Revert "[heap] Make survival counters concurrent (atomic)" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 11 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 | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 8b7893d446b9a453ea73b11017a62fa0a2593fd9..af9d0a6235f0f40426f7062086e8c67eda03c4f0 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1408,26 +1408,22 @@ class Heap {
void UpdateSurvivalStatistics(int start_new_space_size);
- inline void IncrementPromotedObjectsSize(intptr_t object_size) {
+ inline void IncrementPromotedObjectsSize(int object_size) {
DCHECK_GE(object_size, 0);
- promoted_objects_size_.Increment(object_size);
+ promoted_objects_size_ += object_size;
}
+ inline intptr_t promoted_objects_size() { return promoted_objects_size_; }
- inline intptr_t promoted_objects_size() {
- return promoted_objects_size_.Value();
- }
-
- inline void IncrementSemiSpaceCopiedObjectSize(intptr_t object_size) {
+ inline void IncrementSemiSpaceCopiedObjectSize(int object_size) {
DCHECK_GE(object_size, 0);
- semi_space_copied_object_size_.Increment(object_size);
+ semi_space_copied_object_size_ += object_size;
}
-
inline intptr_t semi_space_copied_object_size() {
- return semi_space_copied_object_size_.Value();
+ return semi_space_copied_object_size_;
}
inline intptr_t SurvivedNewSpaceObjectSize() {
- return promoted_objects_size() + semi_space_copied_object_size();
+ return promoted_objects_size_ + semi_space_copied_object_size_;
}
inline void IncrementNodesDiedInNewSpace() { nodes_died_in_new_space_++; }
@@ -1436,18 +1432,10 @@ class Heap {
inline void IncrementNodesPromoted() { nodes_promoted_++; }
- inline void IncrementYoungSurvivorsCounter(intptr_t survived) {
- DCHECK_GE(survived, 0);
- survived_last_scavenge_.SetValue(survived);
- survived_since_last_expansion_.Increment(survived);
- }
-
- inline intptr_t survived_last_scavenge() {
- return survived_last_scavenge_.Value();
- }
-
- inline intptr_t survived_since_last_expansion() {
- return survived_since_last_expansion_.Value();
+ inline void IncrementYoungSurvivorsCounter(int survived) {
+ DCHECK(survived >= 0);
+ survived_last_scavenge_ = survived;
+ survived_since_last_expansion_ += survived;
}
inline intptr_t PromotedTotalSize() {
@@ -2194,10 +2182,10 @@ class Heap {
// For keeping track of how much data has survived
// scavenge since last new space expansion.
- AtomicNumber<intptr_t> survived_since_last_expansion_;
+ int survived_since_last_expansion_;
// ... and since the last scavenge.
- AtomicNumber<intptr_t> survived_last_scavenge_;
+ int survived_last_scavenge_;
// This is not the depth of nested AlwaysAllocateScope's but rather a single
// count, as scopes can be acquired from multiple tasks (read: threads).
@@ -2295,10 +2283,10 @@ class Heap {
GCTracer* tracer_;
int high_survival_rate_period_length_;
- AtomicNumber<intptr_t> promoted_objects_size_;
+ intptr_t promoted_objects_size_;
double promotion_ratio_;
double promotion_rate_;
- AtomicNumber<intptr_t> semi_space_copied_object_size_;
+ intptr_t semi_space_copied_object_size_;
intptr_t previous_semi_space_copied_object_size_;
double semi_space_copied_rate_;
int nodes_died_in_new_space_;
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698