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

Unified Diff: runtime/vm/object.cc

Issue 977283002: Display call site data for functions. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 7914cef2a37c497196035736f71c1a999aaac25e..c845ffe39ec9229f5fa58dd66435d86d84a8093b 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -11886,6 +11886,7 @@ void ICData::PrintToJSONArray(JSONArray* jsarray,
intptr_t column) const {
Isolate* isolate = Isolate::Current();
Class& cls = Class::Handle();
+ Function& func = Function::Handle();
JSONObject jsobj(jsarray);
jsobj.AddProperty("name", String::Handle(target_name()).ToCString());
@@ -11896,11 +11897,20 @@ void ICData::PrintToJSONArray(JSONArray* jsarray,
JSONArray cache_entries(&jsobj, "cacheEntries");
for (intptr_t i = 0; i < NumberOfChecks(); i++) {
- intptr_t cid = GetReceiverClassIdAt(i);
- cls ^= isolate->class_table()->At(cid);
+ func = GetTargetAt(i);
+ if (func.is_static() || (func.kind() == RawFunction::kConstructor)) {
+ cls ^= func.Owner();
+ } else {
+ intptr_t cid = GetReceiverClassIdAt(i);
+ cls ^= isolate->class_table()->At(cid);
+ }
intptr_t count = GetCountAt(i);
JSONObject cache_entry(&cache_entries);
- cache_entry.AddProperty("receiverClass", cls);
+ if (cls.IsTopLevel()) {
+ cache_entry.AddProperty("receiverClass", Library::Handle(cls.library()));
rmacnak 2015/03/05 02:11:28 Weird.
Cutch 2015/03/09 18:22:42 rename to 'receiver'?
rmacnak 2015/03/09 23:16:02 It's not the receiver (i.e. an instance). The sour
+ } else {
+ cache_entry.AddProperty("receiverClass", cls);
+ }
cache_entry.AddProperty("count", count);
}
}

Powered by Google App Engine
This is Rietveld 408576698