Index: runtime/vm/profiler.cc |
diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc |
index 9db93ae0cfe5eb6cdd69cc3b8f21faac1aec2e1a..2e99b34d7ee646d2eb9d364f4c66f09feb469a78 100644 |
--- a/runtime/vm/profiler.cc |
+++ b/runtime/vm/profiler.cc |
@@ -330,6 +330,20 @@ 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; |
+ } |
+ } |
+ |
uintptr_t start = 0; |
char* native_symbol_name = NativeSymbolResolver::LookupSymbolName(pc, &start); |
if (native_symbol_name == NULL) { |
@@ -341,16 +355,6 @@ static void DumpStackFrame(intptr_t frame_index, uword pc) { |
} |
-static void DumpStackFrame(intptr_t frame_index, uword pc, const Code& code) { |
- if (code.IsNull()) { |
- DumpStackFrame(frame_index, pc); |
- } else { |
- OS::PrintErr("Frame[%" Pd "] = Dart:`%s` [0x%" Px "]\n", frame_index, |
- code.ToCString(), pc); |
- } |
-} |
- |
- |
class ProfilerStackWalker : public ValueObject { |
public: |
ProfilerStackWalker(Isolate* isolate, |
@@ -370,16 +374,6 @@ class ProfilerStackWalker : public ValueObject { |
} |
} |
- bool Append(uword pc, const Code& code) { |
- if (sample_ == NULL) { |
- DumpStackFrame(frame_index_, pc, code); |
- frame_index_++; |
- total_frames_++; |
- return true; |
- } |
- return Append(pc); |
- } |
- |
bool Append(uword pc) { |
if (sample_ == NULL) { |
DumpStackFrame(frame_index_, pc); |