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

Side by Side Diff: src/heap/spaces.h

Issue 1410633005: [heap] Base number of compaction tasks on live memory and compaction speed. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Restore 1st version of profiling evacuation performance 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/mark-compact.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 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_SPACES_H_ 5 #ifndef V8_HEAP_SPACES_H_
6 #define V8_HEAP_SPACES_H_ 6 #define V8_HEAP_SPACES_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/atomic-utils.h" 9 #include "src/atomic-utils.h"
10 #include "src/base/atomicops.h" 10 #include "src/base/atomicops.h"
(...skipping 2839 matching lines...) Expand 10 before | Expand all | Expand 10 after
2850 MUST_USE_RESULT virtual HeapObject* SweepAndRetryAllocation( 2850 MUST_USE_RESULT virtual HeapObject* SweepAndRetryAllocation(
2851 int size_in_bytes) override; 2851 int size_in_bytes) override;
2852 }; 2852 };
2853 2853
2854 2854
2855 // A collection of |CompactionSpace|s used by a single compaction task. 2855 // A collection of |CompactionSpace|s used by a single compaction task.
2856 class CompactionSpaceCollection : public Malloced { 2856 class CompactionSpaceCollection : public Malloced {
2857 public: 2857 public:
2858 explicit CompactionSpaceCollection(Heap* heap) 2858 explicit CompactionSpaceCollection(Heap* heap)
2859 : old_space_(heap, OLD_SPACE, Executability::NOT_EXECUTABLE), 2859 : old_space_(heap, OLD_SPACE, Executability::NOT_EXECUTABLE),
2860 code_space_(heap, CODE_SPACE, Executability::EXECUTABLE) {} 2860 code_space_(heap, CODE_SPACE, Executability::EXECUTABLE),
2861 duration_(0.0),
2862 bytes_compacted_(0) {}
2861 2863
2862 CompactionSpace* Get(AllocationSpace space) { 2864 CompactionSpace* Get(AllocationSpace space) {
2863 switch (space) { 2865 switch (space) {
2864 case OLD_SPACE: 2866 case OLD_SPACE:
2865 return &old_space_; 2867 return &old_space_;
2866 case CODE_SPACE: 2868 case CODE_SPACE:
2867 return &code_space_; 2869 return &code_space_;
2868 default: 2870 default:
2869 UNREACHABLE(); 2871 UNREACHABLE();
2870 } 2872 }
2871 UNREACHABLE(); 2873 UNREACHABLE();
2872 return nullptr; 2874 return nullptr;
2873 } 2875 }
2874 2876
2877 void ReportCompactionProgress(double duration, intptr_t bytes_compacted) {
2878 duration_ += duration;
2879 bytes_compacted_ += bytes_compacted;
2880 }
2881
2882 double duration() const { return duration_; }
2883 intptr_t bytes_compacted() const { return bytes_compacted_; }
2884
2875 private: 2885 private:
2876 CompactionSpace old_space_; 2886 CompactionSpace old_space_;
2877 CompactionSpace code_space_; 2887 CompactionSpace code_space_;
2888
2889 // Book keeping.
2890 double duration_;
2891 intptr_t bytes_compacted_;
2878 }; 2892 };
2879 2893
2880 2894
2881 // ----------------------------------------------------------------------------- 2895 // -----------------------------------------------------------------------------
2882 // Old object space (includes the old space of objects and code space) 2896 // Old object space (includes the old space of objects and code space)
2883 2897
2884 class OldSpace : public PagedSpace { 2898 class OldSpace : public PagedSpace {
2885 public: 2899 public:
2886 // Creates an old space object. The constructor does not allocate pages 2900 // Creates an old space object. The constructor does not allocate pages
2887 // from OS. 2901 // from OS.
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
3067 count = 0; 3081 count = 0;
3068 } 3082 }
3069 // Must be small, since an iteration is used for lookup. 3083 // Must be small, since an iteration is used for lookup.
3070 static const int kMaxComments = 64; 3084 static const int kMaxComments = 64;
3071 }; 3085 };
3072 #endif 3086 #endif
3073 } // namespace internal 3087 } // namespace internal
3074 } // namespace v8 3088 } // namespace v8
3075 3089
3076 #endif // V8_HEAP_SPACES_H_ 3090 #endif // V8_HEAP_SPACES_H_
OLDNEW
« no previous file with comments | « src/heap/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698