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

Unified Diff: runtime/vm/object.cc

Issue 965593002: Improved profiler view and inclusive profile tree (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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/vm/object.h ('k') | runtime/vm/profiler.cc » ('j') | 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 f93e45982f9a1d4320e66f1f2739854b78e3ed0f..569ae50404708ac039e72c5463025beb2d3e265c 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -12514,6 +12514,24 @@ RawString* Code::PrettyName() const {
}
+bool Code::IsAllocationStubCode() const {
+ const Object& obj = Object::Handle(owner());
+ return obj.IsClass();
+}
+
+
+bool Code::IsStubCode() const {
+ const Object& obj = Object::Handle(owner());
+ return obj.IsNull();
+}
+
+
+bool Code::IsFunctionCode() const {
+ const Object& obj = Object::Handle(owner());
+ return obj.IsFunction();
+}
+
+
void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
JSONObject jsobj(stream);
AddTypeProperties(&jsobj, "Code", JSONType(), ref);
@@ -12523,11 +12541,16 @@ void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
jsobj.AddPropertyF("end", "%" Px "", EntryPoint() + Size());
jsobj.AddProperty("optimized", is_optimized());
jsobj.AddProperty("alive", is_alive());
- jsobj.AddProperty("kind", "Dart");
+ const Object& obj = Object::Handle(owner());
+ const bool is_stub = IsStubCode() || IsAllocationStubCode();
+ if (is_stub) {
+ jsobj.AddProperty("kind", "Stub");
+ } else {
+ jsobj.AddProperty("kind", "Dart");
+ }
const String& user_name = String::Handle(PrettyName());
const String& vm_name = String::Handle(Name());
AddNameProperties(&jsobj, user_name, vm_name);
- const Object& obj = Object::Handle(owner());
if (obj.IsFunction()) {
jsobj.AddProperty("function", obj);
} else {
@@ -12535,7 +12558,6 @@ void Code::PrintJSONImpl(JSONStream* stream, bool ref) const {
JSONObject func(&jsobj, "function");
func.AddProperty("type", "@Function");
func.AddProperty("kind", "Stub");
- func.AddPropertyF("id", "functions/stub-%" Pd "", EntryPoint());
func.AddProperty("name", user_name.ToCString());
AddNameProperties(&func, user_name, vm_name);
}
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698