Age | Commit message (Collapse) | Author |
|
The clause cannot possibly match, because there will always be
a {bif,...} clause that will match before reaching the fclearerror
instruction.
|
|
30cc5c90 changed the internal representation of catch and
try...catch, but beam_type was not updated in one place.
|
|
When the bit syntax is used to match a single binary literal, the bit
syntax instructions will be replaced with a comparison to a binary
literal. The only problem is that the bs_context_to_binary instruction
will not be eliminated.
Example:
f(<<"string">>) ->
ok.
This function would be translated to:
{function, f, 1, 2}.
{label,1}.
{line,...}.
{func_info,...}.
{label,2}.
{test,is_eq_exact,{f,3},[{x,0},{literal,<<"string">>}]}.
{move,{atom,ok},{x,0}}.
return.
{label,3}.
{bs_context_to_binary,{x,0}}.
{jump,{f,1}}.
The bs_context_to_binary instruction serves no useful purpose,
since {x,0} can never be a match context. Eliminating the
instruction, the resulting code will be:
{function, f, 1, 2}.
{label,1}.
{line,...}.
{func_info,...}.
{label,2}.
{test,is_eq_exact,{f,1},[{x,0},{literal,<<"string">>}]}.
{move,{atom,ok},{x,0}}.
return.
|
|
In a select_val instruction, values associated with a label
which is the same as the failure label can be removed. We
already do this optimization in beam_clean, but it is better
do this sort of optimization before the beam_jump pass.
Also rewrite a select_val instruction with a single value
to is_eq_exact instruction followed by a jump instruction.
|
|
In the future we might want to add more bit syntax optimizations,
but beam_block is already sufficiently complicated. Therefore, move
the bit syntax optimizations out of beam_block into a separate
compiler pass called beam_bs.
|
|
Knowing that a BIF returns an integer makes it possible to
replace '==' with the cheaper '=:=' test.
|
|
Consider the following function:
f(Bin, Bool) ->
case Bin of
<<Val:16/binary,_/binary>> when Bool ->
Val
end.
Simplified, the generated code looks like:
bs_start_match2 Fail Live Bin => Bin
bs_get_integer2 Fail Live Bin size=Sz unit=1 => Val
bs_skip_bits2 Fail Bin size=all unit=8
is_eq_exact Fail Bool true
The code generator will replace the bs_skip_bits2 instruction with
a bs_test_unit instruction if it can be clearly seen that the
context register will not be used again. In this case, it is not
obvious without looking at the code at the Fail label.
However, it turns out that bs_test_unit instruction is always
safe beacuse of the way v3_kernel compiles pattern matching.
It doesn't matter whether the match context will be used again.
If it will be used again, the position in it will *not* be used.
Instead, a bs_restore2 instruction will restore one of the saved
instructions.
|
|
d0784035ab fixed a problem with register corruption. Because of
that, opt_moves/2 will never be asked to optimize instructions with
more than two destination registers. Therefore, to regain full
coverage of beam_block, remove the final clause in opt_moves/2.
|
|
* maint:
Update sasl vsn to 2.6
|
|
* siri/sasl-vsn-OTP-18.1:
Update sasl vsn to 2.6
|
|
|
|
* bjorn/compiler/remove-deprecated/OTP-12979:
core_lib: Remove previously deprecated functions
|
|
* maint:
Update application versions
|
|
* hb/app_vsn:
Update application versions
|
|
|
|
* ia/ssl/soft-upgrade:
ssl: Correct soft upgrade test
|
|
Soft upgrade test did not work as expected due to that the upgrade
frame work keeps the control of the test case process to itself,
so we need a proxy process to receive messages from ssl test framework.
|
|
|
|
|
|
* ia/inets/next/version:
inets: Prepare for release
|
|
* ia/ssl/cuddle_tests:
ssl: Timeout tuning
|
|
* maint:
stdlib: Fix leaking files after error_logger:logfile(close)
|
|
* dgud/stdlib/fix-file-error_log-leak:
stdlib: Fix leaking files after error_logger:logfile(close)
|
|
|
|
* maint:
erts: Make sure to deal with EINTR write failures
|
|
* lukas/erts/ttsl_eintr/OTP-12987:
erts: Make sure to deal with EINTR write failures
|
|
|
|
* siri/cuddle-maint:
Exclude ose application from upgrade test
|
|
|
|
|
|
|
|
Introduced when changing state from tuple to record.
|
|
* goertzenator/enif_make_pid-unused_param:
fix unused parameter warning in enif_make_pid
OTP-12989
|
|
* mikpe/erts-binary_to_integer-fix:
erts: fix binary_to_integer boundary case
OTP-12988
|
|
* leoliu/export-catch_exception:
Export shell:catch_exception/1 as documented
|
|
* maint:
stdlib: Update application version
|
|
* hb/stdlib/update_app_vsn:
stdlib: Update application version
|
|
|
|
* maint:
Update application versions
|
|
* hb/update_version_numbers:
Update application versions
|
|
|
|
|
|
* ia/odbc/next-version:
odbc: Prepare for release
|
|
|
|
|
|
|
|
* ia/public_key/next-version:
public_key: Document enhancements
|
|
OTP-12986
|
|
* maint:
mnesia: Improve index updates
wx: Fix wxAuiManager:getAllPanes/1
wx: Add missing aui functionality
|
|
* dgud/wx/add-missing-aui-func/OTP-12961:
wx: Fix wxAuiManager:getAllPanes/1
wx: Add missing aui functionality
|