aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
AgeCommit message (Collapse)Author
2018-09-06Merge branch 'maint'Rickard Green
* maint: Fix an endless rescheduling loop when a process is executing process_info(self(), ...)
2018-09-06Merge pull request #1943 from max-au/handle_signals_before_dirty_gcRickard Green
Fix an endless rescheduling loop when a process is executing process_… OTP-15275
2018-09-05Merge branch 'maint'Sverker Eriksson
2018-09-05Merge branch 'sverker/erts/ets-memstat-false-leak/ERL-720/OTP-15278' into maintSverker Eriksson
* sverker/erts/ets-memstat-false-leak/ERL-720/OTP-15278: erts: Refactor ets FixedDeletion allocations erts: Fix ets memstat false leak of FixedDeletion
2018-09-05Merge pull request #1947 from bjorng/bjorn/opt-put-tupleBjörn Gustavsson
Introduce a put_tuple2 instruction
2018-09-04Fix an endless rescheduling loop when a process is executing ↵Maxim Fedorov
process_info(self(), ...) It is possible that a process has to yield before completing process_info BIF when it runs out of reductions. If this BIF is called by the process itself, it does not send a signal but executes in the context of a process. If it has to yield, it turns F_LOCAL_SIGS_ONLY flag on, which means new signals won't be fetched from the outer message queue. When the same process needs to execute dirty system code (e.g. dirty GC) it has to be run on a dirty scheduler. However signals enqueued into outer queue cause it to be rescheduled on a normal scheduler. F_LOCAL_SIGS_ONLY prevent outer queue signals delivery, creating an endless rescheduling loop. This commit disengages F_LOCAL_SIG_ONLY if process needs to execute dirty code in order to complete signal delivery and allow process to be moved to dirty run queue.
2018-09-04Merge branch 'maint'Sverker Eriksson
2018-09-04Merge PR-1920 from saleyn/float_to_list OTP-15276Sverker Eriksson
Fix bug in compact representation of float_to_list/2
2018-09-03erts: Refactor ets FixedDeletion allocationsSverker Eriksson
2018-09-03erts: Fix ets memstat false leak of FixedDeletionSverker Eriksson
causing erlang:memory to report too much ets memory.
2018-09-03Introduce a put_tuple2 instructionBjörn Gustavsson
Sometimes when building a tuple, there is no way to avoid an extra `move` instruction. Consider this code: make_tuple(A) -> {ok,A}. The corresponding BEAM code looks like this: {test_heap,3,1}. {put_tuple,2,{x,1}}. {put,{atom,ok}}. {put,{x,0}}. {move,{x,1},{x,0}}. return. To avoid overwriting the source register `{x,0}`, a `move` instruction is necessary. The problem doesn't exist when building a list: %% build_list(A) -> [A]. {test_heap,2,1}. {put_list,{x,0},nil,{x,0}}. return. Introduce a new `put_tuple2` instruction that builds a tuple in a single instruction, so that the `move` instruction can be eliminated: %% make_tuple(A) -> {ok,A}. {test_heap,3,1}. {put_tuple2,{x,0},{list,[{atom,ok},{x,0}]}}. return. Note that the BEAM loader already combines `put_tuple` and `put` instructions into an internal instruction similar to `put_tuple2`. Therefore the introduction of the new instruction will not speed up execution of tuple building itself, but it will be less work for the loader to load the new instruction.
2018-09-03Merge branch 'maint'Björn Gustavsson
* maint: ops.tab: Fix potentially unsafe optimization of raise/2
2018-09-03ops.tab: Fix potentially unsafe optimization of raise/2Björn Gustavsson
The operands for the raise/2 instruction are almost always in x(2) and x(1). Therefore the loader translates the raise/2 instruction to an i_raise/0 instruction which uses the values in x(2) and x(1). If the operands happens to be in other registers, the loader inserts move/2 instruction to move them to x(2) and x(1). The problem is that x(3) is used as a temporary register when generating the move/2 instructions. That is unsafe if the Value operand for raise/2 is x(3). Thus: raise x(0) x(3) will be translated to: move x(0) x(3) move x(3) x(1) move x(3) x(2) i_raise The Trace will be written to both x(2) and x(1). The current compiler will never use x(3) for the Value operand, so there is no need to patch previous releases. But a future compiler version might allocate registers differently.
2018-08-30Merge branch 'maint'Rickard Green
* maint: Updated OTP version Update release notes Update version numbers Fix missing 'in' trace events during 'running' trace
2018-08-30Merge branch 'maint-21' into maintRickard Green
* maint-21: Updated OTP version Update release notes Update version numbers Fix missing 'in' trace events during 'running' trace
2018-08-29Merge branch 'rickard/running-trace-fix/ERL-713/OTP-15269' into maint-21Erlang/OTP
* rickard/running-trace-fix/ERL-713/OTP-15269: Fix missing 'in' trace events during 'running' trace
2018-08-27Fix bug in compact representation of float_to_list/2Serge Aleynikov
2018-08-27Fix missing 'in' trace events during 'running' traceRickard Green
'in' trace events could be lost when a process had to be rescheduled on another scheduler type (normal <-> dirty).
2018-08-24Merge branch 'bjorn/compiler/ssa'Björn Gustavsson
* bjorn/compiler/ssa: Travis CI: Run the SSA linter in the Linux64SmokeTest build Remove retired compiler passes Introduce a new SSA-based intermediate format hipe_beam_to_icode: Correct translation of get_map_elements beam_dead: Remove shortcut of binary matching instruction beam_bs: Remove optimizations that are easier done on SSA format Don't run unsafe compiler passes Simplify optimizations by introducing is_nil late beam_utils: Make is_tagged_tuple a pure test beam_except: Enhance recognition of function_clause exceptions beam_validator: Infer the types of copies in a smarter way beam_validator: Improve merge of cons and literal list beam_validator: Strengthen validation of func_info beam_validator: Allow get_tuple_element before dsetelement beam_validator: Don't transfer state to labels that can't be reached beam_validator: Improve type analysis for tuples beam_validator: Be more careful when updating try/catch state beam_trim: Handle an empty list of instructions v3_core: Number argument variables in ascending order Teach binary instructions to use Y registers as destination OTP-14894
2018-08-23Merge pull request #1932 from josevalim/jv-sb-bm/OTP-15238Lukas Larsson
Do not allocate good and bad shifts for single byte lookups
2018-08-21Merge branch 'max-au/dist_msg_too_long'Rickard Green
* max-au/dist_msg_too_long: Cleanup unused dist output buf immediately instead of at GC Throw 'system_limit' when distribution message size exceed INT_MAX instead of crashing emulator with 'Absurdly large distribution data buffer'
2018-08-21Cleanup unused dist output buf immediately instead of at GCRickard Green
2018-08-21Merge branch 'maint'Rickard Green
* maint: Fix incoming suspend monitor down
2018-08-21Merge branch 'rickard/fix-suspend-monitor-down/OTP-15237/ERL-704' into maintRickard Green
* rickard/fix-suspend-monitor-down/OTP-15237/ERL-704: Fix incoming suspend monitor down
2018-08-20Fix incoming suspend monitor downRickard Green
An incoming suspend monitor down wasn't handled correct when the local monitor half had been removed with an emulator crash as result.
2018-08-17Teach binary instructions to use Y registers as destinationBjörn Gustavsson
The new code generator will use Y registers as a destination for binary construction and matching instructions. v3_codegen would always first store terms in an X register and it would be the responsibility of the optimization passes to optimize the extra moves.
2018-08-16Do not allocate good and bad shifts for single byte lookupsJosé Valim
The single byte lookups always rely on `memchr` and never really use the good and bad shifts arrays.
2018-08-16Merge branch 'josevalim/jv-sb/PR-1803/OTP-15238' into masterLukas Larsson
Optimize binary match from 10% up to 70x
2018-08-15Merge branch 'maint'Björn Gustavsson
* maint: Fix compiler crash when compiling double receives erts: Delete fd from poll-set when closing fd_driver port
2018-08-15merge branch 'lukas/erts/fd_driver-fix_pollset_delete/ERL-692/OTP-15236' ↵Lukas Larsson
into maint erts: Delete fd from poll-set when closing fd_driver port
2018-08-10Merge branch 'rickard/full-cache-nif-env/OTP-15223/ERL-695' into maint-21Erlang/OTP
* rickard/full-cache-nif-env/OTP-15223/ERL-695: Fix caching of NIF environment when executing dirty # Conflicts: # erts/emulator/beam/erl_nif.c
2018-08-10Merge branch 'dotsimon/ref_ordering_bug/OTP-15225' into maint-21Erlang/OTP
* dotsimon/ref_ordering_bug/OTP-15225: Fixed #Ref ordering bug Test #Ref ordering in lists and ets
2018-08-10erts: Delete fd from poll-set when closing fd_driver portLukas Larsson
2018-08-09Merge branch 'maint'Rickard Green
* maint: Fix caching of NIF environment when executing dirty
2018-08-09Merge branch 'rickard/full-cache-nif-env/OTP-15223/ERL-695' into maintRickard Green
* rickard/full-cache-nif-env/OTP-15223/ERL-695: Fix caching of NIF environment when executing dirty
2018-08-09Fix caching of NIF environment when executing dirtyRickard Green
2018-08-09Fixed #Ref ordering bugSimon Cornish
2018-08-09Test #Ref ordering in lists and etsSimon Cornish
2018-08-09Merge branch 'maint'Rickard Green
* maint: Fixed #Ref ordering bug Test #Ref ordering in lists and ets
2018-08-07Fixed #Ref ordering bugSimon Cornish
2018-08-07Test #Ref ordering in lists and etsSimon Cornish
2018-08-07Optimize binary matchJosé Valim
The idea is to use memchr on the first lookup for binary:match/2 and also after every match on binary:matches/2. We only use memchr in case of matches because benchmarks showed that using memchr even when we had false positives could negatively affect performance. This speeds up binary matching and binary splitting by 4x in some cases and by 70x in other scenarios (when the last character in the needle does not occur in the subject). The reason to use memchr is that it is highly specialized in most modern operating systems, often defaulting to SIMD operations. The implementation uses the reduction count to figure out how many bytes should be read with memchr. We could increase those numbers but they do not seem to make a large difference.
2018-08-03josevalim/jv-preserve-map-same-value/PR-1889/OTP-15211Lukas Larsson
Do not allocate a new map when the value is the same
2018-08-03Merge branch 'maint'Lukas Larsson
2018-08-03erts: Fix seq_trace to not clear token for system messagesLukas Larsson
A lot of erts internal messages used behind APIs to create non-blocking calls, e.g. port_command, would cause the seq_trace token to be cleared from the caller when it should not. This commit fixes that and adds asserts that makes sure that all messages sent have to correct token set. Fixes: ERL-602
2018-08-03Merge branch 'maint'Lukas Larsson
2018-08-03Merge branch 'lukas/erts/fix_udp_realloc_bug' into maintLukas Larsson
* lukas/erts/fix_udp_realloc_bug: erts: Limit the automatic max buffer for UDP to 2^16 erts: Free udp buffer when getting EAGAIN
2018-08-03Merge branch 'maint'Lukas Larsson
2018-08-03Merge branch 'lukas/erts/etoomanyrefs_forker/OTP-15210' into maintLukas Larsson
* lukas/erts/etoomanyrefs_forker/OTP-15210: erts: Handle EMFILE errors in forker_driver for write
2018-07-31Merge branch 'maint'Lukas Larsson