Index: src/spaces-inl.h |
diff --git a/src/spaces-inl.h b/src/spaces-inl.h |
index e863b519a99c0c06f93471d96428caa703dceb7a..450f300e44f7e2f5a24fcb54dbfc45682c874ee1 100644 |
--- a/src/spaces-inl.h |
+++ b/src/spaces-inl.h |
@@ -253,30 +253,26 @@ HeapObject* PagedSpace::AllocateLinearly(int size_in_bytes) { |
// Raw allocation. |
AllocationResult PagedSpace::AllocateRaw(int size_in_bytes) { |
HeapObject* object = AllocateLinearly(size_in_bytes); |
- if (object != NULL) { |
- if (identity() == CODE_SPACE) { |
- SkipList::Update(object->address(), size_in_bytes); |
- } |
- return object; |
- } |
- ASSERT(!heap()->linear_allocation() || |
+ ASSERT((object == NULL) || |
+ !heap()->linear_allocation() || |
(anchor_.next_chunk() == &anchor_ && |
anchor_.prev_chunk() == &anchor_)); |
- object = free_list_.Allocate(size_in_bytes); |
- if (object != NULL) { |
- if (identity() == CODE_SPACE) { |
- SkipList::Update(object->address(), size_in_bytes); |
+ if (object == NULL) { |
+ object = free_list_.Allocate(size_in_bytes); |
+ if (object == NULL) { |
+ object = SlowAllocateRaw(size_in_bytes); |
} |
- return object; |
} |
- object = SlowAllocateRaw(size_in_bytes); |
if (object != NULL) { |
if (identity() == CODE_SPACE) { |
SkipList::Update(object->address(), size_in_bytes); |
} |
+ if (FLAG_allocations_digest) { |
+ heap()->OnAllocationEvent(object, size_in_bytes); |
Hannes Payer (out of office)
2014/06/09 15:23:51
See my comment about Heap::AllocateRaw.
Igor Sheludko
2014/06/10 08:22:54
Replied.
|
+ } |
return object; |
} |
@@ -299,6 +295,9 @@ AllocationResult NewSpace::AllocateRaw(int size_in_bytes) { |
allocation_info_.set_top(allocation_info_.top() + size_in_bytes); |
ASSERT_SEMISPACE_ALLOCATION_INFO(allocation_info_, to_space_); |
+ if (FLAG_allocations_digest) { |
+ heap()->OnAllocationEvent(obj, size_in_bytes); |
Hannes Payer (out of office)
2014/06/09 15:23:51
See my comment about Heap::AllocateRaw.
Igor Sheludko
2014/06/10 08:22:54
Replied.
|
+ } |
return obj; |
} |