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

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

Issue 1427973006: [heap] make inline allocation step size dynamic (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase 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 cf053d0a9c53ad6595a4a72e3861c815cb99c43e..c563ba42599827beb34ddcb67f91fd8a5617447e 100644
--- a/test/cctest/test-spaces.cc
+++ b/test/cctest/test-spaces.cc
@@ -885,5 +885,37 @@ UNINITIALIZED_TEST(InlineAllocationObserver) {
isolate->Dispose();
}
+
+UNINITIALIZED_TEST(InlineAllocationObserverCadence) {
+ v8::Isolate::CreateParams create_params;
+ create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
+ v8::Isolate* isolate = v8::Isolate::New(create_params);
+ {
+ v8::Isolate::Scope isolate_scope(isolate);
+ v8::HandleScope handle_scope(isolate);
+ v8::Context::New(isolate)->Enter();
+
+ Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate);
+
+ NewSpace* new_space = i_isolate->heap()->new_space();
+
+ Observer observer1(512);
+ new_space->AddInlineAllocationObserver(&observer1);
+ Observer observer2(576);
+ new_space->AddInlineAllocationObserver(&observer2);
+
+ for (int i = 0; i < 512; ++i) {
+ AllocateUnaligned(new_space, 32);
+ }
+
+ new_space->RemoveInlineAllocationObserver(&observer1);
+ new_space->RemoveInlineAllocationObserver(&observer2);
+
+ CHECK_EQ(observer1.count(), 30);
+ CHECK_EQ(observer2.count(), 26);
+ }
+ isolate->Dispose();
+}
+
} // namespace internal
} // namespace v8
« 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