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

Side by Side Diff: src/heap/mark-compact.cc

Issue 1039733003: This fixes missing incremental write barrier issue when double fields unboxing is enabled. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 8 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 | « src/heap/heap.cc ('k') | src/heap/spaces.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/code-stubs.h" 9 #include "src/code-stubs.h"
10 #include "src/compilation-cache.h" 10 #include "src/compilation-cache.h"
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 if (FLAG_trace_fragmentation && 716 if (FLAG_trace_fragmentation &&
717 max_evacuation_candidates >= kMaxMaxEvacuationCandidates) { 717 max_evacuation_candidates >= kMaxMaxEvacuationCandidates) {
718 PrintF("Hit max page compaction limit of %d pages\n", 718 PrintF("Hit max page compaction limit of %d pages\n",
719 kMaxMaxEvacuationCandidates); 719 kMaxMaxEvacuationCandidates);
720 } 720 }
721 max_evacuation_candidates = 721 max_evacuation_candidates =
722 Min(kMaxMaxEvacuationCandidates, max_evacuation_candidates); 722 Min(kMaxMaxEvacuationCandidates, max_evacuation_candidates);
723 723
724 int count = 0; 724 int count = 0;
725 int fragmentation = 0; 725 int fragmentation = 0;
726 int page_number = 0;
726 Candidate* least = NULL; 727 Candidate* least = NULL;
727 728
728 PageIterator it(space); 729 PageIterator it(space);
729 while (it.has_next()) { 730 while (it.has_next()) {
730 Page* p = it.next(); 731 Page* p = it.next();
731 if (p->NeverEvacuate()) continue; 732 if (p->NeverEvacuate()) continue;
732 733
733 // Invariant: Evacuation candidates are just created when marking is 734 // Invariant: Evacuation candidates are just created when marking is
734 // started. At the end of a GC all evacuation candidates are cleared and 735 // started. At the end of a GC all evacuation candidates are cleared and
735 // their slot buffers are released. 736 // their slot buffers are released.
736 CHECK(!p->IsEvacuationCandidate()); 737 CHECK(!p->IsEvacuationCandidate());
737 CHECK(p->slots_buffer() == NULL); 738 CHECK(p->slots_buffer() == NULL);
738 739
739 if (FLAG_stress_compaction) { 740 if (FLAG_stress_compaction) {
740 unsigned int counter = space->heap()->ms_count(); 741 if (FLAG_manual_evacuation_candidates_selection) {
741 uintptr_t page_number = reinterpret_cast<uintptr_t>(p) >> kPageSizeBits; 742 if (p->IsFlagSet(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING)) {
742 if ((counter & 1) == (page_number & 1)) fragmentation = 1; 743 p->ClearFlag(MemoryChunk::FORCE_EVACUATION_CANDIDATE_FOR_TESTING);
744 fragmentation = 1;
745 }
746 } else {
747 unsigned int counter = space->heap()->ms_count();
748 if ((counter & 1) == (page_number & 1)) fragmentation = 1;
749 page_number++;
750 }
743 } else if (mode == REDUCE_MEMORY_FOOTPRINT && !FLAG_always_compact) { 751 } else if (mode == REDUCE_MEMORY_FOOTPRINT && !FLAG_always_compact) {
744 // Don't try to release too many pages. 752 // Don't try to release too many pages.
745 if (estimated_release >= over_reserved) { 753 if (estimated_release >= over_reserved) {
746 continue; 754 continue;
747 } 755 }
748 756
749 intptr_t free_bytes = 0; 757 intptr_t free_bytes = 0;
750 758
751 if (!p->WasSwept()) { 759 if (!p->WasSwept()) {
752 free_bytes = (p->area_size() - p->LiveBytes()); 760 free_bytes = (p->area_size() - p->LiveBytes());
(...skipping 3876 matching lines...) Expand 10 before | Expand all | Expand 10 after
4629 SlotsBuffer* buffer = *buffer_address; 4637 SlotsBuffer* buffer = *buffer_address;
4630 while (buffer != NULL) { 4638 while (buffer != NULL) {
4631 SlotsBuffer* next_buffer = buffer->next(); 4639 SlotsBuffer* next_buffer = buffer->next();
4632 DeallocateBuffer(buffer); 4640 DeallocateBuffer(buffer);
4633 buffer = next_buffer; 4641 buffer = next_buffer;
4634 } 4642 }
4635 *buffer_address = NULL; 4643 *buffer_address = NULL;
4636 } 4644 }
4637 } 4645 }
4638 } // namespace v8::internal 4646 } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/heap/heap.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698