Age | Commit message (Collapse) | Author |
|
* bjorn/compiler/map-core-syntax/OTP-12454:
Make the syntax for map pairs readable
|
|
* maint:
Update primary bootstrap
Correct unsafe optimization of '==' and '/='
Conflicts:
bootstrap/lib/compiler/ebin/sys_core_fold.beam
|
|
|
|
* bjorn/compiler/maps-comparison/OTP-12456:
Correct unsafe optimization of '==' and '/='
|
|
Since '=:=' is cheaper than '==', the compiler tries to replace
'==' with '=:=' if the result of comparison will be the same.
As an example:
V == {a,b}
can be rewritten to:
V =:= {a,b}
since the literal on the right side contains no numeric values
that '==' would compare differently to '=:='.
With the introduction of maps, we will need to take them into
account. Since the comparison of maps is planned to change in 18.0,
we will be very conservative and only do the optimization if
both keys and values are non-numeric.
|
|
* henrik/fix-master:
fix faulty merge
|
|
|
|
Conflicts:
OTP_VERSION
erts/emulator/sys/unix/sys.c
erts/vsn.mk
|
|
|
|
* maint:
Update primary bootstrap
Be more careful about map patterns when evalutating element/2
Do not convert map patterns to map expressions
Conflicts:
bootstrap/lib/compiler/ebin/sys_core_fold.beam
lib/compiler/test/match_SUITE.erl
|
|
|
|
* bjorn/compiler/map-bugs/OTP-12451:
Be more careful about map patterns when evalutating element/2
Do not convert map patterns to map expressions
|
|
We must not convert map patterns to map expressions.
|
|
In code such as:
case {a,Map} of
{a,#{}}=T ->
T
end
we must NOT rewrite a map pattern to a map expression like this:
case Map of
#{} ->
{a,#{}}
end
because the pattern '#{}' will match any map, but the expression
'#{}' will construct an empty map.
|
|
|
|
* ia/ssl/self-signed-root/OTP-12449:
ssl: Remove selfsigned anchor certificate from the certificate chain
|
|
A selfsigned trusted anchor should not be in the certifcate chain passed to
the certificate path validation.
Conflicts:
lib/ssl/src/ssl_certificate.erl
|
|
|
|
|
|
* egil/fix-getifaddrs-realloc/OTP-12445:
erts: Fix getifaddrs realloc ptr mismatch
|
|
* egil/fix-child_setup-close/OTP-12446:
erts: Use closefrom() if available when closing fds
erts: Don't close all fds twice in child_setup
|
|
* egil/fix-crashdump-epmd/OTP-12447:
erts: Check driver version before assigning callback
erts: Don't lookup invalid port for crashdump handling
erts: Reserve a file descriptor for the crashdump file
erts: Use emergency close to close epmd
erts: Extend driver interface with emergency_close
|
|
'ia/maint/inets/invalid-content-length/mod_alias_https/consistent_keep_alive_timeout/OTP-12429/OTP-12436' into maint-17
* ia/maint/inets/invalid-content-length/mod_alias_https/consistent_keep_alive_timeout/OTP-12429/OTP-12436:
inets: Consistent view of configuration parameter keep_alive_timeout
inets: httpd - mod_alias now handles https URIs
inets: httpd - Sanity check of content-length header
|
|
Use the same syntax for map pairs in Core Erlang code as in the
Erlang Code. This Erlang code:
M#{x:=42,y=>1}
will look like this in Core Erlang:
~{'x':=42,'y'=>1|M}~
|
|
|
|
|
|
* mikpe/hipe-code-alloc-fixes:
hipe: improve error handling at code allocation failure
hipe: remove two obsolete BIFs
hipe: remove HIPE_ALLOC_CODE macro
|
|
When a buffer was exhausted and subsequently a realloc, we could get
an invalid pointer.
For this to occur we would need to have a realloc to lower adresses.
The symptom would be garbage returned from erlang:port_control(Port, 25, [])
(prim_inet:getifaddrs(Port) resulting in a badarg) or a segmentation fault.
|
|
Gracefully handle invalid content-lenght headers instead of
crashing in list_to_integer.
|
|
|
|
* 0xAX/inets-typo-fix:
lib/inets: fix typo in httpd_load_test example
|
|
|
|
* bjorn/compiler/map-fixes:
cerl: Remove a clause in fold_map_pairs/3 that will never be reached
Move grouping of map constructions from v3_core to v3_kernel
core_pp: Correct printing of map literals
Strengthen and modernize compile_SUITE
core_parse: Always fold literal conses
cerl: Make sure that we preserve the invariants for maps
cerl_clauses: Fix indentation
sys_core_fold: Strengthen optimization of letrecs in effect context
Fix handling of binary map keys in comprehensions
core_lib: Teach is_var_used/2 to handle keys in map patterns
warnings_SUITE: Eliminate compiler warning for a shadowed variable
lc_SUITE: Add shadow/1
Modernize lc_SUITE
|
|
* bjorn/compiler/coverage:
sys_core_fold: Remove uncovered clauses matching #c_map{}
beam_z: Remove the uncovered to_typed_literal/1 function
Speed up running of compiler test suites in coverage mode
|
|
|
|
When translating a function with map construction:
f(A) ->
B = b,
C = c,
#{A=>1,B=>2,C=>3}.
v3_core would break apart the map construction into three
parts because of the way the map instructions in BEAM work --
variable keys need to be in their own instruction.
In the example, constant propagation will turn two of the
keys to literal keys. But the initial breaking apart will
not be undone, so there will still be three map constructions:
'f'/1 =
fun (_cor0) ->
let <_cor3> = ~{::<_cor0,1>}~
in let <_cor4> = ~{::<'b',2>|_cor3}~
in ~{::<'c',3>|_cor4}~
It would be possible to complicate the sys_core_fold pass
to regroup map operations so that we would get:
'f'/1 =
fun (_cor0) ->
let <_cor3> = ~{::<_cor0,1>}~
in ~{::<'b',2>,::<'c',3>|_cor3}~
A simpler way that allows to simplify the translation is
to skip the grouping in v3_core and translate the function
to:
'f'/1 =
fun (_cor0) ->
~{::<_cor0,1>,::<'b',2>,::<'c',3>}~
We will then let v3_kernel do the grouping while translating
from Core Erlang to Kernel Erlang.
|
|
A map key in a pattern would be incorrectly pretty-printed.
As an example, the pattern in:
x() ->
#{ #{ a => 3 } := 42 } = X.
would be pretty-printed as:
<~{~<~{~<'a',3>}~,42>}~
instead of:
<~{~<~{::<'a',3>}~,42>}~
When this problem has been corrected, the workaround for it in
cerl:ann_c_map/3 can be removed. The workaround was not harmless,
as it would cause the following map update to incorrectly succeed:
(#{})#{a:=1}
|
|
sys_core_fold:eval_element/3 attempts to evaluate calls to element/2
at compile time or to warn when the call will obviously fail. For
example:
element(1, [a])
will obviously fail and eval_element/3 will produce a warning.
eval_element/3 uses the helper functions is_not_integer/1 and
is_not_tuple/1 to test whether the arguments are known to be
incorrect. The clauses that attempt to match #c_map{} in those
helper function will never be executed, because #c_map{} will
never occur directly in an argument for a function call.
For example, code such as:
element(1, #{a=>Val})
will be translated to:
let <NewVar> = #{a=>Val}
in element(1, NewVar)
since maps are not considered safe (some map operations may
cause an exception at run time).
|
|
closefrom() was only used in the vfork() case before, now also
used in the fork() case.
|
|
The commit c2b4eab25c907f453a394d382c04cd04e6c06b49 introduced an error
in which child_setup erroneously tried to close all file descriptors twice.
|
|
|
|
|
|
When we compile from Core Erlang, do it with and without
Core Erlang optimizations to ensure that we are not dependent
on the optimizations always being run.
|
|
v3_core is careful to always create literals whenever possible.
Correct core_parse so it, too, always creates literals out
of literal conses. With that correction, we can remove the
workaround in sys_core_fold (introduced in 26a5dea3cb5e101)
that handles non-literal flags in a binary.
|
|
It was a workaround for a bug that has been fixed.
|
|
I have spent too much time lately waiting for 'cover' to finish,
so now its time to optimize the running time of the tests suite
in coverage mode.
Basically, when 'cover' is running, the test suites would not
run any tests in parallel. The reason is that using too many
parallel processes when running 'cover' would be slower than
running them sequentially. But those measurements were made
several years ago, and many improvements have been made to
improve the parallelism of the run-time system.
Experimenting with the test_lib:p_run/2 function, I found that
increasing the number of parallel processes would speed up the
self_compile tests cases in compilation_SUITE. The difference
between using 3 processes or 4 processes was slight, though,
so it seems that we should not use more than 4 processes when
running 'cover'.
We don't want to change test_lib:parallel/0, because there is
no way to limit the number of test cases that will be run in
parallel by common_test. However, there as test suites (such as
andor_SUITE) that don't invoke the compiler at run-time. We can
run the cases in such test suites in parallel even if 'cover'
is running.
|
|
|
|
The hipe_bifs:make_native_stub/2 and hipe_bifs:get_emu_address/1
BIFs were originally used by hipe_unified_loader.erl, but the
code been obsolete and disabled for ages.
Remove the BIFs and all references to them.
In hipe_unified_loader.erl, remove the no-op emu_make_stubs/1
function.
|
|
The HIPE_ALLOC_CODE macro in the HiPE runtime was introduced
ages ago to allow x86 and amd64 to switch from erts_alloc()
to an mmap() implementation with proper flag setting. Nowadays
the macro is identical on all platforms, and serves no purpose.
Delete the macro, move the hipe_alloc_code() prototype to
hipe_arch.h, and simplify hipe_bifs_enter_code_2().
|
|
* vladdu/edoc_remove_packages/OTP-12431:
[edoc] remove functionality related to packages
[edoc] add test for nested source directories
|