| 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 VM_SCAVENGER_H_ | 5 #ifndef VM_SCAVENGER_H_ |
| 6 #define VM_SCAVENGER_H_ | 6 #define 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/flags.h" | 10 #include "vm/flags.h" |
| 11 #include "vm/globals.h" | 11 #include "vm/globals.h" |
| 12 #include "vm/raw_object.h" | 12 #include "vm/raw_object.h" |
| 13 #include "vm/spaces.h" | |
| 14 #include "vm/virtual_memory.h" | 13 #include "vm/virtual_memory.h" |
| 15 #include "vm/visitor.h" | 14 #include "vm/visitor.h" |
| 16 | 15 |
| 17 namespace dart { | 16 namespace dart { |
| 18 | 17 |
| 19 // Forward declarations. | 18 // Forward declarations. |
| 20 class Heap; | 19 class Heap; |
| 21 class Isolate; | 20 class Isolate; |
| 22 class JSONObject; | 21 class JSONObject; |
| 23 class ScavengerVisitor; | 22 class ScavengerVisitor; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 74 |
| 76 intptr_t UsedInWords() const { | 75 intptr_t UsedInWords() const { |
| 77 return (top_ - FirstObjectStart()) >> kWordSizeLog2; | 76 return (top_ - FirstObjectStart()) >> kWordSizeLog2; |
| 78 } | 77 } |
| 79 intptr_t CapacityInWords() const { | 78 intptr_t CapacityInWords() const { |
| 80 return (end_ - FirstObjectStart()) >> kWordSizeLog2; | 79 return (end_ - FirstObjectStart()) >> kWordSizeLog2; |
| 81 } | 80 } |
| 82 intptr_t ExternalInWords() const { | 81 intptr_t ExternalInWords() const { |
| 83 return external_size_ >> kWordSizeLog2; | 82 return external_size_ >> kWordSizeLog2; |
| 84 } | 83 } |
| 85 SpaceUsage GetCurrentUsage() const { | |
| 86 SpaceUsage usage; | |
| 87 usage.used_in_words = UsedInWords(); | |
| 88 usage.capacity_in_words = CapacityInWords(); | |
| 89 usage.external_in_words = ExternalInWords(); | |
| 90 return usage; | |
| 91 } | |
| 92 | 84 |
| 93 void VisitObjects(ObjectVisitor* visitor) const; | 85 void VisitObjects(ObjectVisitor* visitor) const; |
| 94 void VisitObjectPointers(ObjectPointerVisitor* visitor) const; | 86 void VisitObjectPointers(ObjectPointerVisitor* visitor) const; |
| 95 | 87 |
| 96 void StartEndAddress(uword* start, uword* end) const { | 88 void StartEndAddress(uword* start, uword* end) const { |
| 97 *start = to_->start(); | 89 *start = to_->start(); |
| 98 *end = to_->end(); | 90 *end = to_->end(); |
| 99 } | 91 } |
| 100 | 92 |
| 101 // Returns true if the last scavenge had a promotion failure. | 93 // Returns true if the last scavenge had a promotion failure. |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 | 212 |
| 221 friend class ScavengerVisitor; | 213 friend class ScavengerVisitor; |
| 222 friend class ScavengerWeakVisitor; | 214 friend class ScavengerWeakVisitor; |
| 223 | 215 |
| 224 DISALLOW_COPY_AND_ASSIGN(Scavenger); | 216 DISALLOW_COPY_AND_ASSIGN(Scavenger); |
| 225 }; | 217 }; |
| 226 | 218 |
| 227 } // namespace dart | 219 } // namespace dart |
| 228 | 220 |
| 229 #endif // VM_SCAVENGER_H_ | 221 #endif // VM_SCAVENGER_H_ |
| OLD | NEW |