diff options
author | Sverker Eriksson <[email protected]> | 2015-01-16 21:25:50 +0100 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2015-03-12 18:56:40 +0100 |
commit | 2dfa8ceaf30d69c9e5753b706dafe741b3cda4ca (patch) | |
tree | a2378750aa22ef900084b03d376e728f55b6dae4 /erts/emulator/beam | |
parent | 96f6e470284858f1b8644ea949283dad24161dfe (diff) | |
download | otp-2dfa8ceaf30d69c9e5753b706dafe741b3cda4ca.tar.gz otp-2dfa8ceaf30d69c9e5753b706dafe741b3cda4ca.tar.bz2 otp-2dfa8ceaf30d69c9e5753b706dafe741b3cda4ca.zip |
erts: Add matching of hashmaps
Diffstat (limited to 'erts/emulator/beam')
-rw-r--r-- | erts/emulator/beam/utils.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/erts/emulator/beam/utils.c b/erts/emulator/beam/utils.c index b341c4d949..cea20a6002 100644 --- a/erts/emulator/beam/utils.c +++ b/erts/emulator/beam/utils.c @@ -2325,6 +2325,32 @@ tailrecur_ne: } break; /* not equal */ } + case HASHMAP_SUBTAG: + { + if (!is_boxed(b) || *boxed_val_rel(b,b_base) != hdr) + goto not_equal; + + aa = hashmap_val_rel(a, a_base) + 1; + bb = hashmap_val_rel(b, b_base) + 1; + switch (hdr & _HEADER_MAP_SUBTAG_MASK) { + case HAMT_SUBTAG_HEAD_ARRAY: + aa++; bb++; + case HAMT_SUBTAG_NODE_ARRAY: + sz = 16; + break; + case HAMT_SUBTAG_HEAD_BITMAP: + aa++; bb++; + case HAMT_SUBTAG_NODE_BITMAP: + sz = hashmap_bitcount(MAP_HEADER_VAL(hdr)); + ASSERT(sz > 0 && sz < 16); + break; + default: + erl_exit(1, "Unknown hashmap subsubtag\n"); + } + goto term_array; + } + default: + ASSERT(!"Unknown boxed subtab in EQ"); } break; } |