diff options
author | Sverker Eriksson <[email protected]> | 2016-10-14 16:59:34 +0200 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2016-10-14 16:59:34 +0200 |
commit | add49d36f93c03fc2edbf17663a4e7ddd982a5f0 (patch) | |
tree | 8f14cd262562cd26fc067657f98c002945494027 /erts/emulator/beam/beam_load.c | |
parent | 6b588ecd5f62c6867ca1aea17c42f90159859fa9 (diff) | |
parent | 81cf5bc05e502809398116eaa0b78deb9336d68b (diff) | |
download | otp-add49d36f93c03fc2edbf17663a4e7ddd982a5f0.tar.gz otp-add49d36f93c03fc2edbf17663a4e7ddd982a5f0.tar.bz2 otp-add49d36f93c03fc2edbf17663a4e7ddd982a5f0.zip |
Merge branch 'sverker/proc-dict-atom-hash/PR-1194'
* sverker/proc-dict-atom-hash:
kernel: Add test pdict_SUITE:literals
erts: Refactor process dict hash pre-calculation
Use atom value as hash value in process dictionary
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r-- | erts/emulator/beam/beam_load.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c index 13552ae88c..ee40c308ce 100644 --- a/erts/emulator/beam/beam_load.c +++ b/erts/emulator/beam/beam_load.c @@ -39,6 +39,7 @@ #include "erl_binary.h" #include "erl_zlib.h" #include "erl_map.h" +#include "erl_process_dict.h" #ifdef HIPE #include "hipe_bif0.h" @@ -4346,22 +4347,25 @@ gen_get_map_element(LoaderState* stp, GenOpArg Fail, GenOpArg Src, static int hash_internal_genop_arg(LoaderState* stp, GenOpArg Key, Uint32* hx) { + Eterm key_term; switch (Key.type) { case TAG_a: - *hx = atom_tab(atom_val(Key.val))->slot.bucket.hvalue; - return 1; + key_term = Key.val; + break; case TAG_i: - *hx = Key.val; - return 1; + key_term = make_small(Key.val); + break; case TAG_n: - *hx = make_internal_hash(NIL); - return 1; + key_term = NIL; + break; case TAG_q: - *hx = make_internal_hash(stp->literals[Key.val].term); - return 1; + key_term = stp->literals[Key.val].term; + break; default: return 0; } + *hx = erts_pd_make_hx(key_term); + return 1; } |