From a307b90ba474d2700289cd010d606b8c133fbacb Mon Sep 17 00:00:00 2001 From: Yiannis Tsiouris Date: Tue, 28 Jan 2014 18:05:31 +0200 Subject: Add a BIF that only returns the atom ok A call in llvm_fix_pinned_regs/0 is inserted in the beginning of LLVM unwind blocks (i.e. code executed when an LLVM 'invoke' call triggers an exception) in order to get the BP and SP registers right. This is needed because LLVM exception handling doesn't provide the return value (that also contains the values for these registers, as defined in the HiPE Calling Convention for LLVM) on the 'landingpad's. --- erts/emulator/hipe/hipe_bif2.c | 7 +++++++ erts/emulator/hipe/hipe_bif2.tab | 1 + 2 files changed, 8 insertions(+) diff --git a/erts/emulator/hipe/hipe_bif2.c b/erts/emulator/hipe/hipe_bif2.c index 7637049bc3..054911e822 100644 --- a/erts/emulator/hipe/hipe_bif2.c +++ b/erts/emulator/hipe/hipe_bif2.c @@ -182,3 +182,10 @@ BIF_RETTYPE hipe_bifs_debug_native_called_2(BIF_ALIST_2) BIF_RET(am_ok); } +/* Stub-BIF for LLVM: + * Reloads BP, SP (in llvm unwind label) */ + +BIF_RETTYPE hipe_bifs_llvm_fix_pinned_regs_0(BIF_ALIST_0) +{ + BIF_RET(am_ok); +} diff --git a/erts/emulator/hipe/hipe_bif2.tab b/erts/emulator/hipe/hipe_bif2.tab index 45a395bf57..1b659cfa90 100644 --- a/erts/emulator/hipe/hipe_bif2.tab +++ b/erts/emulator/hipe/hipe_bif2.tab @@ -30,3 +30,4 @@ bif hipe_bifs:in_native/0 bif hipe_bifs:modeswitch_debug_on/0 bif hipe_bifs:modeswitch_debug_off/0 bif hipe_bifs:debug_native_called/2 +bif hipe_bifs:llvm_fix_pinned_regs/0 -- cgit v1.2.3