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

Unified Diff: src/spaces.h

Issue 138953018: Use NoBarrier_Load and NoBarrier_Store in FreeListCategory::Concatenate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 10 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/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.h
diff --git a/src/spaces.h b/src/spaces.h
index 6d3b5fcda1fac1b925d186a45c90a0bedf60e7c3..bc01719814f17ed2e3aed17863b4c86f71b13247 100644
--- a/src/spaces.h
+++ b/src/spaces.h
@@ -1518,7 +1518,7 @@ class FreeListNode: public HeapObject {
class FreeListCategory {
public:
FreeListCategory() :
- top_(NULL),
+ top_(0),
end_(NULL),
available_(0) {}
@@ -1536,9 +1536,13 @@ class FreeListCategory {
void RepairFreeList(Heap* heap);
- FreeListNode** GetTopAddress() { return &top_; }
- FreeListNode* top() const { return top_; }
- void set_top(FreeListNode* top) { top_ = top; }
+ FreeListNode* top() const {
+ return reinterpret_cast<FreeListNode*>(NoBarrier_Load(&top_));
+ }
+
+ void set_top(FreeListNode* top) {
+ NoBarrier_Store(&top_, reinterpret_cast<AtomicWord>(top));
+ }
FreeListNode** GetEndAddress() { return &end_; }
FreeListNode* end() const { return end_; }
@@ -1551,7 +1555,7 @@ class FreeListCategory {
Mutex* mutex() { return &mutex_; }
bool IsEmpty() {
- return top_ == NULL;
+ return top() == 0;
}
#ifdef DEBUG
@@ -1560,7 +1564,8 @@ class FreeListCategory {
#endif
private:
- FreeListNode* top_;
+ // top_ points to the top FreeListNode* in the free list category.
+ AtomicWord top_;
FreeListNode* end_;
Mutex mutex_;
« no previous file with comments | « no previous file | src/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698