summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/instrs.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <bjorn@erlang.org>2019-02-28 10:25:02 +0100
committerBjörn Gustavsson <bjorn@erlang.org>2019-03-01 14:06:13 +0100
commit2f432a4399544baa346ffa9b0dd18a7ab717dd53 (patch)
treee24d30ea239bd15524fe51ed24356d789b66103b /erts/emulator/beam/instrs.tab
parentd841a0919f73adca02a1776e65fca4fd8318050d (diff)
downloaderlang-2f432a4399544baa346ffa9b0dd18a7ab717dd53.tar.gz
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.tab12
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);
}