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

Unified Diff: src/heap/slot-set.h

Issue 2409163002: [heap] Don't read current bucket twice when interating over slot set. (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/slot-set.h
diff --git a/src/heap/slot-set.h b/src/heap/slot-set.h
index 5616bc8778518d6a4f2930dff456f95208823b6b..07a854dbb8babe7298552a10ae4d26e8556ec697 100644
--- a/src/heap/slot-set.h
+++ b/src/heap/slot-set.h
@@ -168,10 +168,10 @@ class SlotSet : public Malloced {
int Iterate(Callback callback, EmptyBucketMode mode) {
int new_count = 0;
for (int bucket_index = 0; bucket_index < kBuckets; bucket_index++) {
- if (bucket[bucket_index].Value() != nullptr) {
+ base::AtomicValue<uint32_t>* current_bucket =
+ bucket[bucket_index].Value();
+ if (current_bucket != nullptr) {
int in_bucket_count = 0;
- base::AtomicValue<uint32_t>* current_bucket =
- bucket[bucket_index].Value();
int cell_offset = bucket_index * kBitsPerBucket;
for (int i = 0; i < kCellsPerBucket; i++, cell_offset += kBitsPerCell) {
if (current_bucket[i].Value()) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698