diff options
author | Björn Gustavsson <[email protected]> | 2018-09-05 13:25:28 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-09-05 13:25:28 +0200 |
commit | 66b797b4aeca486f515d96c1677cc633ce12a5d3 (patch) | |
tree | 1d5d55a26a42a97b1f052fa87cfe772e212b6775 /erts/emulator/beam/instrs.tab | |
parent | 092f4847f489cba0381676a6a389ddbfc2af4f1e (diff) | |
parent | 47a2ff39ac75c69b41f90f05a63fd9a2e6c0b36a (diff) | |
download | otp-66b797b4aeca486f515d96c1677cc633ce12a5d3.tar.gz otp-66b797b4aeca486f515d96c1677cc633ce12a5d3.tar.bz2 otp-66b797b4aeca486f515d96c1677cc633ce12a5d3.zip |
Merge pull request #1947 from bjorng/bjorn/opt-put-tuple
Introduce a put_tuple2 instruction
Diffstat (limited to 'erts/emulator/beam/instrs.tab')
-rw-r--r-- | erts/emulator/beam/instrs.tab | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/erts/emulator/beam/instrs.tab b/erts/emulator/beam/instrs.tab index 42c1168f85..da1dd3dc45 100644 --- a/erts/emulator/beam/instrs.tab +++ b/erts/emulator/beam/instrs.tab @@ -559,17 +559,19 @@ update_list(Hd, Dst) { HTOP += 2; } -i_put_tuple := i_put_tuple.make.fill; - -i_put_tuple.make(Dst) { - $Dst = make_tuple(HTOP); -} - -i_put_tuple.fill(Arity) { +put_tuple2(Dst, Arity) { Eterm* hp = HTOP; Eterm arity = $Arity; + /* + * If operands are not packed (in the 32-bit VM), + * is is not safe to use $Dst directly after I + * has been updated. + */ + Eterm* dst_ptr = &($Dst); + //| -no_next + ASSERT(arity != 0); *hp++ = make_arityval(arity); I = $NEXT_INSTRUCTION; do { @@ -586,6 +588,7 @@ i_put_tuple.fill(Arity) { break; } } while (--arity != 0); + *dst_ptr = make_tuple(HTOP); HTOP = hp; ASSERT(VALID_INSTR(* (Eterm *)I)); Goto(*I); |