aboutsummaryrefslogtreecommitdiffstats
path: root/erts
AgeCommit message (Collapse)Author
2019-08-22Merge pull request #2351 from bjorng/bjorn/erts/optimize-cp-management/OTP-15077Björn Gustavsson
Optimize continuation pointer management
2019-08-22Optimize the move_call instructionsBjörn Gustavsson
The `move_call` instructions are combinations of a `move` instruction and a `call` instruction. As currently implemented, the `move` part of the instruction is executed in its entirety before the `call` part is even started. The reason is that the C compiler cannot see that it would be safe to read the target address of the call before writing to the move destination. Rewrite the instructions to explicitly read both the source for the move and the target address for the call before writing the destination of the move. Micro-benchmarks show a small but consistent speed-up after this change.
2019-08-22Optimize deallocate_return instructionsBjörn Gustavsson
Eliminating the CP register and putting continuation pointers directly on the stack made the deallocate_return instruction slower. Try to mitigate this slow down by specializing deallocate_return for small stack. For the move_deallocate_return instruction, reorder instructions to make it possible to execute the read instructions in parallel.
2019-08-22Optimize continuation pointer managementBjörn Gustavsson
The BEAM instructions for calling a function don't save the continuation pointer (return address) on the stack, but to a special BEAM register called CP. It is the responsibility of the called function to save CP to the stack frame before calling other functions. In the earlier implementations of BEAM on Sparc, CP was located in a CPU register. That meant that the continuation pointer was never written to memory when calling simple functions that didn't call other functions at all or ended in a tail-call to another function. The modern BEAM no longer keeps CP in CPU register. Instead, it is kept in the `process` struct (in `p->cp`). That means the continuation pointer must be written to the memory on every call, and if the called function will call other functions, it will must read the continuation pointer from `p->cp` and store it on the stack. This commit eliminates the concept of the CP register and modifies the call instructions to directly store the continuation pointer on the stack. That makes allocation and trimming of stack frames slightly faster. A more important benefit is simplification of code that handles continuation pointers. Because all continuation pointers are now stored on the stack, the special case of handling `p->cp` disappears. Co-authored-by: John Högberg <[email protected]>
2019-08-22Merge branch 'josevalim/edoc/no-more-inets/OTP-15999/PR-2317'Hans Bolinder
* josevalim/edoc/no-more-inets/OTP-15999/PR-2317: system: Remove special handling of EDoc in otp_SUITE. Remove inets dependency from edoc
2019-08-22Merge branch 'maint'Lukas Larsson
2019-08-20system: Remove special handling of EDoc in otp_SUITE.Hans Bolinder
2019-08-19Add helping verbTom Kelley
Needed a helping verb, added a helping verb.
2019-08-16Merge branch 'maint'John Högberg
* maint: erts: Scan heap fragments for off-heap binaries
2019-08-16Merge branch 'john/erts/process_info-binary-heap-fragments/OTP-15978' into maintJohn Högberg
* john/erts/process_info-binary-heap-fragments/OTP-15978: erts: Scan heap fragments for off-heap binaries
2019-08-13Merge branch 'maint'John Högberg
* maint: erts: Fix crash in instrument:allocations/0-1
2019-08-13Merge branch 'john/erts/fix-instrument-allocations-race/OTP-15983' into maintJohn Högberg
* john/erts/fix-instrument-allocations-race/OTP-15983: erts: Fix crash in instrument:allocations/0-1
2019-08-12Merge branch 'maint'John Högberg
* maint: erts: Create heap binaries in binary:split/2-3 erts: Create heap binaries in binary_part/2-3 erts: Create heap binaries in split_binary/2 erts: Create heap binaries in bs_get_binary2 erts: Remove size check in bs_start_match erts: Disallow binaries whose size in bits exceeds UWORD_MAX
2019-08-12Merge branch 'john/erts/bs_get_binary2-heap-binaries/OTP-15977' into maintJohn Högberg
* john/erts/bs_get_binary2-heap-binaries/OTP-15977: erts: Create heap binaries in binary:split/2-3 erts: Create heap binaries in binary_part/2-3 erts: Create heap binaries in split_binary/2 erts: Create heap binaries in bs_get_binary2 erts: Remove size check in bs_start_match erts: Disallow binaries whose size in bits exceeds UWORD_MAX
2019-08-12Merge branch 'maint'John Högberg
* maint: Fix documentation for erlang:is_map_key/2
2019-08-12erts: Fix crash in instrument:allocations/0-1John Högberg
The current carrier list was read when the allocator wasn't locked, crashing the emulator if a block scan raced with a carrier allocation.
2019-08-12Merge pull request #2325 from max-au/is_map_key_doc_fixBjörn Gustavsson
Fix documentation for erlang:is_map_key/2
2019-08-12erts: Scan heap fragments for off-heap binariesJohn Högberg
2019-08-09erts: Create heap binaries in binary:split/2-3John Högberg
2019-08-09erts: Create heap binaries in binary_part/2-3John Högberg
2019-08-09erts: Create heap binaries in split_binary/2John Högberg
2019-08-09erts: Create heap binaries in bs_get_binary2John Högberg
ErlSubBin is a large struct that often dwarfs the region of memory it points at, and it's common for them to refer to a ProcBin which must be kept around as long as the SubBin lives, using up even more heap space and keeping the referenced binary alive regardless of how small the sub-binary is.
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-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-07erts: Escape atoms in erlang:fun_to_list/1John Högberg
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-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-01Merge branch 'maint'Micael Karlberg
2019-08-01Merge branch 'bmk/erts/esock/20190730/select_info/OTP-15958' into maintMicael Karlberg
2019-07-31Merge branch 'maint'Raimo Niskanen
* maint: The linger option is not transferred on *BSD
2019-07-31Merge branch 'raimo/inherit-listen-options/OTP-15824' into maintRaimo Niskanen
* raimo/inherit-listen-options/OTP-15824: The linger option is not transferred on *BSD
2019-07-30[esock|doc] Updated select-infoMicael Karlberg
2019-07-30[esock] Updated select-infoMicael Karlberg
2019-07-30Merge branch 'maint'Micael Karlberg
2019-07-30Merge branch 'bmk/erts/esock/20190729/eafnosupport_on_solaris10' into maintMicael Karlberg
2019-07-30Merge branch 'maint'Micael Karlberg
2019-07-30Merge branch 'bmk/erts/esock/20190724/invalid_sockaddr_null_in_sendto' into ↵Micael Karlberg
maint
2019-07-30[esock] Post merge fixMicael Karlberg
2019-07-30Merge branch 'maint'Micael Karlberg
2019-07-30Merge branch 'bmk/esock/20190723/renaming_nif_functions/OTP-15955' into maintMicael Karlberg
2019-07-30Merge branch 'maint'Micael Karlberg
2019-07-30Merge branch 'bmk/erts/esock/20190717/socket_options/OTP-15904' into maintMicael Karlberg
2019-07-29Fix documentation for erlang:is_map_key/2Maxim Fedorov
This function is allowed to be used in guards.
2019-07-29[esoco|test] Attempt to handle unsupported unix domain socketMicael Karlberg
2019-07-29[esock|test] Race during socket closeMicael Karlberg
Add a sleep to reduce the chance that process exit has not been "processed" by the nif code. Also increased the test case timetrap for the sc_ctrl_proc_exit group of test cases. OTP-15904
2019-07-27erts: Do not use named no_cpuid label in asmMatwey V. Kornilov
Ask compiler to generate unique label name. Using named label has implications on optimizer, that may lead to the compilation errors as the following: pthread/ethread.c: Assembler messages: pthread/ethread.c:213: Error: symbol `no_cpuid' is already defined pthread/ethread.c:213: Error: symbol `no_cpuid' is already defined pthread/ethread.c:213: Error: symbol `no_cpuid' is already defined