| 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" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 | 66 |
| 67 // Accessors to generate code for inlined allocation. | 67 // Accessors to generate code for inlined allocation. |
| 68 uword* TopAddress() { return &top_; } | 68 uword* TopAddress() { return &top_; } |
| 69 uword* EndAddress() { return &end_; } | 69 uword* EndAddress() { return &end_; } |
| 70 static intptr_t top_offset() { return OFFSET_OF(Scavenger, top_); } | 70 static intptr_t top_offset() { return OFFSET_OF(Scavenger, top_); } |
| 71 static intptr_t end_offset() { return OFFSET_OF(Scavenger, end_); } | 71 static intptr_t end_offset() { return OFFSET_OF(Scavenger, end_); } |
| 72 | 72 |
| 73 intptr_t UsedInWords() const { | 73 intptr_t UsedInWords() const { |
| 74 return (top_ - FirstObjectStart()) >> kWordSizeLog2; | 74 return (top_ - FirstObjectStart()) >> kWordSizeLog2; |
| 75 } | 75 } |
| 76 intptr_t CapacityInWords() const { return space_->size() >> kWordSizeLog2; } | 76 intptr_t CapacityInWords() const { |
| 77 return (end_ - FirstObjectStart()) >> kWordSizeLog2; |
| 78 } |
| 77 intptr_t ExternalInWords() const { | 79 intptr_t ExternalInWords() const { |
| 78 return external_size_ >> kWordSizeLog2; | 80 return external_size_ >> kWordSizeLog2; |
| 79 } | 81 } |
| 80 | 82 |
| 81 void VisitObjects(ObjectVisitor* visitor) const; | 83 void VisitObjects(ObjectVisitor* visitor) const; |
| 82 void VisitObjectPointers(ObjectPointerVisitor* visitor) const; | 84 void VisitObjectPointers(ObjectPointerVisitor* visitor) const; |
| 83 | 85 |
| 84 void StartEndAddress(uword* start, uword* end) const { | 86 void StartEndAddress(uword* start, uword* end) const { |
| 85 *start = to_->start(); | 87 *start = to_->start(); |
| 86 *end = to_->end(); | 88 *end = to_->end(); |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 212 | 214 |
| 213 friend class ScavengerVisitor; | 215 friend class ScavengerVisitor; |
| 214 friend class ScavengerWeakVisitor; | 216 friend class ScavengerWeakVisitor; |
| 215 | 217 |
| 216 DISALLOW_COPY_AND_ASSIGN(Scavenger); | 218 DISALLOW_COPY_AND_ASSIGN(Scavenger); |
| 217 }; | 219 }; |
| 218 | 220 |
| 219 } // namespace dart | 221 } // namespace dart |
| 220 | 222 |
| 221 #endif // VM_SCAVENGER_H_ | 223 #endif // VM_SCAVENGER_H_ |
| OLD | NEW |