| 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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 ASSERT(Isolate::Current()->heap()->OldContains(address)); |
| 67 ASSERT((address & kSmiTagMask) != kSmiTag); |
| 67 if (!dedup_sets_->set()->Add(address)) { | 68 if (!dedup_sets_->set()->Add(address)) { |
| 68 // Add a new DedupSet. Schedule an interrupt if we have run over the max | 69 // Add a new DedupSet. Schedule an interrupt if we have run over the max |
| 69 // number of DedupSets. | 70 // number of DedupSets. |
| 70 dedup_sets_ = new DedupSet(dedup_sets_); | 71 dedup_sets_ = new DedupSet(dedup_sets_); |
| 71 count_++; | 72 count_++; |
| 72 // TODO(iposva): Fix magic number. | 73 // TODO(iposva): Fix magic number. |
| 73 if (count_ > 100) { | 74 if (count_ > 100) { |
| 74 Isolate::Current()->ScheduleInterrupts(Isolate::kStoreBufferInterrupt); | 75 Isolate::Current()->ScheduleInterrupts(Isolate::kStoreBufferInterrupt); |
| 75 } | 76 } |
| 76 } | 77 } |
| 77 } | 78 } |
| 78 | 79 |
| 79 } // namespace dart | 80 } // namespace dart |
| OLD | NEW |