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

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: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « runtime/bin/vmservice/observatory/test/weak_properties_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 19465 matching lines...) Expand 10 before | Expand all | Expand 10 after
19476 return reinterpret_cast<RawWeakProperty*>(raw); 19476 return reinterpret_cast<RawWeakProperty*>(raw);
19477 } 19477 }
19478 19478
19479 19479
19480 const char* WeakProperty::ToCString() const { 19480 const char* WeakProperty::ToCString() const {
19481 return "_WeakProperty"; 19481 return "_WeakProperty";
19482 } 19482 }
19483 19483
19484 19484
19485 void WeakProperty::PrintJSONImpl(JSONStream* stream, bool ref) const { 19485 void WeakProperty::PrintJSONImpl(JSONStream* stream, bool ref) const {
19486 Instance::PrintJSONImpl(stream, ref); 19486 JSONObject jsobj(stream);
19487 PrintSharedInstanceJSON(&jsobj, ref);
19488 ObjectIdRing* ring = Isolate::Current()->object_id_ring();
19489 const intptr_t id = ring->GetIdForObject(raw());
19490 jsobj.AddPropertyF("id", "objects/%" Pd "", id);
19491
19492 if (ref) {
19493 return;
19494 }
19495
19496 const Object& key_handle = Object::Handle(key());
19497 jsobj.AddProperty("key", key_handle);
19498 const Object& value_handle = Object::Handle(value());
19499 jsobj.AddProperty("value", value_handle);
19487 } 19500 }
19488 19501
19489 RawAbstractType* MirrorReference::GetAbstractTypeReferent() const { 19502 RawAbstractType* MirrorReference::GetAbstractTypeReferent() const {
19490 ASSERT(Object::Handle(referent()).IsAbstractType()); 19503 ASSERT(Object::Handle(referent()).IsAbstractType());
19491 return AbstractType::Cast(Object::Handle(referent())).raw(); 19504 return AbstractType::Cast(Object::Handle(referent())).raw();
19492 } 19505 }
19493 19506
19494 19507
19495 RawClass* MirrorReference::GetClassReferent() const { 19508 RawClass* MirrorReference::GetClassReferent() const {
19496 ASSERT(Object::Handle(referent()).IsClass()); 19509 ASSERT(Object::Handle(referent()).IsClass());
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
19686 return tag_label.ToCString(); 19699 return tag_label.ToCString();
19687 } 19700 }
19688 19701
19689 19702
19690 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 19703 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
19691 Instance::PrintJSONImpl(stream, ref); 19704 Instance::PrintJSONImpl(stream, ref);
19692 } 19705 }
19693 19706
19694 19707
19695 } // namespace dart 19708 } // namespace dart
OLDNEW
« 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