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

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: build 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
« no previous file with comments | « runtime/bin/vmservice/observatory/test/weak_properties_test.dart ('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 c7ef20ed235e10a0ae0afce94fdad8a893a6e717..394ce89c0c5faf78296ee4719e15c285e4f14c81 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -19483,7 +19483,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 {
« no previous file with comments | « runtime/bin/vmservice/observatory/test/weak_properties_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698