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

Side by Side Diff: runtime/vm/store_buffer.cc

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, 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 | « runtime/vm/store_buffer.h ('k') | runtime/vm/stub_code_ia32.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 #include "vm/store_buffer.h" 5 #include "vm/store_buffer.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 8
9 namespace dart { 9 namespace dart {
10 10
11 void StoreBufferBlock::ProcessBuffer() { 11 void StoreBufferBlock::ProcessBuffer() {
12 // TODO(iposva): Do the right thing for store buffer overflow. 12 // TODO(iposva): Do the right thing for store buffer overflow.
13 top_ = 0; // Currently just reset back to the beginning. 13 top_ = 0; // Currently just reset back to the beginning.
14 } 14 }
15 15
16 16
17 bool StoreBufferBlock::Contains(uword pointer) { 17 bool StoreBufferBlock::Contains(uword pointer) {
18 for (int32_t i = 0; i < top_; i++) { 18 for (int32_t i = 0; i < top_; i++) {
19 if (pointers_[i] == pointer) { 19 if (pointers_[i] == pointer) {
20 return true; 20 return true;
21 } 21 }
22 } 22 }
23 return false; 23 return false;
24 } 24 }
25 25
26
27 StoreBuffer::~StoreBuffer() {
28 DedupSet* current = dedup_sets_;
29 dedup_sets_ = NULL;
30 while (current != NULL) {
31 DedupSet* next = current->next_;
32 delete current;
33 current = next;
34 }
35 }
36
37
38 void StoreBuffer::AddPointer(uword address) {
39 ASSERT(dedup_sets_ != NULL);
40 if (!dedup_sets_->set_->Add(address)) {
41 // TODO(iposva): Limit growth of deduplication sets until the rest of the
42 // mechanism is hooked up.
43 delete dedup_sets_;
44 dedup_sets_ = NULL;
45
46 DedupSet* fresh_element = new DedupSet();
47 fresh_element->next_ = dedup_sets_;
48 dedup_sets_ = fresh_element;
49 }
50 }
51
26 } // namespace dart 52 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/store_buffer.h ('k') | runtime/vm/stub_code_ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698