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

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 for DCHECK only variable 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
« no previous file with comments | « src/heap/spaces.cc ('k') | src/profiler/sampling-heap-profiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces-inl.h
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h
index ef081fa00a6b982132feddce542beb39e59e0ca4..3fbd5b7853ea2db4ed654402f31bce2cb146c452 100644
--- a/src/heap/spaces-inl.h
+++ b/src/heap/spaces-inl.h
@@ -462,12 +462,18 @@ 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
+ HeapObject* heap_obj = nullptr;
+ if (!result.IsRetry() && result.To(&heap_obj)) {
+ AllocationStep(heap_obj->address(), size_in_bytes);
+ }
+ return result;
}
« no previous file with comments | « src/heap/spaces.cc ('k') | src/profiler/sampling-heap-profiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698