diff options
author | Lukas Larsson <[email protected]> | 2016-06-27 20:18:22 +0200 |
---|---|---|
committer | Lukas Larsson <[email protected]> | 2016-10-12 15:39:38 +0200 |
commit | 855b3a9be724ffd3c9f7e311cf9d810099fa36ef (patch) | |
tree | f54a4e6ae4c00f0dd752f48d9dc99fad46c11faf /erts/emulator/beam/erl_db_util.c | |
parent | fad45d54881152eea14e84a88eb7fbaa0ba0329b (diff) | |
download | otp-855b3a9be724ffd3c9f7e311cf9d810099fa36ef.tar.gz otp-855b3a9be724ffd3c9f7e311cf9d810099fa36ef.tar.bz2 otp-855b3a9be724ffd3c9f7e311cf9d810099fa36ef.zip |
erts: Refactor out func_info into struct
This commit adds two new structs to be used to represent
erlang code in erts.
ErtsCodeInfo is used to describe the i_func_info header
that is part of all Export entries and the prelude of
each function. This replaces all the BeamInstr * that
were previously used to point to these locations.
After this change the code should never use BeamInstr *
with offsets to figure out different parts of the
func_info header.
ErtsCodeMFA is a struct that is used to descripe a
MFA in code. It is used within ErtsCodeInfo and also
in Process->current.
All function that previously took Eterm * or BeamInstr *
to identify a MFA now use the ErtsCodeMFA or ErtsCodeInfo
where appropriate.
The code has been tested to work when adding a new field to the
ErtsCodeInfo struct, but some updates are needed in ops.tab to
make it work.
Diffstat (limited to 'erts/emulator/beam/erl_db_util.c')
-rw-r--r-- | erts/emulator/beam/erl_db_util.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/erts/emulator/beam/erl_db_util.c b/erts/emulator/beam/erl_db_util.c index 6732b708a8..988467ce44 100644 --- a/erts/emulator/beam/erl_db_util.c +++ b/erts/emulator/beam/erl_db_util.c @@ -1769,7 +1769,7 @@ Eterm db_prog_match(Process *c_p, Eterm t; Eterm *esp; MatchVariable* variables; - BeamInstr *cp; + ErtsCodeInfo *cp; const UWord *pc = prog->text; Eterm *ehp; Eterm ret; @@ -2408,9 +2408,9 @@ restart: ehp = HAllocX(build_proc, 4, HEAP_XTRA); *esp++ = make_tuple(ehp); ehp[0] = make_arityval(3); - ehp[1] = cp[0]; - ehp[2] = cp[1]; - ehp[3] = make_small((Uint) cp[2]); + ehp[1] = cp->mfa.module; + ehp[2] = cp->mfa.function; + ehp[3] = make_small((Uint) cp->mfa.arity); } break; case matchSilent: |