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

Side by Side Diff: runtime/vm/scavenger.h

Issue 2992153002: Fixes bug in calculation of memory used by new space (Closed)
Patch Set: Created 3 years, 4 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
« no previous file with comments | « no previous file | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
194 194
195 uword top() { return top_; } 195 uword top() { return top_; }
196 uword end() { return end_; } 196 uword end() { return end_; }
197 197
198 void set_top(uword value) { top_ = value; } 198 void set_top(uword value) { top_ = value; }
199 void set_end(uword value) { 199 void set_end(uword value) {
200 ASSERT(to_->end() == value); 200 ASSERT(to_->end() == value);
201 end_ = value; 201 end_ = value;
202 } 202 }
203 203
204 int64_t UsedInWords() const { 204 int64_t UsedInWords() const;
205 return (top_ - FirstObjectStart()) >> kWordSizeLog2;
206 }
207 int64_t CapacityInWords() const { return to_->size_in_words(); } 205 int64_t CapacityInWords() const { return to_->size_in_words(); }
208 int64_t ExternalInWords() const { return external_size_ >> kWordSizeLog2; } 206 int64_t ExternalInWords() const { return external_size_ >> kWordSizeLog2; }
209 SpaceUsage GetCurrentUsage() const { 207 SpaceUsage GetCurrentUsage() const {
210 SpaceUsage usage; 208 SpaceUsage usage;
211 usage.used_in_words = UsedInWords(); 209 usage.used_in_words = UsedInWords();
212 usage.capacity_in_words = CapacityInWords(); 210 usage.capacity_in_words = CapacityInWords();
213 usage.external_in_words = ExternalInWords(); 211 usage.external_in_words = ExternalInWords();
214 return usage; 212 return usage;
215 } 213 }
216 214
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
338 336
339 friend class ScavengerVisitor; 337 friend class ScavengerVisitor;
340 friend class ScavengerWeakVisitor; 338 friend class ScavengerWeakVisitor;
341 339
342 DISALLOW_COPY_AND_ASSIGN(Scavenger); 340 DISALLOW_COPY_AND_ASSIGN(Scavenger);
343 }; 341 };
344 342
345 } // namespace dart 343 } // namespace dart
346 344
347 #endif // RUNTIME_VM_SCAVENGER_H_ 345 #endif // RUNTIME_VM_SCAVENGER_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698