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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « src/heap/spaces.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 867 matching lines...) Expand 10 before | Expand all | Expand 10 after
878 CHECK_EQ(observer2.count(), 3); // this one is still active. 878 CHECK_EQ(observer2.count(), 3); // this one is still active.
879 879
880 new_space->RemoveInlineAllocationObserver(&observer2); 880 new_space->RemoveInlineAllocationObserver(&observer2);
881 AllocateUnaligned(new_space, 384); 881 AllocateUnaligned(new_space, 384);
882 CHECK_EQ(observer1.count(), 16); 882 CHECK_EQ(observer1.count(), 16);
883 CHECK_EQ(observer2.count(), 3); 883 CHECK_EQ(observer2.count(), 3);
884 } 884 }
885 isolate->Dispose(); 885 isolate->Dispose();
886 } 886 }
887 887
888
889 UNINITIALIZED_TEST(InlineAllocationObserverCadence) {
890 v8::Isolate::CreateParams create_params;
891 create_params.array_buffer_allocator = CcTest::array_buffer_allocator();
892 v8::Isolate* isolate = v8::Isolate::New(create_params);
893 {
894 v8::Isolate::Scope isolate_scope(isolate);
895 v8::HandleScope handle_scope(isolate);
896 v8::Context::New(isolate)->Enter();
897
898 Isolate* i_isolate = reinterpret_cast<Isolate*>(isolate);
899
900 NewSpace* new_space = i_isolate->heap()->new_space();
901
902 Observer observer1(512);
903 new_space->AddInlineAllocationObserver(&observer1);
904 Observer observer2(576);
905 new_space->AddInlineAllocationObserver(&observer2);
906
907 for (int i = 0; i < 512; ++i) {
908 AllocateUnaligned(new_space, 32);
909 }
910
911 new_space->RemoveInlineAllocationObserver(&observer1);
912 new_space->RemoveInlineAllocationObserver(&observer2);
913
914 CHECK_EQ(observer1.count(), 30);
915 CHECK_EQ(observer2.count(), 26);
916 }
917 isolate->Dispose();
918 }
919
888 } // namespace internal 920 } // namespace internal
889 } // namespace v8 921 } // namespace v8
OLDNEW
« 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