OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #ifndef RUNTIME_VM_SCAVENGER_H_ | 5 #ifndef RUNTIME_VM_SCAVENGER_H_ |
6 #define RUNTIME_VM_SCAVENGER_H_ | 6 #define RUNTIME_VM_SCAVENGER_H_ |
7 | 7 |
8 #include "platform/assert.h" | 8 #include "platform/assert.h" |
9 #include "platform/utils.h" | 9 #include "platform/utils.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 explicit SemiSpace(VirtualMemory* reserved); | 56 explicit SemiSpace(VirtualMemory* reserved); |
57 ~SemiSpace(); | 57 ~SemiSpace(); |
58 | 58 |
59 VirtualMemory* reserved_; // NULL for an empty space. | 59 VirtualMemory* reserved_; // NULL for an empty space. |
60 MemoryRegion region_; | 60 MemoryRegion region_; |
61 | 61 |
62 static SemiSpace* cache_; | 62 static SemiSpace* cache_; |
63 static Mutex* mutex_; | 63 static Mutex* mutex_; |
64 }; | 64 }; |
65 | 65 |
66 | |
67 // Statistics for a particular scavenge. | 66 // Statistics for a particular scavenge. |
68 class ScavengeStats { | 67 class ScavengeStats { |
69 public: | 68 public: |
70 ScavengeStats() {} | 69 ScavengeStats() {} |
71 ScavengeStats(int64_t start_micros, | 70 ScavengeStats(int64_t start_micros, |
72 int64_t end_micros, | 71 int64_t end_micros, |
73 SpaceUsage before, | 72 SpaceUsage before, |
74 SpaceUsage after, | 73 SpaceUsage after, |
75 intptr_t promo_candidates_in_words, | 74 intptr_t promo_candidates_in_words, |
76 intptr_t promoted_in_words) | 75 intptr_t promoted_in_words) |
(...skipping 23 matching lines...) Expand all Loading... |
100 | 99 |
101 private: | 100 private: |
102 int64_t start_micros_; | 101 int64_t start_micros_; |
103 int64_t end_micros_; | 102 int64_t end_micros_; |
104 SpaceUsage before_; | 103 SpaceUsage before_; |
105 SpaceUsage after_; | 104 SpaceUsage after_; |
106 intptr_t promo_candidates_in_words_; | 105 intptr_t promo_candidates_in_words_; |
107 intptr_t promoted_in_words_; | 106 intptr_t promoted_in_words_; |
108 }; | 107 }; |
109 | 108 |
110 | |
111 class Scavenger { | 109 class Scavenger { |
112 public: | 110 public: |
113 Scavenger(Heap* heap, | 111 Scavenger(Heap* heap, |
114 intptr_t max_semi_capacity_in_words, | 112 intptr_t max_semi_capacity_in_words, |
115 uword object_alignment); | 113 uword object_alignment); |
116 ~Scavenger(); | 114 ~Scavenger(); |
117 | 115 |
118 // Check whether this Scavenger contains this address. | 116 // Check whether this Scavenger contains this address. |
119 // During scavenging both the to and from spaces contain "legal" objects. | 117 // During scavenging both the to and from spaces contain "legal" objects. |
120 // During a scavenge this function only returns true for addresses that will | 118 // During a scavenge this function only returns true for addresses that will |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
297 | 295 |
298 friend class ScavengerVisitor; | 296 friend class ScavengerVisitor; |
299 friend class ScavengerWeakVisitor; | 297 friend class ScavengerWeakVisitor; |
300 | 298 |
301 DISALLOW_COPY_AND_ASSIGN(Scavenger); | 299 DISALLOW_COPY_AND_ASSIGN(Scavenger); |
302 }; | 300 }; |
303 | 301 |
304 } // namespace dart | 302 } // namespace dart |
305 | 303 |
306 #endif // RUNTIME_VM_SCAVENGER_H_ | 304 #endif // RUNTIME_VM_SCAVENGER_H_ |
OLD | NEW |