diff options
author | Björn Gustavsson <[email protected]> | 2019-02-26 12:23:35 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2019-03-01 14:06:13 +0100 |
commit | a29c834dd3cef789fb6d4a45092c20680eafd29d (patch) | |
tree | 3ba554e0e1e68a552193b3ada8e81297a0c361f5 /erts/emulator/beam/instrs.tab | |
parent | 60656d125a0f23c1f45069fdee80a5048439f06e (diff) | |
download | otp-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.tab | 10 |
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); |