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

Unified Diff: runtime/vm/store_buffer.h

Issue 10702067: - Separate store buffer data in the isolate into the StoreBufferBlock and (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « runtime/vm/object.cc ('k') | runtime/vm/store_buffer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/store_buffer.h
===================================================================
--- runtime/vm/store_buffer.h (revision 9322)
+++ runtime/vm/store_buffer.h (working copy)
@@ -7,6 +7,7 @@
#include "platform/assert.h"
#include "vm/globals.h"
+#include "vm/hash_set.h"
namespace dart {
@@ -40,8 +41,44 @@
private:
int32_t top_;
uword pointers_[kSize];
+
+ friend class StoreBuffer;
};
+
+class StoreBuffer {
+ public:
+ StoreBuffer() : dedup_sets_(new DedupSet()) {}
+ ~StoreBuffer();
+
+ void AddPointer(uword address);
+
+ void ProcessBlock(StoreBufferBlock* block);
+
+ private:
+ // Simple linked list element containing a HashSet of old->new pointers.
+ class DedupSet {
+ public:
+ enum {
+ kSetSize = 1024,
+ kFillRatio = 80
+ };
+
+ DedupSet() : set_(new HashSet(kSetSize, kFillRatio)), next_(NULL) {}
+ ~DedupSet() {
+ delete set_;
+ }
+
+ DedupSet* next_;
+ HashSet* set_;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(DedupSet);
+ };
+
+ DedupSet* dedup_sets_;
+};
+
} // namespace dart
#endif // VM_STORE_BUFFER_H_
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/store_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698