| 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 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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) : scavenger_(scavenger) { |
| 275 } | 275 } |
| 276 | 276 |
| 277 void VisitHandle(uword addr) { | 277 void VisitHandle(uword addr, bool is_prologue_weak) { |
| 278 FinalizablePersistentHandle* handle = | 278 FinalizablePersistentHandle* handle = |
| 279 reinterpret_cast<FinalizablePersistentHandle*>(addr); | 279 reinterpret_cast<FinalizablePersistentHandle*>(addr); |
| 280 RawObject** p = handle->raw_addr(); | 280 RawObject** p = handle->raw_addr(); |
| 281 if (scavenger_->IsUnreachable(p)) { | 281 if (scavenger_->IsUnreachable(p)) { |
| 282 FinalizablePersistentHandle::Finalize(handle); | 282 FinalizablePersistentHandle::Finalize(handle, is_prologue_weak); |
| 283 } | 283 } |
| 284 } | 284 } |
| 285 | 285 |
| 286 private: | 286 private: |
| 287 Scavenger* scavenger_; | 287 Scavenger* scavenger_; |
| 288 | 288 |
| 289 DISALLOW_COPY_AND_ASSIGN(ScavengerWeakVisitor); | 289 DISALLOW_COPY_AND_ASSIGN(ScavengerWeakVisitor); |
| 290 }; | 290 }; |
| 291 | 291 |
| 292 | 292 |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 724 space.AddProperty("name", "Scavenger"); | 724 space.AddProperty("name", "Scavenger"); |
| 725 space.AddProperty("user_name", "new"); | 725 space.AddProperty("user_name", "new"); |
| 726 space.AddProperty("collections", collections()); | 726 space.AddProperty("collections", collections()); |
| 727 space.AddProperty("used", UsedInWords() * kWordSize); | 727 space.AddProperty("used", UsedInWords() * kWordSize); |
| 728 space.AddProperty("capacity", CapacityInWords() * kWordSize); | 728 space.AddProperty("capacity", CapacityInWords() * kWordSize); |
| 729 space.AddProperty("time", RoundMicrosecondsToSeconds(gc_time_micros())); | 729 space.AddProperty("time", RoundMicrosecondsToSeconds(gc_time_micros())); |
| 730 } | 730 } |
| 731 | 731 |
| 732 | 732 |
| 733 } // namespace dart | 733 } // namespace dart |
| OLD | NEW |