guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 03/05: push/pop of link register does not affect stack s


From: Andy Wingo
Subject: [Guile-commits] 03/05: push/pop of link register does not affect stack size on x86
Date: Thu, 20 Jun 2019 04:59:14 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 1c36f036f604048320fc4393eb3e16d81575bbee
Author: Andy Wingo <address@hidden>
Date:   Thu Jun 20 10:53:12 2019 +0200

    push/pop of link register does not affect stack size on x86
    
    * lightening/x86-cpu.c (pop_link_register, push_link_register): Don't
      record stack size changes here.
---
 lightening/x86-cpu.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/lightening/x86-cpu.c b/lightening/x86-cpu.c
index d737f26..7757dc0 100644
--- a/lightening/x86-cpu.c
+++ b/lightening/x86-cpu.c
@@ -2561,13 +2561,22 @@ jmpi_with_link(jit_state_t *_jit, jit_word_t i0)
 static void
 pop_link_register(jit_state_t *_jit)
 {
+  /* Treat this instruction as having no effect on the stack size; its
+   * effect is non-local (across functions) and handled manually.  */
+
+  int saved_frame_size = _jit->frame_size;
   popr(_jit, jit_gpr_regno (JIT_LR));
+  _jit->frame_size = saved_frame_size;
 }
 
 static void
 push_link_register(jit_state_t *_jit)
 {
+  /* See comment in pop_link_register.  */
+
+  int saved_frame_size = _jit->frame_size;
   pushr(_jit, jit_gpr_regno (JIT_LR));
+  _jit->frame_size = saved_frame_size;
 }
 
 static void



reply via email to

[Prev in Thread] Current Thread [Next in Thread]