Age | Commit message (Collapse) | Author | |
---|---|---|---|
2016-11-18 | Remove beam_bool | Björn Gustavsson | |
The guard optimizations in v3_kernel has removed the need for beam_bool. | |||
2016-11-18 | v3_kernel: Generate optimized code for guards | Björn Gustavsson | |
The compiler produces poor code for complex guard expressions with andalso/orelse. Here is an example from the filename module: -define(IS_DRIVELETTER(Letter),(((Letter >= $A) andalso (Letter =< $Z)) orelse ((Letter >= $a) andalso (Letter =< $z)))). skip_prefix(Name, false) -> Name; skip_prefix([L, DrvSep|Name], DrvSep) when ?IS_DRIVELETTER(L) -> Name; skip_prefix(Name, _) -> Name. beam_bool fails to simplify the code for the guard, leaving several 'bif' instructions: {function, skip_prefix, 2, 49}. {label,48}. {line,[{location,"filename.erl",187}]}. {func_info,{atom,filename},{atom,skip_prefix},2}. {label,49}. {test,is_ne_exact,{f,52},[{x,1},{atom,false}]}. {test,is_nonempty_list,{f,52},[{x,0}]}. {get_list,{x,0},{x,2},{x,3}}. {test,is_nonempty_list,{f,52},[{x,3}]}. {get_list,{x,3},{x,4},{x,5}}. {bif,'=:=',{f,52},[{x,1},{x,4}],{x,6}}. {test,is_ge,{f,50},[{x,2},{integer,65}]}. {bif,'=<',{f,52},[{x,2},{integer,90}],{x,7}}. {test,is_eq_exact,{f,51},[{x,7},{atom,false}]}. {test,is_ge,{f,50},[{x,2},{integer,97}]}. {bif,'=<',{f,52},[{x,2},{integer,122}],{x,7}}. {jump,{f,51}}. {label,50}. {move,{atom,false},{x,7}}. {label,51}. {bif,'=:=',{f,52},[{x,7},{atom,true}],{x,7}}. {test,is_eq_exact,{f,52},[{x,6},{atom,true}]}. {test,is_eq_exact,{f,52},[{x,7},{atom,true}]}. {move,{x,5},{x,0}}. return. {label,52}. return. We can add optimizations of guard tests to v3_kernel to achive a better result: {function, skip_prefix, 2, 49}. {label,48}. {line,[{location,"filename.erl",187}]}. {func_info,{atom,filename},{atom,skip_prefix},2}. {label,49}. {test,is_ne_exact,{f,51},[{x,1},{atom,false}]}. {test,is_nonempty_list,{f,51},[{x,0}]}. {get_list,{x,0},{x,2},{x,3}}. {test,is_nonempty_list,{f,51},[{x,3}]}. {get_list,{x,3},{x,4},{x,5}}. {test,is_eq_exact,{f,51},[{x,1},{x,4}]}. {test,is_ge,{f,51},[{x,2},{integer,65}]}. {test,is_lt,{f,50},[{integer,90},{x,2}]}. {test,is_ge,{f,51},[{x,2},{integer,97}]}. {test,is_ge,{f,51},[{integer,122},{x,2}]}. {label,50}. {move,{x,5},{x,0}}. return. {label,51}. return. Looking at the STDLIB application, there were 112 lines of BIF calls in guards that beam_bool failed to convert to test instructions. This commit eliminates all those BIF calls. Here is how I counted the instructions: $ PATH=$ERL_TOP/bin:$PATH erlc -I ../include -I ../../kernel/include -S *.erl $ grep "bif,'[=<>]" *.S | grep -v f,0 dets.S: {bif,'=:=',{f,547},[{x,4},{atom,read_write}],{x,4}}. dets.S: {bif,'=:=',{f,547},[{x,5},{atom,saved}],{x,5}}. dets.S: {bif,'=:=',{f,589},[{x,5},{atom,read}],{x,5}}. . . . $ grep "bif,'[=<>]" *.S | grep -v f,0 | wc 112 224 6765 $ | |||
2016-11-13 | sys_core_fold: Remove unnecessary calls to opt_bool_case/1 | Björn Gustavsson | |
The fixpoint iteration added in 05130e48 makes those calls superfluous. | |||
2016-11-13 | record_SUITE: Strengthen test of record access in guards | Björn Gustavsson | |
2016-11-11 | Merge branch 'bjorn/compiler/tests' | Björn Gustavsson | |
* bjorn/compiler/tests: guard_SUITE: Add more test of guards compile_SUITE: Smoke test and cover more of v3_kernel_pp | |||
2016-11-11 | guard_SUITE: Add more test of guards | Björn Gustavsson | |
2016-11-11 | compile_SUITE: Smoke test and cover more of v3_kernel_pp | Björn Gustavsson | |
2016-11-11 | Merge branch 'maint' | Peter Andersson | |
2016-11-11 | Merge branch 'peppe/common_test/fix_default_gl/ERL-279/OTP-13973' into maint | Peter Andersson | |
* peppe/common_test/fix_default_gl/ERL-279/OTP-13973: Fix problem with printouts to incorrect parent group leader OTP-13973 | |||
2016-11-10 | Merge branch 'maint' | Sverker Eriksson | |
# Conflicts: # lib/hipe/llvm/hipe_rtl_to_llvm.erl | |||
2016-11-10 | Merge branch 'margnus1/hipe_llvm39_bugs/PR-1237/OTP-14027/OTP-14028' into maint | Sverker Eriksson | |
* margnus1/hipe_llvm39_bugs/PR-1237: hipe_rtl_to_llvm: Constants for bits per byte/word hipe_llvm: Work around LLVM 3.9 sdesc bug hipe_llvm: Fix incorrect atom alignment assumption | |||
2016-11-10 | Merge branch 'maint' | Ingela Anderton Andin | |
2016-11-10 | ssl: Use SHA2 for signing ECC certs if possible | Ingela Anderton Andin | |
ECC certs should preferably use SHA2, this is what we want to be testing. Also assembling of all available test suites must consider TLS version. | |||
2016-11-09 | Merge branch 'maint' | Ingela Anderton Andin | |
2016-11-09 | Merge branch 'ingela/ssl/tune-timeouts-packet_SUITE' into maint | Ingela Anderton Andin | |
* ingela/ssl/tune-timeouts-packet_SUITE: ssl: Change to more modest timeouts | |||
2016-11-09 | Merge branch 'maint' | Ingela Anderton Andin | |
2016-11-09 | Merge branch 'ingela/ssl/ECC-faulty-workaround' into maint | Ingela Anderton Andin | |
* ingela/ssl/ECC-faulty-workaround: ssl: Remove faulty workaround | |||
2016-11-09 | ssl: Remove faulty workaround | Ingela Anderton Andin | |
We where never really satisfied with this workaround it was a bit far fetched, so we are pleased to be able to remove it. | |||
2016-11-09 | Merge branch 'maint' | Raimo Niskanen | |
2016-11-09 | Merge branch ↵ | Raimo Niskanen | |
'gomoripeti/kernel/controlling_proc_badarg_doc/PR-1208/OTP-14022' into maint * gomoripeti/kernel/controlling_proc_badarg_doc/PR-1208/OTP-14022: controlling_process can return {error, badarg} | |||
2016-11-08 | hipe_rtl_to_llvm: Constants for bits per byte/word | Magnus Lång | |
The constant ?WORD_WIDTH is renamed ?BITS_IN_WORD, and a new constant ?BITS_IN_BYTE is introduced. Additionally, a bug in a currently unused case clause of llvm_type_from_size/1 is fixed (the size of a word was hardcoded to 64 bits). | |||
2016-11-08 | Merge branch 'maint' | Raimo Niskanen | |
2016-11-08 | Merge branch 'raimo/gen_statem-improvements/OTP-13929' into maint | Raimo Niskanen | |
* raimo/gen_statem-improvements/OTP-13929: Log terminate to sys debug Optimize event timeout Rework timeout handling Clarify the chapter 'Postponing Events' (ERL-284) Fix doc and type for state enter calls | |||
2016-11-08 | Merge branch 'maint' | Björn-Egil Dahlberg | |
2016-11-08 | Merge branch 'jxck/fix-doc-typo/PR-1238' into maint | Björn-Egil Dahlberg | |
* jxck/fix-doc-typo/PR-1238: fix typo on doc of maps | |||
2016-11-08 | Merge branch 'richcarl/mnesia-app-module/PR-1223' | Dan Gudmundsson | |
* richcarl/mnesia-app-module/PR-1223: Make a separate application module for Mnesia | |||
2016-11-08 | Merge branch 'maint' | Dan Gudmundsson | |
* maint: New commands to ease looking up OTP documentation | |||
2016-11-08 | Merge branch 'leoliu/tools/emacs-erldoc/PR-1197/OTP-14018' into maint | Dan Gudmundsson | |
* leoliu/tools/emacs-erldoc/PR-1197/OTP-14018: New commands to ease looking up OTP documentation | |||
2016-11-08 | fix typo on doc of maps | Jxck | |
typo | |||
2016-11-07 | hipe_llvm: Work around LLVM 3.9 sdesc bug | Magnus Lång | |
As of LLVM 3.9, the x86-call-frame-opt pass in LLVM's X86 backend causes the stack descriptors to contain incorrect (or even negative) frame sizes or root slot offsets. This might cause LLVM-compiled modules to be rejected during loading with a badarg exception in hipe_bifs:enter_sdecs/1 (which additionally prints a "hipe_bifs_enter_sdesc_1: bad sdesc!" message to stderr), or it might cause corruption or segmentation faults when walking stacks (f.ex. during GC) containing frames compiled with ErLLVM. As a workaround, we pass the -no-x86-call-frame-opt flag to llc when the version is at least 3.9 | |||
2016-11-07 | hipe_llvm: Fix incorrect atom alignment assumption | Magnus Lång | |
ErLLVM was declaring atoms in the following manner: @atom_ok = external constant i64 ; Used inside a function like this %var = ptrtoint i64* @atom_ok to i64 However, doing so makes LLVM think the `atom_ok` is 8-byte aligned, since it refers to a i64 value. This resulted in LLVM occasionally incorrectly optimising away type tests on atoms, causing incorrect behaviour or even segfaults. One such case is in bs_match_compiler:coverage_apply/2, in which an is_boxed test on a literal atom was optimised away, causing the code to try and load the "header" of an atom. This problem reproduces with LLVM versions 3.7 through 3.9. By declaring atoms as i8 (byte) constants instead, LLVM no longer makes these alignment assumptions, and the bug is fixed. | |||
2016-11-07 | Merge branch 'sverker/distr-debug/PR-1174' | Sverker Eriksson | |
2016-11-07 | Merge branch 'maint' | Sverker Eriksson | |
2016-11-07 | Merge branch 'kostis/hipe-bs_match_string/PR-1234/OTP-14005' into maint | Sverker Eriksson | |
* kostis/hipe-bs_match_string/PR-1234/OTP-14005: Add a test case that should now work Fix the native code translation of bs_match_string | |||
2016-11-07 | Merge branch 'maint' | Ingela Anderton Andin | |
2016-11-07 | Merge branch 'ferd/ssl-allow-ecc-config/PR-1210/OTP-13959' into maint | Ingela Anderton Andin | |
* ferd/ssl-allow-ecc-config/PR-1210/OTP-13959: Add ECC curve selection order config in TLS server | |||
2016-11-07 | Merge branch 'maint' | Björn-Egil Dahlberg | |
2016-11-07 | Merge branch 'egil/erts/cuddle-tests' into maint | Björn-Egil Dahlberg | |
* egil/erts/cuddle-tests: stdlib: Increase timeouts in ets_SUITE stdlib: Increase timeouts in rand_SUITE stdlib: Increase timeouts in base64_SUITE erts: Use cmd on windows for port_SUITE | |||
2016-11-04 | [cosProperty] Update version and release notes | Lars Thorsen | |
2016-11-04 | [orber] Update version and release notes | Lars Thorsen | |
2016-11-04 | [cosProperty] Fix dialyzer warning | Lars Thorsen | |
Remove one unused clause found by dialyzer. | |||
2016-11-04 | [orber] Fix dialyzer warnings | Lars Thorsen | |
Removed two matching errors and one unused clause found by dialyzer. | |||
2016-11-04 | stdlib: Increase timeouts in ets_SUITE | Björn-Egil Dahlberg | |
* valgrind needs lots of time | |||
2016-11-04 | stdlib: Increase timeouts in rand_SUITE | Björn-Egil Dahlberg | |
* valgrind needs lots of time | |||
2016-11-04 | stdlib: Increase timeouts in base64_SUITE | Björn-Egil Dahlberg | |
* valgrind needs lots of time | |||
2016-11-04 | [crypto] Remove depricated functions | Lars Thorsen | |
2016-11-03 | Add a test case that should now work | Kostis Sagonas | |
2016-11-03 | Fix the native code translation of bs_match_string | Kostis Sagonas | |
This fixes a HiPE bug reported on erlang-questions on 2/11/2016. The BEAM to ICode tranaslation of the bs_match_string instruction, written long ago for binaries (i.e., with byte-sized strings), tried to do a `clever' translation of even bit-sized strings using a HiPE primop that took a `Size' argument expressed in *bytes*. ICode is not really the place to do such a thing, and moreover there is really no reason for the HiPE primop not to take a Size argument expressed in *bits* instead. This commit changes the `Size' argument to be in bits, postpones the translation of the bs_match_string primop Fixed in a pair-programming/debugging session with @margnus1. until RTL and does a proper translation using bit-sized quantities there. | |||
2016-11-03 | Merge branch 'sverker/kernel-erts-dependency/OTP-14003' into maint | Sverker Eriksson | |
* sverker/kernel-erts-dependency: kernel: Add lost dependency to erts-8.1 | |||
2016-11-03 | Merge branch 'gandrade/fmod/PR-1216/OTP-14000' | Björn Gustavsson | |
* gandrade/fmod/PR-1216/OTP-14000: Add test cases for math:fmod/2 BIF Support math:fmod/2 BIF on compiler Add math:fmod/2 BIF |