dplassgit / d2lang

D2 is a strongly-typed, statically-typed, (mostly) inferred-type compiled language.
MIT License
5 stars 1 forks source link

For procs with no locals, don't bother saving RBP #298

Closed dplassgit closed 6 months ago

dplassgit commented 6 months ago
_f:

   ; SOURCE: f(a: INT) {
   push RBP
   mov RBP, RSP
   ; reserving RCX

   ; SOURCE: return 1 [INT const]
   mov DWORD EAX, 1
   jmp __exit_of_f

   ; SOURCE: end f
 __exit_of_f:
   mov RSP, RBP
   pop RBP
   ret

Doesn't need to do anything with rsp, rbp