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

Unified Diff: runtime/vm/store_buffer.cc

Issue 1271833002: Chunk-wise marking stack processing. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Encapsulate visitor's interface to marking stack in WorkList inner class. Created 5 years, 4 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
Index: runtime/vm/store_buffer.cc
diff --git a/runtime/vm/store_buffer.cc b/runtime/vm/store_buffer.cc
index f4fbad79f51c17274c5eb471934b049a79ec2675..7fe58c74290511b3938a448735e28b89494a8940 100644
--- a/runtime/vm/store_buffer.cc
+++ b/runtime/vm/store_buffer.cc
@@ -90,7 +90,7 @@ void StoreBuffer::PushBlock(StoreBufferBlock* block, bool check_threshold) {
}
-StoreBufferBlock* StoreBuffer::PopBlock() {
+StoreBufferBlock* StoreBuffer::PopNonFullBlock() {
{
MutexLocker ml(mutex_);
if (!partial_.IsEmpty()) {
@@ -112,6 +112,24 @@ StoreBufferBlock* StoreBuffer::PopEmptyBlock() {
}
+StoreBufferBlock* StoreBuffer::PopNonEmptyBlock() {
+ MutexLocker ml(mutex_);
+ if (!full_.IsEmpty()) {
+ return full_.Pop();
+ } else if (!partial_.IsEmpty()) {
+ return partial_.Pop();
+ } else {
+ return NULL;
+ }
+}
+
+
+bool StoreBuffer::IsEmpty() {
+ MutexLocker ml(global_mutex_);
+ return full_.IsEmpty() && partial_.IsEmpty();
+}
+
+
StoreBuffer::List::~List() {
while (!IsEmpty()) {
delete Pop();
« runtime/vm/store_buffer.h ('K') | « runtime/vm/store_buffer.h ('k') | runtime/vm/thread.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698