aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/ops.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-02-28 10:25:02 +0100
committerBjörn Gustavsson <[email protected]>2019-03-01 14:06:13 +0100
commit2f432a4399544baa346ffa9b0dd18a7ab717dd53 (patch)
treee24d30ea239bd15524fe51ed24356d789b66103b /erts/emulator/beam/ops.tab
parentd841a0919f73adca02a1776e65fca4fd8318050d (diff)
downloadotp-2f432a4399544baa346ffa9b0dd18a7ab717dd53.tar.gz
otp-2f432a4399544baa346ffa9b0dd18a7ab717dd53.tar.bz2
otp-2f432a4399544baa346ffa9b0dd18a7ab717dd53.zip
Combine is_nonempty_list with get_hd/get_tl
The is_nonempty_list test is very frequently followed by get_tl, and frequently followed by get_hd.
Diffstat (limited to 'erts/emulator/beam/ops.tab')
-rw-r--r--erts/emulator/beam/ops.tab10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 47a8e566b2..3cfc685336 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -679,8 +679,18 @@ is_nonempty_list Fail=f S=x | allocate Need Rs => is_nonempty_list_allocate Fail
is_nonempty_list Fail=f S=x | get_list S D1=x D2=x => \
is_nonempty_list_get_list Fail S D1 D2
+is_nonempty_list Fail=f S=x | get_hd S Dst=x => \
+ is_nonempty_list_get_hd Fail S Dst
+
+is_nonempty_list Fail=f S=x | get_tl S Dst=x => \
+ is_nonempty_list_get_tl Fail S Dst
+
is_nonempty_list_allocate f? rx t t
+
is_nonempty_list_get_list f? rx x x
+is_nonempty_list_get_hd f? x x
+is_nonempty_list_get_tl f? x x
+
is_nonempty_list f? xy
is_atom f? x