| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/scavenger.h" | 5 #include "vm/scavenger.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 intptr_t count = pending->Count(); | 519 intptr_t count = pending->Count(); |
| 520 total_count += count; | 520 total_count += count; |
| 521 while (!pending->IsEmpty()) { | 521 while (!pending->IsEmpty()) { |
| 522 RawObject* raw_object = pending->Pop(); | 522 RawObject* raw_object = pending->Pop(); |
| 523 ASSERT(raw_object->IsRemembered()); | 523 ASSERT(raw_object->IsRemembered()); |
| 524 raw_object->ClearRememberedBit(); | 524 raw_object->ClearRememberedBit(); |
| 525 visitor->VisitingOldObject(raw_object); | 525 visitor->VisitingOldObject(raw_object); |
| 526 raw_object->VisitPointers(visitor); | 526 raw_object->VisitPointers(visitor); |
| 527 } | 527 } |
| 528 pending->Reset(); | 528 pending->Reset(); |
| 529 isolate->store_buffer()->PushBlock(pending); | 529 // Return the emptied block for recycling (no need to check threshold). |
| 530 isolate->store_buffer()->PushBlock(pending, StoreBuffer::kIgnoreThreshold); |
| 530 pending = next; | 531 pending = next; |
| 531 } | 532 } |
| 532 heap_->RecordData(kStoreBufferEntries, total_count); | 533 heap_->RecordData(kStoreBufferEntries, total_count); |
| 533 heap_->RecordData(kDataUnused1, 0); | 534 heap_->RecordData(kDataUnused1, 0); |
| 534 heap_->RecordData(kDataUnused2, 0); | 535 heap_->RecordData(kDataUnused2, 0); |
| 535 // Done iterating through old objects remembered in the store buffers. | 536 // Done iterating through old objects remembered in the store buffers. |
| 536 visitor->VisitingOldObject(NULL); | 537 visitor->VisitingOldObject(NULL); |
| 537 } | 538 } |
| 538 | 539 |
| 539 | 540 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 913 } | 914 } |
| 914 | 915 |
| 915 | 916 |
| 916 void Scavenger::FreeExternal(intptr_t size) { | 917 void Scavenger::FreeExternal(intptr_t size) { |
| 917 ASSERT(size >= 0); | 918 ASSERT(size >= 0); |
| 918 external_size_ -= size; | 919 external_size_ -= size; |
| 919 ASSERT(external_size_ >= 0); | 920 ASSERT(external_size_ >= 0); |
| 920 } | 921 } |
| 921 | 922 |
| 922 } // namespace dart | 923 } // namespace dart |
| OLD | NEW |