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

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

Issue 1577853007: [heap] Parallel newspace evacuation, semispace copy, and compaction \o/ (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase (2 changes factored out) and addressed comments Created 4 years, 11 months 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
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"
11 #include "src/base/bits.h" 11 #include "src/base/bits.h"
12 #include "src/base/platform/mutex.h" 12 #include "src/base/platform/mutex.h"
13 #include "src/flags.h" 13 #include "src/flags.h"
14 #include "src/hashmap.h" 14 #include "src/hashmap.h"
15 #include "src/heap/store-buffer.h"
15 #include "src/list.h" 16 #include "src/list.h"
16 #include "src/objects.h" 17 #include "src/objects.h"
17 #include "src/utils.h" 18 #include "src/utils.h"
18 19
19 namespace v8 { 20 namespace v8 {
20 namespace internal { 21 namespace internal {
21 22
22 class CompactionSpaceCollection; 23 class CompactionSpaceCollection;
23 class Isolate; 24 class Isolate;
24 25
(...skipping 2964 matching lines...) Expand 10 before | Expand all | Expand 10 after
2989 int size_in_bytes) override; 2990 int size_in_bytes) override;
2990 }; 2991 };
2991 2992
2992 2993
2993 // A collection of |CompactionSpace|s used by a single compaction task. 2994 // A collection of |CompactionSpace|s used by a single compaction task.
2994 class CompactionSpaceCollection : public Malloced { 2995 class CompactionSpaceCollection : public Malloced {
2995 public: 2996 public:
2996 explicit CompactionSpaceCollection(Heap* heap) 2997 explicit CompactionSpaceCollection(Heap* heap)
2997 : old_space_(heap, OLD_SPACE, Executability::NOT_EXECUTABLE), 2998 : old_space_(heap, OLD_SPACE, Executability::NOT_EXECUTABLE),
2998 code_space_(heap, CODE_SPACE, Executability::EXECUTABLE), 2999 code_space_(heap, CODE_SPACE, Executability::EXECUTABLE),
3000 local_pretenuring_feedback_(HashMap::PointersMatch,
3001 kInitialLocalPretenuringFeedbackCapacity),
2999 duration_(0.0), 3002 duration_(0.0),
3000 bytes_compacted_(0) {} 3003 bytes_compacted_(0) {}
3001 3004
3002 CompactionSpace* Get(AllocationSpace space) { 3005 CompactionSpace* Get(AllocationSpace space) {
3003 switch (space) { 3006 switch (space) {
3004 case OLD_SPACE: 3007 case OLD_SPACE:
3005 return &old_space_; 3008 return &old_space_;
3006 case CODE_SPACE: 3009 case CODE_SPACE:
3007 return &code_space_; 3010 return &code_space_;
3008 default: 3011 default:
3009 UNREACHABLE(); 3012 UNREACHABLE();
3010 } 3013 }
3011 UNREACHABLE(); 3014 UNREACHABLE();
3012 return nullptr; 3015 return nullptr;
3013 } 3016 }
3014 3017
3015 void ReportCompactionProgress(double duration, intptr_t bytes_compacted) { 3018 void ReportCompactionProgress(double duration, intptr_t bytes_compacted) {
3016 duration_ += duration; 3019 duration_ += duration;
3017 bytes_compacted_ += bytes_compacted; 3020 bytes_compacted_ += bytes_compacted;
3018 } 3021 }
3019 3022
3020 double duration() const { return duration_; } 3023 double duration() const { return duration_; }
3021 intptr_t bytes_compacted() const { return bytes_compacted_; } 3024 intptr_t bytes_compacted() const { return bytes_compacted_; }
3025 HashMap* local_pretenuring_feedback() { return &local_pretenuring_feedback_; }
3026 LocalStoreBuffer* local_store_buffer() { return &local_store_buffer_; }
3022 3027
3023 private: 3028 private:
3029 static const int kInitialLocalPretenuringFeedbackCapacity = 256;
3030
3024 CompactionSpace old_space_; 3031 CompactionSpace old_space_;
3025 CompactionSpace code_space_; 3032 CompactionSpace code_space_;
3033 HashMap local_pretenuring_feedback_;
3034 LocalStoreBuffer local_store_buffer_;
3026 3035
3027 // Book keeping. 3036 // Book keeping.
3028 double duration_; 3037 double duration_;
3029 intptr_t bytes_compacted_; 3038 intptr_t bytes_compacted_;
3030 }; 3039 };
3031 3040
3032 3041
3033 // ----------------------------------------------------------------------------- 3042 // -----------------------------------------------------------------------------
3034 // Old object space (includes the old space of objects and code space) 3043 // Old object space (includes the old space of objects and code space)
3035 3044
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
3220 count = 0; 3229 count = 0;
3221 } 3230 }
3222 // Must be small, since an iteration is used for lookup. 3231 // Must be small, since an iteration is used for lookup.
3223 static const int kMaxComments = 64; 3232 static const int kMaxComments = 64;
3224 }; 3233 };
3225 #endif 3234 #endif
3226 } // namespace internal 3235 } // namespace internal
3227 } // namespace v8 3236 } // namespace v8
3228 3237
3229 #endif // V8_HEAP_SPACES_H_ 3238 #endif // V8_HEAP_SPACES_H_
OLDNEW
« src/heap/mark-compact.cc ('K') | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698