aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
AgeCommit message (Collapse)Author
2014-01-31compiler: Teach beam_disasm has_map_field instructionBjörn-Egil Dahlberg
2014-01-31compiler: Fold binary Map key patterns to literalsBjörn-Egil Dahlberg
2014-01-31compiler: Strengthen listings testsBjörn-Egil Dahlberg
2014-01-31compiler: Strengthen Maps testsBjörn-Egil Dahlberg
2014-01-29compiler: Add core compile test for mapsBjörn-Egil Dahlberg
2014-01-29compiler: Fix core parse for MapsBjörn-Egil Dahlberg
2014-01-29compiler: Fixup #map_pair{} specBjörn-Egil Dahlberg
2014-01-29compiler: Update inliner testsBjörn-Egil Dahlberg
2014-01-29compiler: Squash #c_map_pair_*{} to #c_map_pair{}Björn-Egil Dahlberg
Simplify compiler internals and parsing of core format.
2014-01-29compiler: Squash #k_map_pair_*{} to #k_map_pair{}Björn-Egil Dahlberg
Simplify compiler internals for kernel passes.
2014-01-29compiler: Fix term order compiler for mapsBjörn-Egil Dahlberg
2014-01-28compiler: Rename map pattern to proper nameBjörn-Egil Dahlberg
2014-01-28compiler: Add Maps types to cerlBjörn-Egil Dahlberg
2014-01-28compiler: Format stacktrace on errorBjörn-Egil Dahlberg
2014-01-28compiler: Teach Maps to beam_disasmBjörn-Egil Dahlberg
2014-01-28compiler: Fix v3_core for map update syntaxBjörn-Egil Dahlberg
Make map update expressions safe, i.e. (foo())#{ k1 := 1 }
2014-01-28compiler: Fix get_map_element bug with allocateBjörn-Egil Dahlberg
The instruction get_map_element has a faillabel so you may not use the instruction within a allocate/deallocate block.
2014-01-28compiler: Test Maps inliningBjörn-Egil Dahlberg
2014-01-28compiler: Teach Maps understanding to inlinerBjörn-Egil Dahlberg
2014-01-28compiler: Implement different instructions for => and :=Björn Gustavsson
2014-01-28Pass the map pair operators through to the v3_codegen passBjörn Gustavsson
2014-01-28sys_core_fold: Remove optimization that has become invalidBjörn Gustavsson
With the => and := operators for updating maps, this optimization is no longer valid.
2014-01-28compiler: Implement support for exact Op in MapsBjörn-Egil Dahlberg
The syntax is handled upto v3_kernel where it is reduced to previous behaviour for construction and updates. Meaning, the ':=' operator is handled exactly as '=>' operator.
2014-01-28Extend representation for maps in Core ErlangBjörn-Egil Dahlberg
2014-01-28Update erl_lint, erl_expand_records, sys_pre_expand for MapsBjörn-Egil Dahlberg
Update erlang lint and syntax expand for #{ K := V }
2014-01-28erts: Add the type-testing guard BIF is_map/1Björn-Egil Dahlberg
To add a type-testing guard BIF, the following steps are needed: * The BIF itself is added to bif.tab (note that it should be declared using "ubif", not "bif"), and its implementation to erl_bif_op.c. * erl_internal must be modified in 3 places: The type test must be recognized as guard BIF, as a type test, and it must be auto-imported. * There must be an instruction that implements the same type test as the BIF (it will be used in guards). beam_utils:bif_to_test/3 must be updated to recognize the new guard BIF.
2014-01-28compiler: Fix sorted keys in put_map instructionBjörn-Egil Dahlberg
All pairs in a Map needs to be in strict ascending key order.
2014-01-28compiler: Fix multiple same keysBjörn-Egil Dahlberg
2014-01-28compiler: Check for duplicate key literals in MapBjörn-Egil Dahlberg
If a literal key already is present in a Map update the latter should be used. Warn for previous duplicates in the Map.
2014-01-28compiler: Handle literals, not just atoms, as keys in mapsBjörn-Egil Dahlberg
2014-01-28compiler: Fix no basic blocks for mapsBjörn-Egil Dahlberg
2014-01-28compiler: Fix stack register reorderingBjörn-Egil Dahlberg
Can now handle {list [reg()]} elements in instructions.
2014-01-28Implement support for maps in the compilerBjörn Gustavsson
To make it possible to build the entire OTP system, also define dummys for the instructions in ops.tab.
2014-01-28Introduce a representation for maps in Core ErlangBjörn Gustavsson
2014-01-28Update erl_lint, erl_expand_records, sys_pre_expand for mapsBjörn Gustavsson
2014-01-24beam_except: Eliminate compiler crashBjörn Gustavsson
Code such as: bar(X) -> case {X+1} of 1 -> ok end. would crash the beam_except pass of the compiler. The reason for the crash is that the '+' operator would add a line/1 instruction that the beam_except pass was not prepared to handle. Reported-by: Erik Søe Sørensen
2014-01-21Fix testing with unicode pathsDan Gudmundsson
re needs unicode option
2014-01-20Merge branch 'bjorn/compiler/optimizations/OTP-11584'Björn Gustavsson
* bjorn/compiler/optimizations/OTP-11584: Generalize optimizations of case statements Ignore warnings when running sys_core_fold after inlining
2014-01-20Merge branch 'bjorn/fix-line-number-in-bs-exception/OTP-11572'Björn Gustavsson
* bjorn/fix-line-number-in-bs-exception/OTP-11572: compiler: Correct line number in exception from binary construction
2014-01-17compiler: Silence false warning for unmatched return in 'after' clauseBjörn Gustavsson
Because 26940a8c0c lifted code in the 'after' clause of 'try' to a new function, Dialyzer could produce false warnings for code such as: try ... after file:close(F) end. Mark the the call to the generated function as 'compiler_generated' to silence the warning.
2014-01-16Generalize optimizations of case statementsBjörn Gustavsson
Case expressions such as: case {Expr1,Expr} of {V1,V2} -> ... end are already optimized to not actually build the tuple. Generalize the optimization to avoid building any kind of composite term, such as: case {ok,[A,B]} of {ok,[X,Y]} -> ... end We don't expect programmers to write such code directly, but inlining can produce such code. We need to be careful about the warnings we produce. If the case expression is a literal, it is expected that no warnings should be produced for clauses that don't match. We must make sure that we continue to suppress those warnings.
2014-01-16compiler: Correct line number in exception from binary constructionBjörn Gustavsson
Reported-by: Stanislav Seletskiy
2014-01-09Merge branch 'nox/fix-dbg_ieval-exporting-rules/OTP-11553'Björn Gustavsson
* nox/fix-dbg_ieval-exporting-rules/OTP-11553: compiler tests: Test exporting rules for andalso/orelse Fix evaluation of andalso and orelse in the debugger
2014-01-08compiler tests: Test exporting rules for andalso/orelseBjörn Gustavsson
2014-01-08Ignore warnings when running sys_core_fold after inliningBjörn Gustavsson
The new inliner (cerl_inline) does not mark inlined code as compiler generated. Therefore, when sys_core_fold is run after inlining, it may generate spurious warnings. The easiest way out (for now, at least) is to discard all warnings found when running sys_core_fold after inlining.
2013-12-19Eliminate bottlenecks in sys_core_foldBjörn Gustavsson
Compiling programs with very many uses of the "dot notation" for extracting a record element could be very slow. The reason is that each extraction of a record element (R#r.a) would first be transformed to code like this: case R of {r,rec0,_,_} -> rec0; _ -> error({badrecord,r}) end In Core Erlang, each '_' would be become a new variable. The resulting code would be optimized by sys_core_fold, but the optimization process could be very slow. Profiling shows that sub_del_var/2 was the worst bottleneck, and the sub_is_val/2 the second worst bottleneck. In both cases, the culprit is the linear traversal of a very long list (the list of variable substitutions). Fortunately, there already is a gb_set (the scope) which contains all variables that are currently live. If a variable is not known to be live, it is no point in doing the linear operation on the list.
2013-12-18Officially support building core filesTuncer Ayaz
erlc is wired to treat *.core files as core and build them as compile:file(File, [from_core]), but this is not documented. There's also an udocumented compile:file/2 option called 'from_core'. This has been in place and in use for a long time. Therefore, it should be supported officially. To fix that, make the following changes: * document erlc handling of *.core files * document 'from_core'
2013-12-18Officially support building assembler filesTuncer Ayaz
erlc is wired to treat *.S files as assembler and build them as compile:file(File, [from_asm]), but this is not documented. There's also a documented compile:file/2 option called 'asm' (mapping to 'from_asm'), but the wording discourages its use. All of this has been in place and in use for a long time. Therefore, it should be supported officially. To fix that, make the following changes: * document erlc handling of *.core files * un-document 'asm' and document 'from_asm' instead * deprecate 'asm' While at it, fix a minor typo in the test suite.
2013-12-13Test compilation of BEAM assembly with optimisations onAnthony Ramine
2013-12-13Keep exit blocks in order when moving them in beam_jumpAnthony Ramine
This makes applying the pass a second time a no-op.