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

Unified Diff: runtime/vm/object.cc

Issue 2803013004: Mark optimized code for the crash handler and disassembler output. (Closed)
Patch Set: . Created 3 years, 8 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/disassembler.cc ('k') | runtime/vm/profiler_test.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 4cb204d3e98847c69f2c437964968dc5c6a10eaa..c7472e4a7ee1d0d88352f9ed52bf28c9bc27dc8e 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -14484,47 +14484,43 @@ intptr_t Code::GetDeoptIdForOsr(uword pc) const {
const char* Code::ToCString() const {
- Zone* zone = Thread::Current()->zone();
- if (IsStubCode()) {
- const char* name = StubCode::NameOfStub(UncheckedEntryPoint());
- return zone->PrintToString("[stub: %s]", name);
- } else {
- return zone->PrintToString("Code entry: 0x%" Px, UncheckedEntryPoint());
- }
+ return Thread::Current()->zone()->PrintToString("Code(%s)", QualifiedName());
}
const char* Code::Name() const {
- const Object& obj = Object::Handle(owner());
+ Zone* zone = Thread::Current()->zone();
+ const Object& obj = Object::Handle(zone, owner());
if (obj.IsNull()) {
// Regular stub.
- Thread* thread = Thread::Current();
- Zone* zone = thread->zone();
const char* name = StubCode::NameOfStub(UncheckedEntryPoint());
ASSERT(name != NULL);
- return OS::SCreate(zone, "[Stub] %s", name);
+ return zone->PrintToString("[Stub] %s", name);
} else if (obj.IsClass()) {
// Allocation stub.
- Thread* thread = Thread::Current();
- Zone* zone = thread->zone();
- const Class& cls = Class::Cast(obj);
- String& cls_name = String::Handle(zone, cls.ScrubbedName());
+ String& cls_name = String::Handle(zone, Class::Cast(obj).ScrubbedName());
ASSERT(!cls_name.IsNull());
- return OS::SCreate(zone, "[Stub] Allocate %s", cls_name.ToCString());
+ return zone->PrintToString("[Stub] Allocate %s", cls_name.ToCString());
} else {
ASSERT(obj.IsFunction());
// Dart function.
- // Same as scrubbed name.
- return String::Handle(Function::Cast(obj).UserVisibleName()).ToCString();
+ const char* opt = is_optimized() ? "*" : "";
+ const char* function_name =
+ String::Handle(zone, Function::Cast(obj).UserVisibleName()).ToCString();
+ return zone->PrintToString("%s%s", opt, function_name);
}
}
const char* Code::QualifiedName() const {
- const Object& obj = Object::Handle(owner());
+ Zone* zone = Thread::Current()->zone();
+ const Object& obj = Object::Handle(zone, owner());
if (obj.IsFunction()) {
- return String::Handle(Function::Cast(obj).QualifiedScrubbedName())
- .ToCString();
+ const char* opt = is_optimized() ? "*" : "";
+ const char* function_name =
+ String::Handle(zone, Function::Cast(obj).QualifiedScrubbedName())
+ .ToCString();
+ return zone->PrintToString("%s%s", opt, function_name);
}
return Name();
}
« no previous file with comments | « runtime/vm/disassembler.cc ('k') | runtime/vm/profiler_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698