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

Unified Diff: src/heap/spaces-inl.h

Issue 1625753002: Allocation sampling for paged/lo spaces (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Use allspaces iterator and fix style issues 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 side-by-side diff with in-line comments
Download patch
Index: src/heap/spaces-inl.h
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h
index 3023fbf51ead410fba6a14aaab99dff05e5acf61..808f1359cb3f775d1fcfdd8910268f00c659722f 100644
--- a/src/heap/spaces-inl.h
+++ b/src/heap/spaces-inl.h
@@ -425,12 +425,21 @@ AllocationResult PagedSpace::AllocateRawAligned(int size_in_bytes,
AllocationResult PagedSpace::AllocateRaw(int size_in_bytes,
AllocationAlignment alignment) {
#ifdef V8_HOST_ARCH_32_BIT
- return alignment == kDoubleAligned
- ? AllocateRawAligned(size_in_bytes, kDoubleAligned)
- : AllocateRawUnaligned(size_in_bytes);
+ AllocationResult result =
+ alignment == kDoubleAligned
+ ? AllocateRawAligned(size_in_bytes, kDoubleAligned)
+ : AllocateRawUnaligned(size_in_bytes);
#else
- return AllocateRawUnaligned(size_in_bytes);
+ AllocationResult result = AllocateRawUnaligned(size_in_bytes);
#endif
+ if (!result.IsRetry()) {
+ Object* obj = result.ToObjectChecked();
ofrobots 2016/02/11 05:51:46 This code would be much simpler if you used Alloca
mattloring 2016/02/11 14:54:14 Done.
+ if (obj->IsHeapObject()) {
+ HeapObject* heap_obj = static_cast<HeapObject*>(obj);
+ AllocationStep(heap_obj->address(), size_in_bytes);
+ }
+ }
+ return result;
}

Powered by Google App Engine
This is Rietveld 408576698