aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler
AgeCommit message (Collapse)Author
2015-06-17compiler: Add regressions_SUITEBjörn-Egil Dahlberg
regressions_SUITE will have code snippets which previously crashed the compiler. This commits includes a test for Maps crash in beam_bool.
2015-06-17compiler: Fix beam_bool pass for get_map_elementsBjörn-Egil Dahlberg
Before beam_split the get_map_elements instruction is still in blocks and the helper function in beam_jump did not reflect this. Reported-by: Quviq twitter account
2015-06-04Merge branch 'bjorn/compiler/spurious-warning'Björn Gustavsson
* bjorn/compiler/spurious-warning: sys_core_fold: Eliminate warnings for unused terms in effect context sys_core_fold: Eliminate warnings for unused terms
2015-05-27Merge branch 'bjorn/compiler/doc'Björn Gustavsson
* bjorn/compiler/doc: Update compiler documentation (Sneaking in OTP-12769 here which is a release note for syntax_tools. Sorry about that.)
2015-05-27Update compiler documentationBjörn Gustavsson
Language cleaned up by the technical writer tmanevik from Combitech. Proofreading and corrections by Björn Gustavsson.
2015-05-27Update application versionsHans Bolinder
2015-05-26Merge branch 'egil/opt-compile-time/OTP-12774'Björn-Egil Dahlberg
* egil/opt-compile-time/OTP-12774: stdlib: Relax erl_anno_SUITE:is_anno/1 test Update primary bootstrap compiler: Use Maps as type information compiler: Use Maps instead of dict in beam_jump compiler: Use cerl_sets instead of gb_sets in beam_type compiler: Use Maps instead of gb_trees in beam_dead compiler: Use cerl_sets instead of gb_sets in beam_jump compiler: Use cerl_sets instead of sets in v3_kernel compiler: Use cerl_sets instead of gb_sets in sys_core_fold compiler: Add cerl_sets module compiler: Scope uses gb_sets not gb_trees beam_dict: Use Maps to map function name indices beam_dict: Use Maps to map line indices beam_dict: Use Maps to map atom indices v3_codegen: Use Maps to map local functions v3_life: Refactor variable db compiler: Use lc instead of map/1 in v3_codegen stdlib: Optimize erl_anno:is_string/1 Conflicts: bootstrap/lib/kernel/ebin/inet_dns.beam bootstrap/lib/stdlib/ebin/erl_anno.beam bootstrap/lib/stdlib/ebin/erl_lint.beam
2015-05-22sys_core_fold: Eliminate warnings for unused terms in effect contextBjörn Gustavsson
The optimization introduced in 0a0d39d351fc could cause spurious warnings of the type: "a term is constructed, but never used". That would happen for constructs in effect context. To avoid those warnings, we will need to apply warning suppression also in effect context.
2015-05-22Merge branch 'egil/fix-compiler-beam_bsm/OTP-12758'Björn-Egil Dahlberg
* egil/fix-compiler-beam_bsm/OTP-12758: compiler: Add tests for beam_bsm get_map_elements compiler: Teach beam_bsm get_map_elements instruction
2015-05-21compiler: Use Maps as type informationBjörn-Egil Dahlberg
Using Maps as type information container speedups files like cow_http_hd.erl by ~500ms. Previously spent ~60% of the time in orddict:store/3.
2015-05-21compiler: Use Maps instead of dict in beam_jumpBjörn-Egil Dahlberg
2015-05-21compiler: Use cerl_sets instead of gb_sets in beam_typeBjörn-Egil Dahlberg
2015-05-21compiler: Use Maps instead of gb_trees in beam_deadBjörn-Egil Dahlberg
2015-05-21compiler: Use cerl_sets instead of gb_sets in beam_jumpBjörn-Egil Dahlberg
2015-05-21compiler: Use cerl_sets instead of sets in v3_kernelBjörn-Egil Dahlberg
2015-05-21compiler: Use cerl_sets instead of gb_sets in sys_core_foldBjörn-Egil Dahlberg
2015-05-21compiler: Add cerl_sets moduleBjörn-Egil Dahlberg
A sets implementation based on maps.
2015-05-21compiler: Scope uses gb_sets not gb_treesBjörn-Egil Dahlberg
2015-05-21beam_dict: Use Maps to map function name indicesBjörn-Egil Dahlberg
2015-05-21beam_dict: Use Maps to map line indicesBjörn-Egil Dahlberg
2015-05-21beam_dict: Use Maps to map atom indicesBjörn-Egil Dahlberg
2015-05-21v3_codegen: Use Maps to map local functionsBjörn-Egil Dahlberg
2015-05-21v3_life: Refactor variable dbBjörn-Egil Dahlberg
2015-05-21compiler: Use lc instead of map/1 in v3_codegenBjörn-Egil Dahlberg
Small speed increase for large files.
2015-05-21Don't make 'compiler' dependent on 'tools'Björn Gustavsson
In a5d724cf240a, a debug option for running eprof on a specific compiler pass was added. That commit added a direct call to the eprof module in the tools application, and therefore the test case otp_SUITE:runtime_dependencies/1 would fail because xref would find a call to the tools application, but tools is not listed as a runtime dependency in compiler.app. Since the 'eprof' option is only likely to be used by compiler maintainers, we don't want a real dependency to the tools application. Therefore, use c:appcall/4 to hide the call to the eprof module (and to report the error nicely if the tools application is missing).
2015-05-21compiler: Add tests for beam_bsm get_map_elementsBjörn-Egil Dahlberg
2015-05-21compiler: Teach beam_bsm get_map_elements instructionBjörn-Egil Dahlberg
Allows for 'creation of sub binary delayed' optimization if map instructions are in a clause. Reported-by: José Valim
2015-05-13sys_core_fold: Eliminate warnings for unused termsBjörn Gustavsson
The optimization introduced in 0a0d39d351fc would cause spurious warnings of the type: "a term is constructed, but never used". To avoid the warning, we must mark not only tuples and lists as compiler_generated, but also each element. We must also propagate compiler_generated annotations in lets. For example, if we have: let <X -| ['compiler_generated']> = 42 in X + 1 we must propagate the compiler_generated annotation to the literal when do constant propagation: 42 -| ['compiler_generated'] + 1
2015-05-13Revert "Prepare release"Henrik Nord
This reverts commit e09dd66dc4d89c62ddfd8c19791f9678d5d787c6.
2015-05-12Prepare releaseErlang/OTP
2015-05-08Update runtime depencies for the compiler applicationBjörn Gustavsson
2015-05-08Merge branch 'nox/compiler/parse_transform-undef/OTP-12723'Björn Gustavsson
* nox/compiler/parse_transform-undef/OTP-12723: Properly report unknown parse transforms
2015-04-30compiler: Use module erl_annoHans Bolinder
2015-04-29Merge branch 'bjorn/compiler/misc'Björn Gustavsson
* bjorn/compiler/misc: test_lib: Simplify uniq/0 beam_dict: Correct comparison in opcode/2 beam_utils: Re-use the local helper function drop_labels/1 beam_asm: Speed up encoding of large numbers compilation_SUITE: Speed up the self_compile test cases beam_listing: Optimize writing of .S files v3_core, v3_codegen: Eliminate old-style catches cerl_inline: Replace old-style 'catch' with 'try'...'catch' sys_core_fold: Suppress warnings better beam_utils: Teach check_liveness/3 to understand get_map_elements Teach beam_trim to handle map instructions beam_utils: Be less conservative about liveness for exit instructions beam_validator: Stop validating the 'aligned' flag for binaries beam_validator: Clean up updating of types for y register beam_validator: Remove support for removed BIF fault/1,2 beam_validator: Correct merging of states beam_validator: Correct merging of y registers sys_pre_expand: Remove unused fields in #expand{} record
2015-04-29test_lib: Simplify uniq/0Björn Gustavsson
Simplify the uniq/0 function by using erlang:unique_integer/1.
2015-04-29beam_dict: Correct comparison in opcode/2Björn Gustavsson
The intention of the comparison is to avoid unnecessary updates of the ">=" instead of ">". With the ">" comparison, typically every line instruction would cause the #asm{} record to be updated.
2015-04-29beam_utils: Re-use the local helper function drop_labels/1Björn Gustavsson
In 8470558, the drop_labels/1 function was added to beam_utils as a minor optimization. Since the function is already available, we might as well use it in index_label/3 too.
2015-04-29beam_asm: Speed up encoding of large numbersBjörn Gustavsson
The misc_SUITE:integer_encoding/1 test case is annoyingly slow. Rewrite the encoding of integers in beam_asm to use the binary:encode_unsigned/1 BIF. Also tweak the test case itself. Scale the down the maximum size of the numbers being generated, but also add test of numbers around boundaries of power of two (which are the numbers most likely to expose bugs in the encoding).
2015-04-29compilation_SUITE: Speed up the self_compile test casesBjörn Gustavsson
It is not necessary to compile the compile three times. After the second compilation, we compare the generated .beam files with the .beam files that were used when compiling them. Doing one more round will not find more bugs. While we are it, remove the ?line macros and the unused make_current/1 function.
2015-04-29beam_listing: Optimize writing of .S filesBjörn Gustavsson
The test suites generates listing files, so we can slightly speed up running of test suites (especially when running 'cover') by optimizing writing of .S files.
2015-04-29v3_core, v3_codegen: Eliminate old-style catchesBjörn Gustavsson
2015-04-29cerl_inline: Replace old-style 'catch' with 'try'...'catch'Björn Gustavsson
Using 'try'...'catch' simplifies the code and improves coverage because we don't have to re-throw accidentally caught errors.
2015-04-29sys_core_fold: Suppress warnings betterBjörn Gustavsson
86fbd6d76d strengthened type optimization in lets. As a result of the stronger optimizations, special care had to be taken to suppress false warnings. It turns out that false warnings can still slip through. Slapping on a 'compiler_generated' annotation at the top-level of a complex term such as #c_tuple{} may not suppress all warnings. We will need to go deeper into the term to eliminate all warnings.
2015-04-29beam_utils: Teach check_liveness/3 to understand get_map_elementsBjörn Gustavsson
Understanding get_map_elements improves the stack trimming done by beam_trim.
2015-04-29Teach beam_trim to handle map instructionsBjörn Gustavsson
2015-04-29beam_utils: Be less conservative about liveness for exit instructionsBjörn Gustavsson
beam_utils used to be overly conservative about liveness for exit instructions such as: call_ext erlang:exit/1 beam_utils would consider all y registers to be used, to avoid overwriting a catch or try tag. That does not seem to be a real risk. However, we miss opportunities for stack trimming if we consider y registers used by an exit instruction.
2015-04-29beam_validator: Stop validating the 'aligned' flag for binariesBjörn Gustavsson
The run-time system stopped paying attention the 'aligned' flag in bit syntax construction and matching when bitstrings were introduced in language. The beam_asm compiler pass will crash if the 'aligned' flag is given in bit syntax instructions. beam_validator still validates the 'aligned' flag. Before 912fea0b712a (which removed the possibility to validate existing BEAM files), the 'aligned' flag could actually be encountered when validating a BEAM file. Since the validation of 'aligned' no longer serves any useful purpose, remove the validation code.
2015-04-29beam_validator: Clean up updating of types for y registerBjörn Gustavsson
set_type_y/3 is far too complicated. Note that we don't need to check the #st.numy field, because we will detect the error anyway because the information for the y register will be missing in the #st.y gb_tree. There is also a clause that would never match because of a spelling error (the first "n" was missing in "uninitialized"). That clause is not needed because the default clause will do fine. Furthermore, we can break out the special case for handling catch_end and similar instructions into a new function.
2015-04-27Merge branch 'bjorn/use-monotonic-time'Björn Gustavsson
* bjorn/use-monotonic-time: supervisor: Correct restart handling test_server: Use erlang:monotonic_time/0 compile: Teach 'time' option to show three significant decimals timer: Use monotonic_time/0 in tc/1,2,3
2015-04-23beam_validator: Remove support for removed BIF fault/1,2Björn Gustavsson
The fault/1,2 BIF was removed a long time ago.