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

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

Issue 177093010: Use a tag bit for indicating prologue weak persistent handles, this avoids (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/verifier.h » ('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) 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
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
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
OLDNEW
« no previous file with comments | « runtime/vm/isolate.cc ('k') | runtime/vm/verifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698