Chromium Code Reviews| Index: runtime/vm/profiler.cc |
| diff --git a/runtime/vm/profiler.cc b/runtime/vm/profiler.cc |
| index 7c1980172931214b3a974397dcb171f4c6bf2244..a76222485bc0b58fd0e02cbc712570667c626715 100644 |
| --- a/runtime/vm/profiler.cc |
| +++ b/runtime/vm/profiler.cc |
| @@ -1676,15 +1676,6 @@ static void SetPCMarkerIfSafe(Sample* sample) { |
| // If FP == SP, the pc marker hasn't been pushed. |
| if (fp > sp) { |
| -#if defined(TARGET_OS_WINDOWS) |
|
Vyacheslav Egorov (Google)
2014/08/08 12:47:54
I don't think this code was doing anything.
Stack
Cutch
2014/08/08 13:24:53
Your analysis is correct, this logic isn't entirel
|
| - // If the fp is at the beginning of a page, it may be unsafe to access |
| - // the pc marker, because we are reading it from a different thread on |
| - // Windows. The next page may be a guard page. |
| - const intptr_t kPageMask = VirtualMemory::PageSize() - 1; |
| - if ((sample->fp() & kPageMask) == 0) { |
| - return; |
| - } |
| -#endif |
| const uword pc_marker = *(fp + kPcMarkerSlotFromFp); |
| sample->set_pc_marker(pc_marker); |
| } |
| @@ -2047,7 +2038,11 @@ void Profiler::RecordSampleInterruptCallback( |
| sample->set_user_tag(isolate->user_tag()); |
| sample->set_sp(state.sp); |
| sample->set_fp(state.fp); |
| +#if !(defined(TARGET_OS_WINDOWS) && defined(HOST_ARCH_X64)) |
| + // It is never safe to read other thread's stack unless |
| + // other thread is inside Dart code. |
| SetPCMarkerIfSafe(sample); |
|
Cutch
2014/08/08 13:24:53
This should either be:
#if !defined(TARGET_OS_WIN
|
| +#endif |
| // Walk the call stack. |
| if (FLAG_profile_vm) { |