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

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
« no previous file with comments | « vm/assembler_x64.cc ('k') | vm/store_buffer.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
14 // Forward declarations.
15 class Isolate;
16
14 class StoreBufferBlock { 17 class StoreBufferBlock {
15 public: 18 public:
16 // Each block contains kSize pointers. 19 // Each block contains kSize pointers.
17 static const int32_t kSize = 1024; 20 static const int32_t kSize = 1024;
18 21
19 StoreBufferBlock() : top_(0) {} 22 StoreBufferBlock() : top_(0) {}
20 23
21 static int top_offset() { return OFFSET_OF(StoreBufferBlock, top_); } 24 static int top_offset() { return OFFSET_OF(StoreBufferBlock, top_); }
22 static int pointers_offset() { 25 static int pointers_offset() {
23 return OFFSET_OF(StoreBufferBlock, pointers_); 26 return OFFSET_OF(StoreBufferBlock, pointers_);
24 } 27 }
25 28
26 // Add a pointer to the block of pointers. The buffer will be processed if it 29 // Add a pointer to the block of pointers. The buffer will be processed if it
27 // has been filled by this operation. 30 // has been filled by this operation.
28 void AddPointer(uword pointer) { 31 void AddPointer(uword pointer) {
29 ASSERT(top_ < kSize); 32 ASSERT(top_ < kSize);
30 pointers_[top_++] = pointer; 33 pointers_[top_++] = pointer;
31 if (top_ == kSize) { 34 if (top_ == kSize) {
32 ProcessBuffer(); 35 ProcessBuffer();
33 } 36 }
34 } 37 }
35 38
36 // Process this store buffer and remember its contents in the heap. 39 // Process this store buffer and remember its contents in the heap.
37 void ProcessBuffer(); 40 void ProcessBuffer();
41 void ProcessBuffer(Isolate* isolate);
38 42
39 bool Contains(uword pointer); 43 bool Contains(uword pointer);
40 44
41 private: 45 private:
42 int32_t top_; 46 int32_t top_;
43 uword pointers_[kSize]; 47 uword pointers_[kSize];
44 48
45 friend class StoreBuffer; 49 friend class StoreBuffer;
46 }; 50 };
47 51
(...skipping 27 matching lines...) Expand all
75 private: 79 private:
76 DISALLOW_COPY_AND_ASSIGN(DedupSet); 80 DISALLOW_COPY_AND_ASSIGN(DedupSet);
77 }; 81 };
78 82
79 DedupSet* dedup_sets_; 83 DedupSet* dedup_sets_;
80 }; 84 };
81 85
82 } // namespace dart 86 } // namespace dart
83 87
84 #endif // VM_STORE_BUFFER_H_ 88 #endif // VM_STORE_BUFFER_H_
OLDNEW
« no previous file with comments | « vm/assembler_x64.cc ('k') | vm/store_buffer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698