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

Unified Diff: runtime/vm/object.cc

Issue 1392953003: Add view for MegamorphicCache. Update view for ObjectPool. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 2 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') | no next file » | 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 ba7b223da2fd50d0cd096c3cc60050541de50a32..ac87c8b164178931cb4ea23fd4d7a65d2eb02902 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -11099,18 +11099,23 @@ void ObjectPool::PrintJSONImpl(JSONStream* stream, bool ref) const {
uword imm;
Object& obj = Object::Handle();
for (intptr_t i = 0; i < Length(); i++) {
+ JSONObject jsentry(stream);
+ jsentry.AddProperty("offset", OffsetFromIndex(i));
switch (InfoAt(i)) {
case ObjectPool::kTaggedObject:
obj = ObjectAt(i);
- jsarr.AddValue(obj);
+ jsentry.AddProperty("kind", "Object");
+ jsentry.AddProperty("value", obj);
break;
case ObjectPool::kImmediate:
imm = RawValueAt(i);
- jsarr.AddValue64(imm);
+ jsentry.AddProperty("kind", "Immediate");
+ jsentry.AddProperty64("value", imm);
break;
case ObjectPool::kNativeEntry:
imm = RawValueAt(i);
- jsarr.AddValueF("0x%" Px, imm);
+ jsentry.AddProperty("kind", "NativeEntry");
+ jsentry.AddProperty64("value", imm);
break;
default:
UNREACHABLE();
@@ -13908,7 +13913,14 @@ const char* MegamorphicCache::ToCString() const {
void MegamorphicCache::PrintJSONImpl(JSONStream* stream, bool ref) const {
- Object::PrintJSONImpl(stream, ref);
+ JSONObject jsobj(stream);
+ AddCommonObjectProperties(&jsobj, "Object", ref);
+ jsobj.AddServiceId(*this);
+ if (ref) {
+ return;
+ }
+ jsobj.AddProperty("_buckets", Object::Handle(buckets()));
+ jsobj.AddProperty("_mask", mask());
}
« no previous file with comments | « runtime/observatory/observatory_sources.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698