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

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

Issue 1465633002: [heap] pause/resume inline allocation observers around scavenge (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-spaces.cc
diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc
index accf9334ede1279aa098e36c6807feabc353dabe..6c3591a855abe4cb3f50c7e550c7276e85ffab85 100644
--- a/test/cctest/test-spaces.cc
+++ b/test/cctest/test-spaces.cc
@@ -872,10 +872,24 @@ UNINITIALIZED_TEST(InlineAllocationObserver) {
CHECK_EQ(observer1.count(), 20); // no more notifications.
CHECK_EQ(observer2.count(), 3); // this one is still active.
+ // Ensure that Pause/ResumeInlineAllocationObservers work correctly.
+ AllocateUnaligned(new_space, 48);
+ CHECK_EQ(observer2.count(), 3);
+ new_space->PauseInlineAllocationObservers();
+ CHECK_EQ(observer2.count(), 3);
+ AllocateUnaligned(new_space, 384);
+ CHECK_EQ(observer2.count(), 3);
+ new_space->ResumeInlineAllocationObservers();
+ CHECK_EQ(observer2.count(), 3);
+ // Coupled with the 48 bytes allocated before the pause, another 48 bytes
+ // allocated here should trigger a notification.
+ AllocateUnaligned(new_space, 48);
+ CHECK_EQ(observer2.count(), 4);
+
new_space->RemoveInlineAllocationObserver(&observer2);
AllocateUnaligned(new_space, 384);
CHECK_EQ(observer1.count(), 20);
- CHECK_EQ(observer2.count(), 3);
+ CHECK_EQ(observer2.count(), 4);
}
isolate->Dispose();
}
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698