diff options
author | Björn Gustavsson <[email protected]> | 2019-02-28 10:25:02 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-03-01 14:06:13 +0100 |
commit | 2f432a4399544baa346ffa9b0dd18a7ab717dd53 (patch) | |
tree | e24d30ea239bd15524fe51ed24356d789b66103b /erts/emulator/beam/instrs.tab | |
parent | d841a0919f73adca02a1776e65fca4fd8318050d (diff) | |
download | otp-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/instrs.tab')
-rw-r--r-- | erts/emulator/beam/instrs.tab | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab index 14ca07f97e..fc88cab22f 100644 --- a/erts/emulator/beam/instrs.tab +++ b/erts/emulator/beam/instrs.tab @@ -678,6 +678,18 @@ is_nonempty_list_get_list(Fail, Src, Hd, Tl) { $get_list($Src, $Hd, $Tl); } +is_nonempty_list_get_hd(Fail, Src, Hd) { + //| -no_prefetch + $is_nonempty_list($Fail, $Src); + $get_hd($Src, $Hd); +} + +is_nonempty_list_get_tl(Fail, Src, Tl) { + //| -no_prefetch + $is_nonempty_list($Fail, $Src); + $get_tl($Src, $Tl); +} + jump(Fail) { $JUMP($Fail); } |