aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe
AgeCommit message (Collapse)Author
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.
2016-10-14erts: Move new hipe ref and sdesc lists to loader stateSverker Eriksson
2016-10-14erts: Use hipe_free_moduleSverker Eriksson
2016-10-14erts: Check hipe stack in check_process_codeMagnus Lång
This is part of commit 1bd508921dd93086b05e7d0038b816b36c421d86. I did not include the fun-checking as we have a new purge strategy for funs in OTP 20. That remains to be solved some other way for hipe.
2016-10-14Add a loader state for HiPE code loadingMagnus Lång
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.
2016-10-12erts: Refactor find_function_from_pc to return MFALukas Larsson
2016-10-12erts: Refactor out func_info into structLukas Larsson
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.
2016-10-10erts: Remove unused hipe_bifs:code_sizeSverker Eriksson
and hipe_bifs:update_code_size
2016-10-10erts: Improve hipe load/upgrade/purge machinerySverker Eriksson
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.
2016-10-10erts: Refactor hipe_sdesc.summary into bit fieldsSverker Eriksson
2016-10-10erts: Refactor rename struct hipe_sdescSverker Eriksson
2016-10-10erts: Refactor rename structs hipe_mfa and hipe_refSverker Eriksson
2016-08-31Remove old purge strategyRickard Green
2016-07-29Merge branch 'margnus1/erts/fix-hipe-literal-gc/PR-1122/OTP-13777' into maintBjörn-Egil Dahlberg
* margnus1/erts/fix-hipe-literal-gc/PR-1122/OTP-13777: check_process_code: Sweep HiPE stack for literals
2016-07-14hipe: Remove performance profiling codeLukas Larsson
This type of statistics is now available through the microstate accounting API.
2016-07-06check_process_code: Sweep HiPE stack for literalsMagnus Lång
Because check_process_code neglected checking the HiPE stack for references to the literal area, such references would survive the purge and subsequent deletion of a module and its literal area. These dangling references would then cause incorrect behaviour or even hard crashes of the VM. By simply adding a scan of the HiPE stack to check_process_code and erts_garbage_collect_literals, this problem is fixed. In order to support full stack walks without deleting the graylimit trap, a new stack walking interface function, nstack_walk_init_sdesc_ignore_trap() was introduced.
2016-06-30hipe: Fix bug in trap frame allocation wrappersMagnus Lång
The trap frame allocation wrappers occasionally call the garbage collector, even though built-in functions are not supposed to. On non-{x86,amd64} platforms, HiPE was optimising the BIF wrapper interface on the basis that BIFs do not GC. So, when hipe_reserve_beam_trap_frame called the garbage collector, the state in the PCB was stale and corruption happened. Now, these particular BIFs are reclassified as GC BIFs. Unfortunately, in order to do that we needed to introduce a gc_bif_interface_3 macro in every hipe_$ARCH_bifs.m4 file.
2016-06-30hipe: Add assertion for gc in bif without wrapperMagnus Lång
An easy source of tricky bugs is to start calling the garbage collector from a built-in function without adding that bif to hipe_bif_list.m4. With this change we, in the debug build, keep track of whether the canonical stack and heap pointers are stored in the PCB or in registers/stack, allowing us to catch this class of mistakes with an assertion.
2016-05-31Merge branch 'rickard/mv-dirty-reds-count/OTP-13123'Rickard Green
* rickard/mv-dirty-reds-count/OTP-13123: Move dirty reduction count to erts_dirty_process_main()
2016-05-31Move dirty reduction count to erts_dirty_process_main()Rickard Green
2016-05-31Merge branch 'sverker/bad-hash'Sverker Eriksson
2016-05-26Merge branch 'margnus1/llvm-compatibility/PR-1057/OTP-13626'Sverker Eriksson
2016-05-26erts: Improve bucket search for hipe_mfa_infoSverker Eriksson
by actually using the cached hash value.
2016-05-26erts: Improve some bad hash functionsSverker Eriksson
Multiplying two atoms will always yield the same low 6 bits. The most important tabke 'export' was saved by the prime number table size which seemed to yield a decent uniform distribution anyway.
2016-05-17erts: Move max_heap_size field so that ErLLVM works againLukas Larsson
2016-05-11hipe_llvm: Allow LLVM-generated constantsMagnus Lång
Since 3.7, LLVM sometimes generates SSE constants in a special constant section with the requisite alignment (".rodata.cst16"). This broke hipe_llvm since it assumed that all constants that were linked from the text section were constants generated by hipe_llvm. As this is the first time alignments larger than 8 have been required, some small changes were required to hipe_consttab and hipe_bifs:alloc_data/2. Note that hipe_bifs:alloc_data/2 still assumes that erl_alloc will provide the requisite alignment.
2016-05-10erts: Fix max heap size exit when in hipe modeLukas Larsson
2016-05-09Merge branch 'sverker/trace-send-receive-matchspec/OTP-13507'Sverker Eriksson
2016-05-04erts: Add Sender in 'receive' trace matchspecSverker Eriksson
All 'EXIT' and monitor messages are sent from 'system' Timeouts are "sent" from 'clock_service'
2016-05-04erts: Add matchspec to 'receive' traceSverker Eriksson
2016-05-04erts: Rename struct typeSverker Eriksson
as is trips up my editor symbol tagging.
2016-05-04hipe_x86: Patch relocations with implicit addendsMagnus Lång
LLVM likes to use relocation addends on x86, which HiPE was ignoring, causing crashes.
2016-05-04Ensure correct reduction countingRickard Green
2016-04-20Merge branch 'sverker/hipe-code-alloc'Sverker Eriksson
2016-04-15erts: Add 'exec_alloc' for hipe codeSverker Eriksson
that uses its own super carrier (erts_exec_mmapper) to guarantee low addressed and executable memory (PROT_EXEC). Currently only used on x86_64 that needs low memory for HiPE/AMD64's small code model. By initializing erts_exec_mapper early we secure its low memory area before erts_literal_mmapper might steal it.
2016-04-15erts: Implement tracer modulesLukas Larsson
Add the possibility to use modules as trace data receivers. The functions in the module have to be nifs as otherwise complex trace probes will be very hard to handle (complex means trace probes for ports for example). This commit changes the way that the ptab->tracer field works from always being an immediate, to now be NIL if no tracer is present or else be the tuple {TracerModule, TracerState} where TracerModule is an atom that is later used to lookup the appropriate tracer callbacks to call and TracerState is just passed to the tracer callback. The default process and port tracers have been rewritten to use the new API. This commit also changes the order which trace messages are delivered to the potential tracer process. Any enif_send done in a tracer module may be delayed indefinitely because of lock order issues. If a message is delayed any other trace message send from that process is also delayed so that order is preserved for each traced entity. This means that for some trace events (i.e. send/receive) the events may come in an unintuitive order (receive before send) to the trace receiver. Timestamps are taken when the trace message is generated so trace messages from differented processes may arrive with the timestamp out of order. Both the erlang:trace and seq_trace:set_system_tracer accept the new tracer module tracers and also the backwards compatible arguments. OTP-10267
2016-03-15update copyright-yearHenrik Nord
2016-02-24Merge branch 'master' into sverk/master/halt-INT_MINSverker Eriksson