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

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

Issue 937833002: Unlink pages from the space page list after evacuation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | src/heap/spaces.cc » ('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 3042 matching lines...) Expand 10 before | Expand all | Expand 10 after
3053 // Allocate emergency memory for the case when compaction fails due to out 3053 // Allocate emergency memory for the case when compaction fails due to out
3054 // of memory. 3054 // of memory.
3055 if (!space->HasEmergencyMemory()) { 3055 if (!space->HasEmergencyMemory()) {
3056 space->CreateEmergencyMemory(); 3056 space->CreateEmergencyMemory();
3057 } 3057 }
3058 if (p->IsEvacuationCandidate()) { 3058 if (p->IsEvacuationCandidate()) {
3059 // During compaction we might have to request a new page. Check that we 3059 // During compaction we might have to request a new page. Check that we
3060 // have an emergency page and the space still has room for that. 3060 // have an emergency page and the space still has room for that.
3061 if (space->HasEmergencyMemory() && space->CanExpand()) { 3061 if (space->HasEmergencyMemory() && space->CanExpand()) {
3062 EvacuateLiveObjectsFromPage(p); 3062 EvacuateLiveObjectsFromPage(p);
3063 // Unlink the page from the list of pages here. We must not iterate
3064 // over that page later (e.g. when scan on scavenge pages are
3065 // processed). The page itself will be freed later and is still
3066 // reachable from the evacuation candidates list.
3067 p->Unlink();
3063 } else { 3068 } else {
3064 // Without room for expansion evacuation is not guaranteed to succeed. 3069 // Without room for expansion evacuation is not guaranteed to succeed.
3065 // Pessimistically abandon unevacuated pages. 3070 // Pessimistically abandon unevacuated pages.
3066 for (int j = i; j < npages; j++) { 3071 for (int j = i; j < npages; j++) {
3067 Page* page = evacuation_candidates_[j]; 3072 Page* page = evacuation_candidates_[j];
3068 slots_buffer_allocator_.DeallocateChain(page->slots_buffer_address()); 3073 slots_buffer_allocator_.DeallocateChain(page->slots_buffer_address());
3069 page->ClearEvacuationCandidate(); 3074 page->ClearEvacuationCandidate();
3070 page->SetFlag(Page::RESCAN_ON_EVACUATION); 3075 page->SetFlag(Page::RESCAN_ON_EVACUATION);
3071 } 3076 }
3072 break; 3077 break;
(...skipping 1340 matching lines...) Expand 10 before | Expand all | Expand 10 after
4413 SlotsBuffer* buffer = *buffer_address; 4418 SlotsBuffer* buffer = *buffer_address;
4414 while (buffer != NULL) { 4419 while (buffer != NULL) {
4415 SlotsBuffer* next_buffer = buffer->next(); 4420 SlotsBuffer* next_buffer = buffer->next();
4416 DeallocateBuffer(buffer); 4421 DeallocateBuffer(buffer);
4417 buffer = next_buffer; 4422 buffer = next_buffer;
4418 } 4423 }
4419 *buffer_address = NULL; 4424 *buffer_address = NULL;
4420 } 4425 }
4421 } 4426 }
4422 } // namespace v8::internal 4427 } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698