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

Side by Side Diff: src/heap/slots-buffer.cc

Issue 1632913003: [heap] Move to page lookups for SemiSpace, NewSpace, and Heap containment methods (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: mips ports Created 4 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 | « src/heap/mark-compact.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 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 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/slots-buffer.h" 5 #include "src/heap/slots-buffer.h"
6 6
7 #include "src/assembler.h" 7 #include "src/assembler.h"
8 #include "src/heap/heap.h" 8 #include "src/heap/heap.h"
9 #include "src/objects-inl.h" 9 #include "src/objects-inl.h"
10 10
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 49
50 for (int slot_idx = 0; slot_idx < slots_count; ++slot_idx) { 50 for (int slot_idx = 0; slot_idx < slots_count; ++slot_idx) {
51 ObjectSlot slot = slots[slot_idx]; 51 ObjectSlot slot = slots[slot_idx];
52 if (!IsTypedSlot(slot)) { 52 if (!IsTypedSlot(slot)) {
53 Object* object = *slot; 53 Object* object = *slot;
54 // Slots are invalid when they currently: 54 // Slots are invalid when they currently:
55 // - do not point to a heap object (SMI) 55 // - do not point to a heap object (SMI)
56 // - point to a heap object in new space 56 // - point to a heap object in new space
57 // - are not within a live heap object on a valid pointer slot 57 // - are not within a live heap object on a valid pointer slot
58 // - point to a heap object not on an evacuation candidate 58 // - point to a heap object not on an evacuation candidate
59 if (!object->IsHeapObject() || heap->InNewSpace(object) || 59 // TODO(mlippautz): Move InNewSpace check above IsSlotInLiveObject once
60 // we filter out unboxed double slots eagerly.
61 if (!object->IsHeapObject() ||
60 !heap->mark_compact_collector()->IsSlotInLiveObject( 62 !heap->mark_compact_collector()->IsSlotInLiveObject(
61 reinterpret_cast<Address>(slot)) || 63 reinterpret_cast<Address>(slot)) ||
64 heap->InNewSpace(object) ||
62 !Page::FromAddress(reinterpret_cast<Address>(object)) 65 !Page::FromAddress(reinterpret_cast<Address>(object))
63 ->IsEvacuationCandidate()) { 66 ->IsEvacuationCandidate()) {
64 // TODO(hpayer): Instead of replacing slots with kRemovedEntry we 67 // TODO(hpayer): Instead of replacing slots with kRemovedEntry we
65 // could shrink the slots buffer in-place. 68 // could shrink the slots buffer in-place.
66 slots[slot_idx] = kRemovedEntry; 69 slots[slot_idx] = kRemovedEntry;
67 } 70 }
68 } else { 71 } else {
69 ++slot_idx; 72 ++slot_idx;
70 DCHECK(slot_idx < slots_count); 73 DCHECK(slot_idx < slots_count);
71 } 74 }
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 while (buffer != NULL) { 155 while (buffer != NULL) {
153 SlotsBuffer* next_buffer = buffer->next(); 156 SlotsBuffer* next_buffer = buffer->next();
154 DeallocateBuffer(buffer); 157 DeallocateBuffer(buffer);
155 buffer = next_buffer; 158 buffer = next_buffer;
156 } 159 }
157 *buffer_address = NULL; 160 *buffer_address = NULL;
158 } 161 }
159 162
160 } // namespace internal 163 } // namespace internal
161 } // namespace v8 164 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698