aboutsummaryrefslogtreecommitdiffstats
path: root/lib/ssh/src/ssh_sftp.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2019-02-21 06:10:38 +0100
committerBjörn Gustavsson <[email protected]>2019-02-21 14:04:29 +0100
commit5239eb0c62a96fb6b02c182a6786049e9782b123 (patch)
treef79d552850686625dfb43b03783df1154c838374 /lib/ssh/src/ssh_sftp.erl
parent03d097203b23cca5da801f25abf40218ad5ada83 (diff)
downloadotp-5239eb0c62a96fb6b02c182a6786049e9782b123.tar.gz
otp-5239eb0c62a96fb6b02c182a6786049e9782b123.tar.bz2
otp-5239eb0c62a96fb6b02c182a6786049e9782b123.zip
sys_core_fold: Remove an unsafe optimization
`sys_core_fold` has an optimization of repeated pattern matching. For example, when a record is matched the first time, the pattern is remembered. When the same record is matched again, the matching does not need to be repeated, but the variables bound in the first matching can be re-used. It turns out that that there is a name capture problem when the old inliner is used. The old inliner is used when explicitly inling certain functions, and by the compiler test suites for testing the compiler. The name capture problem could be eliminated by more aggressive variable renaming when inlining. But, fortunately, given the new SSA passes, this optimization is no longer as essential as it used to be. Removing the optimization turns out to be mostly benefical, leading to a smaller stack frame in many cases. Also remove the optimizations of `element/2`, `is_record/3`, and `setelement/3` from `sys_core_fold`. Because matched patterns are no longer remembered, those optimizations can very rarely be applied any more. (Those same optimizations are already done in `beam_ssa_type`.)
Diffstat (limited to 'lib/ssh/src/ssh_sftp.erl')
0 files changed, 0 insertions, 0 deletions