aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_x86_bifs.m4
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-03-18 18:19:45 +0100
committerSverker Eriksson <[email protected]>2011-10-26 18:22:42 +0200
commit01c734e6a60bb9579c00079f7d81d197b684c9e3 (patch)
treeafc4d3879b54dbedbe3e94453af9135cd399c3d2 /erts/emulator/hipe/hipe_x86_bifs.m4
parent7085a1a3240e80b9558d722e2979c9122e0b29d2 (diff)
downloadotp-01c734e6a60bb9579c00079f7d81d197b684c9e3.tar.gz
otp-01c734e6a60bb9579c00079f7d81d197b684c9e3.tar.bz2
otp-01c734e6a60bb9579c00079f7d81d197b684c9e3.zip
erts-hipe: Enable debug compiled hipe-VM with lock checker
Add hipe_debug_bif_wrapper() as a wrapper for every BIF called by native code.
Diffstat (limited to 'erts/emulator/hipe/hipe_x86_bifs.m4')
-rw-r--r--erts/emulator/hipe/hipe_x86_bifs.m415
1 files changed, 11 insertions, 4 deletions
diff --git a/erts/emulator/hipe/hipe_x86_bifs.m4 b/erts/emulator/hipe/hipe_x86_bifs.m4
index dca5721c29..2ea69bde3c 100644
--- a/erts/emulator/hipe/hipe_x86_bifs.m4
+++ b/erts/emulator/hipe/hipe_x86_bifs.m4
@@ -20,6 +20,7 @@ changecom(`/*', `*/')dnl
include(`hipe/hipe_x86_asm.m4')
+#`include' "config.h"
#`include' "hipe_literals.h"
`#if THE_NON_VALUE == 0
@@ -28,6 +29,12 @@ include(`hipe/hipe_x86_asm.m4')
#define TEST_GOT_EXN cmpl $THE_NON_VALUE,%eax
#endif'
+`#if defined(ERTS_ENABLE_LOCK_CHECK) && defined(ERTS_SMP)
+# define CALL_BIF(F) movl $CSYM(F), P_BIF_CALLEE(P); call CSYM(hipe_debug_bif_wrapper)
+#else
+# define CALL_BIF(F) call CSYM(F)
+#endif'
+
define(TEST_GOT_MBUF,`movl P_MBUF(P), %edx # `TEST_GOT_MBUF'
testl %edx, %edx
jnz 3f
@@ -64,7 +71,7 @@ ASYM($1):
NBIF_ARG(2,1,0)
lea 8(%esp), %eax
NBIF_ARG_REG(1,%eax) # BIF__ARGS
- call CSYM($2)
+ CALL_BIF($2)
TEST_GOT_MBUF
/* switch to native stack */
@@ -99,7 +106,7 @@ ASYM($1):
NBIF_ARG(3,2,1)
lea 8(%esp), %eax
NBIF_ARG_REG(1,%eax) # BIF__ARGS
- call CSYM($2)
+ CALL_BIF($2)
TEST_GOT_MBUF
/* switch to native stack */
@@ -135,7 +142,7 @@ ASYM($1):
NBIF_ARG(4,3,2)
lea 8(%esp), %eax
NBIF_ARG_REG(1,%eax) # BIF__ARGS
- call CSYM($2)
+ CALL_BIF($2)
TEST_GOT_MBUF
/* switch to native stack */
@@ -164,7 +171,7 @@ ASYM($1):
/* make the call on the C stack */
NBIF_ARG_REG(0,P)
/* skip BIF__ARGS */
- call CSYM($2)
+ CALL_BIF($2)
TEST_GOT_MBUF
/* switch to native stack */