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

Unified Diff: runtime/vm/object_graph.cc

Issue 1246073005: Retaining path improvements. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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
« no previous file with comments | « runtime/observatory/tests/service/get_retaining_path_rpc_test.dart ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_graph.cc
diff --git a/runtime/vm/object_graph.cc b/runtime/vm/object_graph.cc
index 879e87ca07c1702aa69f9382b19ffeaef951b606..ad6f8614821e9e866f971ef954992724c482045a 100644
--- a/runtime/vm/object_graph.cc
+++ b/runtime/vm/object_graph.cc
@@ -261,9 +261,25 @@ class RetainingPathVisitor : public ObjectGraph::Visitor {
intptr_t length() const { return length_; }
+ bool ShouldSkip(RawObject* obj) {
+ // A retaining path through ICData is never the only retaining path,
+ // and it is less informative than its alternatives.
+ intptr_t cid = obj->GetClassId();
+ switch (cid) {
+ case kICDataCid:
+ return true;
+ default:
+ return false;
+ }
+ }
+
virtual Direction VisitObject(ObjectGraph::StackIterator* it) {
if (it->Get() != obj_) {
- return kProceed;
+ if (ShouldSkip(it->Get())) {
+ return kBacktrack;
+ } else {
+ return kProceed;
+ }
} else {
HANDLESCOPE(Isolate::Current());
Object& current = Object::Handle();
« no previous file with comments | « runtime/observatory/tests/service/get_retaining_path_rpc_test.dart ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698