aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
AgeCommit message (Collapse)Author
2011-01-17Optimize addition of a small integer to a variableBjörn Gustavsson
Introduce a new i_increment/4 to optimize the addition of a register and a small integer. This instruction saves two instruction words compared to the standard instructions (an i_fetch/2 instruction followed by a i_plus/3 instruction) and will also be slightly faster.
2011-01-17Introduce a special instruction for select_val with two valuesBjörn Gustavsson
The new instruction will save one word (because no size operand is needed), and is slightly faster. Handle select_tuple_arity in the same way.
2011-01-17Introduce a few more specialized put_list instructionsBjörn Gustavsson
2011-01-17Eliminate the "put_list c n Dst" instructionsBjörn Gustavsson
Since the literal (constant) pool was introduced in R12, the BEAM compiler will never generate a "put_list Const [] Dst" instruction (it will instead generate a "move [Const] Dst" instruction).
2011-01-17Eliminate the specific move_sd instructionBjörn Gustavsson
The move_sd specific instruction is no longer used since there are specific move instructions covering all possible permutations of operands. Also eliminate the move_cy instruction because it is almost never generated by the compiler.
2011-01-17Eliminate use of GetArg1() in the badmatch and case_end instructionsBjörn Gustavsson
Create separate instructions for each register type. The "badmatch x(0)" and "case_end x(0)" (which are very common) will only require a single word each, compared to two words when GetArg1() is used.
2011-01-17Eliminate use of GetArg2() in the i_element instructionBjörn Gustavsson
Use separate instructions for each register type.
2011-01-17Eliminate use of GetArg1() in the fast_element instructionBjörn Gustavsson
Use separate instructions for each register type.
2011-01-17Eliminate use of GetArg1() in the jump_on_val* instructionsBjörn Gustavsson
2011-01-17Eliminate use of GetArg1() in the select_val instructionBjörn Gustavsson
Instead of having one i_select_val_sfI instruction that uses the GetArg1() macro to fetch the controlling expression, use three separate instructions for each of the register types. That will save one word when selecting on the {x,0} register. It should also be slightly faster since a conditional branch is eliminated. Although it seems that the BEAM compiler will never generate a constant controlling expression (even with optimizations turned off), we still make sure that they will work by evaluating the select_val instruction at load time. Handle the select_tuple_arity instruction in the same way.
2011-01-17beam_emu: Eliminate sloppy use of tmp_arg1 and tmp_arg2Björn Gustavsson
The tmp_arg1 and tmp_arg2 variables are intended for transferring values from the fetch/2 instructions to instructions such as i_plus/3. In many places, however, tmp_arg1 and tmp_arg2 are used as general temporary variables within a single instruction. Improve the code generation by replacing sloppy use of tmp_arg1 and tmp_arg2 with block-local variables. In most cases, that will allow the temporary values to be kept in registers.
2011-01-17beam_emu: Don't inline helper functions into process_main()Björn Gustavsson
By default, GCC will inline calls to helper functions. Since process_main() is already huge, there is no reason to inline the helper functions (and some of them are used very seldom).
2011-01-17beam_emu: Clean up calling of the error_handler moduleBjörn Gustavsson
There were two separate functions (call_error_handler() and call_breakpoint_handler()) that were identical except for the name of the function in the error_handler module being called. Generalize call_error_handler() by adding a function name argument so that it can be used for both purposes. Also let the call_error_handler() return the new program counter instead of passing it in c_p->i. That slightly decrease the code size at the call site. There is also no need to use the Dispatch() macro to yet again decrease the reduction counter, because that has just been done by the call instruction that caused the execution of the call_error_handler or i_debug_breakpoint instruction.
2011-01-17Simplify a select_val instruction that selects only one valueBjörn Gustavsson
The compiler does not generate select_val instructions that only selects one value, but the loader may previously have created such an instruction when it splitted a select_val instruction that selected on bignums.
2011-01-17Optimize creation of tuplesBjörn Gustavsson
Combine the put_tuple/2 and all following put/1 instructions to one i_put_tuple/2 instruction. In general, that will reduce the number of instruction words by 50 percent. Measurements seem to indicate that the speed is about the same.
2011-01-17beam_load: Run the packing engine before loading list argumentsBjörn Gustavsson
2011-01-17Allow packing of some more instructionsBjörn Gustavsson
2011-01-17Support packing of the 'I' type in a 64-bit emulatorBjörn Gustavsson
In many (not all) cases, the value for the 'I' type will fit into 32 bits.
2011-01-17Eliminate redundant jump instructionsBjörn Gustavsson
2011-01-17Eliminate the special instructions for selecting floats and bignumsBjörn Gustavsson
2011-01-17BEAM loader: Introduce a new move2_xxxx instructionBjörn Gustavsson
2011-01-17BEAM loader: Pack more instructions using a new 'Q' typeBjörn Gustavsson
Introduce a new 'Q' type, similar to 'P' except that it can be packed.
2011-01-17If the wordsize is 64 bits, pack up to 4 operands into a wordBjörn Gustavsson
In the 32-bit BEAM emulator, it is only possible to pack 3 register operands into one word. Therefore, the move2 instruction (that has 4 operands) needs two words for its operands. Take advantage of the larger wordsize in the 64-bit emulator and pack up to 4 operands into a single word.
2011-01-17BEAM loader: Combine is_type/1 and is_eq/1 instructionsBjörn Gustavsson
In the transformation engine in the loader, an is_eq/1 instruction is currently always preceded by an is_type/1 instruction. Therefore, save a word and slight amount of time by combining those instructions into an is_type_eq/2 instruction.
2011-01-17beam_debug: Fix dissambly of some variable-operand instructionsBjörn Gustavsson
The i_jump_on_val_zero/3 and i_select_tuple_arity/3 instructions were not disassembled correctly.
2011-01-17beam_debug: Change one occurrence of "X[0]" to "x[0]" for consistencyBjörn Gustavsson
2011-01-17BEAM loader: Fix bug in handling of "rest" argumentsBjörn Gustavsson
It would only really work in simple case like: select_val S=q Fail=f Size=u Rest=* => ... where all operands for a single instruction where bound to variables, and not for more complicated cases such as: i_put_tuple Dst Arity Puts=* | put PutSrc => ...
2011-01-17Remove the last vestiges of the allocating fmove/2 instructionBjörn Gustavsson
There was a version of the BEAM loader and emulator that had two versions of the fmove/2 instruction, one version that allocated heap space internally and a newer version that assumed that a previous test_heap/2 instruction had already allocated the heap space. Though the allocating fmove/2 instruction is no longer supported, some vestiges of it still remains.
2011-01-17Add erts_debug:instructions/0 for listing all specific instructionsBjörn Gustavsson
erts_debug:instructions/0 is useful for finding which specific instructions that are not used at all.
2010-12-03Merge branch 'pan/unicode-filenames/OTP-8887' into devPatrik Nyblom
* pan/unicode-filenames/OTP-8887: (27 commits) Test and correct filelib and filename Add documentation to erlang.xml and slight correction to unicode_usage.xml Add section about Unicode file names to stdlib users guide Correct bug in file_name_SUITE making it fail on Unix instead of Windows7 Add documentation about raw filenames and Unicode file name translation mode Make filelib not crash on re codepoints beyond 255 in re when filename is raw Mend on_load_embedded testcase which did not handle windows links Correct testcase regarding windows versions supporting soft links. Teach filelib to use re in unicode mode when filenames are not raw Treat soft links on Windows correctly in file_name_SUITE Adapt new soft and hard link routines on Windos to Unicode Corrected testcases broken by unicode filenames Update preloaded prim_file Teach prim_file not to accept atoms and not to throw exceptions Adapt inet_drv to Visual Studio 2008 Teach spawn_executable about Unicode Convert filenames read on MacOSX to canonical form Teach file to accept codepoints beyond 255. Add testcases Correct shell utilities to handle unicode and possibly binaries ...
2010-12-01Merge branch 'rickard/load-balance-wrap/OTP-8950' into devRickard Green
* rickard/load-balance-wrap/OTP-8950: Prevent wrapping of values used during load balancing
2010-12-01Prevent wrapping of values used during load balancingRickard Green
Some integer values used during load balancing could under rare circumstances wrap causing a load unbalance between schedulers.
2010-11-30Teach prim_file not to accept atoms and not to throw exceptionsPatrik Nyblom
2010-11-30Teach spawn_executable about UnicodePatrik Nyblom
Also corrected compressed files on Windows
2010-11-30Convert filenames read on MacOSX to canonical formPatrik Nyblom
2010-11-30Make Unicode filenames work on WindowsPatrik Nyblom
2010-11-30Handle binary file names and conversion of unicode stringsPatrik Nyblom
2010-11-29Teach binary:matches not to return 'nomatch' on empty inputPatrik Nyblom
2010-11-29Teach filename to accept raw data and add filename enc option to emuPatrik Nyblom
2010-11-29Add bifs to translate between erlang filenames and native encodingPatrik Nyblom
2010-11-25NIF 64-bit integer get/make bugfix for halfword emulator.Sverker Eriksson
2010-11-25Teach erl_alloc.c not to disable internal allocators for halfwordPatrik Nyblom
2010-11-22ETS 'compressed' option.Sverker Eriksson
The compressed format is using a slighty modified variant of the extern format (term_to_binary). To not worsen key lookup's too much, the top tuple itself and the key element are not compressed. Table objects with only immediate non-key elements will therefor not gain anything (but actually consume one extra word for "alloc_size").
2010-11-18Merge branch 'rickard/cpu-groups/OTP-8861' into devRickard Green
* rickard/cpu-groups/OTP-8861: Generalize reader groups Move cpu topology functionality into erl_cpu_topology.[ch] Do not use more reader groups for schedulers than schedulers Conflicts: erts/emulator/beam/erl_init.c
2010-11-18Generalize reader groupsRickard Green
Reader groups have been generalized to cpu groups which can be used for implementing reader groups, but also for implementing other functionality in the future.
2010-11-18Move cpu topology functionality into erl_cpu_topology.[ch]Rickard Green
2010-11-18Do not use more reader groups for schedulers than schedulersRickard Green
When the runtime system had fewer schedulers than logical processors, the system could get an unnecessarily large amount reader groups.
2010-11-18Merge branch 'rickard/sys_schedule_debug' into devRickard Green
* rickard/sys_schedule_debug: Verify that no outstanding I/O exist when checking for I/O in debug build
2010-11-18Verify that no outstanding I/O exist when checking for I/O in debug buildRickard Green
2010-11-18Merge branch 'pg/fix-system_info-cpu_topology-segfault' into devRickard Green
* pg/fix-system_info-cpu_topology-segfault: Fix crash with erlang:system_info({cpu_topology,junk}) OTP-8914