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

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

Issue 1173043002: Reuse empty StoreBufferBlocks. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: address comments Created 5 years, 6 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
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/store_buffer.h » ('j') | 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) 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
519 // Iterating through the store buffers. 519 // Iterating through the store buffers.
520 // Grab the deduplication sets out of the isolate's consolidated store buffer. 520 // Grab the deduplication sets out of the isolate's consolidated store buffer.
521 StoreBufferBlock* pending = isolate->store_buffer()->Blocks(); 521 StoreBufferBlock* pending = isolate->store_buffer()->Blocks();
522 intptr_t total_count = 0; 522 intptr_t total_count = 0;
523 while (pending != NULL) { 523 while (pending != NULL) {
524 StoreBufferBlock* next = pending->next(); 524 StoreBufferBlock* next = pending->next();
525 // Generated code appends to store buffers; tell MemorySanitizer. 525 // Generated code appends to store buffers; tell MemorySanitizer.
526 MSAN_UNPOISON(pending, sizeof(*pending)); 526 MSAN_UNPOISON(pending, sizeof(*pending));
527 intptr_t count = pending->Count(); 527 intptr_t count = pending->Count();
528 total_count += count; 528 total_count += count;
529 for (intptr_t i = 0; i < count; i++) { 529 while (!pending->IsEmpty()) {
530 RawObject* raw_object = pending->At(i); 530 RawObject* raw_object = pending->Pop();
531 ASSERT(raw_object->IsRemembered()); 531 ASSERT(raw_object->IsRemembered());
532 raw_object->ClearRememberedBit(); 532 raw_object->ClearRememberedBit();
533 visitor->VisitingOldObject(raw_object); 533 visitor->VisitingOldObject(raw_object);
534 raw_object->VisitPointers(visitor); 534 raw_object->VisitPointers(visitor);
535 } 535 }
536 delete pending; 536 pending->Reset();
537 isolate->store_buffer()->PushBlock(pending);
537 pending = next; 538 pending = next;
538 } 539 }
539 heap_->RecordData(kStoreBufferEntries, total_count); 540 heap_->RecordData(kStoreBufferEntries, total_count);
540 heap_->RecordData(kDataUnused1, 0); 541 heap_->RecordData(kDataUnused1, 0);
541 heap_->RecordData(kDataUnused2, 0); 542 heap_->RecordData(kDataUnused2, 0);
542 // Done iterating through old objects remembered in the store buffers. 543 // Done iterating through old objects remembered in the store buffers.
543 visitor->VisitingOldObject(NULL); 544 visitor->VisitingOldObject(NULL);
544 } 545 }
545 546
546 547
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
902 } 903 }
903 904
904 905
905 void Scavenger::FreeExternal(intptr_t size) { 906 void Scavenger::FreeExternal(intptr_t size) {
906 ASSERT(size >= 0); 907 ASSERT(size >= 0);
907 external_size_ -= size; 908 external_size_ -= size;
908 ASSERT(external_size_ >= 0); 909 ASSERT(external_size_ >= 0);
909 } 910 }
910 911
911 } // namespace dart 912 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/store_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698