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

Side by Side Diff: runtime/vm/object.cc

Issue 266043004: Small cleanup to Code and Profiler pages (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 7 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/client/lib/src/service/object.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 11721 matching lines...) Expand 10 before | Expand all | Expand 10 after
11732 } 11732 }
11733 11733
11734 11734
11735 void Code::PrintJSONImpl(JSONStream* stream, bool ref) const { 11735 void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
11736 JSONObject jsobj(stream); 11736 JSONObject jsobj(stream);
11737 jsobj.AddProperty("type", JSONType(ref)); 11737 jsobj.AddProperty("type", JSONType(ref));
11738 jsobj.AddPropertyF("id", "code/%" Px64"-%" Px "", compile_timestamp(), 11738 jsobj.AddPropertyF("id", "code/%" Px64"-%" Px "", compile_timestamp(),
11739 EntryPoint()); 11739 EntryPoint());
11740 jsobj.AddPropertyF("start", "%" Px "", EntryPoint()); 11740 jsobj.AddPropertyF("start", "%" Px "", EntryPoint());
11741 jsobj.AddPropertyF("end", "%" Px "", EntryPoint() + Size()); 11741 jsobj.AddPropertyF("end", "%" Px "", EntryPoint() + Size());
11742 jsobj.AddProperty("is_optimized", is_optimized()); 11742 jsobj.AddProperty("isOptimized", is_optimized());
11743 jsobj.AddProperty("is_alive", is_alive()); 11743 jsobj.AddProperty("isAlive", is_alive());
11744 jsobj.AddProperty("kind", "Dart"); 11744 jsobj.AddProperty("kind", "Dart");
11745 const String& name = String::Handle(Name()); 11745 const String& name = String::Handle(Name());
11746 const String& pretty_name = String::Handle(PrettyName()); 11746 const String& pretty_name = String::Handle(PrettyName());
11747 const char* name_prefix = is_optimized() ? "*" : ""; 11747 jsobj.AddProperty("name", name.ToCString());
11748 jsobj.AddPropertyF("name", "%s%s", name_prefix, name.ToCString()); 11748 jsobj.AddProperty("user_name", pretty_name.ToCString());
11749 jsobj.AddPropertyF("user_name", "%s%s", name_prefix, pretty_name.ToCString());
11750 const Object& obj = Object::Handle(owner()); 11749 const Object& obj = Object::Handle(owner());
11751 if (obj.IsFunction()) { 11750 if (obj.IsFunction()) {
11752 jsobj.AddProperty("function", obj); 11751 jsobj.AddProperty("function", obj);
11753 } else { 11752 } else {
11754 // Generate a fake function reference. 11753 // Generate a fake function reference.
11755 JSONObject func(&jsobj, "function"); 11754 JSONObject func(&jsobj, "function");
11756 func.AddProperty("type", "@Function"); 11755 func.AddProperty("type", "@Function");
11757 func.AddProperty("kind", "Stub"); 11756 func.AddProperty("kind", "Stub");
11758 func.AddPropertyF("id", "functions/stub-%" Pd "", EntryPoint()); 11757 func.AddPropertyF("id", "functions/stub-%" Pd "", EntryPoint());
11759 func.AddProperty("user_name", pretty_name.ToCString()); 11758 func.AddProperty("user_name", pretty_name.ToCString());
(...skipping 7018 matching lines...) Expand 10 before | Expand all | Expand 10 after
18778 return tag_label.ToCString(); 18777 return tag_label.ToCString();
18779 } 18778 }
18780 18779
18781 18780
18782 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const { 18781 void UserTag::PrintJSONImpl(JSONStream* stream, bool ref) const {
18783 Instance::PrintJSONImpl(stream, ref); 18782 Instance::PrintJSONImpl(stream, ref);
18784 } 18783 }
18785 18784
18786 18785
18787 } // namespace dart 18786 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/bin/vmservice/client/lib/src/service/object.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698