| Index: runtime/vm/deopt_instructions.cc
|
| diff --git a/runtime/vm/deopt_instructions.cc b/runtime/vm/deopt_instructions.cc
|
| index a926fdf7458427dd7a7c0510c4b130a6d45c249b..26ea335b7515f6fb0fb06a2b0e67d034a42232fb 100644
|
| --- a/runtime/vm/deopt_instructions.cc
|
| +++ b/runtime/vm/deopt_instructions.cc
|
| @@ -143,18 +143,21 @@ DeoptContext::~DeoptContext() {
|
| TimelineStream* compiler_stream = isolate->GetCompilerStream();
|
| ASSERT(compiler_stream != NULL);
|
| if (compiler_stream->Enabled()) {
|
| + // Allocate what is needed before StarEvent, which is blocking allocation
|
| + // and GC until Complete.
|
| const Code& code = Code::Handle(zone(), code_);
|
| const Function& function = Function::Handle(zone(), code.function());
|
| - const char* function_name = function.QualifiedUserVisibleNameCString();
|
| + const String& function_name =
|
| + String::Handle(zone(), function.QualifiedUserVisibleName());
|
| const char* reason = DeoptReasonToCString(deopt_reason());
|
| - int counter = function.deoptimization_counter();
|
| + const int counter = function.deoptimization_counter();
|
| TimelineEvent* timeline_event = compiler_stream->StartEvent();
|
| if (timeline_event != NULL) {
|
| timeline_event->Duration("Deoptimize",
|
| deopt_start_micros_,
|
| OS::GetCurrentMonotonicMicros());
|
| timeline_event->SetNumArguments(3);
|
| - timeline_event->CopyArgument(0, "function", function_name);
|
| + timeline_event->CopyArgument(0, "function", function_name.ToCString());
|
| timeline_event->CopyArgument(1, "reason", reason);
|
| timeline_event->FormatArgument(2, "deoptimizationCount", "%d", counter);
|
| timeline_event->Complete();
|
|
|