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

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

Issue 10796075: - Tighten assertions around store buffers. (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/object.h ('k') | no next file » | 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 #include "vm/runtime_entry.h" 8 #include "vm/runtime_entry.h"
9 9
10 namespace dart { 10 namespace dart {
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 while (current != NULL) { 56 while (current != NULL) {
57 DedupSet* next = current->next(); 57 DedupSet* next = current->next();
58 delete current; 58 delete current;
59 current = next; 59 current = next;
60 } 60 }
61 } 61 }
62 62
63 63
64 void StoreBuffer::AddPointer(uword address) { 64 void StoreBuffer::AddPointer(uword address) {
65 ASSERT(dedup_sets_ != NULL); 65 ASSERT(dedup_sets_ != NULL);
66 ASSERT(Isolate::Current()->heap()->OldContains(address));
66 if (!dedup_sets_->set()->Add(address)) { 67 if (!dedup_sets_->set()->Add(address)) {
67 // Add a new DedupSet. Schedule an interrupt if we have run over the max 68 // Add a new DedupSet. Schedule an interrupt if we have run over the max
68 // number of DedupSets. 69 // number of DedupSets.
69 dedup_sets_ = new DedupSet(dedup_sets_); 70 dedup_sets_ = new DedupSet(dedup_sets_);
70 count_++; 71 count_++;
71 // TODO(iposva): Fix magic number. 72 // TODO(iposva): Fix magic number.
72 if (count_ > 100) { 73 if (count_ > 100) {
73 Isolate::Current()->ScheduleInterrupts(Isolate::kStoreBufferInterrupt); 74 Isolate::Current()->ScheduleInterrupts(Isolate::kStoreBufferInterrupt);
74 } 75 }
75 } 76 }
76 } 77 }
77 78
78 } // namespace dart 79 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698