Age | Commit message (Collapse) | Author |
|
* sverker/is_module_native-trace-bug/OTP-14390:
erts: Fix code:is_module_native for local trace
erts: Move and rename erts_is_native_break()
|
|
Local trace on first function in module
made code:is_module_native/1 return true.
Use new erts_is_function_native() to make a proper check.
|
|
|
|
|
|
to replace macro ERTS_INTERNAL_BINARY_FIELDS
as header in Binary and friends.
|
|
|
|
should be fixed since
32729cab75325de58bf127e6e8836348071b8682
|
|
into union with actual usage types.
|
|
to long lived, short lived and native stack.
|
|
A magic destructor can return 0 and thereby take control
and prolong the lifetime of a magic binary.
|
|
|
|
* maint:
Atomic reference count of binaries also in non-SMP
Conflicts:
erts/emulator/beam/erl_fun.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()
|
|
* josevalim/atu8-chunk/PR-1078/OTP-14178:
Add new AtU8 beam chunk
|
|
The new chunk stores atoms encoded in UTF-8.
beam_lib has also been modified to handle the new
'utf8_atoms' attribute while the 'atoms' attribute
may be a missing chunk from now on.
The binary_to_atom/2 BIF can now encode any utf8
binary with up to 255 characters.
The list_to_atom/1 BIF can now accept codepoints
higher than 255 with up to 255 characters (thanks
to Björn Gustavsson).
|
|
|
|
Symptom: SEGV crash on ARM in delete_code() -> export_list().
Could probably happen on other machines as well.
Problem: Staging export table was iterated in an unsafe way
while an entry was added for a new export fun.
Solution: Correct write order and some memory barriers.
|
|
to be declared once in beam_load.h
and get rid of #ifdef kludge.
|
|
|
|
* sverker/hipe-code-loadnpurge: (35 commits)
erts: Cleanup dead code
kernel,hipe: Fix dialyzer warnings
erts: Replace unsafe Module.first_hipe_ref
erts: Disable DBG_TRACE_MFA for debug build
kernel: Fix code_SUITE:upgrade for non-hipe
erts: Cleanup hipe trampoline code
erts: Remove dead alloc stats in hipe_amd64.c
erts: Remove code_SUITE:make_stub and make_stub_many_funs
erts: Let code:make_stub_module raise 'notsup'
erts: Fix bug in stack walk on risc
erts: Fix old leak for ppc hipe code
erts: Fix old leak for arm hipe code
erts: Fix old leak of sparc hipe code
erts: Fix old leak of hipe code on x86 32-bit
erts: Enable exec_alloc for all hipe architectures
erts: Remove debug printout for hipe loader state
erts: Free hipe_refs and hipe_sdesc of a failed load
erts: Refactor out hipe_purge_refs/sdesc
erts: Refactor hipe_loader_state_dtor into a true destructor
hipe: TRY fix llvm external calls to own module
...
|
|
* sverker/proc-dict-atom-hash:
kernel: Add test pdict_SUITE:literals
erts: Refactor process dict hash pre-calculation
Use atom value as hash value in process dictionary
|
|
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
|
|
if hipe is disabled.
Makes the code simpler to just ifdef away
a lot of hipe stuff.
|
|
that is only called once.
Basically switch hipe_free_loader_state and hipe_loader_state_dtor.
|
|
by introducing hipe_bifs:commit_patch_load/1
that creates the HipeModule.
|
|
|
|
Just like the BEAM loader state (as returned by
erlang:prepare_loading/2), the HiPE loader state is contained in a magic
binary.
Eventually, we will separate HiPE loading into a prepare and a finalise
phase, like the BEAM loader, where the prepare phase will be implemented
by hipe_unified_loader and the finalise phase be implemented in C by
hipe_load.c and beam_load.c, making prepare side-effect free and
finalise atomic. The finalise phase will be exposed through the
erlang:finish_loading/1 API, just like the BEAM loader, as this will
allow HiPE and BEAM modules to be mixed in the same atomic "commit".
The usage of a loader state makes it easier to keep track of all
resources allocated during loading, and will not only make it easy to
prevent leaks when hipe_unified_loader crashes, but also paves the way
for proper, leak-free, unloading of HiPE modules.
|
|
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.
|
|
with new function erts_pd_make_hx()
|
|
In the origin implementation, the hash value of atom term is retrieved
from the atom table. Reading the atom table is expensive since it is in
memory and leads to more cache missing.
The size of a process dictionary is usually small. The atom value (the
index) is unique and can be hash value for it. Using the atom value
directly should be more efficient.
|
|
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.
|
|
* maint:
erts: Add nif_SUITE:t_on_load
erts: Improve nif_SUITE:upgrade test
Don't leak old code when loading a modules with an on_load function
Conflicts:
erts/preloaded/ebin/erts_code_purger.beam
erts/preloaded/ebin/erts_internal.beam
erts/preloaded/src/erts_code_purger.erl
|
|
Normally, calling code:delete/1 before re-loading the code for a
module is unnecessary but causes no problem.
But there will be be problems if the new code has an on_load function.
Code with an on_load function will always be loaded as old code
to allowed it to be easily purged if the on_load function would fail.
If the on_load function succeeds, the old and current code will be
swapped.
So in the scenario where code:delete/1 has been called explicitly,
there is old code but no current code. Loading code with an
on_load function will cause the reference to the old code to be
overwritten. That will at best cause a memory leak, and at worst
an emulator crash (especially if NIFs are involved).
To avoid that situation, we will put the code with the on_load
function in a special, third slot in Module.
ERL-240
|
|
|
|
|
|
|
|
* sverker/load-corrupt-beam/ERL-216:
erts:: Unsignify a bunch of loader variables
erts: Reject an invalid beam code header size
erts: Fix load of beam with invalid imports and atom numbers
|
|
* 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
|
|
|
|
|
|
|
|
|
|
* bjorn/gc-bifs:
compiler: Eliminate num_bif_SUITE
erl_internal: Eliminate duplication of guard tests
beam_debug: Improve the disassembly of gc_bif instructions
Simplify creation of new GC BIFs
make_tables: Remove broken automatic BIF aliasing
|
|
Add the BIF type "gcbif" in bif.tab for defining GC BIFs. That will
eliminate some of the hand-written administrative code for handling
GC BIFs, saving the developer's time.
|
|
Before:
$ size bin/x86_64-unknown-linux-gnu/beam.smp
text data bss dec hex filename
3080982 188369 158472 3427823 344def bin/x86_64-unknown-linux-gnu/beam.smp
After:
$ size bin/x86_64-unknown-linux-gnu/beam.smp
text data bss dec hex filename
3164694 104657 158472 3427823 344def bin/x86_64-unknown-linux-gnu/beam.smp
|
|
This merge is actually only some left overs.
The bulk work for hipe-amd64-code-alloc has already been
merge (without ticket number) at 42a1166b47721cd444.
|
|
'hx' may be used uninitialized
|
|
Load the module as old code; swap old and new code if the
-on_load function succeeds. That way, a failed update attempt
for a module that has an -on_load function will preserve the
previous version of the code.
|