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

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

Issue 1058613003: Version 4.3.61.6 (cherry-pick) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@4.3
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 | « include/v8-version.h ('k') | 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 3331 matching lines...) Expand 10 before | Expand all | Expand 10 after
3342 for (int i = 0; i < npages; i++) { 3342 for (int i = 0; i < npages; i++) {
3343 Page* p = evacuation_candidates_[i]; 3343 Page* p = evacuation_candidates_[i];
3344 DCHECK(p->IsEvacuationCandidate() || 3344 DCHECK(p->IsEvacuationCandidate() ||
3345 p->IsFlagSet(Page::RESCAN_ON_EVACUATION)); 3345 p->IsFlagSet(Page::RESCAN_ON_EVACUATION));
3346 DCHECK(static_cast<int>(p->parallel_sweeping()) == 3346 DCHECK(static_cast<int>(p->parallel_sweeping()) ==
3347 MemoryChunk::SWEEPING_DONE); 3347 MemoryChunk::SWEEPING_DONE);
3348 PagedSpace* space = static_cast<PagedSpace*>(p->owner()); 3348 PagedSpace* space = static_cast<PagedSpace*>(p->owner());
3349 // Allocate emergency memory for the case when compaction fails due to out 3349 // Allocate emergency memory for the case when compaction fails due to out
3350 // of memory. 3350 // of memory.
3351 if (!space->HasEmergencyMemory()) { 3351 if (!space->HasEmergencyMemory()) {
3352 space->CreateEmergencyMemory(); 3352 space->CreateEmergencyMemory(); // If the OS lets us.
3353 } 3353 }
3354 if (p->IsEvacuationCandidate()) { 3354 if (p->IsEvacuationCandidate()) {
3355 // During compaction we might have to request a new page. Check that we 3355 // During compaction we might have to request a new page in order to free
3356 // have an emergency page and the space still has room for that. 3356 // up a page. Check that we actually got an emergency page above so we
3357 if (space->HasEmergencyMemory() || space->CanExpand()) { 3357 // can guarantee that this succeeds.
3358 if (space->HasEmergencyMemory()) {
3358 EvacuateLiveObjectsFromPage(p); 3359 EvacuateLiveObjectsFromPage(p);
3359 // Unlink the page from the list of pages here. We must not iterate 3360 // Unlink the page from the list of pages here. We must not iterate
3360 // over that page later (e.g. when scan on scavenge pages are 3361 // over that page later (e.g. when scan on scavenge pages are
3361 // processed). The page itself will be freed later and is still 3362 // processed). The page itself will be freed later and is still
3362 // reachable from the evacuation candidates list. 3363 // reachable from the evacuation candidates list.
3363 p->Unlink(); 3364 p->Unlink();
3364 } else { 3365 } else {
3365 // Without room for expansion evacuation is not guaranteed to succeed. 3366 // Without room for expansion evacuation is not guaranteed to succeed.
3366 // Pessimistically abandon unevacuated pages. 3367 // Pessimistically abandon unevacuated pages.
3367 for (int j = i; j < npages; j++) { 3368 for (int j = i; j < npages; j++) {
(...skipping 1393 matching lines...) Expand 10 before | Expand all | Expand 10 after
4761 SlotsBuffer* buffer = *buffer_address; 4762 SlotsBuffer* buffer = *buffer_address;
4762 while (buffer != NULL) { 4763 while (buffer != NULL) {
4763 SlotsBuffer* next_buffer = buffer->next(); 4764 SlotsBuffer* next_buffer = buffer->next();
4764 DeallocateBuffer(buffer); 4765 DeallocateBuffer(buffer);
4765 buffer = next_buffer; 4766 buffer = next_buffer;
4766 } 4767 }
4767 *buffer_address = NULL; 4768 *buffer_address = NULL;
4768 } 4769 }
4769 } 4770 }
4770 } // namespace v8::internal 4771 } // namespace v8::internal
OLDNEW
« no previous file with comments | « include/v8-version.h ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698