aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/ops.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-07-04 08:58:33 +0200
committerBjörn Gustavsson <[email protected]>2015-07-06 13:38:18 +0200
commite820b8534fd440aaf4991f3c57b8990ce836c8b0 (patch)
treee3d620c0082786e870bbb7144aaa56f2561ce38d /erts/emulator/beam/ops.tab
parent7bfff20c48cdcabf1eae4b193a374a72977b9d3e (diff)
downloadotp-e820b8534fd440aaf4991f3c57b8990ce836c8b0.tar.gz
otp-e820b8534fd440aaf4991f3c57b8990ce836c8b0.tar.bz2
otp-e820b8534fd440aaf4991f3c57b8990ce836c8b0.zip
Speed up list matching
The combination is_non_empty_list followed by get_list is extremly common (but not in estone_SUITE, which is why it has not been noticed before). Therefore it is worthwile to introduce a combined instruction.
Diffstat (limited to 'erts/emulator/beam/ops.tab')
-rw-r--r--erts/emulator/beam/ops.tab7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 3d52da77d3..46fefb88af 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -682,6 +682,13 @@ is_nonempty_list F=f x==0 | test_heap I1 I2 => is_non_empty_list_test_heap F I1
%macro: is_non_empty_list_test_heap IsNonemptyListTestHeap -fail_action -pack
is_non_empty_list_test_heap f I t
+is_nonempty_list Fail=f S=x | get_list S D1=x D2=x => \
+ is_nonempty_list_get_list Fail S D1 D2
+
+%macro: is_nonempty_list_get_list IsNonemptyListGetList -fail_action -pack
+is_nonempty_list_get_list f r x x
+is_nonempty_list_get_list f x x x
+
%macro: is_nonempty_list IsNonemptyList -fail_action
is_nonempty_list f x
is_nonempty_list f y