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

Unified Diff: runtime/vm/object.cc

Issue 1533653003: Add SourceReport, a class for generating Dart source-level reports. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 12 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/vm/object.h ('k') | runtime/vm/source_report.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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()) {
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/source_report.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698