aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-03-25 09:47:42 +0100
committerBjörn Gustavsson <[email protected]>2015-04-13 12:37:55 +0200
commit5b8872c37f63b35e13464109e986ef3727588040 (patch)
treeaa35e8c7bbb675e3772bd3fc205c78ca9a137599 /erts
parent47e1ed4c0681a73c9d6bc8d24ece85dd77957034 (diff)
downloadotp-5b8872c37f63b35e13464109e986ef3727588040.tar.gz
otp-5b8872c37f63b35e13464109e986ef3727588040.tar.bz2
otp-5b8872c37f63b35e13464109e986ef3727588040.zip
Optimize use of i_get_map_element/4
In the i_get_map_element/4 instruction, for literal keys other than atoms, the key would be put into x[0] instead of used directly in the instruction. The reason is that the original implementation of maps only supported atom keys.
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/ops.tab22
1 files changed, 11 insertions, 11 deletions
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 92d9ccb5eb..23f5b75b7a 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -1521,21 +1521,21 @@ get_map_elements Fail Src Size Rest=* | map_key_sort(Size, Rest) => \
i_get_map_elements f s I
-get_map_element Fail Src=rxy Key=ax Dst => i_get_map_element Fail Src Key Dst
-get_map_element Fail Src=rxy Key=rycq Dst => \
+get_map_element Fail Src=rxy Key=cx Dst => i_get_map_element Fail Src Key Dst
+get_map_element Fail Src=rxy Key=ry Dst => \
move Key x | i_get_map_element Fail Src x Dst
get_map_element Fail Src Key Dst => jump Fail
%macro: i_get_map_element GetMapElement -fail_action
-i_get_map_element f r a r
-i_get_map_element f x a r
-i_get_map_element f y a r
-i_get_map_element f r a x
-i_get_map_element f x a x
-i_get_map_element f y a x
-i_get_map_element f r a y
-i_get_map_element f x a y
-i_get_map_element f y a y
+i_get_map_element f r c r
+i_get_map_element f x c r
+i_get_map_element f y c r
+i_get_map_element f r c x
+i_get_map_element f x c x
+i_get_map_element f y c x
+i_get_map_element f r c y
+i_get_map_element f x c y
+i_get_map_element f y c y
i_get_map_element f r x r
i_get_map_element f x x r
i_get_map_element f y x r