Index: runtime/vm/store_buffer.h |
=================================================================== |
--- runtime/vm/store_buffer.h (revision 9305) |
+++ 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)) {} |
siva
2012/07/02 20:57:42
: next_(NULL) {}
Ivan Posva
2012/07/03 00:10:24
Done.
|
+ ~DedupSet() { |
+ delete set_; |
+ } |
+ |
+ DedupSet* next_; |
+ HashSet* set_; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(DedupSet); |
+ }; |
+ |
+ DedupSet* dedup_sets_; |
+}; |
+ |
} // namespace dart |
#endif // VM_STORE_BUFFER_H_ |