aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)Author
2015-03-11Properly collect variables in match specs with mapsAnthony Ramine
2015-03-11Fix compilation of match specs with mapsAnthony Ramine
The previous compilation was just plain wrong with push/pop mismatches. Reported-by: Björn-Egil Dahlberg
2015-03-11v3_life: Combine literal/2 and literal2/2Björn Gustavsson
For unclear reasons, there are two functions in v3_life that are almost identical: literal/2 and literal2/2. literal/2 is used for expressions and literal2/2 for patterns. It turns out that literal2/2 can do everything that literal/2 can do, except that it transforms maps differently. If we adjust v3_codegen to accept the same format of maps in expressions and patterns, we can rename literal2/2 to literal/2 and use it for expressions and patterns.
2015-03-11Merge branch 'hb/pr/357'Hans Bolinder
* hb/pr/357: Make the scanned form of the io_lib format strings available for processing
2015-03-11Merge branch 'hb/dialyzer/fix_from_form/OTP-12350'Hans Bolinder
* hb/dialyzer/fix_from_form/OTP-12350: [dialyzer] Correct handling of limited opaque types [dialyzer] Add testcases [dialyzer] Limit depth and size of types from forms [dialyzer] Fix the conversion of forms to types
2015-03-10kernel: Add test for unicode mode in fileDan Gudmundsson
2015-03-10kernel: Fix file:read_line/1 unicode error handlingDan Gudmundsson
When a file was opened with some unicode encoding, file:read_line/1 could return unicode codepoints > 255 in list mode and wrong error message in bin mode. Chose to break out 'get_line' functionality from get_chars/5 since 'get_until' handling is different (comes from io module which should return unicode lists) and seems to have its own (doc?) problems.
2015-03-10Merge branch 'maint'Zandra Hird
2015-03-10Merge branch 'josevalim/jv-binary-ets' into maintZandra Hird
* josevalim/jv-binary-ets: Support binary standard input in ets:i/1 OTP-12550
2015-03-10[dialyzer] Correct handling of limited opaque typesHans Bolinder
2015-03-10[dialyzer] Add testcasesHans Bolinder
The tests cannot be handled by earlier versions of Dialyzer.
2015-03-10[dialyzer] Limit depth and size of types from formsHans Bolinder
2015-03-10[dialyzer] Fix the conversion of forms to typesHans Bolinder
In particular fix handling of records.
2015-03-10Make the scanned form of the io_lib format strings available for processingRichard Carlsson
This adds three new functions to io_lib - scan_format/2, unscan_format/1, and build_text/1 - which expose the parsed form of the format control sequences to make it possible to easily modify or filter the input to io_lib:format/2. This can e.g. be used in order to replace unbounded-size control sequences like ~w or ~p with corresponding depth-limited ~W and ~P before doing the actual formatting.
2015-03-09Merge branch 'maint'Zandra Hird
2015-03-09Merge branch 'mururu/fix-type' into maintZandra Hird
* mururu/fix-type: Fix typos in the public_key doc OTP-12549
2015-03-09Merge branch 'ia/ssl/crl-cache/OTP-10362'Ingela Anderton Andin
* ia/ssl/crl-cache/OTP-10362: ssl: fix white box tests ssl: Integrate public_key CRL verification with the ssl application
2015-03-09Merge branch 'maint'Erland Schönbeck
Conflicts: erts/test/otp_SUITE.erl
2015-03-09Merge branch 'seriyps/zlib-inflate-bound'Henrik Nord
* seriyps/zlib-inflate-bound: Add zlib limited output buffer size functionality Conflicts: erts/preloaded/ebin/zlib.beam OTP-12548
2015-03-09Merge branch 'erland/ssh/time/OTP-12444' into maintErland Schönbeck
* erland/ssh/time/OTP-12444: Update misleading comment in ssh_basic_SUITE Update new time API and be back-compatible in ssh Use new time API and be back-compatible in ssh otp_SUITE: Ignore undefined functions in ssh
2015-03-09v3_codegen: Don't save options in the process dictionaryBjörn Gustavsson
v3_codegen puts the compilation in the process dictionary, but never uses them.
2015-03-09Don't inline core_parseBjörn Gustavsson
Inlining the core_parse module is slow (the inline pass alone takes more than 6 seconds on my computer) and has no benefit.
2015-03-09Restore lookup order after testRaimo Niskanen
2015-03-09ssl: fix white box testsIngela Anderton Andin
2015-03-09ssl: Integrate public_key CRL verification with the ssl applicationIngela Anderton Andin
2015-03-09Merge branch 'maint'Ingela Anderton Andin
2015-03-09Merge branch 'ia/public_key/crl/OTP-12547' into maintIngela Anderton Andin
* ia/public_key/crl/OTP-12547: public_key: Improve CRL handling support
2015-03-09public_key: Improve CRL handling supportIngela Anderton Andin
2015-03-09v3_core: Teach pat_alias/2 to eliminate duplicated variablesBjörn Gustavsson
Duplicated variables as aliases in patterns, such as: f({_,_}=Dup=Dup) -> ... will work, but produce sub-optimal code similar to: f({_,_}=Dup=NewVar) when Dup =:= NewVar -> ... with one extra guard test for each duplicated variable. Rewrite pat_alias/2 to eliminate all duplicated variables. While we are at it, also simplify handling of tuples, conses, and literals by using the data functions in the cerl module.
2015-03-09beam_dead: Improve optimization by eliminating fallthroughsBjörn Gustavsson
2015-03-09beam_dead: Optimize Var =:= VarBjörn Gustavsson
2015-03-09beam_peep: Optimize away redundant use of is_boolean testsBjörn Gustavsson
2015-03-09beam_bool: Correct initialized_regs/2Björn Gustavsson
initialized_regs/2 did not handle allocating instructions; instead treating them as any other 'set' instruction. The consequences could be one or both of the following: Going past the allocating instruction (looking at more instructions) would mean that initialized_regs/2 could return registers that were not actually initialized. That could mean that MustBeKilled in ensure_opt_safe/6 could contain too few registers, and that the code that followed tried to use an uninitialized register. The beam_validator should have detected that problem. Not taking account the number of live registers in the allocating instruction could mean that some registers were not found to be initialized, which could mean that MustBeKilled would contain too many registers. That would mean a missed optimization.
2015-03-09sys_core_fold: Generalize case optimizationBjörn Gustavsson
For a long time, there has been an optimization for: {V1,V2,...} = case Expr of Pat -> ... {Val1,Val2,...}; ... end that avoids building the tuples. The construct looks like this in Core Erlang: let <V> = case X of Pattern -> {Y,Z} end in case V of {A,B} -> A+B end The current optimization will try to replace the second 'case' with a 'let': let <A,B> = case X of Pattern -> <Y,Z> end in A+B Simple variations of the construct would prevent the optimizations; for example this one: let <V> = case X of Pattern -> {'ok',Val} end in case V of {ok,Val} -> Val end The problem is that the optimization tries to do too much. By making the optimization do less and have it depend on other optimizations to finish the job, it will become more powerful. Thus we can rewrite the code like this: let <V1,V2> = case X of Pattern -> <'ok',Val> end in let <V> = {V1,V2} in case V of {ok,Val} -> Val end Note that the second case is unchanged. The other optimizations in the sys_core_fold module will optimize the second 'case' and eliminate the building of the tuple.
2015-03-09sys_core_fold: Improve optimization of 'not'Björn Gustavsson
Optimize away 'not' in sys_core_fold instead of in beam_block and beam_dead, as we can do a better job in sys_core_fold. I modified the test suite temporarily to never turn off Core Erlang modifications and looked at the coverage. With the new optimizations active in sys_core_fold, the code in beam_block and beam_dead did not find a single 'not' that it could optimize. That proves that the new optimization is at least as good as the old one. Manually, I could also verify that the new optimization would optimize some variations of 'not' that the old one would not handle.
2015-03-09sys_core_fold: Suppress compiler warnings when evaluating element/2Björn Gustavsson
More aggressive optimizations that we plan to introduce could cause spurious compiler warnings.
2015-03-09Clean up evaluation of setelement/3Björn Gustavsson
The 'try' ... 'catch' is problematic. Firstly, if no optimization is possible, an exception will always be thrown. Secondly, bugs in the code will go unnoticed.
2015-03-09Replace '==' with '=:=' when both operands are integersBjörn Gustavsson
'=:=' is a cheaper operation than '==', so we should always use '=:=' if the result will be the same as if '==' were used.
2015-03-09Update type information based on BIFs that returns integersBjörn Gustavsson
2015-03-09sys_core_fold: Strengthen type optimization in letsBjörn Gustavsson
Make sure that we take extract all possible type information when optimizing a 'let' construct. Since the stronger optimization may generate false warnings, we also need to take special care to suppress false warnings.
2015-03-09Update primary bootstrapBjörn Gustavsson
2015-03-09Merge branch 'bjorn/compiler/maps'Björn Gustavsson
* bjorn/compiler/maps: v3_codegen: Teach the put_map_* instructions to reuse source registers beam_validator: Tighten tests of maps v3_core: Eliminate the sloppiness-encouraging get_ianno/1 function v3_core: Add is_map tests before map instructions beam_type: Use the complete register map when calculating liveness Introduce '%live' annotations with a complete register map beam_validator: Teach bif_type/3 and is_bif_safe/2 about is_map/1 v3_core: Simplify conversion of map patterns
2015-03-09v3_codegen: Teach the put_map_* instructions to reuse source registersBjörn Gustavsson
The put_map_assoc and put_map_exact instructions in the run-time system will support that the target register is the same as one of the source registers. Teach the code generator to take advantage of that. The disadvantages of not reusing register when possible is that the garbage collector may retain dead terms longer than necessary.
2015-03-09beam_validator: Tighten tests of mapsBjörn Gustavsson
2015-03-09v3_core: Eliminate the sloppiness-encouraging get_ianno/1 functionBjörn Gustavsson
get_ianno/1 would retrieve either a bare annotation or an annotation wrapped in an #a{} record. In both cases, it would return a wrapped annotation. We can replace the calls to get_ianno/1 with calls to get_anno/1, because the argument is always an #iclause{} and all iclause records are always initialized with a wrapped annotation.
2015-03-09v3_core: Add is_map tests before map instructionsBjörn Gustavsson
If we have a sequence of put_map_* instructions operating on the same map, it will be more efficient if we can have one is_map/2 instruction before put_map_* instructions, so that each put_map_* does not need to test whether the argument is a map.
2015-03-09beam_type: Use the complete register map when calculating livenessBjörn Gustavsson
When calculating the number of live registers for allocation instruction, it is not always safe to start with the number of live registers at the start of the block. We will need to use the register map to know whether there are any holes (dead registers) that are not subsequently filled. If the allocation instruction already has a number of live registers calculated, there is nothing to be gained by raising it.
2015-03-09Introduce '%live' annotations with a complete register mapBjörn Gustavsson
As a preparation for fixing a bug, introduce a complete register map in the '%live' annotations.
2015-03-09Merge branch 'ia/ssl/soft-upgrade-test-server-bug-workaround'Ingela Anderton Andin
* ia/ssl/soft-upgrade-test-server-bug-workaround: ssl: Workaround test server halfwordemulator bug
2015-03-07Correct typo in erlang(3) documentationNick Mills