Chromium Code Reviews| Index: runtime/vm/profiler.cc |
| diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc |
| index a3fb9c6c90a7e83438908ef7d0907464d963b576..4de16a6926020198433bad805e8ddf01a2070a56 100644 |
| --- a/runtime/vm/profiler.cc |
| +++ b/runtime/vm/profiler.cc |
| @@ -406,17 +406,22 @@ void ClearProfileVisitor::VisitSample(Sample* sample) { |
| } |
| static void DumpStackFrame(intptr_t frame_index, uword pc) { |
| - Isolate* isolate = Isolate::Current(); |
| - if ((isolate != NULL) && isolate->is_runnable()) { |
| - Code& code = Code::Handle(Code::LookupCodeInVmIsolate(pc)); |
| - if (!code.IsNull()) { |
| - OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName()); |
| - return; |
| - } |
| - code = Code::LookupCode(pc); |
| - if (!code.IsNull()) { |
| - OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName()); |
| - return; |
| + Thread* thread = Thread::Current(); |
| + if ((thread != NULL) && !thread->IsAtSafepoint()) { |
| + Isolate* isolate = thread->isolate(); |
| + if ((isolate != NULL) && isolate->is_runnable()) { |
| + // Attempt to symbolize Dart frames if we have can safely iterate the |
| + // current isolate's heap. |
|
danunez
2017/08/08 20:44:02
This comment is unclear to me. It reads like there
rmacnak
2017/08/09 17:58:39
Deleted "have"
|
| + Code& code = Code::Handle(Code::LookupCodeInVmIsolate(pc)); |
| + if (!code.IsNull()) { |
| + OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName()); |
| + return; |
| + } |
| + code = Code::LookupCode(pc); |
| + if (!code.IsNull()) { |
| + OS::PrintErr(" [0x%" Pp "] %s\n", pc, code.QualifiedName()); |
| + return; |
| + } |
|
siva
2017/08/08 23:59:55
why not
Code& code = Code::Handle(Code::LookupCo
rmacnak
2017/08/09 17:58:39
Done.
|
| } |
| } |