Age | Commit message (Collapse) | Author |
|
When attempting to eliminate the move/2 instruction in the following
code:
{bif,self,{f,0},[],{x,0}}.
{move,{x,0},{x,1}}.
.
.
.
{put_tuple,2,{x,1}}.
{put,{atom,ok}}.
{put,{x,0}}.
beam_block would produce the following unsafe code:
{bif,self,{f,0},[],{x,1}}.
.
.
.
{put_tuple,2,{x,1}}.
{put,{atom,ok}}.
{put,{x,1}}.
It is unsafe because the tuple is self-referential.
The following code:
{put_list,{y,6},nil,{x,4}}.
{move,{x,4},{x,5}}.
{put_list,{y,1},{x,5},{x,5}}.
.
.
.
{put_tuple,2,{x,6}}.
{put,{x,4}}.
{put,{x,5}}.
would be incorrectly transformed to:
{put_list,{y,6},nil,{x,5}}.
{put_list,{y,1},{x,5},{x,5}}.
.
.
.
{put_tuple,2,{x,6}}.
{put,{x,5}}.
{put,{x,5}}.
(Both elements in the built tuple get the same value.)
|
|
|
|
Matching can be done on any terms.
|
|
* maint:
kernel: Correct contracts and a bug in group_history
stdlib: Correct contracts
dialyzer: Optimize handling of a lot of warnings
Conflicts:
lib/kernel/src/erl_boot_server.erl
|
|
* hasse/kernel-stdlib/fix_contracts/OTP-14889:
kernel: Correct contracts and a bug in group_history
stdlib: Correct contracts
dialyzer: Optimize handling of a lot of warnings
|
|
|
|
Make sure that there is the correct number of put/1 instructions
following put_tuple/2. Also make it illegal to reference the
register for the tuple being built in a put/1 instruction.
That is, beam_validator will now issue a diagnostice for the the
following code:
{put_tuple,1,{x,0}}.
{put,{x,0}}.
|
|
|
|
|
|
If the number of warnings is huge the '--'/2 operator is slow.
|
|
Consider the following function:
function({function,Name,Arity,CLabel,Is0}, Lc0) ->
try
%% Optimize the code for the function.
catch
Class:Error:Stack ->
io:format("Function: ~w/~w\n", [Name,Arity]),
erlang:raise(Class, Error, Stack)
end.
The stacktrace is retrieved, but it is only used in the call
to erlang:raise/3. There is no need to build a stacktrace
in this function. We can avoid the building if we introduce
an instruction called raw_raise/3 that works exactly like
the erlang:raise/3 BIF except that its third argument must
be a raw stacktrace.
|
|
* bjorn/erts/beam_debug:
beam_debug: Fix printing of f operand for catch_yf
beam_debug: Print out strings for bs_match_string/bs_put_string
beam_debug: Print the MFA in the i_make_fun/2 instruction
|
|
* maint:
ErLLVM: Preserve precise BEAM tailcall semantics
observer: Fix change accum
Remove double calls
observer: Don't crash for late messages
observer: Optimize tv tab for many tables
|
|
ErLLVM: Preserve precise BEAM tailcall semantics
OTP-14886
|
|
* dgud/observer/opt-tv-tab/OTP-14856:
observer: Fix change accum
Remove double calls
observer: Don't crash for late messages
observer: Optimize tv tab for many tables
|
|
Fix getenv usage.
And remove set path it is automagically done by driver interface.
|
|
* ingela/ssl/no-chacha-default-for-now/ERL-538/OTP-14882:
ssl: Remove chacha ciphers form default for now
|
|
We have discovered interoperability problems, ERL-538, that we
believe needs to be solved in crypto.
|
|
* ingela/ssl/remove-3des-from-default/OTP-14768:
ssl: Remove 3DES cipher suites from default
|
|
The BEAM compiler chooses not to perform tailcall optimisations for some
calls in tail position, for example to some built-in functions. However,
when the ErLLVM HiPE backend is used, LLVM may choose to perform
tailcall optimisation on these calls, breaking the expected semantics.
To preserve the precise semantics exhibited by BEAM, the 'notail'
marker, present in LLVM since version 3.8, is added to call instructions
that BEAM has not turned into tail calls, which inhibits LLVM from
performing tail-call optimisation in turn.
|
|
* maint:
dialyzer: Fix bsl/2 bug
|
|
* hasse/dialyzer/fix_bsl:
dialyzer: Fix bsl/2 bug
|
|
|
|
|
|
|
|
sys_core_bsm: Rearrange arguments to enable delayed sub binary creation
|
|
* bjorn/erts/optimize-utf8/OTP-14774:
Optimize matching of an 'utf8' segment in the binary syntax
|
|
Matching out an 8-bit integer is faster than matching out
an utf8-encoded code point, even if the value of the code
point is less than 128. The reason is that matching out
an 8-bit integer is specially optimized to avoid a function
call. Do a similar optimization for matching out an utf8
segment.
|
|
|
|
|
|
|
|
particularly slow erlc when compiler is hipe compiled.
hipe_unified_loader:load did not patch external call sites
and instead caused a double hipe mode switch per call.
hipe_unified_loader:load is only used
for early modules first loaded as beam
and by code:atomic_load and friends.
|
|
|
|
|
|
* fhunleth/binary_to_integer_chec/PR-1671/OTP-14879:
Fail if ':' is passed to binary_to_integer/2
|
|
Fix typo in PKCS-7.asn1
OTP-14878
|
|
* maint:
stdlib: Garbage the shell's evaluator process more often
|
|
* hasse/stdlib/fix_shell_evaluator:
stdlib: Garbage the shell's evaluator process more often
|
|
* maint:
asn1_SUITE: Fix failure in xref_export_all/1
|
|
The variable 'S' was used twice. If the test case failed
because there were unused functions in asn1_SUITE, there
would be an ugly badmatch exception instead of the intended
nice error message.
|
|
|
|
Fix a broken erlang:trace/3 link in doc
|
|
|
|
|
|
which is has been since 3d21f793538927ae88f78504a11dd898e8ca1a7a
|
|
Conflicts:
lib/stdlib/test/stdlib_bench_SUITE.erl
|
|
|
|
A minor fix.
If the Erlang shell saves no results (history(0) or results(0)), the
evaluator process now garbage collects itself. This means that any
huge binaries created by the evaluation are reclaimed faster than
before.
|
|
|
|
Argument order can prevent the delayed sub binary creation.
Here is an example directly from the Efficiency Guide:
non_opt_eq([H|T1], <<H,T2/binary>>) ->
non_opt_eq(T1, T2);
non_opt_eq([_|_], <<_,_/binary>>) ->
false;
non_opt_eq([], <<>>) ->
true.
When compiling with the bin_opt_info option, there will be a
suggestion to change the argument order.
It turns out sys_core_bsm can itself change the order, not the
order of the arguments of themselves, but the order in which
the arguments are matched. Here is how it can be rewritten in
pseudo Core Erlang code:
non_opt_eq(Arg1, Arg2) ->
case < Arg2,Arg1 > of
< <<H1,T2/binary>>, [H2|T1] > when H1 =:= H2 ->
non_opt_eq(T1, T2);
< <<_,T2/binary>ffff>, [_|T1] > ->
false;
< <<>>, [] >> ->
true
end.
When rewritten like this, the bs_start_match2 instruction will be
the first instruction in the function and it will be possible to
store the match context in the same register as the binary
({x,1} in this case) and to delay the creation of sub binaries.
The switching of matching order also enables many other simplifications
in sys_core_bsm, since there is no longer any need to pass the position
of the pattern as an argument.
We will update the Efficiency Guide in a separate branch before the
release of OTP 21.
|