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

Unified Diff: runtime/vm/object.cc

Issue 536273002: Teach the Observatory about WeakProperties (ephemerons). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 3 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 03cde270d4a2258e515a95c700d348db305f3da8..e906354951d0c1eab187b3488ac8630d59160246 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -19480,7 +19480,20 @@ const char* WeakProperty::ToCString() const {
void WeakProperty::PrintJSONImpl(JSONStream* stream, bool ref) const {
- Instance::PrintJSONImpl(stream, ref);
+ JSONObject jsobj(stream);
+ PrintSharedInstanceJSON(&jsobj, ref);
+ ObjectIdRing* ring = Isolate::Current()->object_id_ring();
+ const intptr_t id = ring->GetIdForObject(raw());
+ jsobj.AddPropertyF("id", "objects/%" Pd "", id);
+
+ if (ref) {
+ return;
+ }
+
+ const Object& key_handle = Object::Handle(key());
+ jsobj.AddProperty("key", key_handle);
+ const Object& value_handle = Object::Handle(value());
+ jsobj.AddProperty("value", value_handle);
}
RawAbstractType* MirrorReference::GetAbstractTypeReferent() const {

Powered by Google App Engine
This is Rietveld 408576698