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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « runtime/observatory/observatory_sources.gypi ('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 11081 matching lines...) Expand 10 before | Expand all | Expand 10 after
11092 jsobj.AddProperty("length", Length()); 11092 jsobj.AddProperty("length", Length());
11093 if (ref) { 11093 if (ref) {
11094 return; 11094 return;
11095 } 11095 }
11096 11096
11097 { 11097 {
11098 JSONArray jsarr(&jsobj, "_entries"); 11098 JSONArray jsarr(&jsobj, "_entries");
11099 uword imm; 11099 uword imm;
11100 Object& obj = Object::Handle(); 11100 Object& obj = Object::Handle();
11101 for (intptr_t i = 0; i < Length(); i++) { 11101 for (intptr_t i = 0; i < Length(); i++) {
11102 JSONObject jsentry(stream);
11103 jsentry.AddProperty("offset", OffsetFromIndex(i));
11102 switch (InfoAt(i)) { 11104 switch (InfoAt(i)) {
11103 case ObjectPool::kTaggedObject: 11105 case ObjectPool::kTaggedObject:
11104 obj = ObjectAt(i); 11106 obj = ObjectAt(i);
11105 jsarr.AddValue(obj); 11107 jsentry.AddProperty("kind", "Object");
11108 jsentry.AddProperty("value", obj);
11106 break; 11109 break;
11107 case ObjectPool::kImmediate: 11110 case ObjectPool::kImmediate:
11108 imm = RawValueAt(i); 11111 imm = RawValueAt(i);
11109 jsarr.AddValue64(imm); 11112 jsentry.AddProperty("kind", "Immediate");
11113 jsentry.AddProperty64("value", imm);
11110 break; 11114 break;
11111 case ObjectPool::kNativeEntry: 11115 case ObjectPool::kNativeEntry:
11112 imm = RawValueAt(i); 11116 imm = RawValueAt(i);
11113 jsarr.AddValueF("0x%" Px, imm); 11117 jsentry.AddProperty("kind", "NativeEntry");
11118 jsentry.AddProperty64("value", imm);
11114 break; 11119 break;
11115 default: 11120 default:
11116 UNREACHABLE(); 11121 UNREACHABLE();
11117 } 11122 }
11118 } 11123 }
11119 } 11124 }
11120 } 11125 }
11121 11126
11122 11127
11123 void ObjectPool::DebugPrint() const { 11128 void ObjectPool::DebugPrint() const {
(...skipping 2777 matching lines...) Expand 10 before | Expand all | Expand 10 after
13901 UNREACHABLE(); 13906 UNREACHABLE();
13902 } 13907 }
13903 13908
13904 13909
13905 const char* MegamorphicCache::ToCString() const { 13910 const char* MegamorphicCache::ToCString() const {
13906 return "MegamorphicCache"; 13911 return "MegamorphicCache";
13907 } 13912 }
13908 13913
13909 13914
13910 void MegamorphicCache::PrintJSONImpl(JSONStream* stream, bool ref) const { 13915 void MegamorphicCache::PrintJSONImpl(JSONStream* stream, bool ref) const {
13911 Object::PrintJSONImpl(stream, ref); 13916 JSONObject jsobj(stream);
13917 AddCommonObjectProperties(&jsobj, "Object", ref);
13918 jsobj.AddServiceId(*this);
13919 if (ref) {
13920 return;
13921 }
13922 jsobj.AddProperty("_buckets", Object::Handle(buckets()));
13923 jsobj.AddProperty("_mask", mask());
13912 } 13924 }
13913 13925
13914 13926
13915 RawSubtypeTestCache* SubtypeTestCache::New() { 13927 RawSubtypeTestCache* SubtypeTestCache::New() {
13916 ASSERT(Object::subtypetestcache_class() != Class::null()); 13928 ASSERT(Object::subtypetestcache_class() != Class::null());
13917 SubtypeTestCache& result = SubtypeTestCache::Handle(); 13929 SubtypeTestCache& result = SubtypeTestCache::Handle();
13918 { 13930 {
13919 // SubtypeTestCache objects are long living objects, allocate them in the 13931 // SubtypeTestCache objects are long living objects, allocate them in the
13920 // old generation. 13932 // old generation.
13921 RawObject* raw = Object::Allocate(SubtypeTestCache::kClassId, 13933 RawObject* raw = Object::Allocate(SubtypeTestCache::kClassId,
(...skipping 7602 matching lines...) Expand 10 before | Expand all | Expand 10 after
21524 return tag_label.ToCString(); 21536 return tag_label.ToCString();
21525 } 21537 }
21526 21538
21527 21539
21528 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 21540 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
21529 Instance::PrintJSONImpl(stream, ref); 21541 Instance::PrintJSONImpl(stream, ref);
21530 } 21542 }
21531 21543
21532 21544
21533 } // namespace dart 21545 } // namespace dart
OLDNEW
« 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