aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe
AgeCommit message (Collapse)Author
2018-01-17Fix slow hipe executionSverker Eriksson
particularly slow erlc when compiler is hipe compiled. hipe_unified_loader:load did not patch external call sites and instead caused a double hipe mode switch per call. hipe_unified_loader:load is only used for early modules first loaded as beam and by code:atomic_load and friends.
2018-01-03Add PRIMOP_ABI_VSN to erts checksumSverker Eriksson
in order to detect incompatible changes in primop interface (which we just did for bs_put_utf8) and refuse hipe loading.
2018-01-03Fix bug in hipe primop bs_put_utf8Sverker Eriksson
by preventing it from doing GC, which generated code relies on.
2017-11-11fix output formatting in several HiPE debug BIFsMikael Pettersson
Fix formatting in hipe_bifs:show_pcb/1, hipe_bifs:show_estack/1, and hipe_bifs:show_nstack/1. fflush(stdout) before switching from printf() to erts_printf() to avoid garbled output. Adjust field lengths to work on both 64- and 32-bit systems. Tested on Linux/x86_64 (64-bit) and Linux/ARMv7 (32-bit).
2017-11-05fix output formatting in hipe_bifs:show_heap/1Mikael Pettersson
When the code switches from printf() to erts_printf() the output becomes garbled. Fixed by fflush()ing stdout first. Fixed formatting of the "H E A P" banner for 64-bit systems.
2017-11-03Fix bug in hipe for <<X/utf32>>Sverker Eriksson
by introducing new primop 'is_unicode' with no exception (ab)use and no GC. Replaces bs_validate_unicode which is kept for backward compat for now.
2017-11-03Prevent hipe_bs_validate_unicode from doing GCSverker Eriksson
Fix for x86_64 only. The calling native code can not handle a GC as it has a raw pointer where to write the binary data. If a GC happens the data (utf32) will be written to the old deallocated heap.
2017-07-06Allow toggling lock counting at runtimeJohn Högberg
The implementation is still hidden behind ERTS_ENABLE_LOCK_COUNT, and all categories are still enabled by default, but the actual counting can be toggled at will. OTP-13170
2017-05-04Update copyright yearRaimo Niskanen
2017-04-12erts: Introduce struct binary_internalsSverker Eriksson
to replace macro ERTS_INTERNAL_BINARY_FIELDS as header in Binary and friends.
2017-04-11erts: Init refc=1 in erts_bin_nrml_allocSverker Eriksson
Only term_to_binary needed some extra attention as it used to initialize refc as 0 instead of 1.
2017-04-05erts: Remove hipe_bifs:remove_refs_from/1Sverker Eriksson
which serves no purpose after all the hipe load&purge fixes merged at 32729cab75325de58bf127e6e8836348071b8682
2017-04-04Refactor hipe specific code to use ErtsCodeInfoSverker Eriksson
instead of ugly negative indexing.
2017-03-30Add a missing 0 to an address, which was suspiciously missingKostis Sagonas
2017-03-27Make hipe_bifs:alloc_data/3 pad addr to alignmentMagnus Lång
7814ec18b made hipe_bifs:alloc_data/3 expect alignments greater than 8 from erts_alloc(), which is not something that it guarantees. Fix it up so that it pads the allocation up to the required alignment, in case it does not initially satisfy the alignment requirement.
2017-03-17erts: Change HIPE allocations from sys_allocSverker Eriksson
to long lived, short lived and native stack.
2017-02-28erts: Refactor MOVE_CONS to inline functionBjörn-Egil Dahlberg
2017-02-28erts: Refactor MOVE_BOXED to inline functionBjörn-Egil Dahlberg
2017-02-19erts: Drop workarounds for ErLLVM w/ LLVM < 3.9Magnus Lång
2017-02-14erts: Add deallocation veto for magic destructorsSverker Eriksson
A magic destructor can return 0 and thereby take control and prolong the lifetime of a magic binary.
2017-02-06Use magic refs for code loading stateRickard Green
2017-02-06Merge branch 'maint'Rickard Green
* maint: Atomic reference count of binaries also in non-SMP Conflicts: erts/emulator/beam/erl_fun.c
2017-02-06Merge branch 'rickard/binary-refc' into maintRickard Green
OTP-14202 * rickard/binary-refc: Atomic reference count of binaries also in non-SMP Conflicts: erts/emulator/beam/beam_bp.c
2017-02-06Atomic reference count of binaries also in non-SMPRickard Green
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()
2017-01-23Merge branch 'sverker/ASSERT_IN_ENV'Sverker Eriksson
* sverker/ASSERT_IN_ENV: erts: Add macro ERTS_PROC_LOCKS_HIGHER_THAN erts: Cleanup and extra assertions in nif_SUITE.c erts: Cleanup enif_make_reverse_list erts: Add assertions for correct ErlNifEnv erts: Make erts_dbg_within_proc available # Conflicts: # erts/emulator/beam/erl_gc.h
2017-01-17Merge branch 'maint'Rickard Green
* maint: Remove debug printout and unnecessary GC
2017-01-17Remove debug printout and unnecessary GCRickard Green
2017-01-12Perform potentially long GC on dirty schedulers if availableRickard Green
2017-01-12Support for dirty BIFsRickard Green
2017-01-04erts: Make erts_dbg_within_proc availableSverker Eriksson
for debug assertions.
2016-12-06erts: Fix missing HiPE trampolines on armMagnus Lång
8bb80fe76f5b replaced the "__arm__" macro used to test for the arm architecture in hipe_bif0 with the "arm" macro, which is not universally available. As this replacement is not motivated in the commit message, nor replicated in any other file that uses the "__arm__" macro, this seems to be an accident, and this commit reverts the replacement. When compiled in an environment without the "arm" macro, upgrading hipe code would occasionally not patch relocations to the new module due to being out of range for a shortjump, and a trampoline not being provided to do a longjump. Since this type of relocation patches are not expected to be able to fail, there is no error handling, and aside from a "hipe_redirect_to_module: patch failed" message, code upgrade would proceed and lead to various incorrect behaviour.
2016-11-17erts: Fix all -Wundef errorsSverker Eriksson
2016-10-28erts: Exclude random beam functions from hipe stacktraceSverker Eriksson
2016-10-26erts: Remove unused argument to hipe_set_closure_stubSverker Eriksson
2016-10-18Change the return type of hipe_bifs:add_ref/2Kostis Sagonas
2016-10-14Merge branch 'master' into sverker/hipe-code-loadnpurgeSverker Eriksson
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
2016-10-14erts: Replace unsafe Module.first_hipe_refSverker Eriksson
with hash table mod2mfa_tab
2016-10-14erts: Cleanup hipe trampoline codeSverker Eriksson
2016-10-14erts: Remove dead alloc stats in hipe_amd64.cSverker Eriksson
erlang:system_info({allocator, exec_alloc}) have stats if we need it.
2016-10-14erts: Fix bug in stack walk on riscSverker Eriksson
Symptom: Got ra==NULL at nsp==nsp_end when running basic_SUITE:basic_arith on arm why has this not been detected before?
2016-10-14erts: Fix old leak for ppc hipe codeSverker Eriksson
* Use erts_alloc(ERTS_ALC_T_HIPE_EXEC,_) * Each module has its own trampolines
2016-10-14erts: Fix old leak for arm hipe codeSverker Eriksson
* Use erts_alloc(ERTS_ALC_T_HIPE_EXEC,_) * Each module has its own trampolines * Stubs do not use trampolines, they do their own long jumps.
2016-10-14erts: Fix old leak of sparc hipe codeSverker Eriksson
2016-10-14erts: Fix old leak of hipe code on x86 32-bitSverker Eriksson
2016-10-14erts: Remove debug printout for hipe loader stateSverker Eriksson
creation and destruction.
2016-10-14erts: Free hipe_refs and hipe_sdesc of a failed loadSverker Eriksson
2016-10-14erts: Refactor out hipe_purge_refs/sdescSverker Eriksson
from hipe_purge_module.
2016-10-14erts: Refactor hipe_loader_state_dtor into a true destructorSverker Eriksson
that is only called once. Basically switch hipe_free_loader_state and hipe_loader_state_dtor.
2016-10-14hipe,erts: Remove cached fun 'native_address'Sverker Eriksson
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.
2016-10-14erts: Fix early hipe patch loadingSverker Eriksson
by introducing hipe_bifs:commit_patch_load/1 that creates the HipeModule.