aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2019-02-21sys_core_fold: Remove an unsafe optimizationBjörn Gustavsson
`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`.)
2019-02-21beam_ssa_type: Optimize setelement with partially constant argumentsBjörn Gustavsson
2019-02-21beam_ssa_opt: Do local CSE of get_tuple_element instructionsBjörn Gustavsson
For some reason, a `get_tuple_element` instruction was not deemed suitble for local common sub expression elimination. It turns out that enabling CSE for `get_tuple_element` is benefical. It will also be even more benefical in a future commit where some of the optimizations in `sys_core_fold` are removed.
2019-02-21Merge branch 'john/compiler/more-validator-cuddling'John Högberg
* john/compiler/more-validator-cuddling: beam_validator: Refactor call argument validation beam_validator: Refactor liveness/stack initialization checks beam_validator: Refactor try/catch handling beam_validator: Remember definitions on assignment beam_validator: Refactor stack trimming beam_validator: Track definitions of all terms beam_validator: Remove special handling of map_get/is_map_key beam_validator: Refactor select_tuple_arity beam_validator: Treat select_val as a series of '=:=' beam_validator: Treat all bs_get instructions as extractions beam_validator: Separate BIF/call types more clearly beam_validator: Assert that no tuple elements are out of bounds beam_validator: Get rid of the last uses of set_aliased_type beam_validator: Minor cosmetic refactoring
2019-02-21beam_validator: Refactor call argument validationJohn Högberg
2019-02-21beam_validator: Refactor liveness/stack initialization checksJohn Högberg
2019-02-21beam_validator: Refactor try/catch handlingJohn Högberg
2019-02-21Merge branch 'siri/cuddle-master'Siri Hansen
* siri/cuddle-master: Update sasl/test/test_lib.hrl with recent versions of kernel and stdlib [logger] Fix faulty report_cb in logger_disk_log_h_SUITE:logging/1 [cdv] Update compiler directive for release compatibility [reltool] Make test pass when $ERL_LIBS is set
2019-02-21Update sasl/test/test_lib.hrl with recent versions of kernel and stdlibSiri Hansen
2019-02-21[logger] Fix faulty report_cb in logger_disk_log_h_SUITE:logging/1Siri Hansen
2019-02-21[cdv] Update compiler directive for release compatibilitySiri Hansen
In crashdump_viewer test, the helper module must be loaded on earlier releases (major-2), so it has a compiler directive. This was r18, but is now changed to r20.
2019-02-21[reltool] Make test pass when $ERL_LIBS is setSiri Hansen
2019-02-21Merge branch 'ingela/ssl/bench'Ingela Anderton Andin
* ingela/ssl/bench: ssl: Improve bench SUITE
2019-02-21ssl: Improve bench SUITEIngela Anderton Andin
Add shorter time trap, modernize code and make sure help process terminates.
2019-02-21Merge branch 'ingela/ssl/fix-master-doc'Ingela Anderton Andin
2019-02-21Merge pull request #2149 from bjorng/bjorn/compiler/miscBjörn Gustavsson
Miscellaneous compiler improvements
2019-02-21Merge branch 'maint'Hans Bolinder
* maint: stdlib: Fix a bug in the Erlang Pretty Printer
2019-02-21Merge branch 'hasse/stdlib/fix_erl_pp/ERL-818/OTP-15592' into maintHans Bolinder
* hasse/stdlib/fix_erl_pp/ERL-818/OTP-15592: stdlib: Fix a bug in the Erlang Pretty Printer
2019-02-21dialyzer: Fix maps as parameter of opaque typesHans Bolinder
The clause added for maps in commit 1a7c41be is corrected.
2019-02-21dialyzer: Fix key check of lists:key{search,member,find}()Hans Bolinder
Replace integers and floats with t_number() since keysearch et al compare the key (rather than match). Corrects the commit b3c8e94.
2019-02-20beam_validator: Remember definitions on assignmentJohn Högberg
2019-02-20beam_validator: Refactor stack trimmingJohn Högberg
2019-02-20beam_validator: Track definitions of all termsJohn Högberg
2019-02-20beam_validator: Remove special handling of map_get/is_map_keyJohn Högberg
Neither can be used for type subtraction, so the default BIF handler suits them just fine.
2019-02-20beam_validator: Refactor select_tuple_arityJohn Högberg
2019-02-20beam_validator: Treat select_val as a series of '=:='John Högberg
2019-02-20beam_validator: Treat all bs_get instructions as extractionsJohn Högberg
While this is strictly only relevant for bs_get_binary2, we should never build anything while matching a message, so it ought to be safe to remove this last raw use of propagate_fragility.
2019-02-20beam_validator: Separate BIF/call types more clearlyJohn Högberg
2019-02-20beam_validator: Assert that no tuple elements are out of boundsJohn Högberg
2019-02-20beam_validator: Get rid of the last uses of set_aliased_typeJohn Högberg
Granted, it's replaced with a thin wrapper, but it'll simplify migration to the new type format.
2019-02-20beam_validator: Minor cosmetic refactoringJohn Högberg
2019-02-20erl_bifs: Add a note to the comment for is_pure/3Björn Gustavsson
2019-02-20Correct confusing comment in beam_ssa_typeBjörn Gustavsson
2019-02-20ssl: Reintroduce documentation of signature_algs_cert and log_level optionIngela Anderton Andin
When changing the ssl application to use type specs in documentation master additions where lost in the merge as we did not want to rewrite the new documentation in a merge commit.
2019-02-20Improve optimization of switchesBjörn Gustavsson
Part of the switch optimization done by `ssa_opt_sw` can be better done in `beam_ssa_type`.
2019-02-20Evaluate pure BIFs with literal argumentsBjörn Gustavsson
2019-02-20Revert "ssl: Workaround for compiler errors, to be reverted later"Ingela Anderton Andin
This reverts commit 028df3a72f7b813ef9851799a07ded30b7d3ad55.
2019-02-20use erts’ ERL_TRY_LINK_JAVA in common_test/test_server/configure.inAntonio Nikishaev
2019-02-20Refactor optimization of Bool =:= trueBjörn Gustavsson
Refactor optimization of `Bool =:= true` to make the code somewhat simpler, as well as potentially apply the optimization in more cases.
2019-02-20Always make andalso/orelse right-associativeBjörn Gustavsson
Always rewriting left-associative andalso/orelse to right-associative will not change the code (except in very rare cases), but it will make sure that the transformation is tested.
2019-02-20Merge pull request #2146 from bjorng/bjorn/compiler/set_tuple_elementBjörn Gustavsson
Do the destructive setelement optimization in SSA
2019-02-19Merge branch 'maint'Siri Hansen
2019-02-19Merge branch 'siri/logger/pretty-print-config/OTP-15600' into maintSiri Hansen
* siri/logger/pretty-print-config/OTP-15600: [logger] Add pretty print function for configuration
2019-02-19[logger] Add pretty print function for configurationSiri Hansen
2019-02-19ssl: Validate Client FinishedPéter Dimitrov
Validate Client Finished message. If validation fails, send decrypt_error alert. Change-Id: I1da7be3505ca6df2b3d50282f0500b988ef8b488
2019-02-19Do the destructive setelement optimization in SSABjörn Gustavsson
The expansion of record field updates, when more than one field is updated, but not a majority of the fields, will create a sequence of calls to `erlang:setelement(Index, Value, Tuple)` where Tuple in the first call is the original record tuple, and in the subsequent calls Tuple is the result of the previous call. Furthermore, all Index values are constant positive integers, and the first call to `setelement` will have the greatest index. Thus all the following calls do not actually need to test at run-time whether Tuple has type tuple, nor that the index is within the tuple bounds. Since OTP R7, the `sys_core_dsetel` pass, run as the very last Core Erlang pass, has optimized this sequence of `setelement` calls to use a special destructive version of `setelement` (called `set_tuple_element`) for all but the very first `setelement` in the sequence. It turns out that the presence of the `set_tuple_element` in SSA code is awkward and can prevent or complicate type analysis and aggressive optimizations. Therefore, this commit removes the `sys_core_dsetel` pass and reimplements it for SSA code. The optimization will be done in the `beam_ssa_pre_codegen` pass (that is, just before code generation and after running all other SSA code optimization passes). In most cases, the resulting BEAM code is identical to previous code. For a few modules, the BEAM code is actually slightly better, with smaller stack frames.
2019-02-19Merge branch 'maint'Hans Nilsson
* maint: ssh: Refactor decryption in ssh_protocol_SUITE
2019-02-19Merge branch 'hans/ssh/cuddle_tests' into maintHans Nilsson
* hans/ssh/cuddle_tests: ssh: Refactor decryption in ssh_protocol_SUITE
2019-02-19Merge branch 'maint'Hans Bolinder
* maint: dialyzer: Fix a bug regarding contracts
2019-02-19Merge branch 'hasse/dialyzer/fix_contract_check/OTP-15562/ERL-845' into maintHans Bolinder
* hasse/dialyzer/fix_contract_check/OTP-15562/ERL-845: dialyzer: Fix a bug regarding contracts