diff options
author | Björn Gustavsson <[email protected]> | 2017-09-02 14:35:39 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-09-13 12:20:56 +0200 |
commit | 8650d6d811bb99490e1a75cbbab684a673a950ba (patch) | |
tree | 39924f5d0b31516b7e1d54e0755a6e7cc47c2b78 /erts/emulator/beam/select_instrs.tab | |
parent | bffbd4fb504e9551fc7feb9177ef0a2394c00cae (diff) | |
download | otp-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/select_instrs.tab')
-rw-r--r-- | erts/emulator/beam/select_instrs.tab | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/select_instrs.tab b/erts/emulator/beam/select_instrs.tab index e85ed2c304..88049bbcf0 100644 --- a/erts/emulator/beam/select_instrs.tab +++ b/erts/emulator/beam/select_instrs.tab @@ -68,10 +68,10 @@ select_val_bins.select(Fail, NumElements) { } else if (select_val > mid->val) { low = mid + 1; } else { - $NEXT(mid->addr); + $JUMP(mid->addr); } } - $NEXT($Fail); + $JUMP($Fail); } i_select_tuple_arity2 := select_val2.src.ta_fail.execute; @@ -150,8 +150,8 @@ select_val_lin.execute(N) { } if (vs[ix] == select_val) { - I = $NEXT_INSTRUCTION + $N + ix; - $JUMP(*I); + Eterm offset = *($NEXT_INSTRUCTION + $N + ix); + $JUMP(offset); } else { $JUMP(*select_fail); } |