aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/instrs.tab
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-02-26 12:23:35 +0100
committerBjörn Gustavsson <[email protected]>2019-03-01 14:06:13 +0100
commita29c834dd3cef789fb6d4a45092c20680eafd29d (patch)
tree3ba554e0e1e68a552193b3ada8e81297a0c361f5 /erts/emulator/beam/instrs.tab
parent60656d125a0f23c1f45069fdee80a5048439f06e (diff)
downloadotp-a29c834dd3cef789fb6d4a45092c20680eafd29d.tar.gz
otp-a29c834dd3cef789fb6d4a45092c20680eafd29d.tar.bz2
otp-a29c834dd3cef789fb6d4a45092c20680eafd29d.zip
Combine test_arity with get_tuple_element
The test_arity instruction is often followed by get_tuple_element.
Diffstat (limited to 'erts/emulator/beam/instrs.tab')
-rw-r--r--erts/emulator/beam/instrs.tab10
1 files changed, 10 insertions, 0 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab
index 29e8c29105..5ee98fef02 100644
--- a/erts/emulator/beam/instrs.tab
+++ b/erts/emulator/beam/instrs.tab
@@ -797,6 +797,16 @@ test_arity(Fail, Pointer, Arity) {
}
}
+test_arity_get_tuple_element(Fail, Pointer, Arity, Pos, Dst) {
+ Eterm* ptr = tuple_val($Pointer);
+ Eterm* src;
+ if (*ptr != $Arity) {
+ $FAIL($Fail);
+ }
+ src = ADD_BYTE_OFFSET(ptr, $Pos);
+ $Dst = *src;
+}
+
i_is_eq_exact_immed(Fail, X, Y) {
if ($X != $Y) {
$FAIL($Fail);