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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/object.h" 5 #include "vm/object.h"
6 6
7 #include "include/dart_api.h" 7 #include "include/dart_api.h"
8 #include "platform/assert.h" 8 #include "platform/assert.h"
9 #include "vm/assembler.h" 9 #include "vm/assembler.h"
10 #include "vm/cpu.h" 10 #include "vm/cpu.h"
(...skipping 19462 matching lines...) Expand 10 before | Expand all | Expand 10 after
19473 return reinterpret_cast<RawWeakProperty*>(raw); 19473 return reinterpret_cast<RawWeakProperty*>(raw);
19474 } 19474 }
19475 19475
19476 19476
19477 const char* WeakProperty::ToCString() const { 19477 const char* WeakProperty::ToCString() const {
19478 return "_WeakProperty"; 19478 return "_WeakProperty";
19479 } 19479 }
19480 19480
19481 19481
19482 void WeakProperty::PrintJSONImpl(JSONStream* stream, bool ref) const { 19482 void WeakProperty::PrintJSONImpl(JSONStream* stream, bool ref) const {
19483 Instance::PrintJSONImpl(stream, ref); 19483 JSONObject jsobj(stream);
19484 PrintSharedInstanceJSON(&jsobj, ref);
19485 ObjectIdRing* ring = Isolate::Current()->object_id_ring();
19486 const intptr_t id = ring->GetIdForObject(raw());
19487 jsobj.AddPropertyF("id", "objects/%" Pd "", id);
19488
19489 if (ref) {
19490 return;
19491 }
19492
19493 const Object& key_handle = Object::Handle(key());
19494 jsobj.AddProperty("key", key_handle);
19495 const Object& value_handle = Object::Handle(value());
19496 jsobj.AddProperty("value", value_handle);
19484 } 19497 }
19485 19498
19486 RawAbstractType* MirrorReference::GetAbstractTypeReferent() const { 19499 RawAbstractType* MirrorReference::GetAbstractTypeReferent() const {
19487 ASSERT(Object::Handle(referent()).IsAbstractType()); 19500 ASSERT(Object::Handle(referent()).IsAbstractType());
19488 return AbstractType::Cast(Object::Handle(referent())).raw(); 19501 return AbstractType::Cast(Object::Handle(referent())).raw();
19489 } 19502 }
19490 19503
19491 19504
19492 RawClass* MirrorReference::GetClassReferent() const { 19505 RawClass* MirrorReference::GetClassReferent() const {
19493 ASSERT(Object::Handle(referent()).IsClass()); 19506 ASSERT(Object::Handle(referent()).IsClass());
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
19672 return tag_label.ToCString(); 19685 return tag_label.ToCString();
19673 } 19686 }
19674 19687
19675 19688
19676 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19689 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19677 Instance::PrintJSONImpl(stream, ref); 19690 Instance::PrintJSONImpl(stream, ref);
19678 } 19691 }
19679 19692
19680 19693
19681 } // namespace dart 19694 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698