Skip to content

Commit f39bb15

Browse files
committed
Prettify thread stack bottom fp for perf unwind with fp
1 parent c4c7922 commit f39bb15

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

thread/thread.cpp

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -753,12 +753,14 @@ R"(
753753

754754
DEF_ASM_FUNC(_photon_thread_stub)
755755
R"(
756+
mov %rbp, %rbx
757+
mov $0, %rbp
756758
call _asan_start
757-
mov 0x40(%rbp), %rdi
758-
movq $0, 0x40(%rbp)
759-
call *0x48(%rbp)
760-
mov %rax, 0x48(%rbp)
761-
mov %rbp, %rdi
759+
mov 0x40(%rbx), %rdi
760+
movq $0, 0x40(%rbx)
761+
call *0x48(%rbx)
762+
mov %rax, 0x48(%rbx)
763+
mov %rbx, %rdi
762764
call _photon_thread_die
763765
)"
764766
);
@@ -1284,7 +1286,8 @@ R"(
12841286
return rq.current->error_number;
12851287
}
12861288

1287-
inline void thread_yield_fast() {
1289+
__attribute__((noinline))
1290+
void thread_yield_fast() {
12881291
auto sw = AtomicRunQ().goto_next();
12891292
switch_context(sw.from, sw.to);
12901293
}

0 commit comments

Comments
 (0)