File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#lang crook
22{:= B C D0 D1 E0 E1 F}
3- (provide {:> E0} compile-op0 compile-op1 {:> F} compile-op2)
3+ (provide {:> E0} compile-op0 compile-op1 {:> F} compile-op2 {:> F} pad-stack )
44(require "ast.rkt " )
55{:> D0} (require "types.rkt " )
66(require a86/ast)
151151 (Jl 'err )
152152 (Cmp rax (value->bits 255 ))
153153 (Jg 'err )))
154+
155+ {:> F} ;; Asm
156+ {:> F} ;; Dynamically pad the stack to be aligned for a call
157+ {:> F}
158+ (define pad-stack
159+ (seq (Mov r15 rsp)
160+ (And r15 #b1000 )
161+ (Sub rsp r15)))
162+
163+ {:> F} ;; Asm
164+ {:> F} ;; Undo the stack alignment after a call
165+ {:> F}
166+ (define unpad-stack
167+ (seq (Add rsp r15)))
Original file line number Diff line number Diff line change 2727 (Ret)
2828 {:> E1} ;; Error handler
2929 {:> E1} (Label 'err )
30+ {:> F} pad-stack
3031 {:> E1} (Call 'raise_error )))
3132
3233{:> F} ;; type CEnv = (Listof [Maybe Id])
You can’t perform that action at this time.
0 commit comments