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

Unified Diff: test/cctest/heap/test-spaces.cc

Issue 1625753002: Allocation sampling for paged/lo spaces (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: WIP: Allocation sampling for paged/lo spaces Created 4 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
« src/heap/spaces.h ('K') | « src/profiler/sampling-heap-profiler.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/heap/test-spaces.cc
diff --git a/test/cctest/heap/test-spaces.cc b/test/cctest/heap/test-spaces.cc
index 2fe099d2e3b19af8268f268c670e0df36247f507..d5b98e804e626e1b2a6c54ebfda3331af14bfb26 100644
--- a/test/cctest/heap/test-spaces.cc
+++ b/test/cctest/heap/test-spaces.cc
@@ -797,10 +797,10 @@ static HeapObject* AllocateUnaligned(NewSpace* space, int size) {
return filler;
}
-class Observer : public InlineAllocationObserver {
+class Observer : public AllocationObserver {
public:
explicit Observer(intptr_t step_size)
- : InlineAllocationObserver(step_size), count_(0) {}
+ : AllocationObserver(step_size), count_(0) {}
void Step(int bytes_allocated, Address, size_t) override { count_++; }
@@ -811,7 +811,7 @@ class Observer : public InlineAllocationObserver {
};
-UNINITIALIZED_TEST(InlineAllocationObserver) {
+UNINITIALIZED_TEST(AllocationObserver) {
v8::Isolate::CreateParams create_params;
create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
v8::Isolate* isolate = v8::Isolate::New(create_params);
@@ -825,7 +825,7 @@ UNINITIALIZED_TEST(InlineAllocationObserver) {
NewSpace* new_space = i_isolate->heap()->new_space();
Observer observer1(128);
- new_space->AddInlineAllocationObserver(&observer1);
+ new_space->AddAllocationObserver(&observer1);
// The observer should not get notified if we have only allocated less than
// 128 bytes.
@@ -853,7 +853,7 @@ UNINITIALIZED_TEST(InlineAllocationObserver) {
// Multiple observers should work.
Observer observer2(96);
- new_space->AddInlineAllocationObserver(&observer2);
+ new_space->AddAllocationObserver(&observer2);
AllocateUnaligned(new_space, 2048);
CHECK_EQ(observer1.count(), 20);
@@ -864,7 +864,7 @@ UNINITIALIZED_TEST(InlineAllocationObserver) {
CHECK_EQ(observer2.count(), 2);
// Callback should stop getting called after an observer is removed.
- new_space->RemoveInlineAllocationObserver(&observer1);
+ new_space->RemoveAllocationObserver(&observer1);
AllocateUnaligned(new_space, 384);
CHECK_EQ(observer1.count(), 20); // no more notifications.
@@ -874,7 +874,7 @@ UNINITIALIZED_TEST(InlineAllocationObserver) {
AllocateUnaligned(new_space, 48);
CHECK_EQ(observer2.count(), 3);
{
- PauseInlineAllocationObserversScope pause_observers(new_space);
+ PauseAllocationObserversScope pause_observers(new_space);
CHECK_EQ(observer2.count(), 3);
AllocateUnaligned(new_space, 384);
CHECK_EQ(observer2.count(), 3);
@@ -885,7 +885,7 @@ UNINITIALIZED_TEST(InlineAllocationObserver) {
AllocateUnaligned(new_space, 48);
CHECK_EQ(observer2.count(), 4);
- new_space->RemoveInlineAllocationObserver(&observer2);
+ new_space->RemoveAllocationObserver(&observer2);
AllocateUnaligned(new_space, 384);
CHECK_EQ(observer1.count(), 20);
CHECK_EQ(observer2.count(), 4);
@@ -908,16 +908,16 @@ UNINITIALIZED_TEST(InlineAllocationObserverCadence) {
NewSpace* new_space = i_isolate->heap()->new_space();
Observer observer1(512);
- new_space->AddInlineAllocationObserver(&observer1);
+ new_space->AddAllocationObserver(&observer1);
Observer observer2(576);
- new_space->AddInlineAllocationObserver(&observer2);
+ new_space->AddAllocationObserver(&observer2);
for (int i = 0; i < 512; ++i) {
AllocateUnaligned(new_space, 32);
}
- new_space->RemoveInlineAllocationObserver(&observer1);
- new_space->RemoveInlineAllocationObserver(&observer2);
+ new_space->RemoveAllocationObserver(&observer1);
+ new_space->RemoveAllocationObserver(&observer2);
CHECK_EQ(observer1.count(), 32);
CHECK_EQ(observer2.count(), 28);
« src/heap/spaces.h ('K') | « src/profiler/sampling-heap-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698