Reviewers: jarin,
Description:
Use NoBarrier_Load and NoBarrier_Store in FreeListCategory::Concatenate.
BUG=
Please review this at https://codereview.chromium.org/138953018/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files (+4, -3 lines):
M src/spaces.cc
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index
a80341bd7fc6baa7750e76c89528ba6cbbeb29fe..2534b5ce200aa841f8d419b7d40245e06b1570fa
100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -2082,20 +2082,21 @@ void FreeListNode::set_next(FreeListNode* next) {
intptr_t FreeListCategory::Concatenate(FreeListCategory* category) {
intptr_t free_bytes = 0;
- if (category->top_ != NULL) {
- ASSERT(category->end_ != NULL);
+ if (NoBarrier_Load(reinterpret_cast<AtomicWord*>(&category->top_)) != 0)
{
// This is safe (not going to deadlock) since Concatenate operations
// are never performed on the same free lists at the same time in
// reverse order.
LockGuard<Mutex> target_lock_guard(mutex());
LockGuard<Mutex> source_lock_guard(category->mutex());
+ ASSERT(category->end_ != NULL);
free_bytes = category->available();
if (end_ == NULL) {
end_ = category->end();
} else {
category->end()->set_next(top_);
}
- top_ = category->top();
+ NoBarrier_Store(reinterpret_cast<AtomicWord*>(&top_),
+ reinterpret_cast<AtomicWord>(category->top()));
available_ += category->available();
category->Reset();
}
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.