aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/bs_instrs.tab
AgeCommit message (Collapse)Author
2019-04-12crash dump: Include correct IP for a garbing processBjörn Gustavsson
Make sure that the instruction pointer is correct for a garbing process in a crash dump.
2019-03-27erts: Remove unsafe bs_get_binary2 optimization from loaderJohn Högberg
A load-time optimization assumed that match contexts had no further uses when a bs_get_binary2 overwrote the match context's register, and figured it would be safe to reuse the match context's memory for the resulting binary. This is no longer safe as of OTP 22, as a match context may be reused after being passed to another function.
2019-03-07Slightly optimize binary constructionBjörn Gustavsson
Use S operands instead of s operands for a slight speed increase and reduction in code size of process_main(). Use micro instructions for frequently executed instructions. While at it, use safe multiplication in gen_get_integer() in beam_load.c.
2019-03-06Optimize multiplication in binary matching instructionsBjörn Gustavsson
2019-03-06Eliminate unused i_bs_skip_bits_all2 instructionBjörn Gustavsson
Starting in OTP 19 (in commit 9504c0dd71d0), the compiler emits a test_unit instruction instead of a skip instruction at the end of binary. We can do the same replacement in the loader to get rid of the i_bs_skip_bits_all2 instruction.
2019-03-06Optimize field size calculation on a 64-bit architectureBjörn Gustavsson
On a 64-bit architecture, the size of any binary that would fit in the memory must fit in a small, so we can fail immediately if the size term is not a small.
2019-03-06Reduce code size for binary matching instructionsBjörn Gustavsson
The new compiler required adding support for Y register for all binary matching instructions. That was (intentionally) done in a naive way that simplicated duplicated the entire body of each instruction. Now it's time to be less naive. Rewrite the binary matching instructions using micro instructions. Because some of the binary instructions are huge, that will significantly decrease the size of process_main(). When compiling with clang, a huge process_main() would mess up profile-guide optimization resulting in a significant performance degradation. On my Mac, profile-guide optimzation would decrease the estone benchmark by 100K estones (about 20 percent). This commit gives me back the lost estones.
2018-09-28Rewrite BSM optimizations in the new SSA-based intermediate formatJohn Högberg
This commit improves the bit-syntax match optimization pass, leveraging the new SSA intermediate format to perform much more aggressive optimizations. Some highlights: * Watch contexts can be reused even after being passed to a function or being used in a try block. * Sub-binaries are no longer eagerly extracted, making it far easier to keep "happy paths" free from binary creation. * Trivial wrapper functions no longer disable context reuse.
2018-09-24Support using match contexts from Y registersJohn Högberg
The upcoming beam_ssa_bsm pass allows match contexts to be used across function calls that take said context as an argument, which means it's fairly common for them to end up in Y registers.
2018-06-18Update copyright yearHenrik Nord
2018-02-12Make sure that the overwrite in bs_context_to_binary is safeJohn Högberg
2018-01-19Optimize matching of an 'utf8' segment in the binary syntaxBjörn Gustavsson
Matching out an 8-bit integer is faster than matching out an utf8-encoded code point, even if the value of the code point is less than 128. The reason is that matching out an 8-bit integer is specially optimized to avoid a function call. Do a similar optimization for matching out an utf8 segment.
2017-10-01Move out variables from the head of combined instructionsBjörn Gustavsson
Move out from the head the variables that are only used in the excute phase.
2017-08-11Break out most instructions from beam_emu.cBjörn Gustavsson
2017-08-08Simplify specifying implementation of instructionsBjörn Gustavsson
Eliminate the need to write pre-processor macros for each instruction. Instead allow the implementation of instruction to be written in C directly in the .tab files. Rewrite all existing macros in this way and remove the %macro directive.