diff options
author | Björn Gustavsson <[email protected]> | 2017-09-18 14:03:24 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2017-10-01 07:08:19 +0200 |
commit | e64a26414428c2f9c10cd91991bbc9dd81f0d8ae (patch) | |
tree | 832524e71355e98aac8b871952f451735b047f1d /erts/emulator/beam/beam_load.h | |
parent | 13956599d609156bd2c054213d8a5ed0a1ae7087 (diff) | |
download | otp-e64a26414428c2f9c10cd91991bbc9dd81f0d8ae.tar.gz otp-e64a26414428c2f9c10cd91991bbc9dd81f0d8ae.tar.bz2 otp-e64a26414428c2f9c10cd91991bbc9dd81f0d8ae.zip |
Refactor macros for accessing Beam instructions
The BeamOp() macro in erl_vm.h is clumsy to use. All users
cast the return value to BeamInstr.
Define new macros that are easier to use. In the future,
we might want to pack an operand into the same word as
the pointer to the instruction, so we will define two macros.
BeamIsOpCode() is used to rewrite code like this:
if (Instr == (BeamInstr) BeamOp(op_i_func_info_IaaI) {
...
}
to:
if (BeamIsOpCode(Instr, op_i_func_info_IaaI)) {
...
}
BeamOpCodeAddr(op_apply_bif) is used when we need the address
for an instruction.
Also elimiminate the global variables em_* in beam_emu.c.
They are not really needed. Use the BeamOpCodeAddr() macro
instead.
Diffstat (limited to 'erts/emulator/beam/beam_load.h')
-rw-r--r-- | erts/emulator/beam/beam_load.h | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/erts/emulator/beam/beam_load.h b/erts/emulator/beam/beam_load.h index c4a90d3f3a..156c3c45e2 100644 --- a/erts/emulator/beam/beam_load.h +++ b/erts/emulator/beam/beam_load.h @@ -37,11 +37,6 @@ typedef struct gen_op_entry { extern const GenOpEntry gen_opc[]; -extern BeamInstr beam_debug_apply[]; -extern BeamInstr* em_call_error_handler; -extern BeamInstr* em_apply_bif; -extern BeamInstr* em_call_nif; - struct ErtsLiteralArea_; /* |