aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe/hipe_mode_switch.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2017-04-04 18:55:46 +0200
committerSverker Eriksson <[email protected]>2017-04-04 19:26:58 +0200
commitcbaddb165393002bd76f4d70247662588d3dee26 (patch)
tree21d5c139c4b42594174bb5ce57dc6ed1189209ba /erts/emulator/hipe/hipe_mode_switch.c
parent566ff495cb0f5f87306c81fc8d8ab2323b34d840 (diff)
downloadotp-cbaddb165393002bd76f4d70247662588d3dee26.tar.gz
otp-cbaddb165393002bd76f4d70247662588d3dee26.tar.bz2
otp-cbaddb165393002bd76f4d70247662588d3dee26.zip
Refactor hipe specific code to use ErtsCodeInfo
instead of ugly negative indexing.
Diffstat (limited to 'erts/emulator/hipe/hipe_mode_switch.c')
-rw-r--r--erts/emulator/hipe/hipe_mode_switch.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/erts/emulator/hipe/hipe_mode_switch.c b/erts/emulator/hipe/hipe_mode_switch.c
index 712f65f629..1270a94986 100644
--- a/erts/emulator/hipe/hipe_mode_switch.c
+++ b/erts/emulator/hipe/hipe_mode_switch.c
@@ -176,14 +176,15 @@ void hipe_mode_switch_init(void)
hipe_mfa_info_table_init();
}
-void hipe_set_call_trap(Uint *bfun, void *nfun, int is_closure)
+void hipe_set_call_trap(ErtsCodeInfo* ci, void *nfun, int is_closure)
{
- HIPE_ASSERT(bfun[-5] == BeamOpCode(op_i_func_info_IaaI));
+ BeamInstr* bfun = erts_codeinfo_to_code(ci);
+ HIPE_ASSERT(ci->op == BeamOpCode(op_i_func_info_IaaI));
bfun[0] =
is_closure
? BeamOpCode(op_hipe_trap_call_closure)
: BeamOpCode(op_hipe_trap_call);
- bfun[-4] = (Uint)nfun;
+ ci->u.ncallee = (void (*)(void)) nfun;
}
static __inline__ void