diff options
author | Björn Gustavsson <[email protected]> | 2016-04-01 16:07:37 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2016-04-07 15:27:14 +0200 |
commit | 6d51b25958393d95dee32baafd708aa3909ddb5a (patch) | |
tree | 1e33fe1f5e558a6a6d453c177450a0b42223b7f7 /erts/emulator/beam/code_ix.c | |
parent | ec26a0c56cb6e28cc5a35ef72116275e5eeef823 (diff) | |
download | otp-6d51b25958393d95dee32baafd708aa3909ddb5a.tar.gz otp-6d51b25958393d95dee32baafd708aa3909ddb5a.tar.bz2 otp-6d51b25958393d95dee32baafd708aa3909ddb5a.zip |
Eliminate allocation of variables in transform_engine()
When an instruction with a variable number operands (such as
select_val) is seen of the left side of a transformation, the
'next_arg' instruction will allocate a buffer to fit all variables and
all operands will be copied into the buffer. Very often, the 'commit'
instruction will never be reached because of a test or predicate
failing or because of a short window; in that case, the variable
buffer will be deallocated.
Note that originally there were only few instructions with a variable
number of operands, but now common operations such as tuple building
also have a variable number of operands.
To avoid those frequent allocations and deallocations, modify the
'next_arg' instruction to only save a pointer to the first of the
"rest" arguments. Also move the deallocation of the instructions
on the left side from the 'commit' instruction to the 'end'
instruction to ensure that 'store_rest_args' will still work.
Diffstat (limited to 'erts/emulator/beam/code_ix.c')
0 files changed, 0 insertions, 0 deletions