Index: runtime/vm/object.cc |
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc |
index 0942260d56cc401155ddb08d7594c8034e9a841b..837e8b76a370c05e6be19cf9c9ac61353268b2a9 100644 |
--- a/runtime/vm/object.cc |
+++ b/runtime/vm/object.cc |
@@ -12906,7 +12906,6 @@ void ICData::PrintToJSONArray(const JSONArray& jsarray, |
JSONObject jsobj(&jsarray); |
jsobj.AddProperty("name", String::Handle(target_name()).ToCString()); |
- // TODO(turnidge): Use AddLocation instead. |
jsobj.AddProperty("tokenPos", token_pos); |
// TODO(rmacnak): Figure out how to stringify DeoptReasons(). |
// jsobj.AddProperty("deoptReasons", ...); |
@@ -12934,6 +12933,35 @@ void ICData::PrintToJSONArray(const JSONArray& jsarray, |
} |
+void ICData::PrintToJSONArrayNew(const JSONArray& jsarray, |
+ intptr_t token_pos, |
+ bool is_static_call) const { |
+ Isolate* isolate = Isolate::Current(); |
+ Class& cls = Class::Handle(); |
+ Function& func = Function::Handle(); |
+ |
+ JSONObject jsobj(&jsarray); |
+ jsobj.AddProperty("name", String::Handle(target_name()).ToCString()); |
+ jsobj.AddProperty("tokenPos", token_pos); |
+ // TODO(rmacnak): Figure out how to stringify DeoptReasons(). |
+ // jsobj.AddProperty("deoptReasons", ...); |
+ |
+ JSONArray cache_entries(&jsobj, "cacheEntries"); |
+ for (intptr_t i = 0; i < NumberOfChecks(); i++) { |
+ JSONObject cache_entry(&cache_entries); |
+ func = GetTargetAt(i); |
+ intptr_t count = GetCountAt(i); |
+ if (!is_static_call) { |
+ intptr_t cid = GetReceiverClassIdAt(i); |
+ cls ^= isolate->class_table()->At(cid); |
+ cache_entry.AddProperty("receiver", cls); |
+ } |
+ cache_entry.AddProperty("target", func); |
+ cache_entry.AddProperty("count", count); |
+ } |
+} |
+ |
+ |
static Token::Kind RecognizeArithmeticOp(const String& name) { |
ASSERT(name.IsSymbol()); |
if (name.raw() == Symbols::Plus().raw()) { |