aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2012-03-14v3_core: Don't put negative line numbers in annotationsBjörn Gustavsson
In Core Erlang and later passes, compiler-generated code can be indicated in two different ways: by negative line numbers and by a 'compiler_generated' annotation. Simplify the code and improve coverage by turning negative line numbers positive and adding a 'compiler_generated' annotation in the v3_core pass. That means that Core Erlang and latter passes do not have deal with negative line numbers.
2012-03-14v3_kernel: Dig out the line number only when generating a warningBjörn Gustavsson
2012-03-14v3_kernel: Clean up handling of guardsBjörn Gustavsson
Handling of guards become a mess when andalso/orelse in guards were introduced. Clean it up by using common code for most constructs, regardless of where they occur, and when needed use is_in_guard/1 to handle guard constructs differently.
2012-01-11v3_kernel: Introduce is_in_guard/1Björn Gustavsson
2012-01-11v3_kernel: Removed unreached clause for #k_bin_int{} in sub_size_var/1Björn Gustavsson
The size field of a #k_bin_int{} is always a literal integer (#k_int{}); thus there is no way this clause can match. While we are at it, remove a duplicated call to select_assert_match_possible/3 in select_bin_int/1.
2012-01-11v3_kernel: Remove unreached handling of #k_bin_int{} in arg_con/1Björn Gustavsson
arg_con/1 will never be called with #k_bin_int{} argument, since a #k_bin_int{} is constructed out of #k_bin_seg{} only after arg_con/1 has been called with a #k_bin_seg{} argument.
2012-01-11v3_codegen: Eliminate the special case of 'put' without destinationBjörn Gustavsson
If we let v3_kernel make sure that a 'put' operation always has a destination register, the special case in v3_codegen is not needed.
2012-01-11v3_kernel: Don't attempt to share identical literalsBjörn Gustavsson
It is unlikely that sharing literals will actually save any time. Literals that can be shared are usually small. It is more likely that maintaining the dictionary of literals will waste time.
2012-01-11v3_kernel: Handle sequences in guardsBjörn Gustavsson
A guard with a sequence will cause a crash in v3_codegen. Currently, it seems that a sequence in a guard will never happen when compiling from Erlang code, but there are several reasons to fix this problem anyway: * There are other compilers that generate Core Erlang code. * Changes to sys_core_fold (perhaps additional optimizations) may cause sequences to be generated in guards. * A previously uncovered line in sys_core_fold:opt_guard_try/1 will now be covered.
2012-01-11v3_kernel: Remove clauses that are never executed in arg_val/1Björn Gustavsson
arg_val/1 will never be called for single-valued types, so there is no need handle these types.
2012-01-11v3_kernel.hrl: Remove unused record #k_string{}Björn Gustavsson
2012-01-11v3_kernel.erl: Remove unused define of EXPENSIVE_BINARY_LIMITBjörn Gustavsson
2012-01-11sys_core_fold: Refactor previous_ctx_to_binary/2 to cover it completelyBjörn Gustavsson
2012-01-11sys_core_fold: Fix opt_guard_try/1Björn Gustavsson
opt_guard_try/1 assumed that it was only operating on guards, and implicitly assumed that any function call was to BIFs without any side effects.
2012-01-11sys_core_fold: Simplify opt_bool_not() to cover it completelyBjörn Gustavsson
In: case not Expr of ... we don't have the information to ascertain that Expr is a boolean expression. Therefore, add the catch-all clause unconditionally.
2012-01-11sys_core_fold: Remove duplicate optimizationBjörn Gustavsson
The second clause in opt_case_in_let_2/3 attempts to do the same optimization as opt_bool_case_redundant/1; it will never succeed.
2012-01-11Merge branch 'bjorn/compiler/tests' into maintBjörn Gustavsson
* bjorn/compiler/tests: compile_SUITE: Add test of 'sys_pre_attributes' Correct syntax in compiler.cover Cover v3_kernel:get_line/1 core_SUITE: Cover the nomatch_shadow warning in v3_kernel core_SUITE: Cover v3_kernel:build_match/2 bs_match_SUITE: Add a test case to cover bsm_ensure_no_partition_2/5 core_fold_SUITE: Cover sys_core_fold:is_safe_bool_expr_1/3 core_SUITE: Cover sys_core_fold:eval_is_boolean/2 core_SUITE: Cover sys_core_fold:make_effect_seq/2 beam_validator_SUITE:beam_files/1: Validate modules in parallel compilation_SUITE: Compile compiler modules in parallel compilation_SUITE: Prevent cover from being run on slave nodes test_lib:p_run/2: Be careful about how many parallel processes we use Remove part_eval_SUITE
2012-01-11compile_SUITE: Add test of 'sys_pre_attributes'Björn Gustavsson
2012-01-10Merge branch 'egil/revert-type-information' into maintBjörn-Egil Dahlberg
* egil/revert-type-information: syntax_tools: Remove warnings of missing types hipe: Remove warnings of missing types in records syntax_tools: Suppress warning of unused variable Revert "hipe: Add type information to cfg_info record" Revert "syntax_tool: Add missing type information"
2012-01-09Merge branch 'hb/dialyzer/nowarn_unused_function/OTP-9833' into maintHans Bolinder
* hb/dialyzer/nowarn_unused_function/OTP-9833: Handle nowarn_unused_function like the compiler does
2012-01-05syntax_tools: Remove warnings of missing typesBjörn-Egil Dahlberg
* Just remove the warnings, not fixing the actual problem.
2012-01-05hipe: Remove warnings of missing types in recordsBjörn-Egil Dahlberg
2012-01-05syntax_tools: Suppress warning of unused variableBjörn-Egil Dahlberg
2012-01-05Revert "hipe: Add type information to cfg_info record"Björn-Egil Dahlberg
This reverts commit 644a3ec2848da340490c4027df293a3136de60a4.
2012-01-05Revert "syntax_tool: Add missing type information"Björn-Egil Dahlberg
This reverts commit 38ee7a20cfdc22ead35b4711a086babcf6b3069b.
2012-01-05Correct syntax in compiler.coverBjörn Gustavsson
Modules would not get excluded. While at it, no longer exclude sys_pre_attributes since we will want to test it.
2012-01-04Merge branch 'egil/fix-compiler-warnings' into maintBjörn-Egil Dahlberg
* egil/fix-compiler-warnings: erts: Use re instead of regexp in testsuite erts: Remove unused code in testsuites orber: Use modern list guard in testsuite orber: Ignore unused variable in orber_tb.erl xmerl: Ignore unused variable in xmerl_uri.erl syntax_tool: Add missing type information hipe: Suppress warnings for unused variables hipe: Add type information to cfg_info record tools: Use literal formatting in erl_memory.c asn1: Remove unused variable in asn1_erl_nif.c ei: Remove unused variable in ei_format.c erts: Add missing prototype to DRIVER_INIT runtime_tools: Fix signedness in trace_ip_drv.c to_erl: Remove compiler warnings heart: Suppress compiler warnings erts: Remove compiler warnings in inet_gethost.c erts: Remove dead code in inet_gethost.c erts: Remove dead code
2012-01-04Cover v3_kernel:get_line/1Björn Gustavsson
2012-01-04core_SUITE: Cover the nomatch_shadow warning in v3_kernelBjörn Gustavsson
2012-01-04core_SUITE: Cover v3_kernel:build_match/2Björn Gustavsson
2012-01-04bs_match_SUITE: Add a test case to cover bsm_ensure_no_partition_2/5Björn Gustavsson
Also correct the comment in bsm_ensure_no_partition_2/5, and while at it correct typos in the comment for bsm_nonempty/2.
2012-01-04core_fold_SUITE: Cover sys_core_fold:is_safe_bool_expr_1/3Björn Gustavsson
2012-01-04core_SUITE: Cover sys_core_fold:eval_is_boolean/2Björn Gustavsson
2012-01-04core_SUITE: Cover sys_core_fold:make_effect_seq/2Björn Gustavsson
We need to write a test case in Core Erlang in order to cover make_effect_seq/2, since v3_core does not generate "deep" Core Erlang code.
2012-01-04beam_validator_SUITE:beam_files/1: Validate modules in parallelBjörn Gustavsson
2012-01-04compilation_SUITE: Compile compiler modules in parallelBjörn Gustavsson
On my Mac Pro with 8 cores, this change make self_compile/1 more than twice as fast, and self_compile_old_inliner/1 more than 4 times faster.
2012-01-04compilation_SUITE: Prevent cover from being run on slave nodesBjörn Gustavsson
In the self compilation test cases, the compiler compiles itself and runs the newly compiled version on a slave node. Having the cover server starting on the slave node defeats the purpose of the test, since it will load the SAME cover-compiled code on the slave node. (It will also be slower, but will not improve coverage since it compiles the same source files again.) Use a shielded node to prevent the cover server from getting started on the slave node.
2012-01-04test_lib:p_run/2: Be careful about how many parallel processes we useBjörn Gustavsson
We probably don't gain anything by using more processes than available schedulers. Also, if 'cover' is being run, using more than one process may make it slower, so we will be very conservative and use only one process in that case.
2012-01-04Remove part_eval_SUITEBjörn Gustavsson
This test suite has been superseded by other test suites (e.g. guard_SUITE). Removing it does not decrease the coverage.
2012-01-04erts: Use re instead of regexp in testsuiteBjörn-Egil Dahlberg
2012-01-04Merge branch 'egil/system_profile-profiler-fix/OTP-9849' into maintBjörn-Egil Dahlberg
* egil/system_profile-profiler-fix/OTP-9849: erts: Do not profile system profiler pid test: system_profile profiler pid is not profiled Remove line macros in system_profile_SUITE
2012-01-04erts: Remove unused code in testsuitesBjörn-Egil Dahlberg
2012-01-04orber: Use modern list guard in testsuiteBjörn-Egil Dahlberg
2012-01-04orber: Ignore unused variable in orber_tb.erlBjörn-Egil Dahlberg
2012-01-04xmerl: Ignore unused variable in xmerl_uri.erlBjörn-Egil Dahlberg
2012-01-04Update primary bootstrapBjörn Gustavsson
2012-01-04Merge branch 'bjorn/compiler/match-fail/OTP-9842' into maintBjörn Gustavsson
* bjorn/compiler/match-fail/OTP-9842: Add the beam_except pass to optimize exceptions Eliminate the match_fail primop in v3_kernel and later passes
2012-01-04Add the beam_except pass to optimize exceptionsBjörn Gustavsson
In order to save space, rewrite suitable calls to erlang:error/{1,2} to special BEAM instructions. This code is probably longer than the code taken out of v3_life and v3_codegen in the previous commit, but it is much easier to understand and maintain since the BEAM assembler format is better understood than the v3_life format.
2012-01-04Eliminate the match_fail primop in v3_kernel and later passesBjörn Gustavsson
In the v3_life pass, it is assumed that a 'match_fail' primop only occur at the top-level and at the end of a function. But this code: do_split_cases(A) -> case A of x -> Z = dummy1; _ -> Z = dummy2, a=b end, Z. will be optimized by sys_core_fold to the following code: 'split_cases'/1 = fun (_cor0) -> let <_cor7,Z> = case _cor0 of <'x'> when 'true' -> < 'dummy1','dummy1' > <_cor6> when 'true' -> %% Here follows a 'match_fail' primop inside %% multiple return values: < primop 'match_fail'({'badmatch','b'}),'dummy2' > end in Z moving the 'match_fail' primop into a "values" construction. In the future, we would like to get rid of the v3_life pass (it is there for historical reasons), so in the mean-time we prefer to not add more code to it by generalizing the handling of 'match_fail'. Since the 'match_fail' primop can be simulated by erlang:error/{1,2}, the simplest solution is to translate 'match_fail' to a call to erlang:error/{1,2} in v3_kernel and remove the handling of 'match_fail' in v3_life and v3_codegen. It is tempting to get rid of 'match_fail' also in the Core Erlang format, but there are two issues: - Removing the support for 'match_fail' completely may break tools that generate Core Erlang code. We should not do that in a minor release. - There is no easy way to generate a 'function_clause' exception that will remain correct if it will be inlined into another function. (Calling "erlang:error(function_clause, Args)" is fine only if it is not inlined into another function.) A good solution probably involves introducing new instructions, which is better done in a major release. Noticed-by: Håkan Matsson Minimized-test-case-by: Erik Søe Sørensen
2012-01-04Merge branch 'lukas/docfixes/OTP-9850' into maintLukas Larsson
* lukas/docfixes/OTP-9850: Fix some broken links in documentation