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

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

Issue 1379833002: [heap] Properly account for wasted bytes. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Move code comments to declaration site of fields Created 5 years, 2 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.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/heap/mark-compact.h" 5 #include "src/heap/mark-compact.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/base/sys-info.h" 9 #include "src/base/sys-info.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 3535 matching lines...) Expand 10 before | Expand all | Expand 10 after
3546 enum FreeSpaceTreatmentMode { IGNORE_FREE_SPACE, ZAP_FREE_SPACE }; 3546 enum FreeSpaceTreatmentMode { IGNORE_FREE_SPACE, ZAP_FREE_SPACE };
3547 3547
3548 3548
3549 template <MarkCompactCollector::SweepingParallelism mode> 3549 template <MarkCompactCollector::SweepingParallelism mode>
3550 static intptr_t Free(PagedSpace* space, FreeList* free_list, Address start, 3550 static intptr_t Free(PagedSpace* space, FreeList* free_list, Address start,
3551 int size) { 3551 int size) {
3552 if (mode == MarkCompactCollector::SWEEP_ON_MAIN_THREAD) { 3552 if (mode == MarkCompactCollector::SWEEP_ON_MAIN_THREAD) {
3553 DCHECK(free_list == NULL); 3553 DCHECK(free_list == NULL);
3554 return space->Free(start, size); 3554 return space->Free(start, size);
3555 } else { 3555 } else {
3556 // TODO(hpayer): account for wasted bytes in concurrent sweeping too.
3557 return size - free_list->Free(start, size); 3556 return size - free_list->Free(start, size);
3558 } 3557 }
3559 } 3558 }
3560 3559
3561 3560
3562 // Sweeps a page. After sweeping the page can be iterated. 3561 // Sweeps a page. After sweeping the page can be iterated.
3563 // Slots in live objects pointing into evacuation candidates are updated 3562 // Slots in live objects pointing into evacuation candidates are updated
3564 // if requested. 3563 // if requested.
3565 // Returns the size of the biggest continuous freed memory chunk in bytes. 3564 // Returns the size of the biggest continuous freed memory chunk in bytes.
3566 template <SweepingMode sweeping_mode, 3565 template <SweepingMode sweeping_mode,
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after
4600 MarkBit mark_bit = Marking::MarkBitFrom(host); 4599 MarkBit mark_bit = Marking::MarkBitFrom(host);
4601 if (Marking::IsBlack(mark_bit)) { 4600 if (Marking::IsBlack(mark_bit)) {
4602 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); 4601 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host);
4603 RecordRelocSlot(&rinfo, target); 4602 RecordRelocSlot(&rinfo, target);
4604 } 4603 }
4605 } 4604 }
4606 } 4605 }
4607 4606
4608 } // namespace internal 4607 } // namespace internal
4609 } // namespace v8 4608 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698