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

Unified Diff: runtime/vm/scavenger.cc

Issue 206583003: Add 'address' vm service message that finds heap objects. (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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/scavenger.cc
===================================================================
--- runtime/vm/scavenger.cc (revision 34144)
+++ runtime/vm/scavenger.cc (working copy)
@@ -671,6 +671,24 @@
}
+RawObject* Scavenger::FindObject(FindObjectVisitor* visitor) const {
+ ASSERT(!scavenging_);
+ uword cur = FirstObjectStart();
+ if (visitor->VisitRange(cur, top_)) {
+ while (cur < top_) {
+ RawObject* raw_obj = RawObject::FromAddr(cur);
+ uword next = cur + raw_obj->Size();
+ if (visitor->VisitRange(cur, next) && raw_obj->FindObject(visitor)) {
+ return raw_obj; // Found object, return it.
+ }
+ cur = next;
+ }
+ ASSERT(cur == top_);
+ }
+ return Object::null();
+}
turnidge 2014/03/20 17:01:19 Ditto testing comment from heap.cc. Up to you.
koda 2014/03/20 20:25:37 I think it's sufficient to test it via heap_test.
+
+
void Scavenger::Scavenge() {
// TODO(cshapiro): Add a decision procedure for determining when the
// the API callbacks should be invoked.

Powered by Google App Engine
This is Rietveld 408576698