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 StoreBufferBlock* pending = isolate->store_buffer()->Blocks(); | 519 StoreBufferBlock* pending = isolate->store_buffer()->Blocks(); |
520 intptr_t total_count = 0; | 520 intptr_t total_count = 0; |
521 while (pending != NULL) { | 521 while (pending != NULL) { |
522 StoreBufferBlock* next = pending->next(); | 522 StoreBufferBlock* next = pending->next(); |
523 // Generated code appends to store buffers; tell MemorySanitizer. | 523 // Generated code appends to store buffers; tell MemorySanitizer. |
524 MSAN_UNPOISON(pending, sizeof(*pending)); | 524 MSAN_UNPOISON(pending, sizeof(*pending)); |
525 intptr_t count = pending->Count(); | 525 intptr_t count = pending->Count(); |
526 total_count += count; | 526 total_count += count; |
527 while (!pending->IsEmpty()) { | 527 while (!pending->IsEmpty()) { |
528 RawObject* raw_object = pending->Pop(); | 528 RawObject* raw_object = pending->Pop(); |
| 529 if (raw_object->IsFreeListElement()) { |
| 530 // TODO(rmacnak): Forwarding corpse from become. Probably we should also |
| 531 // visit the store buffer blocks during become, and mark any forwardees |
| 532 // as remembered if their forwarders are remembered to satisfy the |
| 533 // following assert. |
| 534 continue; |
| 535 } |
529 ASSERT(raw_object->IsRemembered()); | 536 ASSERT(raw_object->IsRemembered()); |
530 raw_object->ClearRememberedBit(); | 537 raw_object->ClearRememberedBit(); |
531 visitor->VisitingOldObject(raw_object); | 538 visitor->VisitingOldObject(raw_object); |
532 raw_object->VisitPointers(visitor); | 539 raw_object->VisitPointers(visitor); |
533 } | 540 } |
534 pending->Reset(); | 541 pending->Reset(); |
535 // Return the emptied block for recycling (no need to check threshold). | 542 // Return the emptied block for recycling (no need to check threshold). |
536 isolate->store_buffer()->PushBlock(pending, StoreBuffer::kIgnoreThreshold); | 543 isolate->store_buffer()->PushBlock(pending, StoreBuffer::kIgnoreThreshold); |
537 pending = next; | 544 pending = next; |
538 } | 545 } |
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 } | 878 } |
872 | 879 |
873 | 880 |
874 void Scavenger::FreeExternal(intptr_t size) { | 881 void Scavenger::FreeExternal(intptr_t size) { |
875 ASSERT(size >= 0); | 882 ASSERT(size >= 0); |
876 external_size_ -= size; | 883 external_size_ -= size; |
877 ASSERT(external_size_ >= 0); | 884 ASSERT(external_size_ >= 0); |
878 } | 885 } |
879 | 886 |
880 } // namespace dart | 887 } // namespace dart |
OLD | NEW |