aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2019-08-08Merge branch 'john/compiler/remove-dead-code-beam_ssa_type'John Högberg
* john/compiler/remove-dead-code-beam_ssa_type: beam_ssa_type: Remove unreachable code
2019-08-07Merge pull request #2226 from josevalim/jv-expand-squeeze-literal-integer-utf8John Högberg
Expand and squeeze literal integers/utf8 bin segments
2019-08-07Merge branch 'maint'Dan Gudmundsson
* maint: Update java doc Print last lines of configure log Force xenial builds in travis
2019-08-07Update java docDan Gudmundsson
Replace deprecated <tt> with <code>
2019-08-07beam_ssa_type: Remove unreachable codeJohn Högberg
Now that impossible branches are skipped altogether, it's no longer possible to encounter get_tuple_element with a 'none' argument.
2019-08-07Merge branch 'maint'Lukas Larsson
2019-08-07Merge branch 'john/compiler/validator-improve-try_case-handling'John Högberg
* john/compiler/validator-improve-try_case-handling: beam_validator: Disallow jumps to try_case handlers
2019-08-07Merge branch 'john/compiler/explicit-call-exceptions'John Högberg
* john/compiler/explicit-call-exceptions: compiler: Simplify set_tuple_element optimization compiler: Make 'succeeded' optimization more general compiler: Simplify call type optimization compiler: All calls may throw, so they all need success checks erts_debug: Turn off unsafe optimizations in test case
2019-08-06os_mon: Fix sscanf to use %llu instead of gnu specific %LuLukas Larsson
For instance musl does not recognize the %L modifier.
2019-08-06Merge branch 'lukas/otp/add-dialyzer-make-target/OTP-15915'Lukas Larsson
* lukas/otp/add-dialyzer-make-target/OTP-15915: otp: Add make dialyzer and make xmllint documentation Add 'make dialyzer' target to top and apps
2019-08-06Merge branch 'maint'Lukas Larsson
2019-08-06Fix syntax error in logger_disk_log_h.xmlShion Ryuu
2019-08-06beam_validator: Disallow jumps to try_case handlersJohn Högberg
By keeping track of the tag types in the exception handler list, we can reject direct jumps to try_case handlers such as those provoked by OTP-15945.
2019-08-06compiler: Simplify set_tuple_element optimizationJohn Högberg
By removing 'succeeded' tests on setelement/3 when we know it succeeds, all sequences that are eligible for set_tuple_element will be nicely bundled in the same block, so we won't need to bother with special try/catch handling. The new version is slightly worse in the case where the first setelement/3 is used to infer the tuple size as that call will remain in its own block, but in practice this only occurs when the user manually spells them out and I couldn't find any examples of this in OTP or Elixir. It's equivalent for record updates.
2019-08-06compiler: Make 'succeeded' optimization more generalJohn Högberg
2019-08-06compiler: Simplify call type optimizationJohn Högberg
2019-08-06compiler: All calls may throw, so they all need success checksJohn Högberg
Only adding them when in try/catch worked, but made the exceptions implicit and forced all later optimization passes to keep them in mind. Making them explicit lets us simplify later passes.
2019-08-06erts_debug: Turn off unsafe optimizations in test caseJohn Högberg
The test case alters the return value of a function that the compiler expects will never return, resulting in undefined behavior. Note that the debugger (which may change variables/return values) is unaffected since the affected module is purged and "replaced" with an interpreted variant.
2019-08-05Merge branch 'maint'Björn Gustavsson
* maint: Ensure that the stack slots are initialized when matching maps
2019-08-05Merge branch 'bjorn/compiler/fix-stack-init/ERL-1017/OTP-15968' into maintBjörn Gustavsson
* bjorn/compiler/fix-stack-init/ERL-1017/OTP-15968: Ensure that the stack slots are initialized when matching maps
2019-08-05Ensure that the stack slots are initialized when matching mapsBjörn Gustavsson
When matching a map, the compiler could fail to generate code that would initialize all stack slots (Y registers) properly. Here is a general outline of code that *could* cause this problem: foo(Key, Map) -> Res = case Map of #{Key := Val} -> %% Do something with Val here. . . . #{} -> [] end, %% The stack slot for Val might not have been initialized %% here if the key was not present in the map. . . . %% Use Res. . . . The code generator would wrongly assume that the map matching would always initialize the stack slot, and if nothing else happened to force that stack slot to be initialized, it would remain uninitialized, which would likely crash the runtime system at the next garbage collection. `beam_validator` is supposed to find these kind of problems, but a bug in `beam_validator` prevented it from detecting this problem. https://bugs.erlang.org/browse/ERL-1017
2019-08-05Expand and squeeze literal integers/utf8 bin segmentsJosé Valim
This commit adds two operations when handling literal integers and literal utf8 segments in the v3_kernel pass. The first operation is to expand all literal integers with size more than 8 and literal utf8s into integers with size of 8 (and potentially an integer with size less than 8 at the end). This expansion simplifies the code in other operations inside v3_kernel and ensure they apply more consistently. For instance, literal binary matching now applies to both regular and utf8 strings. Furthermore, we can more efficiently group clauses. For instance, the following code: foo(<<$á/utf8, X/binary>>) -> foo(X); foo(<<$é/utf8, X/binary>>) -> foo(X); foo(<<>>) -> ok. Becomes a bs_get_integer_16 comparing 50089 and 50081, allowing us to skip the utf8 conversion at runtime. However, since expanding an integer of size 16 into two of size 8 can be less efficient when matching at runtime, later we do another pass, where we squeeze all of those integers together into an integer with maximum size of 24. This allows prefix matching, such as: foo(<<"aaaa", X/binary>>) -> foo(X); foo(<<"bbbb", X/binary>>) -> foo(X); foo(<<>>) -> ok. To run more than 2x faster (as long as all clauses match on a given prefix). Compilation times and binary size are roughly the same.
2019-08-05Merge branch 'maint'John Högberg
* maint: beam_validator: Values referenced by other values must be merged
2019-08-05Merge branch 'john/compiler/fix-delayed-type-inference/OTP-15954/ERL-995' ↵John Högberg
into maint * john/compiler/fix-delayed-type-inference/OTP-15954/ERL-995: beam_validator: Values referenced by other values must be merged
2019-08-02Merge pull request #2327 from josevalim/jv-faster-cerl-setsBjörn Gustavsson
Optimize is_subset and is_disjoint in cerl_sets
2019-08-02Merge branch 'maint'Björn Gustavsson
* maint: Avoid extremely long compilation times for huge functions
2019-08-02Merge pull request #2336 from ↵Björn Gustavsson
bjorng/bjorn/compiler/fix-slow-beam_ssa_dead/ERL-1014/OTP-15966 Avoid extremely long compilation times for huge functions
2019-08-02Merge branch 'maint'Björn Gustavsson
* maint: Fix compiler crash when compiling with +no_type_opt Eliminate a crash in the type optimizer pass
2019-08-02Merge branch 'bjorn/compiler/length-misuse/ERL-1013' of ↵Björn Gustavsson
https://github.com/bjorng/otp into maint OTP-15970 * 'bjorn/compiler/length-misuse/ERL-1013' of https://github.com/bjorng/otp: Eliminate a crash in the type optimizer pass
2019-08-02Merge branch 'bjorn/compiler/fix-no_type_opt/ERL-997' of ↵Björn Gustavsson
https://github.com/bjorng/otp into maint OTP-15969 * 'bjorn/compiler/fix-no_type_opt/ERL-997' of https://github.com/bjorng/otp: Fix compiler crash when compiling with +no_type_opt
2019-08-01Merge branch 'maint'Micael Karlberg
2019-08-01Merge branch 'bmk/snmp/20190731/correct_top_sup_stop' into maintMicael Karlberg
2019-08-01Avoid extremely long compilation times for huge functionsBjörn Gustavsson
Compiling this example takes less than a second for OTP 21: -define(B, {?A,?A,?A,?A,?A}). -define(C, {?B,?B,?B,?B,?B}). -define(D, {?C,?C,?C,?C,?C}). -define(E, {?D,?D,?D}). f() -> ?E = foo:bar(). The compilation time for OTP 22 is about 10 seconds. Most of the time is spent in `beam_ssa_dead`. This commit introduces several optimizations to bring the compilation time down to about a second. The most important of those optimizations is limiting the effort spent searching forward for a joining point for the success and failure labels for a two-way branch. This change is helped by the change of representation of variable sets from `ordsets` to `cerl_sets`. https://bugs.erlang.org/browse/ERL-1014
2019-08-01Merge branch 'maint'Micael Karlberg
2019-08-01Merge branch 'bmk/megaco/20190710/test_tweaking' into maintMicael Karlberg
2019-08-01Merge branch 'maint'Björn Gustavsson
* maint: Fix unsafe code sharing
2019-08-01Merge pull request #2329 from bkolobara/crypto/add_ed25519_ed448_to_generate_keyHans Nilsson
Add ed25519 & ed448 support to crypto:generate_key OTP-15967
2019-08-01Merge branch 'bjorn/compiler/fix-unsafe-sharing/OTP-15963' into maintBjörn Gustavsson
* bjorn/compiler/fix-unsafe-sharing/OTP-15963: Fix unsafe code sharing
2019-07-31[snmp] Fixed agent|manager top supervisor stopMicael Karlberg
2019-07-31Merge branch 'maint'Micael Karlberg
2019-07-31Merge branch 'bmk/snmp/manager/20190729/test_tweaking' into maintMicael Karlberg
2019-07-31[megaco|test] Add an event list to the test MGC/MGMicael Karlberg
To provide more info when analyzing failed test cases an "event" queue (of max size 10) is added to both the test MG and MGC. This event queue is printed when the process exist. Also, the multi_ack_timeout is wonky, so add anther platform (sunos) to the skip list...
2019-07-31Merge branch 'maint'Ingela Anderton Andin
2019-07-31ssl: Extend testsPéter Dimitrov
2019-07-31ssl: Fix better OpenSSL support in test frameworkIngela Anderton Andin
2019-07-31ssl: Avoid broken ALPN/NPN renegotiation in OpenSSLIngela Anderton Andin
All these test work fine with current OpenSSL master
2019-07-30Merge branch 'maint'Hans Nilsson
* maint: ssh: added log/4 ssh: Fix log problem in early stages of initialization ssh: Fix potential crash if failure in init of client
2019-07-30Merge branch 'hans/ssh/early_crash_fail_logging/ERL-990/OTP-15962' into maintHans Nilsson
* hans/ssh/early_crash_fail_logging/ERL-990/OTP-15962: ssh: added log/4 ssh: Fix log problem in early stages of initialization ssh: Fix potential crash if failure in init of client
2019-07-30[megaco|test] Fix copyright end dateMicael Karlberg
2019-07-30Fix test of x448 & x25519 curvesBernard Kolobara