From ae00fa234634ad5ac47b3dae252a9f973ad94bcb Mon Sep 17 00:00:00 2001 From: edef Date: Wed, 15 Apr 2015 02:06:52 -0400 Subject: [PATCH] document why we're not using a straigh `ret` --- src/swap.s | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/swap.s b/src/swap.s index 01b2e70..da9dcd1 100644 --- a/src/swap.s +++ b/src/swap.s @@ -31,6 +31,8 @@ jmp 2f movq %rax, %rsp // jump into the new context (return to the call point) + // doing this instead of a straight `ret` is 8ns slower, + // presumably because the branch predictor tries to be clever about it popq %rax jmpq *%rax