summaryrefslogtreecommitdiff
path: root/erts/emulator/beam/export.h
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'maint'Rickard Green2021-12-131-1/+1
|\ | | | | | | | | * maint: Update copyright year
| * Update copyright yearRickard Green2021-12-131-1/+1
| |
* | erts: Optimize fun callsJohn Högberg2021-10-201-13/+8
|/ | | | | | | | | | | | By making local and external funs share the same structure, we can remove a substantial amount of code from the `call_fun` family of instructions. As a result fun calls are now about 15% faster with the interpreter on my machine, 10% faster with the x64 JIT on that same machine, and 15% faster with the AArch64 JIT on my M1 Mac. The improvement is a bit less pronounced for funs with free variables, and a bit more for those without (including external funs).
* erts: Replace `BeamInstr*` with `ErtsCodePtr` (void*)John Högberg2020-11-121-7/+7
| | | | | Using `BeamInstr*` means that all code must be word-aligned even when we're not pointing at BEAM opcodes, which is rather wasteful.
* erts: Rename `addressv` to force merge errorsJohn Högberg2020-11-051-8/+13
|
* jit: Make all code read-only, dual-mapping writable pagesJohn Högberg2020-11-051-1/+1
| | | | | | | | This allows the JIT to be used on systems that enforce a W^X policy. To help catch related errors at compile time, all code pointers have been marked `const`.
* jit: Refactor export entries and NIF loading for W^XJohn Högberg2020-10-301-4/+46
|
* erts: Implement the BeamAsm JITLukas Larsson2020-09-221-10/+26
| | | | | | Co-authored-by: John Högberg <john@erlang.org> Co-authored-by: Dan Gudmundsson <dgud@erlang.org> Co-authored-by: Björn Gustavsson <bjorn@erlang.org>
* erts: Rework loading of beam codeLukas Larsson2020-09-211-2/+0
| | | | | | | This is done in preperation from BeamAsm Co-authored-by: John Högberg <john@erlang.org> Co-authored-by: Dan Gudmundsson <dgud@erlang.org>
* erts: Refactor all headers to work in C++Lukas Larsson2020-09-211-1/+1
| | | | | Co-authored-by: John Högberg <john@erlang.org> Co-authored-by: Dan Gudmundsson <dgud@erlang.org>
* erts: Rename bif_table_index to bif_numberJohn Högberg2019-09-171-1/+1
|
* erts: Refactor BIF tracingJohn Högberg2019-09-161-13/+8
| | | | | | | | | | | | | | | This commit replaces our current BIF-specific tracing functionality with the general function/export tracing used for everything else, fixing a few longstanding issues: * BIFs that trapped to themselves, for example lists:reverse/2, would generate a call trace message for each trap but only a single return trace message. * BIFs that trapped elsewhere, like erlang:delete_module/1, would lose their return trace messages altogether. * Return/exception trace messages on tail calls would point at the function "above" the caller. * Call count tracing simply didn't work.
* erts: Replace ad-hoc export->beam[] wrangling with unionsJohn Högberg2019-09-161-17/+67
|
* Update copyright yearHenrik Nord2018-06-181-1/+1
|
* Refactor macros for accessing Beam instructionsBjörn Gustavsson2017-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The BeamOp() macro in erl_vm.h is clumsy to use. All users cast the return value to BeamInstr. Define new macros that are easier to use. In the future, we might want to pack an operand into the same word as the pointer to the instruction, so we will define two macros. BeamIsOpCode() is used to rewrite code like this: if (Instr == (BeamInstr) BeamOp(op_i_func_info_IaaI) { ... } to: if (BeamIsOpCode(Instr, op_i_func_info_IaaI)) { ... } BeamOpCodeAddr(op_apply_bif) is used when we need the address for an instruction. Also elimiminate the global variables em_* in beam_emu.c. They are not really needed. Use the BeamOpCodeAddr() macro instead.
* erts: Replace usage of all erts_smp prefixes to just ertsLukas Larsson2017-07-171-3/+3
|
* Merge branch 'maint'Sverker Eriksson2016-11-221-1/+1
|\
| * erts: Refactor crash dumping with cbprintfSverker Eriksson2016-11-171-1/+1
| | | | | | | | | | | | Instead of passing around a file descriptor use a function pointer to facilitate more advanced backend write logic such as size limitation or compression.
* | erts: Refactor rename Export.code[] to Export.beam[]Sverker Eriksson2016-10-121-7/+7
| | | | | | | | to avoid scary merge errors.
* | erts: Refactor out func_info into structLukas Larsson2016-10-121-10/+8
|/ | | | | | | | | | | | | | | | | | | | | | | | | 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.
* erts: Cleanup a bunch of un-neccesary #ifndefsLukas Larsson2016-07-141-6/+0
|
* update copyright-yearHenrik Nord2016-03-151-1/+1
|
* Change license text to APLv2Bruce Yinhe2015-06-181-9/+10
|
* Update copyright yearsBjörn-Egil Dahlberg2013-01-251-1/+1
|
* Don't go to single-scheduler mode when managing breakpointsBjörn Gustavsson2012-06-251-6/+5
| | | | | | | | | | | Calls to erlang:set_trace_pattern/3 will no longer block all other schedulers. We will still go to single-scheduler mode when new code is loaded for a module that is traced, or when loading code when there is a default trace pattern set. That is not impossible to fix, but that requires much closer cooperation between tracing BIFs and the loader BIFs.
* erts: Refactor export staging lockSverker Eriksson2012-02-211-3/+3
| | | | Renamed it export_staging_lock and made change it to ordinary mutex.
* erts: Cleanup non-blocking loadSverker Eriksson2012-02-211-4/+14
|
* erts: Refactor more renaming as "staging"Sverker Eriksson2012-02-211-3/+3
|
* erts: Fix memory reports from export tableSverker Eriksson2012-02-211-0/+1
| | | | Report sum from all code index.
* erts: Rename "loader" code_ix as "staging" code_ixSverker Eriksson2012-02-211-2/+2
| | | | | Staging is a better and more general name as does not necessary need to involve code loading (can be deletion, tracing, etc).
* erts: Remove secondary_export_tableSverker Eriksson2012-02-211-0/+4
|
* erts: Call erts_export_consolidate automaticallySverker Eriksson2012-02-211-1/+0
| | | | Renamed merge_secondary_table and called by export_start_load
* erts: Use several addresses in each ExportSverker Eriksson2012-02-211-2/+2
|
* erts: Multiple export tab's using code_ixSverker Eriksson2012-02-211-4/+9
| | | | Still blocking code loading
* erts: First refactor step of export tableSverker Eriksson2012-02-211-1/+1
|
* Fix BeamInstr code array in export.hBjörn-Egil Dahlberg2010-06-031-5/+1
|
* Merge branch 'pan/otp_8332_halfword' into devErlang/OTP2010-03-221-6/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * pan/otp_8332_halfword: Teach testcase in driver_suite the new prototype for driver_async wx: Correct usage of driver callbacks from wx thread Adopt the new (R13B04) Nif functionality to the halfword codebase Support monitoring and demonitoring from driver threads Fix further test-suite problems Correct the VM to work for more test suites Teach {wordsize,internal|external} to system_info/1 Make tracing and distribution work Turn on instruction packing in the loader and virtual machine Add the BeamInstr data type for loaded BEAM code Fix the BEAM dissambler for the half-word emulator Store pointers to heap data in 32-bit words Add a custom mmap wrapper to force heaps into the lower address range Fit all heap data into the 32-bit address range
| * Add the BeamInstr data type for loaded BEAM codePatrik Nyblom2010-03-101-2/+2
| | | | | | | | | | | | | | For cleanliness, use BeamInstr instead of the UWord data type to any machine-sized words that are used for BEAM instructions. Only use UWord for untyped words in general.
| * Store pointers to heap data in 32-bit wordsPatrik Nyblom2010-03-101-1/+5
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Store Erlang terms in 32-bit entities on the heap, expanding the pointers to 64-bit when needed. This works because all terms are stored on addresses in the 32-bit address range (the 32 most significant bits of pointers to term data are always 0). Introduce a new datatype called UWord (along with its companion SWord), which is an integer having the exact same size as the machine word (a void *), but might be larger than Eterm/Uint. Store code as machine words, as the instructions are pointers to executable code which might reside outside the 32-bit address range. Continuation pointers are stored on the 32-bit stack and hence must point to addresses in the low range, which means that loaded beam code much be placed in the low 32-bit address range (but, as said earlier, the instructions themselves are full words). No Erlang term data can be stored on C stacks (enforced by an earlier commit). This version gives a prompt, but test cases still fail (and dump core). The loader (and emulator loop) has instruction packing disabled. The main issues has been in rewriting loader and actual virtual machine. Subsystems (like distribution) does not work yet.
* The R13B03 release.OTP_R13B03Erlang/OTP2009-11-201-0/+79