aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_load.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2016-10-10 15:05:26 +0200
committerSverker Eriksson <[email protected]>2016-10-10 15:10:57 +0200
commitb1070efa22f18e19bc7c55fd69e0796f48abf256 (patch)
tree479494b3bdceef5378b81f90da438cd270bc76ef /erts/emulator/beam/beam_load.c
parentc5a826b3d3a80726473fd9c2a7bea58b4363a993 (diff)
downloadotp-b1070efa22f18e19bc7c55fd69e0796f48abf256.tar.gz
otp-b1070efa22f18e19bc7c55fd69e0796f48abf256.tar.bz2
otp-b1070efa22f18e19bc7c55fd69e0796f48abf256.zip
erts: Refactor process dict hash pre-calculation
with new function erts_pd_make_hx()
Diffstat (limited to 'erts/emulator/beam/beam_load.c')
-rw-r--r--erts/emulator/beam/beam_load.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/erts/emulator/beam/beam_load.c b/erts/emulator/beam/beam_load.c
index 8aecf01bfd..165328f992 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"
@@ -4343,22 +4344,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_val(Key.val);
- 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;
}