aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2017-09-04 15:39:58 +0200
committerBjörn Gustavsson <[email protected]>2017-09-14 10:16:07 +0200
commitef43e32b450df2fdf1c731e9be03693fb0b69e31 (patch)
treeacfed1cfd815815360e597b968296fdc97a8dc8f /erts
parent8650d6d811bb99490e1a75cbbab684a673a950ba (diff)
downloadotp-ef43e32b450df2fdf1c731e9be03693fb0b69e31.tar.gz
otp-ef43e32b450df2fdf1c731e9be03693fb0b69e31.tar.bz2
otp-ef43e32b450df2fdf1c731e9be03693fb0b69e31.zip
Remove JUMP_OFFSET
It has served its purpose.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/beam_load.c8
-rw-r--r--erts/emulator/beam/beam_load.h2
-rw-r--r--erts/emulator/beam/macros.tab6
3 files changed, 5 insertions, 11 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 9b8f33f576..7d3a19ff86 100644
--- a/erts/emulator/beam/beam_load.c
+++ b/erts/emulator/beam/beam_load.c
@@ -4840,11 +4840,7 @@ freeze_code(LoaderState* stp)
ASSERT(this_patch < stp->ci);
next_patch = codev[this_patch];
ASSERT(next_patch < stp->ci);
- if (this_patch < stp->num_functions) {
- codev[this_patch] = (BeamInstr) (codev + value);
- } else {
- codev[this_patch] = (BeamInstr) (codev + value - JUMP_OFFSET);
- }
+ codev[this_patch] = (BeamInstr) (codev + value);
this_patch = next_patch;
}
}
@@ -4889,7 +4885,7 @@ final_touch(LoaderState* stp, struct erl_module_instance* inst_p)
while (index != 0) {
BeamInstr next = codev[index];
codev[index] = BeamOpCode(op_catch_yf);
- catches = beam_catches_cons((BeamInstr *)codev[index+2]+JUMP_OFFSET, catches);
+ catches = beam_catches_cons((BeamInstr *)codev[index+2], catches);
codev[index+2] = make_catch(catches);
index = next;
}
diff --git a/erts/emulator/beam/beam_load.h b/erts/emulator/beam/beam_load.h
index 0b6543638f..c088bdb751 100644
--- a/erts/emulator/beam/beam_load.h
+++ b/erts/emulator/beam/beam_load.h
@@ -21,8 +21,6 @@
#ifndef _BEAM_LOAD_H
# define _BEAM_LOAD_H
-#define JUMP_OFFSET 0x5
-
#include "beam_opcodes.h"
#include "erl_process.h"
diff --git a/erts/emulator/beam/macros.tab b/erts/emulator/beam/macros.tab
index 959f7b28df..35460da1f4 100644
--- a/erts/emulator/beam/macros.tab
+++ b/erts/emulator/beam/macros.tab
@@ -29,8 +29,8 @@ REFRESH_GEN_DEST() {
}
SET_I_REL(Offset) {
- ASSERT(VALID_INSTR(* (Eterm *)((BeamInstr *) ($Offset) + JUMP_OFFSET)));
- I = (BeamInstr *) $Offset + JUMP_OFFSET;
+ ASSERT(VALID_INSTR(* (Eterm *)((BeamInstr *) ($Offset))));
+ I = (BeamInstr *) $Offset;
}
SET_CP_I_ABS(Target) {
@@ -39,7 +39,7 @@ SET_CP_I_ABS(Target) {
}
SET_REL_I(Dst, Offset) {
- $Dst = (BeamInstr *) ($Offset) + JUMP_OFFSET;
+ $Dst = (BeamInstr *) ($Offset);
ASSERT(VALID_INSTR(*$Dst));
}