aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_x86_glue.h
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2011-10-14 19:23:26 +0200
committerSverker Eriksson <[email protected]>2011-10-26 18:19:20 +0200
commit17241c30f56ba6bc31518f1c905f6178784fb4fa (patch)
tree10b6e786c2915bdfe55351088fc5634f49475925 /erts/emulator/hipe/hipe_x86_glue.h
parent5a78dd349ab7974253e3058f9da73188d5394526 (diff)
downloadotp-17241c30f56ba6bc31518f1c905f6178784fb4fa.tar.gz
otp-17241c30f56ba6bc31518f1c905f6178784fb4fa.tar.bz2
otp-17241c30f56ba6bc31518f1c905f6178784fb4fa.zip
erts-hipe: Fix new trap conventions for x86, amd64 and ppc
Diffstat (limited to 'erts/emulator/hipe/hipe_x86_glue.h')
-rw-r--r--erts/emulator/hipe/hipe_x86_glue.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/erts/emulator/hipe/hipe_x86_glue.h b/erts/emulator/hipe/hipe_x86_glue.h
index a7b0f164be..b0db93267c 100644
--- a/erts/emulator/hipe/hipe_x86_glue.h
+++ b/erts/emulator/hipe/hipe_x86_glue.h
@@ -186,6 +186,25 @@ hipe_call_from_native_is_recursive(Process *p, Eterm reg[])
return 0;
}
+/* BEAM called native, which called BIF that returned trap
+ * Discard bif parameters.
+ * If tailcall, also clean up native stub continuation. */
+static __inline__ int
+hipe_trap_from_native_is_recursive(Process *p)
+{
+ Eterm nra = *(p->hipe.nsp++);
+
+ if (p->hipe.narity > NR_ARG_REGS) {
+ p->hipe.nsp += (p->hipe.narity - NR_ARG_REGS);
+ }
+ if (nra != (Eterm)nbif_return) {
+ *--(p->hipe.nsp) = nra;
+ return 1;
+ }
+ return 0;
+}
+
+
/* Native makes a call which needs to unload the parameters.
This differs from hipe_call_from_native_is_recursive() in
that it doesn't check for or pop the BEAM-calls-native frame.