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

Side by Side Diff: vm/store_buffer.h

Issue 10758008: - On store buffer block overflow call a VM leaf function to (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef VM_STORE_BUFFER_H_ 5 #ifndef VM_STORE_BUFFER_H_
6 #define VM_STORE_BUFFER_H_ 6 #define VM_STORE_BUFFER_H_
7 7
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/hash_set.h" 10 #include "vm/hash_set.h"
11 11
12 namespace dart { 12 namespace dart {
13 13
siva 2012/07/09 22:51:07 // Forward declarations.
Ivan Posva 2012/07/09 22:59:35 Done.
14 class Isolate;
15
14 class StoreBufferBlock { 16 class StoreBufferBlock {
15 public: 17 public:
16 // Each block contains kSize pointers. 18 // Each block contains kSize pointers.
17 static const int32_t kSize = 1024; 19 static const int32_t kSize = 1024;
18 20
19 StoreBufferBlock() : top_(0) {} 21 StoreBufferBlock() : top_(0) {}
20 22
21 static int top_offset() { return OFFSET_OF(StoreBufferBlock, top_); } 23 static int top_offset() { return OFFSET_OF(StoreBufferBlock, top_); }
22 static int pointers_offset() { 24 static int pointers_offset() {
23 return OFFSET_OF(StoreBufferBlock, pointers_); 25 return OFFSET_OF(StoreBufferBlock, pointers_);
24 } 26 }
25 27
26 // Add a pointer to the block of pointers. The buffer will be processed if it 28 // Add a pointer to the block of pointers. The buffer will be processed if it
27 // has been filled by this operation. 29 // has been filled by this operation.
28 void AddPointer(uword pointer) { 30 void AddPointer(uword pointer) {
29 ASSERT(top_ < kSize); 31 ASSERT(top_ < kSize);
30 pointers_[top_++] = pointer; 32 pointers_[top_++] = pointer;
31 if (top_ == kSize) { 33 if (top_ == kSize) {
32 ProcessBuffer(); 34 ProcessBuffer();
33 } 35 }
34 } 36 }
35 37
36 // Process this store buffer and remember its contents in the heap. 38 // Process this store buffer and remember its contents in the heap.
37 void ProcessBuffer(); 39 void ProcessBuffer();
40 void ProcessBuffer(Isolate* isolate);
38 41
39 bool Contains(uword pointer); 42 bool Contains(uword pointer);
40 43
41 private: 44 private:
42 int32_t top_; 45 int32_t top_;
43 uword pointers_[kSize]; 46 uword pointers_[kSize];
44 47
45 friend class StoreBuffer; 48 friend class StoreBuffer;
46 }; 49 };
47 50
(...skipping 27 matching lines...) Expand all
75 private: 78 private:
76 DISALLOW_COPY_AND_ASSIGN(DedupSet); 79 DISALLOW_COPY_AND_ASSIGN(DedupSet);
77 }; 80 };
78 81
79 DedupSet* dedup_sets_; 82 DedupSet* dedup_sets_;
80 }; 83 };
81 84
82 } // namespace dart 85 } // namespace dart
83 86
84 #endif // VM_STORE_BUFFER_H_ 87 #endif // VM_STORE_BUFFER_H_
OLDNEW
« no previous file with comments | « vm/assembler_x64.cc ('k') | vm/store_buffer.cc » ('j') | vm/stub_code_ia32.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698