aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2018-12-17Use microops for BIFsMichał Muskała
This allows bif1/2/3 to share the main part of the code. The price is that we always need to copy all three temporary registers when error handling in bodies, but that should be infrequent. Additionally it makes it a bit harder to read the disasembly since now the arguments to BIFs are in the reverse order.
2018-12-17Merge pull request #2057 from michalmuskala/mm/missing-annoBjörn Gustavsson
Add missing annotations in instrs.tab
2018-12-17Merge branch 'raimo/stdlib/sys-log-of-gen-in-terminate-report/OTP-15381'Raimo Niskanen
* raimo/stdlib/sys-log-of-gen-in-terminate-report/OTP-15381: sys:log timeout 0 events Filter gen_server State in crash sys:log Fix statement duplication Document system_events better Adjust sys:log(N, get) to documentation Unify system_events in gen_* Log code change Use from/1 type check Limit more error_logger terms Add client stacktrace Print sys:log in error report Optimize sys:handle_debug/4 Optimize sys:log Fix sys:log functionality Conflicts: lib/stdlib/doc/src/sys.xml
2018-12-14Merge branch 'maint'Raimo Niskanen
Conflicts: lib/ssl/src/ssl_connection.hrl lib/ssl/src/tls_connection.erl
2018-12-14Merge branch 'raimo/ssl/tls_dist-optimization' into maintRaimo Niskanen
* raimo/ssl/tls_dist-optimization: Tighten dist app data receive
2018-12-14Merge branch 'maint'Ingela Anderton Andin
Conflicts: lib/ssl/src/dtls_connection.erl lib/ssl/src/ssl_connection.erl lib/ssl/src/ssl_connection.hrl lib/ssl/src/tls_connection.erl lib/ssl/src/tls_record.erl
2018-12-14Merge branch 'ingela/ssl/optimize/OTP-15445' into maintIngela Anderton Andin
* ingela/ssl/optimize/OTP-15445: ssl: Fix test case ssl: Remove no longer needed functions ssl: Fix downgrade ssl: Remove checks and conversions not needed ssl: Use binary:copy/2 to avoid list overhead ssl: Remove unnecessary internal event ssl: Clean code ssl: Add static_env record
2018-12-14ssl: Fix test caseIngela Anderton Andin
packet raw is a stream, test code manged it packet oriented in the function active_raw.
2018-12-14Merge branch 'maint'Lukas Larsson
2018-12-14Merge branch 'lukas/stdlib/maps_iterator_docs' into maintLukas Larsson
2018-12-14Merge branch 'maint'Lukas Larsson
2018-12-14Merge branch 'lukas/erts/fix_lit_msg_copy_in_gc' into maintLukas Larsson
* lukas/erts/fix_lit_msg_copy_in_gc: erts: Use ptr_val for pointer in gc msg copy
2018-12-13erts: Fix possible heap corruption getting atomicsTomas Abrahamsson
Due to comparison as a signed integer, when getting an unsigned atomic in the range 2^63-1..2^64-1 (when the most significant bit was set), the heap could get corrupted when the integer was retrieved: hsz would get set to zero, but the code proceeded to build a bignum. Steps to reproduce (at least on x86_64): $ erl 1> A = atomics:new(1,[{signed,false}]). 2> atomics:put(A,1,18446744073709551615). 3> atomics:get(A,1). At the last step, the shell would print some garbage and hang.
2018-12-13erts: Fix warning and potential big-endian-bug in prim_fileSverker Eriksson
for set_permission and set_owner.
2018-12-13Merge branch 'maint'Sverker Eriksson
2018-12-13Merge branch 'sverker/add-since-doc/OTP-15460' into maintSverker Eriksson
* sverker/add-since-doc/OTP-15460: Fill in since for multi-clause functions in erlang.erl Fix since attribute for troubled function docs Add empty 'since' attribute for old modules and functions Add since attribute to dtd Add "since" attributes in xml for new functions and modules erl_docgen: Generate "since" OTP version in html erl_interface: Fix doc for return type 'struct hostent'
2018-12-13Fill in since for multi-clause functions in erlang.erlSverker Eriksson
The ones marked since="?" are unknown (but newer than R13B03) monitor/2 port_info/2 process_flag/2 statistics/1 system_flag/2 system_info/1 trace_pattern/3
2018-12-13Merge branch 'maint'Sverker Eriksson
2018-12-13Merge PR-2050 from legoscia/atomics-counters-typosSverker Eriksson
Fix typos in atomics.xml and counters.xml
2018-12-13erts: Fix seq_trace:reset_trace dirty gc bugLukas Larsson
When seq_trace:reset_trace could be called while a process was doing a dirty GC. This triggered a race where all signals was moved to the internal signal queue during the GC which in turn caused the a heap overrun problem. This fix makes it so that the main and msgq lock are taken before the clear. This will make sure that we are allowed to do the clear.
2018-12-13erts: Use sys_memcpy in copy_one_fragLukas Larsson
2018-12-13Add missing annotations in instrs.tabMichał Muskała
Dispatching a function and return never use the next instruction. It's unlikely for raw_raise to use the next instruction.
2018-12-13Tighten dist app data receiveRaimo Niskanen
2018-12-13ssl: Remove no longer needed functionsIngela Anderton Andin
As the stop wrapper functions are no longer needed after tls_sender that altered the behaviour of the TLS distribution code.
2018-12-13ssl: Fix downgradeIngela Anderton Andin
Both test case and code needed updates to work as intended. Code needed update due to new tls_sender process and the test case gave false positive reusult erarlier probably due to beeing to sloopy in order to avoid timeouts.
2018-12-13Merge branch 'bjorn/cuddle-with-tests'Björn Gustavsson
* bjorn/cuddle-with-tests: Cover code in beam_ssa_opt Cover code in beam_ssa_dead Cover code in beam_trim Eliminate warnings for unused variables regressions_SUITE: Fix exports map_SUITE: Test for mixed map creation map_SUITE: Fix indentation
2018-12-13Merge pull request #2047 from bjorng/bjorn/erts/eliminate-gc-bifs/OTP-15440Björn Gustavsson
Simplify implementation of GC BIFs
2018-12-13Simplify GC BIFsBjörn Gustavsson
Summary: This commit simplifies the implementation of the "GC BIFs" so that they no longer need to do a garbage collection, removing duplicate code for all GC BIFs in the runtime system, as well as potentially reducing the size of the loaded BEAM code by using shorter instructions calling those BIFs. A GC BIF is a guard BIF that will do a garbage collection if it needs to build anything on the heap. For example, `abs/1` is a GC BIF because it might need to allocate space on the heap (if the result is a floating point number or the resulting integer is a bignum). Before R12, a guard BIF (such as `abs/1`) that need to allocate heap space would allocate outside of process's main heap, in a heap fragment. GC BIFs were introduced in R12B to support literals. During garbage collection it become necessary to quickly test whether a term was a literal. To make the check simple, guards BIFs were no longer allowed to create heap fragments. Instead GC BIFs were introduced. In OTP 19, the implementation of literals was changed to support storing messages in heap fragments outside of the main heap for a process. That change again made it allowed for guard BIFs to create heap fragments when they need to build terms on the heap. It would even be possible for the guard BIFs to build directly on the main heap if there is room there, because the compiler assumes that a new `test_heap/2` instruction must be emitted when building anything after calling a GC BIF. (We don't do that in this commit; see below.) This commit simplifies the implementation of the GC BIFs in the runtime system. Each GC BIF had a dual implementation: one that was used when the GC BIF was called directly and one used when it was called via `apply/3`. For example, `abs/1` was implemented in `abs_1()` and `erts_gc_abs_1()`. This commit removes the GC version of each BIF. The other version that allocates heap space using `HAlloc()` is updated to use the new `HeapFragOnlyAlloc()` macro that will allocate heap space in a heap fragment outside of the main heap. Because the BIFs will allocate outside of the main heap, the same `bif` instructions used by nonbuilding BIFs can be used for the (former) GC BIFs. Those instructions don't use the macros that save and restore the heap and stack pointers (SWAPOUT/SWAPIN). If the former GC BIFs would build on the main heap, either new instructions would be needed, or SWAPOUT/SWAPIN instructions would need to be added to the `bif` instructions. Instructions that call the former GC BIFs don't need the operand that specifies the number of live X registers. Therefore, the instructions that call the BIFs are usually one word shorter.
2018-12-13Merge branch 'bjorn/erts/remove-faulty-assertion'Björn Gustavsson
* bjorn/erts/remove-faulty-assertion: erl_bif_list: Remove faulty assertion
2018-12-13Merge branch 'maint'Björn Gustavsson
* maint: Fix reading beyond end of bignum in integer squaring
2018-12-13Merge pull request #2051 from bjorng/bjorn/erts/bignum/OTP-15484Björn Gustavsson
Fix reading beyond end of bignum in integer squaring
2018-12-13Fix reading beyond end of bignum in integer squaringBjörn Gustavsson
The multiplication of two bignums is specially optimized when the two operands have the same address, because squaring can be done more efficiently than multiplication of two arbitrary integers. That is, expressions such as `I * I` will be calculated by squaring the value of `I`. The optimized function for squaring would read one word beyond the end of the bignum in the last iteration of a loop. The garbage value would never be used. In almost all circumstances that would be harmless. Only if the read word happened to fall on the start of an unmapped page would the runtime crash. That is unlikely to happen because most bignums are stored on a process heap, and since the stack is located at the other end of the block that the heap is located in, the word beyond the end of bignum is guaranteed to be readable.
2018-12-12ssl: Remove checks and conversions not neededIngela Anderton Andin
2018-12-12ssl: Use binary:copy/2 to avoid list overheadIngela Anderton Andin
2018-12-12ssl: Remove unnecessary internal eventIngela Anderton Andin
2018-12-12ssl: Clean codeIngela Anderton Andin
Rename Connection:handle_common_event Connection:handle_protocol_record removing use of unnecessary argument and making code easier to understand.
2018-12-12Fix since attribute for troubled function docsSverker Eriksson
2018-12-12Add empty 'since' attribute for old modules and functionsSverker Eriksson
2018-12-12ssl: Add static_env recordIngela Anderton Andin
State values created at init
2018-12-11Add since attribute to dtdSverker Eriksson
2018-12-11Add "since" attributes in xml for new functions and modulesSverker Eriksson
introduced after OTP_R13B03.
2018-12-11Fix typos in atomics.xml and counters.xmlMagnus Henoch
2018-12-11Merge branch 'sverker/erts/ets-debug-test-cuddle'Sverker Eriksson
* sverker/erts/ets-debug-test-cuddle: erts: Fix volatile ets test case failures on debug VM
2018-12-11erl_docgen: Generate "since" OTP version in htmlSverker Eriksson
for <func><name> and <module> with "since" attribute.
2018-12-11erl_interface: Fix doc for return type 'struct hostent'Sverker Eriksson
'*' is part of the return type, not the function name.
2018-12-11Merge branch 'maint'Henrik Nord
* maint: Updated OTP version Prepare release
2018-12-10erl_bif_list: Remove faulty assertionBjörn Gustavsson
The variable can be an empty list.
2018-12-10erts: Use ptr_val for pointer in gc msg copyLukas Larsson
Without this fix asserts would trigger in debug build but nothing else would break.
2018-12-10Updated OTP versionOTP-21.2Erlang/OTP
2018-12-10Prepare releaseErlang/OTP