aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2018-02-01 15:59:02 +0100
committerGitHub <[email protected]>2018-02-01 15:59:02 +0100
commit18d9afbd5c62bb7b7237fe0d580fc05737a096c1 (patch)
treed68c29a4d077ce205982a114d65d738e600ec7ea /erts
parentbb0b3c7252119604cf3e8c9ba78d20000e06f4ea (diff)
parentfbcff5a137e37edd80aca9c5fe18ce6880648169 (diff)
downloadotp-18d9afbd5c62bb7b7237fe0d580fc05737a096c1.tar.gz
otp-18d9afbd5c62bb7b7237fe0d580fc05737a096c1.tar.bz2
otp-18d9afbd5c62bb7b7237fe0d580fc05737a096c1.zip
Merge pull request #1701 from bjorng/bjorn/get_hd_tl
Eliminate get_list/3 internally in the compiler
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/instrs.tab10
-rw-r--r--erts/emulator/beam/ops.tab3
2 files changed, 13 insertions, 0 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab
index f19027b1ec..6a531fcc09 100644
--- a/erts/emulator/beam/instrs.tab
+++ b/erts/emulator/beam/instrs.tab
@@ -322,6 +322,16 @@ get_list(Src, Hd, Tl) {
$Tl = tl;
}
+get_hd(Src, Hd) {
+ Eterm* tmp_ptr = list_val($Src);
+ $Hd = CAR(tmp_ptr);
+}
+
+get_tl(Src, Tl) {
+ Eterm* tmp_ptr = list_val($Src);
+ $Tl = CDR(tmp_ptr);
+}
+
i_get(Src, Dst) {
$Dst = erts_pd_hash_get(c_p, $Src);
}
diff --git a/erts/emulator/beam/ops.tab b/erts/emulator/beam/ops.tab
index 1f4a8eadb0..77e375f2c0 100644
--- a/erts/emulator/beam/ops.tab
+++ b/erts/emulator/beam/ops.tab
@@ -182,6 +182,9 @@ get_list r x y
get_list r y r
get_list r x r
+get_hd xy xy
+get_tl xy xy
+
# Old-style catch.
catch y f
catch_end y