aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/msg_instrs.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-02 14:35:39 +0200
committerBjörn Gustavsson <[email protected]>2017-09-13 12:20:56 +0200
commit8650d6d811bb99490e1a75cbbab684a673a950ba (patch)
tree39924f5d0b31516b7e1d54e0755a6e7cc47c2b78 /erts/emulator/beam/msg_instrs.tab
parentbffbd4fb504e9551fc7feb9177ef0a2394c00cae (diff)
downloadotp-8650d6d811bb99490e1a75cbbab684a673a950ba.tar.gz
otp-8650d6d811bb99490e1a75cbbab684a673a950ba.tar.bz2
otp-8650d6d811bb99490e1a75cbbab684a673a950ba.zip
Refactor instructions to support relative jumps
Introduce new macros that can be used for relative jumps and use them consistently. Test that everything works by using a non-zero constant JUMP_OFFSET. The loader subtracts JUMP_OFFSET from loaded labels, and all instructions that use 'f' operands add it back.
Diffstat (limited to 'erts/emulator/beam/msg_instrs.tab')
-rw-r--r--erts/emulator/beam/msg_instrs.tab10
1 files changed, 5 insertions, 5 deletions
diff --git a/erts/emulator/beam/msg_instrs.tab b/erts/emulator/beam/msg_instrs.tab
index 093d48c64c..8055a8616f 100644
--- a/erts/emulator/beam/msg_instrs.tab
+++ b/erts/emulator/beam/msg_instrs.tab
@@ -49,7 +49,7 @@ recv_mark(Dest) {
* the label for the loop_rec/2 instruction for the
* the receive statement.
*/
- c_p->msg.mark = (BeamInstr *) $Dest;
+ $SET_REL_I(c_p->msg.mark, $Dest);
c_p->msg.saved_last = c_p->msg.last;
}
@@ -116,7 +116,7 @@ i_loop_rec(Dest) {
erts_proc_unlock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE);
} else {
c_p->flags &= ~F_DELAY_GC;
- SET_I((BeamInstr *) $Dest);
+ $SET_I_REL($Dest);
Goto(*I); /* Jump to a wait or wait_timeout instruction */
}
}
@@ -253,7 +253,7 @@ loop_rec_end(Dest) {
ASSERT(c_p->flags & F_DELAY_GC);
- SET_I((BeamInstr *) $Dest);
+ $SET_I_REL($Dest);
SAVE_MESSAGE(c_p);
if (FCALLS > 0 || FCALLS > neg_o_reds) {
FCALLS--;
@@ -261,7 +261,7 @@ loop_rec_end(Dest) {
}
c_p->flags &= ~F_DELAY_GC;
- c_p->i = I;
+ $SET_CP_I_ABS(I);
SWAPOUT;
c_p->arity = 0;
c_p->current = NULL;
@@ -374,7 +374,7 @@ wait.src(Src) {
//
wait.execute(JumpTarget) {
- c_p->i = (BeamInstr *) $JumpTarget; /* L1 */
+ $SET_REL_I(c_p->i, $JumpTarget); /* L1 */
SWAPOUT;
c_p->arity = 0;