aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2019-08-09erts: Remove size check in bs_start_matchJohn Högberg
The size check is redundant now that all binaries are guaranteed to be small enough that their size in bits fits into a word.
2019-08-09erts: Disallow binaries whose size in bits exceeds UWORD_MAXJohn Högberg
These have never worked in binary matching (including sub-binaries extracted from them) so it's hard to justify their existence. They also make a future migration of binary sizes from bytes to bits problematic, so we may as well change it ahead of time. This is potentially incompatible on 32-bit platforms where a NIF or driver could allocate 512MB+ binaries, but allocations that large should be expected to fail anyway.
2019-08-09Merge branch 'maint'Dan Gudmundsson
* maint: mnesia: Bump protocol version mnesia: Introduce sync_asym_trans protocol observer: Fixes for html viewers observer: Support darkmode gui
2019-08-09Merge branch 'dgud/observer/fix-darkmode/OTP-15916' into maintDan Gudmundsson
* dgud/observer/fix-darkmode/OTP-15916: observer: Fixes for html viewers observer: Support darkmode gui
2019-08-09Merge branch 'dgud/mnesia/sticky-bug/ERL-768/OTP-15979' into maintDan Gudmundsson
* dgud/mnesia/sticky-bug/ERL-768/OTP-15979: mnesia: Bump protocol version mnesia: Introduce sync_asym_trans protocol
2019-08-09Merge branch 'maint'Dan Gudmundsson
* maint: mnesia: Fix deadlock caused by add_table_copy
2019-08-09Merge branch 'dgud/mnesia/add_table_copy_deadlock/ERL-872/OTP-15933' into maintDan Gudmundsson
* dgud/mnesia/add_table_copy_deadlock/ERL-872/OTP-15933: mnesia: Fix deadlock caused by add_table_copy
2019-08-09Update primary bootstrapBjörn Gustavsson
2019-08-09Merge branch 'maint'Björn Gustavsson
* maint: Update primary bootstrap
2019-08-09Update primary bootstrapBjörn Gustavsson
2019-08-08Document file:open/2 monitors the owner processJosé Valim
The documentation states that file:open/2 is linked to the owner process but that's not true. A monitor is used instead (it has been so for a while).
2019-08-08Merge branch 'maint'John Högberg
* maint: erts: Escape atoms in erlang:fun_to_list/1
2019-08-08Merge branch 'john/erts/fun_to_list-escaping/OTP-15975/ERL-1009' into maintJohn Högberg
* john/erts/fun_to_list-escaping/OTP-15975/ERL-1009: erts: Escape atoms in erlang:fun_to_list/1
2019-08-08Merge branch 'john/compiler/fix-bs_skip-succeeded-oddity'John Högberg
* john/compiler/fix-bs_skip-succeeded-oddity: compiler: Fix awkward match context substitution beam_ssa_lint: Use #b_var{} instead of variable names
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-07compiler: Fix awkward match context substitutionJohn Högberg
This worked out by accident since codegen never actually looks at the arguments for 'succeeded'; it just assumes that they reference the preceding instruction.
2019-08-07beam_ssa_lint: Use #b_var{} instead of variable namesJohn Högberg
2019-08-07Merge branch 'maint'Dan Gudmundsson
* maint: Discard continuous delivery history
2019-08-07Discard continuous delivery historyDan Gudmundsson
Repository grows too large.
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-07Print last lines of configure logDan Gudmundsson
So we can see in travis which applications or options that is disabled, (and/or other config problems)
2019-08-07Force xenial builds in travisDan Gudmundsson
So we know that libwxgtk3.0 exists.
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 'lukas/os_mon/sscanf_Lu/OTP-15974' into maintLukas Larsson
* lukas/os_mon/sscanf_Lu/OTP-15974: os_mon: Fix sscanf to use %llu instead of gnu specific %Lu
2019-08-07erts: Escape atoms in erlang:fun_to_list/1John Högberg
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-06otp: Add make dialyzer and make xmllint documentationLukas Larsson
2019-08-06Merge branch 'maint'Lukas Larsson
2019-08-06Merge pull request #2319 from shionryuu/fix_logger_disk_log_h_docLukas Larsson
Fix syntax error in logger_disk_log_h.xml
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'Lukas Larsson
2019-08-05Merge pull request #2333 from matwey/fix_ethr_x86_cpuid_asm/OTP-15971Lukas Larsson
erts: Do not use named no_cpuid label in asm
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