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

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

Issue 1265943002: Use proper verify method when checking slots buffer entries. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 4 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 | no next file » | 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 4563 matching lines...) Expand 10 before | Expand all | Expand 10 after
4574 void SlotsBuffer::VerifySlots(Heap* heap, SlotsBuffer* buffer) { 4574 void SlotsBuffer::VerifySlots(Heap* heap, SlotsBuffer* buffer) {
4575 while (buffer != NULL) { 4575 while (buffer != NULL) {
4576 SlotsBuffer::ObjectSlot* slots = buffer->slots_; 4576 SlotsBuffer::ObjectSlot* slots = buffer->slots_;
4577 intptr_t slots_count = buffer->idx_; 4577 intptr_t slots_count = buffer->idx_;
4578 4578
4579 for (int slot_idx = 0; slot_idx < slots_count; ++slot_idx) { 4579 for (int slot_idx = 0; slot_idx < slots_count; ++slot_idx) {
4580 ObjectSlot slot = slots[slot_idx]; 4580 ObjectSlot slot = slots[slot_idx];
4581 if (!IsTypedSlot(slot)) { 4581 if (!IsTypedSlot(slot)) {
4582 Object* object = *slot; 4582 Object* object = *slot;
4583 if (object->IsHeapObject()) { 4583 if (object->IsHeapObject()) {
4584 HeapObject* heap_object = HeapObject::cast(object);
4584 CHECK(!heap->InNewSpace(object)); 4585 CHECK(!heap->InNewSpace(object));
4585 CHECK(heap->mark_compact_collector()->IsSlotInLiveObject( 4586 heap->mark_compact_collector()->VerifyIsSlotInLiveObject(
4586 reinterpret_cast<Address>(slot))); 4587 reinterpret_cast<Address>(slot), heap_object);
4587 } 4588 }
4588 } else { 4589 } else {
4589 ++slot_idx; 4590 ++slot_idx;
4590 DCHECK(slot_idx < slots_count); 4591 DCHECK(slot_idx < slots_count);
4591 } 4592 }
4592 } 4593 }
4593 buffer = buffer->next(); 4594 buffer = buffer->next();
4594 } 4595 }
4595 } 4596 }
4596 4597
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after
4748 SlotsBuffer* buffer = *buffer_address; 4749 SlotsBuffer* buffer = *buffer_address;
4749 while (buffer != NULL) { 4750 while (buffer != NULL) {
4750 SlotsBuffer* next_buffer = buffer->next(); 4751 SlotsBuffer* next_buffer = buffer->next();
4751 DeallocateBuffer(buffer); 4752 DeallocateBuffer(buffer);
4752 buffer = next_buffer; 4753 buffer = next_buffer;
4753 } 4754 }
4754 *buffer_address = NULL; 4755 *buffer_address = NULL;
4755 } 4756 }
4756 } // namespace internal 4757 } // namespace internal
4757 } // namespace v8 4758 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698