Path: blob/master/libs/compiler-rt/lib/builtins/x86_64/chkstk.S
12348 views
// This file is dual licensed under the MIT and the University of Illinois Open1// Source Licenses. See LICENSE.TXT for details.23#include "../assembly.h"45// _chkstk routine6// This routine is windows specific7// http://msdn.microsoft.com/en-us/library/ms648426.aspx89// Notes from r22751910// MSVC x64s __chkstk and cygmings ___chkstk_ms do not adjust %rsp11// themselves. It also does not clobber %rax so we can reuse it when12// adjusting %rsp.1314#ifdef __x86_64__1516.text17.balign 418DEFINE_COMPILERRT_FUNCTION(___chkstk_ms)19push %rcx20push %rax21cmp $0x1000,%rax22lea 24(%rsp),%rcx23jb 1f242:25sub $0x1000,%rcx26test %rcx,(%rcx)27sub $0x1000,%rax28cmp $0x1000,%rax29ja 2b301:31sub %rax,%rcx32test %rcx,(%rcx)33pop %rax34pop %rcx35ret36END_COMPILERRT_FUNCTION(___chkstk_ms)3738#endif // __x86_64__394041