OLD | NEW |
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 Loading... |
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 |
OLD | NEW |