Age | Commit message (Collapse) | Author |
|
Prior to 294d66a295f6c2101fe3c2da630979ad4e736c08 there wasn't much
point to keeping track of tuple element types; they were only known
when we had inserted or extracted values from a tuple, and in
neither case was it likely that we'd extract the same values again.
It makes a lot more sense to do so now that type optimizations are
applied across functions; if we return a tuple it's very likely
that its elements will be extracted soon after, and knowing their
types lets us eliminate more type checks.
Co-authored-by: Björn Gustavsson <[email protected]>
|
|
|
|
|
|
|
|
Reduce compilation times
|
|
* bjorn/compiler/cuddle-with-tests:
inline_SUITE: Don't start a slave node
Correct test_lib:is_cloned_mod/1
sys_core_fold_lists: Propagate annotations in expansion of lists functions
Parallelize compile_SUITE:bc_options/1
Remove the optimized_guard/1 test case
|
|
* hans/crypto/fixes/OTP-14732:
otp_test_engine.c fixes
crypto: Fix compilation < 1.0.0
|
|
* maint:
Fix typo in erlang.xml
inets: Ignore bracket option in format_address
Change-Id: I8a215d3872ae74e08d7a17b70ba53535947c032f
|
|
|
|
|
|
crypto: revamp C code [WIP]
OTP-14732
|
|
* peterdmv/inets/fix-http-client/ERIERL-289/OTP-15554:
inets: Ignore bracket option in format_address
Change-Id: If3f19325edb8f8cc1ced717aa125658c00438b70
|
|
A long time ago there was a good idea to run compiled code in a
slave node. Nowadays, not so much.
|
|
test_lib:is_cloned_mod(inline_SUITE) would return true.
|
|
There could be a warning with a `no_file` atom instead of filename
and line number.
|
|
|
|
With the new SSA code passes, the optimized_guard/1 test case has
become really bad at finding unnecessary `and` and `or` instructions.
|
|
Two helper functions in beam_ssa_opt and beam_ssa_dead
are body-recursive for no good reason.
While at it, add some clarifying comments to the functions.
|
|
beam_ssa:def_used/2 is used by beam_ssa_pre_codegen when reserving
Y registers.
Do the following optimizations:
* Use an ordset instead of a gb_set. When the only operation performed
on a set is union/2, an ordset will usually be faster, especially when
the result is an ordset.
* Use a cerl_set instead of a gb_set for the set of all possible
predecessors. cerl_sets is usually faster than gb_sets.
|
|
Avoiding calls usually reduces the size of the stack frame and reduces
register shuffling.
|
|
|
|
Save a little time by using gb_sets:delete/2 instead of
gb_sets:delete_any/2 when the key is known to be in the set.
|
|
beam_ssa_dead could be very slow if there were many blocks
connected with unconditional branches (for example, if a block
had contained many `call` instructions and been split by
ssa_opt_split_blocks).
It turns out that `comb_get_sw/3` does an unnecessary (and perhaps
incorrect) recursive call to itself when the terminator for the
block is an unconditional branch. Removing the recursive call does
not disable any optimizations, but will be much faster if there
are many blocks connected with unconditional branches.
Reported-by: Michał Muskała
|
|
Compilation will be much faster if there are many blocks, but no
get_tuple_element instructions.
Reported-by: Michał Muskała
|
|
Fix internal consistency failure caused by beam_except
|
|
|
|
Fix spec for erl_epmd:port_please
|
|
|
|
|
|
Ignore the option 'ipv6_host_with_brackets' when formatting
addresses to be used in lower level functions.
Change-Id: I3b7b276b37fe129ade9208519bff226e17ae7c57
|
|
|
|
* sverker/port-control-badarg/OTP-15555:
erts: Add doc warnings for erlang:port_command|call|control
erts: Add magic port control numbers
|
|
Fix a bug where the number of live registers in a `bs_get_tail`
instruction was too low.
Consider this example:
-export([bs_get_tail/2]).
bs_get_tail(Bin, Config) ->
bs_get_tail_1(Bin, 0, 0, Config).
bs_get_tail_1(<<_:32, Rest/binary>>, Z1, Z2, F1) ->
{Rest,Z1,Z2,F1}.
`beam_validator` would emit the following diagnostics:
t: function bs_get_tail_1/4+2:
Internal consistency check failed - please report this bug.
Instruction: {func_info,{atom,t},{atom,bs_get_tail_1},4}
Error: {uninitialized_reg,{x,3}}:
Here is the part of the code that generates the `function_clause`
exception before the optimization:
{test_heap,6,4}.
{put_list,{x,3},nil,{x,2}}.
{put_list,{integer,0},{x,2},{x,2}}.
{put_list,{integer,0},{x,2},{x,2}}.
{bs_set_position,{x,1},{x,0}}.
{bs_get_tail,{x,1},{x,0},3}. %3 live registers.
{test_heap,2,3}.
{put_list,{x,0},{x,2},{x,1}}.
{move,{atom,function_clause},{x,0}}.
{line,[{location,"t.erl",8}]}.
{call_ext_only,2,{extfunc,erlang,error,2}}.
The `bs_get_tail` instruction expects that 3 registers will be live
at this point. `beam_except` rewrites the code like this:
{bs_set_position,{x,1},{x,0}}.
{bs_get_tail,{x,1},{x,0},3}. %Still 3. Too low.
{move,{integer,0},{x,1}}.
{move,{integer,0},{x,2}}.
{jump,{f,3}}.
Now the number of live registers in `bs_get_tail` is too low,
because the `{x,3}` register will become undefined.
This commit adds code to update the number of live registers
in the `bs_get_tail` instruction, producing this code:
{bs_set_position,{x,1},{x,0}}.
{bs_get_tail,{x,1},{x,0},4}. %Adjusted to 4.
{move,{integer,0},{x,1}}.
{move,{integer,0},{x,2}}.
{jump,{f,3}}.
|
|
* maint:
Eliminate bogus warning when using tuple calls
|
|
There would be a bogus warning when compiling the following
function with the `tuple_calls` option:
dispatch(X) ->
(list_to_atom("prefix_" ++ atom_to_list(suffix))):doit(X).
The warning would look like this:
no_file: this expression will fail with a 'badarg' exception
https://bugs.erlang.org/browse/ERL-838
|
|
Enhance optimization of function_clause exceptions
|
|
* peterdmv/ssl/improve-logging:
ssl: Improve ssl_logger
Change-Id: I3b181ed527ce210af6c4a7576576fa522fb20767
|
|
* peterdmv/ssl/server-send-finished:
ssl: Fix dialyzer warnings
ssl: Add 'Finished'
ssl: Use HKDF hash function in Transcript-Hash
ssl: Improve test of 1-RTT handshake
ssl: Update certificate_verify
ssl: Update function build_content
ssl: Fix encoding of the Certificate message
ssl: Add EncryptedExtensions
ssl: Fix encoding of empty extensions
ssl: Fix key schedule and traffic keys
ssl: Encode/decode CertificateVerify
Change-Id: Ie525de276ca4ebd9f9fb0fbdc9dc3822f91834e0
|
|
* peterdmv/crypto/fix-type-specs:
crypto: Fix type spec rsa_sign_verify_opt()
Change-Id: Ib7c46c850f29d583a645e78a7e87f334c784518d
|
|
Add lib/compiler/scripts/smoke
|
|
|
|
ssl: Correct check for delayed close due to undliverd data
|
|
* maint:
ssl: Improve openssl interop tests
Change-Id: I5eec73687e9693ab5b08953c5e3db0d09cfd1690
|
|
* peterdmv/ssl/improve_openssl_interop_tests:
ssl: Improve openssl interop tests
Change-Id: I65b63ddb8c8948d246e341f8c821b3b499507cb6
|
|
It accepts both atoms and strings for the node and host name,
plus IP tuples for the host name.
|
|
Improve API and delay creation of map arguments for ?LOG_DEBUG
macro.
Change-Id: I6956112fe64e599d33d83dfdd710cad53b8449e1
|
|
Add `lib/compiler/scripts/smoke` for smoke testing the compiler (that
is, test that the compiler does not crash during compilation).
`smoke` first installs Elixir and mix. It then uses `mix` to download
a number of `hex` packages and compile them.
We don't intend to use `smoke` in our daily builds or Travis, but to run
it manually during compiler development.
|
|
There is an optimization for reducing the number of instructions needed
to generate a `function_clause`. After the latest improvements of the
type optimization pass, that optimization is not always applied.
Here is an example:
-export([foo/3]).
foo(X, Y, Z) ->
bar(a, X, Y, Z).
bar(a, X, Y, Z) when is_tuple(X) ->
{X,Y,Z}.
Note that the compiler internally adds a clause to each function to
generate a `function_clause` exception. Thus:
bar(a, X, Y, Z) when is_tuple(X) ->
{X,Y,Z};
bar(A1, A2, A3, A4) ->
erlang:error(function_clause, [A1,A2,A3,A4]).
Optimizations will rewrite the code basically like this:
bar(_, X, Y, Z) when is_tuple(X) ->
{X,Y,Z};
bar(_, A2, A3, A4) ->
erlang:error(function_clause, [a,A2,A3,A4]).
Note the `a` as the first element of the list of arguments. It
will prevent the optimization of the `function_clause` exception.
The BEAM code for `bar/4` looks like this:
{function, bar, 4, 4}.
{label,3}.
{line,[{location,"t.erl",8}]}.
{func_info,{atom,t},{atom,bar},4}.
{label,4}.
{'%',{type_info,{x,0},{atom,a}}}.
{test,is_tuple,{f,5},[{x,1}]}.
{test_heap,4,4}.
{put_tuple2,{x,0},{list,[{x,1},{x,2},{x,3}]}}.
return.
{label,5}.
{test_heap,8,4}.
{put_list,{x,3},nil,{x,0}}.
{put_list,{x,2},{x,0},{x,0}}.
{put_list,{x,1},{x,0},{x,0}}.
{put_list,{atom,a},{x,0},{x,1}}.
{move,{atom,function_clause},{x,0}}.
{line,[{location,"t.erl",8}]}.
{call_ext,2,{extfunc,erlang,error,2}}.
The code after label 5 is the clause that generates the
`function_clause` exception.
This commit generalizes the optimization so that it can be applied for
this function:
{function, bar, 4, 4}.
{label,3}.
{line,[{location,"t.erl",8}]}.
{func_info,{atom,t},{atom,bar},4}.
{label,4}.
{'%',{type_info,{x,0},{atom,a}}}.
{test,is_tuple,{f,5},[{x,1}]}.
{test_heap,4,4}.
{put_tuple2,{x,0},{list,[{x,1},{x,2},{x,3}]}}.
return.
{label,5}.
{move,{atom,a},{x,0}}.
{jump,{f,3}}.
For this particular function, it would be safe to omit the
`move` instruction before the `{jump,{f,3}}` instruction, but
it would not be safe in general to omit `move` instructions.
|
|
* john/compiler/refactor-validator-type-mgmt:
beam_validator: Add explicit assertions for fragile terms
beam_validator: Refactor type management
|
|
openssl 1.1.x changed the default ECC curves that made testcases
fail in the ECC suite. openssl s_server and s_client sent
'Illegal Parameter' alert when the CertificateVerify (client) or
ServerKeyExchange (server) message was signed with a curve that
was not present in openssl's default ECC curve list (x25519,
secp256r1, secp521r1, secp384r1, brainpoolP256r1, brainpoolP384r1,
brainpool512r1).
This commit changes the default curve of make_ec_cert_chains to
'secp256r1' and explicitly configures the default curve in
those testcases where the default curve of the ssl application
is expected.
Change-Id: I81ebe1a30b8f863b0e2836b1dad3d8bc767cc47e
|