aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2019-01-18beam_ssa_opt: Run the type optimization pass twiceBjörn Gustavsson
The code will be significantly improved by running the type optimization pass twice. The ssa_opt_misc pass can be eliminated because everything it does is also done by the type optimization pass.
2019-01-17beam_ssa_type: Eliminate redundant 'succeeded' instructionsBjörn Gustavsson
The beam_ssa_type pass would leave redundant 'succeeded' instructions, and depend on the live optimization pass to remove them. Update beam_ssa_type to remove redundant 'succeeded' instructions. This will not improve the generated code, but will improve compilation times since it eliminates instructions and variables.
2019-01-16Move optimizations of bs_put* instruction to beam_ssa_optBjörn Gustavsson
Do the optimizations of bs_put* instructions in beam_ssa_opt and remove the beam_bs pass. This can lead to a slight improvement of compilation times.
2019-01-16Refactor string operandsBjörn Gustavsson
There are two instructions that take string operands: {bs_put_string,Fail,NumberOfBytes,{string,String}} {bs_match_string,Fail,Register,NumberOfBits,{string,String}} In the canonical BEAM code that is passed to beam_asm, string String is currently represented as a list. (The string in bs_match_string is a bitstring before the beam_z compiler pass.) That is wasteful, because there will be unnecessary conversions between lists and binaries. Change the representation of String to be a binary. Furthermore, bs_put_string is an optimization of a bs_put_binary instruction with a literal binary operand. Currently, the bs_put_string instruction is introduced in beam_bs. Delay the introduction of bs_put_string to the beam_z pass. That will simplify optimizations and allow us to do the optimization currently done in beam_bs in a SSA pass in a future commit.
2019-01-16Move coalescing of bs_skip to beam_ssa_optBjörn Gustavsson
The optimization can be applied in a few more places if done before ssa_opt_bsm_shortcut (for example, in unicode:cbv/2).
2019-01-16Merge branch 'maint'Björn Gustavsson
* maint: beam_type: Eliminate compiler crash when arithmetic expression fails Conflicts: lib/compiler/src/beam_type.erl
2019-01-16Merge branch 'bjorn/compiler/beam_type/ERL_829/OTP-15518' into maintBjörn Gustavsson
* bjorn/compiler/beam_type/ERL_829/OTP-15518: beam_type: Eliminate compiler crash when arithmetic expression fails
2019-01-16Merge branch 'maint'Rickard Green
* maint: Updated OTP version Prepare release
2019-01-16Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Prepare release
2019-01-16Merge pull request #2091 from bjorng/bjorn/compiler/beam_ssa_typeBjörn Gustavsson
Improve type optimizations
2019-01-16Merge branch 'maint'Ingela Anderton Andin
2019-01-16Merge branch 'ingela/ssl/test-cuddle' into maintIngela Anderton Andin
* ingela/ssl/test-cuddle: ssl: Cuddle tests
2019-01-16ssl: Cuddle testsIngela Anderton Andin
2019-01-16Merge branch 'maint'Hans Bolinder
* maint: syntax_tools: Fix pretty-printing of type funs
2019-01-16Merge branch 'hasse/syntax_tools/fun_types/ERL-815/OTP-15519' into maintHans Bolinder
* hasse/syntax_tools/fun_types/ERL-815/OTP-15519: syntax_tools: Fix pretty-printing of type funs
2019-01-16Merge branch 'maint'Hans Bolinder
* maint: Fix erl_parse:af_constraint() Fix erl_parse:af_fun_type() Add literal character to erl_parse:abstract_type/0 type
2019-01-16Merge pull request #2074 from gomoripeti/singleton_char_typeHans Bolinder
Fixes in erl_parse:abstract_type/0 type
2019-01-16Merge branch 'maint'Hans Bolinder
* maint: Fix sorting in lists.xml
2019-01-16Merge branch 'jfw7/stdlib/fix_doc_lists/PR-2049' into maintHans Bolinder
* jfw7/stdlib/fix_doc_lists/PR-2049: Fix sorting in lists.xml
2019-01-15Prepare releaseErlang/OTP
2019-01-15Merge branch 'john/erts/prim_file-init-restart/OTP-15495/ERL-821' into maint-21Erlang/OTP
* john/erts/prim_file-init-restart/OTP-15495/ERL-821: Remove an unused variable Spawn prim_file helper as a system process
2019-01-15Merge branch 'peterdmv/ssl/fix-srp-encode-decode/ERL-790/OTP-15477' into ↵Erlang/OTP
maint-21 * peterdmv/ssl/fix-srp-encode-decode/ERL-790/OTP-15477: ssl: Fix encoding/decoding of the SRP extension
2019-01-15Merge branch 'ingela/ssl/enhance-error-handling/OTP-15505' into maint-21Erlang/OTP
* ingela/ssl/enhance-error-handling/OTP-15505: ssl: Cuddle test cases ssl: Fix test case ssl: Fix two invalid gen_statem returns
2019-01-15Merge branch 'ingela/maint-21/active-once/ERL-371/OTP-15504' into maint-21Erlang/OTP
* ingela/maint-21/active-once/ERL-371/OTP-15504: ssl: Guarantee active once data delivery
2019-01-15Merge branch 'lars/xmerl/bug-in-detect-charset/OTP-15492' into maint-21Erlang/OTP
* lars/xmerl/bug-in-detect-charset/OTP-15492: [xmerl] Fix detect charset crash
2019-01-15Merge branch 'lukas/ssl/benchmark_basic_test'Lukas Larsson
* lukas/ssl/benchmark_basic_test: inets: Decrease benchmark TC timeout inets: Fix crypto:rand_bytes usage in benchmarks ssl: Only run a basic fast test in test cycle
2019-01-15inets: Decrease benchmark TC timeoutLukas Larsson
2019-01-15inets: Fix crypto:rand_bytes usage in benchmarksLukas Larsson
2019-01-15ssl: Only run a basic fast test in test cycleLukas Larsson
Some of the slower machines takes 20-30 minutes to run one iteration of the payload test.
2019-01-15Merge branch 'maint'Ingela Anderton Andin
Conflicts: lib/ssl/src/ssl.erl
2019-01-15Merge pull request #2069 from zuiderkwast/erl_parse_typesHans Bolinder
Correction of type abstract_expr -> abstract_expr() in erl_parse
2019-01-15Merge pull request #2082 from ↵Ingela Andin
IngelaAndin/ingela/ssl/save-specific-session/OTP-15369 Ingela/ssl/save specific session/otp 15369
2019-01-15Fix sorting in lists.xmljfw7
`search/2` was sorted incorrectly.
2019-01-15Merge branch 'maint'Hans Nilsson
* maint: crypto: Refresh of test case for elliptic curves crypto: Rename a testcase
2019-01-15crypto: Refresh of test case for elliptic curvesHans Nilsson
2019-01-15crypto: Rename a testcaseHans Nilsson
crypto_SUITE:generate_all_supported -> use_all_elliptic_curves
2019-01-15Merge branch 'maint'Hans Nilsson
* maint: crypto: New test suite - crypto_bench_SUITE
2019-01-15syntax_tools: Fix pretty-printing of type funsHans Bolinder
See also ERL-815.
2019-01-14ssl: Add value 'save' to reuse_sessions and reuse_session client optionIngela Anderton Andin
We want to be able to save a specific session to reuse, and make sure it is reusable immediatly when the connection has been established. Add client option {reuse_session, SessionID::binary()} We also do not want clients to save sessions that it did not verify. Additionaly change behaviour of the client and server to not save sessions if reuse_session is set to false.
2019-01-14ssl: Client shall only save verified sessionsIngela Anderton Andin
Modernize test case option handling
2019-01-14ssl: Uncomplicate test codeIngela Anderton Andin
No need for this test case to set a specific cipher suite. An appropriate cipher suite will be negotiated and it will of course be the same for clients with the same configuration.
2019-01-14ssl: Modernize test suiteIngela Anderton Andin
2019-01-14Merge branch 'peterdmv/ssl/handshake_traffic_secret/OTP-15429'Péter Dimitrov
* peterdmv/ssl/handshake_traffic_secret/OTP-15429: (21 commits) ssl: Skip TLS 1.3 suites if crypto lacks support ssl: Update testcase 'encode_decode_srp' ssl: Fix dialyzer warnings ssl: Improve AEAD encode/decode ssl: Refactor state 'negotiated' ssl: Add 'CertificateVerify' ssl: Add support for x25519 and x448 in ECDH ssl: Implement transcript_hash for TLS 1.3 ssl: Fix encoding/decoding of supported_versions ssl: Check if RSASSA-PSS is supported by crypto ssl: Reorder default signature schemes ssl: Create server 'Certificate' message ssl: Calculate handshake traffic keys ssl: Add tests for TLS 1.3 ssl: Fix handling of signature algorithms ssl: Process "supported_versions" before decoding ssl: Update cipher suite formatting in ssl_logger ssl: Fix cipher suite selection ssl: Comment usage of 'state' in TLS 1.3 ssl: Implement TLS 1.3 key schedule ... Change-Id: Iffeff2e2fefa8af618d6d4a3457b8a9dd9392685
2019-01-14beam_type: Eliminate compiler crash when arithmetic expression failsBjörn Gustavsson
The compiler would crash when compiling code such as: (A / B) band 16#ff The type for the expression would be 'none', but beam_type:verified_type/1 did not handle 'none'. https://bugs.erlang.org/browse/ERL-829
2019-01-14Introduce subtraction of typesBjörn Gustavsson
Introduce subtraction of types to allow some redundant tests to be eliminated. Consider this function: foo(L) when is_list(L) -> case L of [_|_] -> non_empty; [] -> empty end. After entering the body of the function, L is known to be either a cons cell or nil (otherwise the is_list/1 guard would have failed). If the L is not a cons cell, it must be nil. Therefore, the test for nil in the second clause of the case can be eliminated. Here is the SSA code with some additonal comments for the function before the optimization: function t:foo(_0) { 0: @ssa_bool = bif:is_list _0 br @ssa_bool, label 4, label 3 4: %% _0 is now a list (cons or nil). @ssa_bool:8 = is_nonempty_list _0 br @ssa_bool:8, label 9, label 7 9: ret literal non_empty 7: %% _0 is not a cons (or we wouldn't be here). %% Subtracting cons from the previously known type list %% gives that _0 must be nil. @ssa_bool:10 = bif:'=:=' _0, literal [] br @ssa_bool:10, label 11, label 6 11: ret literal empty 6: _6 = put_tuple literal case_clause, _0 %% t.erl:5 @ssa_ret:12 = call remote (literal erlang):(literal error)/1, _6 ret @ssa_ret:12 3: _9 = put_list _0, literal [] %% t.erl:4 @ssa_ret:13 = call remote (literal erlang):(literal error)/2, literal function_clause, _9 ret @ssa_ret:13 } Type subtraction gives us that _0 must be nil in block 7, allowing us to remove the comparison of _0 with nil. The code for the function can be simplified to: function t:foo(_0) { 0: @ssa_bool = bif:is_list _0 br @ssa_bool, label 4, label 3 4: @ssa_bool:8 = is_nonempty_list _0 br @ssa_bool:8, label 9, label 11 9: ret literal non_empty 11: ret literal empty 3: _9 = put_list _0, literal [] %% t.erl:4 @ssa_ret:13 = call remote (literal erlang):(literal error)/2, literal function_clause, _9 ret @ssa_ret:13 }
2019-01-14Infer types from more BIFsBjörn Gustavsson
2019-01-14crypto: New test suite - crypto_bench_SUITEHans Nilsson
2019-01-11beam_ssa_codegen: Correct label generation for 'or'Björn Gustavsson
Code generation for 'or' with {z,0} destination could generate duplicate new labels. The bug was introduced in eb571f8951bd.
2019-01-11beam_ssa_pre_codegen: Don't use z registers for 'xor' and 'is_record'Björn Gustavsson
There is no easy way to convert xor or is_record/2 to test operations.
2019-01-11beam_ssa_pre_codegen: Correct short-lived optimizationBjörn Gustavsson