aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2019-01-29Merge branch 'john/compiler/refactor-validator-type-mgmt'John Högberg
* john/compiler/refactor-validator-type-mgmt: beam_validator: Add explicit assertions for fragile terms beam_validator: Refactor type management
2019-01-29Merge pull request #2112 from bjorng/bjorn/compiler/compilation-speedBjörn Gustavsson
Speed up the compiler when compiling the idna package
2019-01-29Merge pull request #2111 from bjorng/bjorn/compiler/not-problem/ERL-840Björn Gustavsson
Fix problems compiling Scalaris
2019-01-29Merge branch 'bjorn/compiler/beam_except'Björn Gustavsson
* bjorn/compiler/beam_except: beam_except: Eliminate unsafe function_clause translation
2019-01-28Merge PR-2108 from sverker/ets-doc-iter-oddity/OTP-15325Sverker Eriksson
Add ETS doc note about subtle iteration oddities
2019-01-28beam_validator: Add explicit assertions for fragile termsJohn Högberg
We haven't seen any related bugs so far, but all instructions that place a term in another ought to reject fragile inputs. It can't hurt to check.
2019-01-28beam_validator: Refactor type managementJohn Högberg
Our current type management (based on set_type_reg etc) is rather error-prone, often requiring special cases on a per-instruction basis. This commit replaces nearly all ad-hoc mechanisms with more general abstractions: * assign - Moves a term. * create_term - Creates a new term. * extract_term - Extracts a term from another, maintaining fragility as required. * update_type - Adds more type information about a register. * type_test - Helper function for type tests that subtracts on failure and meets on success.
2019-01-28beam_except: Eliminate unsafe function_clause translationBjörn Gustavsson
The translation from `error(function_clause, Args)` to a jump to the `func_info` label is not safe if there is a stack frame.
2019-01-28Speed up beam_ssa_deadBjörn Gustavsson
Compilation of code similar the following would be very slow: uts46_map(CP) when 0 =< CP, CP =< 44 -> '3'; uts46_map(CP) when 45 =< CP, CP =< 46 -> 'V'; uts46_map(CP) when 48 =< CP, CP =< 57 -> 'V'; %% More than 2500 similar lines follows. . . . The code is from from: https://github.com/benoitc/erlang-idna/blob/3eb54ccbfa6fb917c0f4ca9197da337ad888ffe0/src/idna_mapping.erl#L6780 By using information about skippable blocks, the beam_ssa_dead pass can be sped up to compile idna_mapping.erl about 10 times faster.
2019-01-28Speed up ssa_opt_merge_blocksBjörn Gustavsson
It is never possible to merge a block ending in a switch with the next block, so it is not necessary to call `beam_ssa:successors/1` in that case. Avoiding the call slightly improves compilation speeds for switches with many branches.
2019-01-28Fix crash in beam_ssa_typeBjörn Gustavsson
To improve compilation times, beam_ssa_type keeps track of variables that are only used once and don't keep types for those variables. As currently implemented, it turns to be unsafe. Change it to only keep track of variables that are only used in the terminator of the block they are defined in. https://bugs.erlang.org/browse/ERL-840
2019-01-28beam_ssa_opt: Make phase/4 tail-recursiveBjörn Gustavsson
If compilation failed, the name of the current function *and* all previously compiled functions would be printed because phase/4 was not tail-recursive. https://bugs.erlang.org/browse/ERL-840
2019-01-25Merge branch 'maint'Hans Nilsson
* maint: ssh: Internal refactor and ct:log -> ct:pal ssh: Change unit in measurements ssh: Invert ssh_bench
2019-01-25ssh: Internal refactor and ct:log -> ct:palHans Nilsson
2019-01-25ssh: Change unit in measurementsHans Nilsson
2019-01-25ssh: Invert ssh_benchHans Nilsson
2019-01-25Merge branch 'maint'Hans Nilsson
* maint: crypto: Reorg crypto: Misc fixes: double time, calibrate once
2019-01-25crypto: ReorgHans Nilsson
2019-01-25crypto: Misc fixes: double time, calibrate onceHans Nilsson
2019-01-25Merge branch 'maint'Lukas Larsson
* maint: Updated OTP version Prepare release Include erlang-logo128.png in release Enable setting custom application icon for Mac OS X through environment variable Update to icon with better resolution
2019-01-25Merge branch 'maint-21' into maintLukas Larsson
* maint-21: Updated OTP version Prepare release
2019-01-25Merge pull request #2029 from richcarl/mnesia-read-local-if-availableDan Gudmundsson
Mnesia should always use the local context if available OTP-15550
2019-01-25Merge pull request #2094 from jfacorro/change-application-icon-mac-os-xDan Gudmundsson
Enable a way to change the application icon for Mac OS X in wx
2019-01-25Merge branch 'maint'Siri Hansen
2019-01-25Merge branch 'siri/cover/searchable-uncovered/OTP-15542' into maintSiri Hansen
* siri/cover/searchable-uncovered/OTP-15542: [cover] Make uncovered lines searchable in html output [cover] Right-align number of hits in html output
2019-01-25Merge branch 'john/compiler/trim-ignore-annos'John Högberg
* john/compiler/trim-ignore-annos: beam_trim: Ignore type annotations
2019-01-25Merge branch 'john/compiler/misc-validator-fixes/ERL-832'John Högberg
* john/compiler/misc-validator-fixes/ERL-832: Make the beam_validator smarter again, again
2019-01-25Merge pull request #2106 from bjorng/bjorn/compiler/fewer-movesBjörn Gustavsson
Reduce redundant moves and register shuffling
2019-01-25Merge pull request #2104 from bjorng/bjorn/compiler/ssa-opt-tail-phisBjörn Gustavsson
Introduce optimizations of tail building
2019-01-24Merge branch 'maint'Rickard Green
* maint: Pluggable distribution socket implementation for EI
2019-01-24Merge branch 'rickard/ei-ext-maint/OTP-15442' into maintRickard Green
* rickard/ei-ext-maint/OTP-15442: Pluggable distribution socket implementation for EI
2019-01-24stdlib: Add ets doc note about subtle iteration odditiesSverker Eriksson
as it has been made more relevant with the introduction of write_concurrency for ordered_set.
2019-01-24Make the beam_validator smarter again, againJohn Högberg
The fix in f9ea85611faca82c7494449ddb8bcb1ef1d194cb didn't consider that the tested register could be aliased.
2019-01-24beam_trim: Ignore type annotationsJohn Högberg
The type annotations inserted by beam_ssa_type and beam_ssa_bsm would inadvertently disable stack trimming, as unknown instructions are considered unsafe.
2019-01-24Merge branch 'maint'Sverker Eriksson
2019-01-24Merge PR-2103 from sverker/ets-iteration-doc/OTP-15545Sverker Eriksson
Clarify ETS docs about table iterations
2019-01-24stdlib: Clarify ets docs about table iterationsSverker Eriksson
2019-01-24Introduce optimizations of tail phisBjörn Gustavsson
Try to eliminate short blocks that starts with a phi node and end in a return. For example: Result = phi { Res1, 4 }, { literal true, 5 } Ret = put_tuple literal ok, Result ret Ret The code in this block can be inserted at the end blocks 4 and 5. Thus, the following code can be inserted into block 4: Ret:1 = put_tuple literal ok, Res1 ret Ret:1 And the following code into block 5: Ret:2 = put_tuple literal ok, literal true ret Ret:2 Which can be further simplified to: ret literal {ok, true} This transformation may lead to more code improvements, for example: * Stack trimming * Fewer test_heap instructions * Smaller stack frames
2019-01-24Prepare releaseErlang/OTP
2019-01-24Merge branch 'ingela/inets/httpc-ipv6-brackets/OTP-15544' into maint-21Erlang/OTP
* ingela/inets/httpc-ipv6-brackets/OTP-15544: inets: httpc - Do not use bracked addresses to gen_tcp or ssl calls
2019-01-24Merge branch 'lukas/erts/fix_inet_multitimer_cleanup/OTP-15536' into maint-21Erlang/OTP
* lukas/erts/fix_inet_multitimer_cleanup/OTP-15536: erts: Fix cleanup of the inet MultiTimer
2019-01-24Merge pull request #2100 from jhogberg/john/compiler/module-type-optimizationJohn Högberg
Apply type optimizations across local function calls
2019-01-24compiler: Introduce module-level type optimizationJohn Högberg
This commit lets the type optimization pass work across functions, tracking return and argument types to eliminate redundant tests.
2019-01-24beam_ssa_opt: Add a scaffold for module-level optimizationsJohn Högberg
This serves as a base for the upcoming module-level type optimization, but may come in handy for other passes like beam_ssa_funs and beam_ssa_bsm that have their own ad-hoc implementations.
2019-01-24Reduce redundant moves and register shufflingBjörn Gustavsson
Consider this function and its corresponding BEAM code: foo(Map, Key) -> Val = case Map of #{Key:=Val0} -> Val0; _ -> default end, bar(1, 2, Val). {label,2}. {test,is_map,{f,3},[{x,0}]}. {get_map_elements,{f,3},{x,0},{list,[{x,1},{x,0}]}}. ^^^^^ {jump,{f,4}}. {label,3}. {move,{atom,default},{x,0}}. ^^^^^ {label,4}. {move,{integer,2},{x,1}}. {move,{x,0},{x,2}}. ^^^^^ {move,{integer,1},{x,0}}. {call_only,3,{f,6}}. Note that the value of the variable `Val` will first be placed in `{x,0}` and then moved to `{x,2}` where it needs to be when calling the `bar/3` function. The reason for the extra `move` instruction is that the register allocator picks the lowest numbered available register when choosing a register to put a variable in. In this case, `{x,0}` will be chosen. If we only could give a hint to the register allocator that it would be better to put `Val` in `{x,2}`, the extra `move` would disappear: {label,2}. {test,is_map,{f,3},[{x,0}]}. {get_map_elements,{f,3},{x,0},{list,[{x,1},{x,2}]}}. {jump,{f,4}}. {label,3}. {move,{atom,default},{x,2}}. {label,4}. {move,{integer,2},{x,1}}. {move,{integer,1},{x,0}}. {call_only,3,{f,6}}. There already is an existing sub pass (`reserve_regs`) in `beam_ssa_pre_codegen` that among things tries to give the register allocator hints that some variables should be placed in specific registers, if possible. However, the existing hinting mechanism is limited, essentially only working within a single SSA block. This commit extends the hinting mechanism, allowing hints to be passed across SSA blocks, eliminating `move` instructions and register shuffling in many places. (494 modules out of a sample of 1236 modules were changed by this commit.)
2019-01-23Include erlang-logo128.png in releaseJuan Facorro
2019-01-23Enable setting custom application icon for Mac OS X through environment variableJuan Facorro
2019-01-23Update to icon with better resolutionJuan Facorro
2019-01-23Merge branch 'rickard/ei-ext/OTP-15442' into rickard/ei-ext-maint/OTP-15442Rickard Green
2019-01-23Pluggable distribution socket implementation for EIRickard Green