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

Unified Diff: runtime/vm/object.cc

Issue 1212933003: Observatory improvements for exploring compiled code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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/observatory_sources.gypi ('k') | runtime/vm/service.cc » ('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 b1c28aba81f2603a35d78499f7d873d65b55382d..fa4bbaef2a9129032889d94b5b4c3267152927c5 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -6979,6 +6979,10 @@ void Function::PrintJSONImpl(JSONStream* stream, bool ref) const {
if (!code.IsNull()) {
jsobj.AddProperty("code", code);
}
+ Array& ics = Array::Handle(ic_data_array());
+ if (!ics.IsNull()) {
+ jsobj.AddProperty("_icDataArray", ics);
+ }
jsobj.AddProperty("_optimizable", is_optimizable());
jsobj.AddProperty("_inlinable", is_inlinable());
code = unoptimized_code();
@@ -10709,7 +10713,14 @@ const char* Instructions::ToCString() const {
void Instructions::PrintJSONImpl(JSONStream* stream, bool ref) const {
- Object::PrintJSONImpl(stream, ref);
+ JSONObject jsobj(stream);
+ AddCommonObjectProperties(&jsobj, "Object", ref);
+ jsobj.AddServiceId(*this);
+ jsobj.AddProperty("_code", Code::Handle(code()));
+ if (ref) {
+ return;
+ }
+ jsobj.AddProperty("_objectPool", ObjectPool::Handle(object_pool()));
}
@@ -10800,7 +10811,35 @@ const char* ObjectPool::ToCString() const {
void ObjectPool::PrintJSONImpl(JSONStream* stream, bool ref) const {
- Object::PrintJSONImpl(stream, ref);
+ JSONObject jsobj(stream);
+ AddCommonObjectProperties(&jsobj, "Object", ref);
+ jsobj.AddServiceId(*this);
+ jsobj.AddProperty("length", Length());
+ if (ref) {
+ return;
+ }
+
+ {
+ JSONArray jsarr(&jsobj, "_entries");
+ uword imm;
+ Object& obj = Object::Handle();
+ for (intptr_t i = 0; i < Length(); i++) {
+ switch (InfoAt(i)) {
+ case ObjectPool::kTaggedObject:
+ obj = ObjectAt(i);
+ jsarr.AddValue(obj);
+ break;
+ case ObjectPool::kImmediate:
+ // We might want to distingiush between immediates and addresses
+ // in the future.
+ imm = RawValueAt(i);
+ jsarr.AddValue64(imm);
+ break;
+ default:
+ UNREACHABLE();
+ }
+ }
+ }
}
@@ -12212,7 +12251,17 @@ RawICData* ICData::NewFrom(const ICData& from, intptr_t num_args_tested) {
void ICData::PrintJSONImpl(JSONStream* stream, bool ref) const {
- Object::PrintJSONImpl(stream, ref);
+ JSONObject jsobj(stream);
+ AddCommonObjectProperties(&jsobj, "Object", ref);
+ jsobj.AddServiceId(*this);
+ jsobj.AddProperty("_owner", Object::Handle(owner()));
+ jsobj.AddProperty("_selector", String::Handle(target_name()).ToCString());
+ if (ref) {
+ return;
+ }
+ jsobj.AddProperty("_argumentsDescriptor",
+ Object::Handle(arguments_descriptor()));
+ jsobj.AddProperty("_entries", Object::Handle(ic_data()));
}
@@ -12974,7 +13023,7 @@ void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
// Generate a fake function reference.
JSONObject func(&jsobj, "function");
func.AddProperty("type", "@Function");
- func.AddProperty("kind", "Stub");
+ func.AddProperty("_kind", "Stub");
func.AddProperty("name", user_name.ToCString());
AddNameProperties(&func, user_name, vm_name);
}
« no previous file with comments | « runtime/observatory/observatory_sources.gypi ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698