Age | Commit message (Collapse) | Author |
|
Instructions that take a 'd' argument needs a -gen_dest flag in their
macros. For example:
%macro:put_list PutList -pack -gen_dest
put_list s s d
-gen_dest was needed when x(0) was stored in a register, since it is
not possible to take the address of a register. Now that x(0) is stored
in memory and we can take the address, we can eliminate gen_dest.
|
|
p->fvalue will be set by BIFs that generate exceptions
(such as throw/1), and it will not be cleared before another
exception is generated. Potentially, p->fvalue may contain a
huge term (e.g. after throw(HugeTerm)) which will be kept in
the heap.
We can shorten the lifetime of f->value by clearing it in
the instructions that handle catches: catch_end and try_end.
That is safe because BEAM code will never access p->fvalue.
If BEAM code needs to rethrow an exception it will use a
reference to the value passed in an X register.
The reason that p->fvalue must not be cleared already in
handle_error() is that native code trap handlers will use
it. (See the comment before handle_error() and the comment
at the end of handle_error() in beam_emu.c for some more
information about exception handling.)
|
|
|
|
* sverker/refactor:
erts: Introduce struct binary_internals
erts: Introduce erts_bin_release
erts: Init refc=1 in erts_bin_drv_alloc*
erts: Init refc=1 in erts_bin_nrml_alloc
erts: Remove deliberate leak of hipe fun entries
erts: Remove hipe_bifs:remove_refs_from/1
Refactor hipe specific code to use ErtsCodeInfo
erts: Refactor ErtsCodeInfo.native
|
|
Only term_to_binary needed some extra attention
as it used to initialize refc as 0 instead of 1.
|
|
bxor is used in the rand module, so even small optimizations
could be worthwile.
Suggested by Raimo Niskanen.
|
|
into union with actual usage types.
|
|
Rewrite the instruction stream on tagged tuple tests.
Tagged tuples means a tuple of any arity with an atom as its first element.
Typically records, ok-tuples and error-tuples.
from:
...
{test,is_tuple,Fail,[Src]}.
{test,test_arity,Fail,[Src,Sz]}.
...
{get_tuple_element,Src,0,Dst}.
...
{test,is_eq_exact,Fail,[Dst,Atom]}.
...
to:
...
{test,is_tagged_tuple,Fail,[Src,Sz,Atom]}.
...
|
|
Not setting it correctly will cause the swapin later
to fail in debug build as REDS_IN will overwrite
the value in reg[5].
|
|
|
|
* maint:
Atomic reference count of binaries also in non-SMP
Conflicts:
erts/emulator/beam/erl_fun.c
|
|
OTP-14202
* rickard/binary-refc:
Atomic reference count of binaries also in non-SMP
Conflicts:
erts/emulator/beam/beam_bp.c
|
|
NIF resources was not handled in a thread-safe manner in the runtime
system without SMP support.
As a consequence of this fix, the following driver functions are now
thread-safe also in the runtime system without SMP support:
- driver_free_binary()
- driver_realloc_binary()
- driver_binary_get_refc()
- driver_binary_inc_refc()
- driver_binary_dec_refc()
|
|
|
|
|
|
|
|
|
|
* maint:
Fix call_time trace for NIFs
Conflicts:
erts/emulator/beam/beam_emu.c
|
|
OTP-14136
* rickard/nif-call-time-trace-bug:
Fix call_time trace for NIFs
|
|
|
|
* maint:
Remove faulty release note for these fixes
New test cases testing stacktrace from apply on erlang:error()
Fix stactrace for apply on error/[1,2], exit/1, or throw/1
Fix stack-trace generated by a traced process
Conflicts:
erts/emulator/beam/beam_emu.c
erts/etc/unix/etp-commands.in
|
|
|
|
|
|
* maint:
Update etp-commands for dirty schedulers
Fix scheduling of system tasks on processes executing dirty
Fix call time tracing with dirty schedulers
Fix send of exit signal to process executing dirty
Fix dirty scheduler process priority
Fix alloc-util hard-debug
Silence debug warning when no beam jump table is used with dirty schedulers
Fix check_process_code() when NifExport is in use
Fix GC when NifExport is in use
Fix saving of original arguments when rescheduling via NifExport
Conflicts:
erts/emulator/beam/beam_bif_load.c
erts/emulator/beam/erl_nif.c
|
|
OTP-14051
* rickard/dirty-scheduling-fixes:
Update etp-commands for dirty schedulers
Fix scheduling of system tasks on processes executing dirty
Fix call time tracing with dirty schedulers
Fix send of exit signal to process executing dirty
Fix dirty scheduler process priority
Fix alloc-util hard-debug
Silence debug warning when no beam jump table is used with dirty schedulers
Conflicts:
erts/etc/unix/etp-commands.in
|
|
|
|
|
|
|
|
Avoid suspending fun caller not just if purge is already done
but also if purge of another module has started. Another purge
of the same module again cannot happen as making current to old
transition includes thread progress.
|
|
Conflicts:
erts/emulator/beam/beam_bif_load.c
erts/emulator/beam/beam_load.c
and added macro DBG_TRACE_MFA_P in beam_load.h
|
|
Did not work with purge and made worse by new purge strategy.
Did yield terrible performance when fun thing is created *before*
fun code is loaded. Like when receiving not yet loaded fun
from other node. The cached 'native_address' in ErlFunThing
will not be updated leading to mode switch and error_handler
being called for every call to the fun from native code.
|
|
|
|
to avoid scary merge errors.
|
|
|
|
This commit adds two new structs to be used to represent
erlang code in erts.
ErtsCodeInfo is used to describe the i_func_info header
that is part of all Export entries and the prelude of
each function. This replaces all the BeamInstr * that
were previously used to point to these locations.
After this change the code should never use BeamInstr *
with offsets to figure out different parts of the
func_info header.
ErtsCodeMFA is a struct that is used to descripe a
MFA in code. It is used within ErtsCodeInfo and also
in Process->current.
All function that previously took Eterm * or BeamInstr *
to identify a MFA now use the ErtsCodeMFA or ErtsCodeInfo
where appropriate.
The code has been tested to work when adding a new field to the
ErtsCodeInfo struct, but some updates are needed in ops.tab to
make it work.
|
|
A step toward better integration of hipe load and purge
Highlights:
* code_server no longer needs to call hipe_unified_loader:post_beam_load/1
Instead new internal function hipe_redirect_to_module()
is called by loading BIFs to patch native call sites if needed.
* hipe_purge_module() is called by erts_internal:purge_module/2
to purge any native code.
* struct hipe_mfa_info redesigned and only used for exported
functions that are called from or implemented by native code.
A list of native call sites (struct hipe_ref) are kept for each hipe_mfa_info.
* struct hipe_sdesc used by hipe_find_mfa_from_ra()
to build native stack traces.
|
|
clang will generate smaller code if we avoid reassigning the
reg and freg arrays. That can be easily arranged by passing them
as arguments to process_main().
|
|
* maint:
Ensure correct mbuf_sz value in process structure
|
|
|
|
* maint:
Fix dirty schedulers build on windows
|
|
* rickard/ds-win-32bit/OTP-13759:
Fix dirty schedulers build on windows
|
|
* maint:
Fix tracing of processes executing dirty
Perform check_process_code while process is executing dirty
Fix purge of code
Reclaim literal area after purge has completed
Separate literal area from code
Conflicts:
erts/emulator/beam/global.h
|
|
* rickard/ds-trace/OTP-13822:
Fix tracing of processes executing dirty
|
|
'rickard/new-purge-strategy/OTP-13833' into maint
* rickard/fun-purge-bug/OTP-13809:
Fix purge of code
Reclaim literal area after purge has completed
Separate literal area from code
Conflicts:
erts/doc/src/erlang.xml
erts/emulator/beam/beam_bif_load.c
erts/emulator/beam/erl_init.c
erts/preloaded/ebin/init.beam
|
|
|
|
Ensure that we cannot get any dangling pointers into code that
has been purged. This is done by a two phase purge. At first
phase all fun entries pointing into the code to purge are marked
for purge. All processes trying to call these funs will be suspended
and by this we avoid getting new direct references into the code.
When all processes has been checked, these processes are resumed.
The new purge strategy now also completely ignore the existence of
indirect references to the code (funs). If such exist, they will
cause bad fun exceptions to the caller, but will not prevent a
soft purge or cause a kill of a process having such live references
during a hard purge. This since it is impossible to give any
guarantees that no processes in the system have such indirect
references. Even when the system is completely clean from such
references, new ones can appear via distribution and/or disk.
|
|
* maint:
Updated OTP version
Prepare release
Avoid segfault when printing slogan after crashdumping
Fix race causing lost wakeup on receive-after timeout
Conflicts:
OTP_VERSION
|
|
* maint-19:
Updated OTP version
Prepare release
Avoid segfault when printing slogan after crashdumping
Fix race causing lost wakeup on receive-after timeout
|
|
* rickard/proc-tmo-bug/OTP-13798:
Fix race causing lost wakeup on receive-after timeout
|
|
|