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

Side by Side Diff: test/cctest/test-spaces.cc

Issue 1460063006: [heap] report allocated object to the inline-allocation-observers (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix comments Created 5 years 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 786 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 CHECK(allocation.To(&filler)); 797 CHECK(allocation.To(&filler));
798 space->heap()->CreateFillerObjectAt(filler->address(), size); 798 space->heap()->CreateFillerObjectAt(filler->address(), size);
799 return filler; 799 return filler;
800 } 800 }
801 801
802 class Observer : public InlineAllocationObserver { 802 class Observer : public InlineAllocationObserver {
803 public: 803 public:
804 explicit Observer(intptr_t step_size) 804 explicit Observer(intptr_t step_size)
805 : InlineAllocationObserver(step_size), count_(0) {} 805 : InlineAllocationObserver(step_size), count_(0) {}
806 806
807 virtual void Step(int bytes_allocated) { count_++; } 807 void Step(int bytes_allocated, Address, size_t) override { count_++; }
808 808
809 int count() const { return count_; } 809 int count() const { return count_; }
810 810
811 private: 811 private:
812 int count_; 812 int count_;
813 }; 813 };
814 814
815 815
816 UNINITIALIZED_TEST(InlineAllocationObserver) { 816 UNINITIALIZED_TEST(InlineAllocationObserver) {
817 v8::Isolate::CreateParams create_params; 817 v8::Isolate::CreateParams create_params;
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
921 new_space->RemoveInlineAllocationObserver(&observer2); 921 new_space->RemoveInlineAllocationObserver(&observer2);
922 922
923 CHECK_EQ(observer1.count(), 32); 923 CHECK_EQ(observer1.count(), 32);
924 CHECK_EQ(observer2.count(), 28); 924 CHECK_EQ(observer2.count(), 28);
925 } 925 }
926 isolate->Dispose(); 926 isolate->Dispose();
927 } 927 }
928 928
929 } // namespace internal 929 } // namespace internal
930 } // namespace v8 930 } // 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