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

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

Issue 1268663004: Add support for large object IsSlotInBlackObject to filter out all dead slots correctly. (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 3042 matching lines...) Expand 10 before | Expand all | Expand 10 after
3053 heap()->IncrementPromotedObjectsSize(object_size); 3053 heap()->IncrementPromotedObjectsSize(object_size);
3054 return true; 3054 return true;
3055 } 3055 }
3056 3056
3057 return false; 3057 return false;
3058 } 3058 }
3059 3059
3060 3060
3061 bool MarkCompactCollector::IsSlotInBlackObject(Page* p, Address slot, 3061 bool MarkCompactCollector::IsSlotInBlackObject(Page* p, Address slot,
3062 HeapObject** out_object) { 3062 HeapObject** out_object) {
3063 // This function does not support large objects right now.
3064 Space* owner = p->owner(); 3063 Space* owner = p->owner();
Hannes Payer (out of office) 2015/07/30 12:38:12 owner() could actually return lo
3065 if (owner == heap_->lo_space() || owner == NULL) { 3064 if (owner == heap_->lo_space() || owner == NULL) {
ulan 2015/07/30 12:45:23 Did you mean if (owner == heap_->lo_space()) { ?
Hannes Payer (out of office) 2015/07/30 13:40:29 As discussed offline, NULL is returned when we som
3066 *out_object = NULL; 3065 Object* large_object = heap_->lo_space()->FindObject(slot);
3067 return true; 3066 // This object has to exist, otherwise we would not have recorded a slot
3067 // for it.
3068 CHECK(large_object->IsHeapObject());
3069 HeapObject* large_heap_object = HeapObject::cast(large_object);
3070 if (IsMarked(large_heap_object)) {
3071 *out_object = large_heap_object;
3072 return true;
3073 }
3074 return false;
3068 } 3075 }
3069 3076
3070 uint32_t mark_bit_index = p->AddressToMarkbitIndex(slot); 3077 uint32_t mark_bit_index = p->AddressToMarkbitIndex(slot);
3071 unsigned int start_index = mark_bit_index >> Bitmap::kBitsPerCellLog2; 3078 unsigned int start_index = mark_bit_index >> Bitmap::kBitsPerCellLog2;
3072 MarkBit::CellType index_in_cell = 1U 3079 MarkBit::CellType index_in_cell = 1U
3073 << (mark_bit_index & Bitmap::kBitIndexMask); 3080 << (mark_bit_index & Bitmap::kBitIndexMask);
3074 MarkBit::CellType* cells = p->markbits()->cells(); 3081 MarkBit::CellType* cells = p->markbits()->cells();
3075 Address cell_base = p->area_start(); 3082 Address cell_base = p->area_start();
3076 unsigned int cell_base_start_index = Bitmap::IndexToCell( 3083 unsigned int cell_base_start_index = Bitmap::IndexToCell(
3077 Bitmap::CellAlignIndex(p->AddressToMarkbitIndex(cell_base))); 3084 Bitmap::CellAlignIndex(p->AddressToMarkbitIndex(cell_base)));
(...skipping 1670 matching lines...) Expand 10 before | Expand all | Expand 10 after
4748 SlotsBuffer* buffer = *buffer_address; 4755 SlotsBuffer* buffer = *buffer_address;
4749 while (buffer != NULL) { 4756 while (buffer != NULL) {
4750 SlotsBuffer* next_buffer = buffer->next(); 4757 SlotsBuffer* next_buffer = buffer->next();
4751 DeallocateBuffer(buffer); 4758 DeallocateBuffer(buffer);
4752 buffer = next_buffer; 4759 buffer = next_buffer;
4753 } 4760 }
4754 *buffer_address = NULL; 4761 *buffer_address = NULL;
4755 } 4762 }
4756 } // namespace internal 4763 } // namespace internal
4757 } // namespace v8 4764 } // 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