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

Unified Diff: runtime/vm/object_graph.cc

Issue 2231313002: Avoid to list internal Arrays in _GetRetainingPath api (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/object_graph.cc
diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc
index bbecac73b11bfdaf1717a3bf6a33c81fb8769b9e..ff20ef810dafe5dd8ccf01c5a6893868b75bc28a 100644
--- a/runtime/vm/object_graph.cc
+++ b/runtime/vm/object_graph.cc
@@ -328,13 +328,21 @@ class RetainingPathVisitor : public ObjectGraph::Visitor {
}
} else {
HANDLESCOPE(thread_);
+ RawObject* object;
Cutch 2016/08/11 13:23:21 It is generally unsafe to use a RawObject* you sho
cbernaschina 2016/08/11 22:03:31 Done.
Object& current = Object::Handle();
Smi& offset_from_parent = Smi::Handle();
+ bool isLastDartInstance = true;
do {
+ object = it->Get();
+ if (!isLastDartInstance && object->IsArray()) {
Cutch 2016/08/11 13:23:21 please document what this is testing for and why i
cbernaschina 2016/08/11 22:03:31 Done.
+ isLastDartInstance = true;
+ continue;
+ }
+ isLastDartInstance = object->IsDartInstance();
intptr_t obj_index = length_ * 2;
intptr_t offset_index = obj_index + 1;
if (!path_.IsNull() && offset_index < path_.Length()) {
- current = it->Get();
+ current = object;
path_.SetAt(obj_index, current);
offset_from_parent = Smi::New(it->OffsetFromParentInWords());
path_.SetAt(offset_index, offset_from_parent);

Powered by Google App Engine
This is Rietveld 408576698