guile-commits
[Top][All Lists]
Advanced

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

[Guile-commits] 01/03: Dynamically assert functions start with instrumen


From: Andy Wingo
Subject: [Guile-commits] 01/03: Dynamically assert functions start with instrument-entry
Date: Thu, 6 Jun 2019 08:49:38 -0400 (EDT)

wingo pushed a commit to branch master
in repository guile.

commit 9c5098ab25818003a0161f5b89f86fb3489bda86
Author: Andy Wingo <address@hidden>
Date:   Mon May 27 19:09:12 2019 +0200

    Dynamically assert functions start with instrument-entry
    
    * libguile/jit.c (emit_indirect_tail_call): Add dynamic assertion.
---
 libguile/jit.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/libguile/jit.c b/libguile/jit.c
index 6cea8bb..d8e892b 100644
--- a/libguile/jit.c
+++ b/libguile/jit.c
@@ -796,22 +796,20 @@ emit_push_frame (scm_jit_state *j, uint32_t proc_slot, 
uint32_t nlocals,
 static void
 emit_indirect_tail_call (scm_jit_state *j)
 {
-  jit_reloc_t not_instrumented, no_mcode;
-
   emit_get_callee_vcode (j, T0);
 
   /* FIXME: If all functions start with instrument-entry, no need for
      this check.  */
   emit_get_vcode_low_byte (j, T1, T0);
-  not_instrumented = jit_bnei (j->jit, T1, scm_op_instrument_entry);
-
+  jit_reloc_t instrumented = jit_beqi (j->jit, T1, scm_op_instrument_entry);
+  jit_breakpoint (j->jit);
+  jit_patch_here (j->jit, instrumented);
   emit_get_ip_relative_addr (j, T1, T0, 1);
   emit_ldxi (j, T1, T1, 0);
-  no_mcode = jit_beqi (j->jit, T1, 0);
+  jit_reloc_t no_mcode = jit_beqi (j->jit, T1, 0);
   ASSERT_HAS_REGISTER_STATE (FP_IN_REGISTER | SP_IN_REGISTER);
   jit_jmpr (j->jit, T1);
 
-  jit_patch_here (j->jit, not_instrumented);
   jit_patch_here (j->jit, no_mcode);
 
   emit_store_ip (j, T0);



reply via email to

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