Age | Commit message (Collapse) | Author |
|
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.
|
|
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.
|
|
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]>
|
|
* maint:
Fix compiler crash when compiling some receive statements
|
|
bjorng/bjorn/compiler/fix-receive-bug/ERL-1022/OTP-15982
Fix compiler crash when compiling some receive statements
|
|
The compiler would crash when compiling the following code:
do(Acc) ->
receive
{Pid, abc} ->
ok;
{Pid, []} ->
ok;
{Pid, _Res} ->
exit(_Res)
end,
do([Pid | Acc]).
The last clause that always raises an exception would confuse the
compiler so that it would think that the `receive` statement was at the
end of the function and it would generate incorrect code for the `do/1`
call following the `receive`.
https://bugs.erlang.org/browse/ERL-1022
|
|
* maint:
erts: Fix crash in instrument:allocations/0-1
|
|
* john/erts/fix-instrument-allocations-race/OTP-15983:
erts: Fix crash in instrument:allocations/0-1
|
|
* 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
|
|
* 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
|
|
* maint:
Fix documentation for erlang:is_map_key/2
|
|
The current carrier list was read when the allocator wasn't locked,
crashing the emulator if a block scan raced with a carrier
allocation.
|
|
Fix documentation for erlang:is_map_key/2
|
|
* maint:
Correct dump_log_write_threshold default value
|
|
Correct documentation on dump_log_write_threshold default value
|
|
* maint:
Handle clicking links more than once in Observer's "Expanded term"
|
|
* upstream/pr/2201:
Handle clicking links more than once in Observer's "Expanded term"
OTP-15980
|
|
|
|
|
|
|
|
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.
|
|
The size check is redundant now that all binaries are guaranteed
to be small enough that their size in bits fits into a word.
|
|
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.
|
|
* maint:
mnesia: Bump protocol version
mnesia: Introduce sync_asym_trans protocol
observer: Fixes for html viewers
observer: Support darkmode gui
|
|
* dgud/observer/fix-darkmode/OTP-15916:
observer: Fixes for html viewers
observer: Support darkmode gui
|
|
* dgud/mnesia/sticky-bug/ERL-768/OTP-15979:
mnesia: Bump protocol version
mnesia: Introduce sync_asym_trans protocol
|
|
* maint:
mnesia: Fix deadlock caused by add_table_copy
|
|
* dgud/mnesia/add_table_copy_deadlock/ERL-872/OTP-15933:
mnesia: Fix deadlock caused by add_table_copy
|
|
|
|
* maint:
Update primary bootstrap
|
|
|
|
* maint:
erts: Escape atoms in erlang:fun_to_list/1
|
|
* john/erts/fun_to_list-escaping/OTP-15975/ERL-1009:
erts: Escape atoms in erlang:fun_to_list/1
|
|
* john/compiler/fix-bs_skip-succeeded-oddity:
compiler: Fix awkward match context substitution
beam_ssa_lint: Use #b_var{} instead of variable names
|
|
* john/compiler/remove-dead-code-beam_ssa_type:
beam_ssa_type: Remove unreachable code
|
|
Expand and squeeze literal integers/utf8 bin segments
|
|
This worked out by accident since codegen never actually looks at
the arguments for 'succeeded'; it just assumes that they reference
the preceding instruction.
|
|
|
|
* maint:
Discard continuous delivery history
|
|
Repository grows too large.
|
|
* maint:
Update java doc
Print last lines of configure log
Force xenial builds in travis
|
|
Replace deprecated <tt> with <code>
|
|
So we can see in travis which applications or options that is disabled,
(and/or other config problems)
|
|
So we know that libwxgtk3.0 exists.
|
|
Now that impossible branches are skipped altogether, it's no
longer possible to encounter get_tuple_element with a 'none'
argument.
|
|
|
|
* lukas/os_mon/sscanf_Lu/OTP-15974:
os_mon: Fix sscanf to use %llu instead of gnu specific %Lu
|
|
|
|
* john/compiler/validator-improve-try_case-handling:
beam_validator: Disallow jumps to try_case handlers
|
|
* 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
|