OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 #include "vm/scavenger.h" | 5 #include "vm/scavenger.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 intptr_t bytes_promoted_; | 264 intptr_t bytes_promoted_; |
265 RawObject* visiting_old_object_; | 265 RawObject* visiting_old_object_; |
266 bool in_scavenge_pointer_; | 266 bool in_scavenge_pointer_; |
267 | 267 |
268 DISALLOW_COPY_AND_ASSIGN(ScavengerVisitor); | 268 DISALLOW_COPY_AND_ASSIGN(ScavengerVisitor); |
269 }; | 269 }; |
270 | 270 |
271 | 271 |
272 class ScavengerWeakVisitor : public HandleVisitor { | 272 class ScavengerWeakVisitor : public HandleVisitor { |
273 public: | 273 public: |
274 explicit ScavengerWeakVisitor(Scavenger* scavenger) : scavenger_(scavenger) { | 274 explicit ScavengerWeakVisitor(Scavenger* scavenger) |
| 275 : HandleVisitor(Isolate::Current()), |
| 276 scavenger_(scavenger) { |
275 } | 277 } |
276 | 278 |
277 void VisitHandle(uword addr, bool is_prologue_weak) { | 279 void VisitHandle(uword addr, bool is_prologue_weak) { |
278 FinalizablePersistentHandle* handle = | 280 FinalizablePersistentHandle* handle = |
279 reinterpret_cast<FinalizablePersistentHandle*>(addr); | 281 reinterpret_cast<FinalizablePersistentHandle*>(addr); |
280 RawObject** p = handle->raw_addr(); | 282 RawObject** p = handle->raw_addr(); |
281 if (scavenger_->IsUnreachable(p)) { | 283 if (scavenger_->IsUnreachable(p)) { |
282 FinalizablePersistentHandle::Finalize(handle, is_prologue_weak); | 284 FinalizablePersistentHandle::Finalize(isolate(), |
| 285 handle, |
| 286 is_prologue_weak); |
283 } | 287 } |
284 } | 288 } |
285 | 289 |
286 private: | 290 private: |
287 Scavenger* scavenger_; | 291 Scavenger* scavenger_; |
288 | 292 |
289 DISALLOW_COPY_AND_ASSIGN(ScavengerWeakVisitor); | 293 DISALLOW_COPY_AND_ASSIGN(ScavengerWeakVisitor); |
290 }; | 294 }; |
291 | 295 |
292 | 296 |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 space.AddProperty("name", "Scavenger"); | 728 space.AddProperty("name", "Scavenger"); |
725 space.AddProperty("user_name", "new"); | 729 space.AddProperty("user_name", "new"); |
726 space.AddProperty("collections", collections()); | 730 space.AddProperty("collections", collections()); |
727 space.AddProperty("used", UsedInWords() * kWordSize); | 731 space.AddProperty("used", UsedInWords() * kWordSize); |
728 space.AddProperty("capacity", CapacityInWords() * kWordSize); | 732 space.AddProperty("capacity", CapacityInWords() * kWordSize); |
729 space.AddProperty("time", RoundMicrosecondsToSeconds(gc_time_micros())); | 733 space.AddProperty("time", RoundMicrosecondsToSeconds(gc_time_micros())); |
730 } | 734 } |
731 | 735 |
732 | 736 |
733 } // namespace dart | 737 } // namespace dart |
OLD | NEW |