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

Unified Diff: src/allocation-tracker.cc

Issue 876613002: Only use FreeSpace objects in the free list. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: update multiplier for mips64 Created 5 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/objects.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/allocation-tracker.cc
diff --git a/src/allocation-tracker.cc b/src/allocation-tracker.cc
index 7534ffb82fd21f007befd70b52dd410dd455335d..d0cb13e2a08513c06c131c522b859b6c1c3ef30a 100644
--- a/src/allocation-tracker.cc
+++ b/src/allocation-tracker.cc
@@ -221,15 +221,26 @@ void AllocationTracker::PrepareForSerialization() {
}
+#ifdef DEBUG
+bool IsFillerOrFreeListNode(HeapObject* object) {
Hannes Payer (out of office) 2015/01/27 08:05:49 Rename to IsFillerOrFreeSpace
Yang 2015/01/27 08:49:48 Acknowledged.
+ Map* map = object->map();
+ Heap* heap = object->GetHeap();
+ return map == heap->raw_unchecked_free_space_map() ||
+ map == heap->raw_unchecked_one_pointer_filler_map() ||
+ map == heap->raw_unchecked_two_pointer_filler_map();
+}
+#endif // DEBUG
+
+
void AllocationTracker::AllocationEvent(Address addr, int size) {
DisallowHeapAllocation no_allocation;
Heap* heap = ids_->heap();
// Mark the new block as FreeSpace to make sure the heap is iterable
// while we are capturing stack trace.
- FreeListNode::FromAddress(addr)->set_size(heap, size);
+ heap->CreateFillerObjectAt(addr, size);
DCHECK_EQ(HeapObject::FromAddress(addr)->Size(), size);
- DCHECK(FreeListNode::IsFreeListNode(HeapObject::FromAddress(addr)));
+ DCHECK(IsFillerOrFreeListNode(HeapObject::FromAddress(addr)));
Hannes Payer (out of office) 2015/01/27 08:05:49 I don't think the two DCHECKs above are useful. We
Yang 2015/01/27 08:49:49 Done.
Isolate* isolate = heap->isolate();
int length = 0;
« no previous file with comments | « no previous file | src/api.cc » ('j') | src/objects.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698