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

Unified Diff: runtime/vm/profiler_service.cc

Issue 2363413004: VM: Avoid allocating strings when disassembling code. (Closed)
Patch Set: addressed comments Created 4 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/profiler.h ('k') | tests/language/disassemble_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/profiler_service.cc
diff --git a/runtime/vm/profiler_service.cc b/runtime/vm/profiler_service.cc
index 1a800170a1b9bd541be828e2d7a96d1af392f6be..b198a224f4c516b9b1b4de00408099fe0c376af8 100644
--- a/runtime/vm/profiler_service.cc
+++ b/runtime/vm/profiler_service.cc
@@ -646,15 +646,15 @@ ProfileFunction* ProfileCode::SetFunctionAndName(ProfileFunctionTable* table) {
function = table->GetUnknown();
} else if (kind() == kDartCode) {
ASSERT(!code_.IsNull());
- const String& name = String::Handle(code_.QualifiedName());
+ const char* name = code_.QualifiedName();
const Object& obj = Object::Handle(code_.owner());
if (obj.IsFunction()) {
function = table->LookupOrAdd(Function::Cast(obj));
} else {
// A stub.
- function = table->AddStub(start(), name.ToCString());
+ function = table->AddStub(start(), name);
}
- SetName(name.ToCString());
+ SetName(name);
} else if (kind() == kNativeCode) {
if (name() == NULL) {
// Lazily set generated name.
« no previous file with comments | « runtime/vm/profiler.h ('k') | tests/language/disassemble_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698