aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
AgeCommit message (Collapse)Author
2017-08-31Add annotations for likely/unlikelyBjörn Gustavsson
In a correct Erlang programs, we can expect that: * A GC test instruction (such as test_heap) is more likely not to do the GC. * A BIF is more likely to succeed than to fail. * A BIF is more likely to fail in a guard than in a body. * An apply or fun call is likely to succeed. Annotate conditions accordingly.
2017-08-31ops.tab: Mark infrequently used instructions as %coldBjörn Gustavsson
Instructions that used to be implemented in beam_emu.c were not marked as cold as it would make no difference.
2017-08-31Introduce '%warm' and beam_warm.hBjörn Gustavsson
The bit syntax instructions are mixed among other instructions in beam_hot.h and beam_cold.h. Introduce a new hotness level called '%warm' with is associated file beam_warm.h. Mark all bit syntax instructions as '%warm'.
2017-08-30Merge pull request #1548 from bjorng/bjorn/erts/remove-float-constant-bcBjörn Gustavsson
Remove backward compatibility support for float literals OTP-14575
2017-08-28Merge branch 'rickard/dist/OTP-14459' into rickard/dist/master/OTP-14459Rickard Green
Conflicts: erts/emulator/beam/bif.c erts/emulator/beam/dist.c erts/emulator/beam/dist.h erts/emulator/beam/erl_bif_info.c erts/emulator/beam/erl_node_tables.c erts/emulator/beam/erl_node_tables.h erts/emulator/beam/external.c
2017-08-28Introduce sender in distributed signals and dflag configurationRickard Green
2017-08-28Optimize dist entry managementRickard Green
2017-08-28Support for distribution controller processesRickard Green
2017-08-28Remove backward compatibility support for float literalsBjörn Gustavsson
Starting from R16B, floating point constants are stored in the literal pool. The backward compatibility support for the old representation of floats has been kept long enough. Also, we might want to ensure that all literals are unique in the future, and we certainly don't want to update this code to ensure uniqueness.
2017-08-24Merge branch 'maint'Rickard Green
* maint: Fix BIF timer race between timeout and auto cleanup Conflicts: erts/emulator/beam/erl_hl_timer.c
2017-08-24Merge branch 'rickard/btm-auto-cleanup-bug/OTP-14554' into maintRickard Green
* rickard/btm-auto-cleanup-bug/OTP-14554: Fix BIF timer race between timeout and auto cleanup
2017-08-24Merge branch 'maint'Rickard Green
* maint: Fix scheduler id field in timers Conflicts: erts/emulator/beam/erl_hl_timer.c
2017-08-24Merge branch 'rickard/timer-sid-bug/OTP-14548' into maintRickard Green
* rickard/timer-sid-bug/OTP-14548: Fix scheduler id field in timers Conflicts: erts/emulator/beam/erl_hl_timer.c
2017-08-24Merge branch 'bjorn/erts/improve-beam-ops'Björn Gustavsson
* bjorn/erts/improve-beam-ops: arith_instrs.tab: Clean up bsl/bsr beam_makeops: Stop using the Arg() macro Eliminate the beam_instrs.h file Add the 'S' type for a register source Introduce more packable types Pack cold instructions too Pack instructions using 'q', 'c', and 's' beam_makeops: Rewrite the packer, fixing several bugs Make map update instruction functions indepedent of instruction format beam_makeops: Introduce the new type 'W' (machine word) Use the wait_timeout_{un}locked_int instructions beam_makeops: Remove the unused aliases 'N' and 'U' beam_makeops: Add an additional sanity check beam_makeops: Prevent truncation when packing 'I' values Improve performance for bsl/bsr arith_instrs.tab: Eliminate warning for uninitialized value beam_emu: Remove unused macros beam_makeops: Remove unused subroutine save_c_code Add missing -no_next for badarg instruction
2017-08-24Merge branch 'maint'Raimo Niskanen
Conflicts: OTP_VERSION
2017-08-24Merge branch 'maint-20' into maintRaimo Niskanen
* maint-20: Updated OTP version Prepare release Accept non-binary options as socket-options Bump version Fix broken handling of default values in extensions for PER compiler: Fix live regs update on allocate in validator Take fail labels into account when determining liveness in block ops Check for overflow when appending binaries, and error out with system_limit
2017-08-23Fix BIF timer race between timeout and auto cleanupRickard Green
2017-08-23Fix scheduler id field in timersRickard Green
2017-08-23arith_instrs.tab: Clean up bsl/bsrBjörn Gustavsson
Eliminate the all-purpose variable 'ires'. Replace it with several variables used that are used for their specific purpose. Narrow the scope of the variables. Do this to improve readability. It is not expected that it should any impact on performance.
2017-08-23Merge branch 'maint'Rickard Green
* maint: Unicode support for erlang:display_string/1
2017-08-23Merge branch 'rickard/unicode-display_string/OTP-14545' into maintRickard Green
* rickard/unicode-display_string/OTP-14545: Unicode support for erlang:display_string/1
2017-08-23Unicode support for erlang:display_string/1Rickard Green
2017-08-23Merge branch 'maint'Sverker Eriksson
2017-08-23Merge branch 'lukas/erts/fix_dirty_trace_message_flush/OTP-14538'Lukas Larsson
* lukas/erts/fix_dirty_trace_message_flush/OTP-14538: erts: Fix incorrect merge of dirty_trace_message_flush fix to master
2017-08-23Merge branch 'sverker/halt-unicode-slogan/OTP-14553' into maintSverker Eriksson
* sverker/halt-unicode-slogan/OTP-14553: erts: Allow any unicode string as crash dump slogan erts: Generate crash_dump slogan string as UTF8 erts: Refactor erts_unicode_list_to_buf
2017-08-23erts: Fix incorrect merge of dirty_trace_message_flush fix to masterLukas Larsson
2017-08-23Eliminate the beam_instrs.h fileBjörn Gustavsson
The beam_instrs.h file serves no useful purpose. Put the instructions in beam_hot.h instead.
2017-08-23Add the 'S' type for a register sourceBjörn Gustavsson
The type 'd' could be used both for destination registers and source register. Restrict the 'd' type to only be used for destinations, and introduce the new 'S' type to be used when a source must be a register.
2017-08-23erts: Allow any unicode string as crash dump sloganSverker Eriksson
i.e the first argument to erlang:halt
2017-08-23Merge branch 'john/erts/fix-binary-append-syslimit/OTP-14524' into maint-20Erlang/OTP
* john/erts/fix-binary-append-syslimit/OTP-14524: Check for overflow when appending binaries, and error out with system_limit # Conflicts: # erts/emulator/test/bs_construct_SUITE.erl
2017-08-23Introduce more packable typesBjörn Gustavsson
The 'I' type can be replaced with 't' if we know that the value will fit in 16 bits. The 'P' type can be replaced with 'Q' if it is used for deallocating a stack frame.
2017-08-23Pack instructions using 'q', 'c', and 's'Björn Gustavsson
Update the pack engine to safely push literal operands to the pack stack and to safely pop them back to another code address. That will allow packing of more instructions.
2017-08-23beam_makeops: Rewrite the packer, fixing several bugsBjörn Gustavsson
The packer had several bugs and limitations. For instance, on a 32-bit Erlang virtual machine it would gladly pack three 't' values into one word even though it would be not safe. The rewritten version will be more careful how much it packs into each word. It will also be able to do packing for more instructions.
2017-08-23Make map update instruction functions indepedent of instruction formatBjörn Gustavsson
Having the helper functions for map update knowing all the details of operands for the instruction will make it difficult to make improvements such as better packing.
2017-08-23beam_makeops: Introduce the new type 'W' (machine word)Björn Gustavsson
As a preparation for potentially improving packing in the future, we will need to make sure that packable types have a defined maximum size. The packer algorithm assumes that two 'I' operands can be packed into one 64-bit word, but there are instructions that use an 'I' operand to store a pointer. It only works because those instructions are not packed for other reasons. Introduce the 'W' type and use it for operands that don't fit in 32 bits.
2017-08-23Use the wait_timeout_{un}locked_int instructionsBjörn Gustavsson
The transformations were incorrect.
2017-08-23Improve performance for bsl/bsrBjörn Gustavsson
Eliminate the variable used for holding which BIF (bsl or bsr). It seems to improve performance slightly.
2017-08-23arith_instrs.tab: Eliminate warning for uninitialized valueBjörn Gustavsson
Make it clear to GCC that shift_left_count is initialized.
2017-08-23beam_emu: Remove unused macrosBjörn Gustavsson
2017-08-22Merge branch 'lukas/erts/HRelease-assert'Lukas Larsson
* lukas/erts/HRelease-assert: erts: Add HRelease endp assert
2017-08-22Add missing -no_next for badarg instructionBjörn Gustavsson
2017-08-16Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/beam/erl_nif.c erts/emulator/beam/erl_process.c
2017-08-16Merge branch 'lukas/erts/fix_dirty_trace_message_flush/OTP-14538' into maintLukas Larsson
* lukas/erts/fix_dirty_trace_message_flush/OTP-14538: erts: Must have main lock when flushing trace messages
2017-08-15Slightly optimize updating of mapsBjörn Gustavsson
The instruction put_map_assoc/5 (used for updating a map) has a failure operand, but it can't actually fail provided that its "map" argument is a map. The following code: M#{key=>value}. will be compiled to: {test,is_map,{f,3},[{x,0}]}. {line,[...]}. {put_map_assoc,{f,0},{x,0},{x,0},1,{list,[{atom,key},{atom,value}]}}. return. {label,3}. %% Code that produces a 'badmap' exception follows. Because of the is_map instruction, {x,0} always contains a map when the put_map_assoc instruction is executed. Therefore we can remove the failure operand. That will save one word, and also eliminate two tests at run-time. The only problem is that the compiler in OTP 17 did not emit a is_map instruction before the put_map_assoc instruction. Therefore, we must add an instruction that tests for a map if the code was compiled with the OTP 17 compiler. Unfortunately, there is no safe and relatively easy way to known that the OTP 17 compiler was used, so we will check whether a compiler before OTP 20 was used. OTP 20 introduced a new chunk type for atoms, which is trivial to check.
2017-08-14Merge branch 'rickard/non-smp-removal-cleanup/OTP-14518'Lukas Larsson
* rickard/non-smp-removal-cleanup/OTP-14518: erts: Cleanup erl and erlang docs after non-smp removal erts: Remove unused prototypes after non-smp removal
2017-08-14erts: Remove unused prototypes after non-smp removalRickard Green
2017-08-11Make '0 bsl BigNumber' consistently succeedBjörn Gustavsson
'0 bsl 134217728' would fail with a system limit exception on a 32-bit BEAM machine, but not on a 64-bit BEAM machine. Smaller values on the right would always work. Make erlang:bsl(0, BigNumber) always return 0 to make for consistency. (The previous commit accidentally did that change for '0 bsl BigNumber'.)
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.
2017-08-01Check for overflow when appending binaries, and error out with system_limitJohn Högberg
This fixes the following bug: A = <<0:((1 bsl 32)-8)>>, B = <<2, 3>>. B =:= <<A/binary,1,B/binary>>. %% Evaluated to true...