aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/ops.tab
AgeCommit message (Collapse)Author
2011-08-03Fix binary construction with huge literal sizesBjörn Gustavsson
Constructing binaries using the bit syntax with literals sizes that would not fit in an Uint will either cause an emulator crash or the loading to be aborted. Use the new TAG_o tag introduced in the previous commit to make sure that the attempt to create huge binary literals will generate a system_limit exception at run-time.
2011-05-20Update copyright yearsBjörn-Egil Dahlberg
2011-03-29BEAM loader: Simplify handling of the func_info/3 instructionBjörn Gustavsson
For some historical reason, the transformation of a func_info/3 instruction to the internal i_func_info/4 instruction is more involved than it needs to be. Remove the gen_func_info() function in the loader and use a simple transformation.
2011-01-17Introduce a few more variations of the move instructionsBjörn Gustavsson
Frequency counts show that move Const x(1) move Const x(2) are very common.
2011-01-17Combine a move + jump sequence into the move_jump instructionBjörn Gustavsson
That will save one word and small amount of time for each occurrence.
2011-01-17Optimize and clean-up the exact equality/non-equality instructionsBjörn Gustavsson
The is_eq_exact/3 and is_ne_exact/3 instructions are commonly used with one immediate or literal operand. Introduce three new specialized instructions: i_is_eq_exact_literal/3 i_is_ne_exact_immed/3 i_is_ne_exact_literal/3 The i_is_ne_exact_literal/3 instruction is not very frequently used, but its existence is justified because we removed in a a previous commit the special instruction for matching bignums and we now use i_is_ne_exact_literal/3 instead. For consistency, rename the existing is_eq_immed/3 instruction to is_eq_exact_immed/3. While at it, remove the optimization of an is_eq/3 instruction with an immediate operand because that optimization is already done by the compiler.
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-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-17Allow packing of some more instructionsBjörn Gustavsson
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-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.
2010-06-03Fix ops.tab to include i_return_time_traceBjörn-Egil Dahlberg
Without the instruction defined in ops the interpreter will not compile when using NO_JUMPTABLE.
2010-06-03Call time breakpoint tracing frameworkBjörn-Egil Dahlberg
Initial commit with a new breakpoint instruction and PSD areas for temporary time storage during tracing.
2010-05-20Remove the bs_bits_to_bytes/3 instructionBjörn Gustavsson
The last compiler to generate code that uses the bs_bits_to_bytes/3 instruction was the R11 compiler. Since we don't support loading R11 *.beam files in R14, removing the remaining support for the instruction.
2010-05-20erts: Stop supporting non-literal empty tuplesBjörn Gustavsson
Since R12B, empty tuples are literals. Thus the compiler will no longer generate the instruction: put_tuple 0 Destination for creating an empty tuple. It is now time to stop supporting that instruction in the run-time system. While we are at it, correct a typo.
2010-05-17Add guard BIFs binary_part/2,3Patrik Nyblom
Add the gc_bif's to the VM. Add infrastructure for gc_bif's (guard bifs that can gc) with two and. three arguments in VM (loader and VM). Add compiler support for gc_bif with three arguments. Add compiler (and interpreter) support for new guard BIFs. Add testcases for new guard BIFs in compiler and emulator.
2010-05-11erts: Implement recv_mark/1 and recv_set/1 for realBjörn Gustavsson
The recv_mark/1 instruction will both save the current position in the message queue and a mark (the address of the loop_rec/2 instruction just following the recv_set/1 instruction). The recv_mark/1 instruction will only use the saved position if the mark is correct. The reason for saving and verifying the mark is that the compiler does not need to guarantee that no other receive instruction can be executed in between the recv_mark/1 and recv_set/1 instructions (the mark will be cleared by the remove_message/0 instruction when a message is removed from the message queue). That means that arbitrary function calls in between those instruction can be allowed.
2010-05-11Introduce the new recv_mark/1 and recv_mark/1 instructionsBjörn Gustavsson
Make the recv_mark/1 and recv_mark/1 instructions known to the compiler and run-time system. For the moment, make the loader ignore any occurrences of those instructions in BEAM files. Also update hipe_beam_to_icode to ignore those instructions.
2010-04-07erts: Fix loading of modules with invalid floating point arithmeticBjörn Gustavsson
The following program is supposed to cause an exception at run-time: foo() -> Sum1 = Sum2 = N = 2, pSum - (Sum1*(Sum2/N)). but the loader fails to load because it contains the following instruction: fconv {atom,pSum} {fr,2} Fix the loader so that it can handle fconv instructions where the first operand is a non-numeric literal. Reported-by: Torbjörn Törnkvist
2010-03-25Merge branch 'bg/compiler-remove-r11-support' into devErlang/OTP
* bg/compiler-remove-r11-support: compiler: Don't support the no_binaries option erts: Don't support the put_string/3 instruction compiler: Don't support the no_constant_pool option compiler: Don't support the r11 option test_server: Don't support communication with R11 nodes binary_SUITE: Don't test bit-level binary roundtrips with R11 nodes erts: Test compatibility of funs with R12 instead of R11 OTP-8531 bg/compiler-remove-r11-support
2010-03-22erts: Don't support the put_string/3 instructionBjörn Gustavsson
Since R14 does not need to load code that can also be loaded in an R11 run-time system, support for the put_string/3 instruction can be removed.
2009-11-20The R13B03 release.OTP_R13B03Erlang/OTP