aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
AgeCommit message (Collapse)Author
2014-01-31Allow making the system with --enable-native-libsKostis Sagonas
The HiPE compiler crashes when trying to compile these files because it does not currently support maps. So, add a -compile(no_native) attribute to these files to allow the system to be made even when configured with --enable-native-libs. This is a temporary fix and will be removed when the HiPE compiler gets proper support for maps.
2014-01-29Merge branch 'egil/maps/OTP-11616'Björn-Egil Dahlberg
* egil/maps/OTP-11616: (112 commits) compiler: Add core compile test for maps compiler: Fix core parse for Maps compiler: Fixup #map_pair{} spec erts: Strengthen map_SUITE tests erts: Update maps_fold test to respect maps:fold/3 stdlib: Make maps:fold/3 order-independent erts: Fixup enif_make_map_put on windows erts: Update preloaded erts_internal.beam hipe: Fixup update cerl pretty printer erts: Add map construction to driver API dialyzer: Add maps tests dialyzer: Remove dead code dialyzer: Reflect map_pair core changes in dialyzer hipe: Update cerl pretty printer compiler: Update inliner tests compiler: Squash #c_map_pair_*{} to #c_map_pair{} compiler: Squash #k_map_pair_*{} to #k_map_pair{} preloaded: Fixup export cmp_term in erts_internal erts: Change 'size' argument of enif_get_map_size from int* to size_t* erts: Fix compile error for halfword emulator ...
2014-01-29stdlib: Make maps:fold/3 order-independentBjörn-Egil Dahlberg
This means replacing maps:foldl/3 and maps:foldr/3 with maps:fold/3.
2014-01-29Merge branch 'bjorn/fna-default/OTP-11612'Björn Gustavsson
* bjorn/fna-default/OTP-11612: Change the default file name encoding mode to +fnaw
2014-01-28stdlib: Strengthen Map module with guardsBjörn-Egil Dahlberg
This commit requires Map enabled bootstrap compiler.
2014-01-28stdlib: Pretty print mapsBjörn-Egil Dahlberg
Pretty printing behaviour mimic records. This commit requires Map enabled bootstrap compiler.
2014-01-28stdlib: Remove bogus map() typeBjörn-Egil Dahlberg
2014-01-28erts,stdlib: Change map module name to mapsBjörn-Egil Dahlberg
Name conforms to EEP.
2014-01-28erts,stdlib: Teach matchspec compiler map guardsBjörn-Egil Dahlberg
2014-01-28stdlib: Fixup id_transform_SUITEBjörn-Egil Dahlberg
2014-01-28dialyzer,hipe,stdlib: Add Maps understanding to DialyzerBjörn-Egil Dahlberg
2014-01-28Change the default file name encoding mode to +fnawBjörn Gustavsson
2014-01-28Merge branch 'siri/appup_tests_17/OTP-11534'Siri Hansen
* siri/appup_tests_17/OTP-11534: Update sasl appup test to work for OTP release 17 Update stdlib appup test to work for OTP release 17 Update kernel appup test to work for OTP release 17
2014-01-28stdlib: Add Map moduleBjörn-Egil Dahlberg
The map type is set to term.
2014-01-28stdlib: Update erl_scan_SUITE for ':=' and '=>' tokensBjörn-Egil Dahlberg
2014-01-28stdlib: Deny variables as keys and disallow ':=' in map constructionBjörn-Egil Dahlberg
In the current iteration of Maps we should deny *any* variables in Map keys.
2014-01-28stdlib: Teach erl_eval Maps ':=' exact operatorBjö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-28stdlib: Fix erl_parse:parse_term/1Björn-Egil Dahlberg
Did not handle Maps.
2014-01-28Extend erl_parse with two Op Map syntaxBjörn-Egil Dahlberg
Example how to construct: #{ K1 => V1, K2 => V2 } How to update: M#{ K1 => V1, K2 := V2 } How to match: #{ K1 := V1, K2 := V2 } = M
2014-01-28Teach erl_scan to recognize ':='Björn-Egil Dahlberg
2014-01-28erl_eval: Add functions to interpreter for mapsBjörn-Egil Dahlberg
2014-01-28stdlib: Update printing to handle MapsBjörn-Egil Dahlberg
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-28erts: Add the size-testing guard BIF map_size/1Björn-Egil Dahlberg
2014-01-28Update erl_lint, erl_expand_records, sys_pre_expand for mapsBjörn Gustavsson
2014-01-28Extend erl_parse with the new map syntaxBjörn-Egil Dahlberg
Example how to match or construct: #{ K1 => V1, K2 => V2 } How to update: M#{ K => V }
2014-01-28Teach erl_scan to recognize '=>'Björn-Egil Dahlberg
2014-01-28Update stdlib appup test to work for OTP release 17Siri Hansen
2014-01-23Properly handle export_all when looking for undefined callbacksAnthony Ramine
Reported-by: Michele Miron
2014-01-22Merge branch 'dgud/test_unicode/OTP-10877'Dan Gudmundsson
* dgud/test_unicode/OTP-10877: sasl test: Quote executable paths (can contain spaces) rt_tools: Handle unicode chars in printouts kernel: code_SUITE fix unicode option Fix (unicode) debug info in test cases stdlib: Fix format if module resides in a unicode directory Fix testing with unicode paths test_server: Fix ts write unicode in config files
2014-01-21stdlib: Fix format if module resides in a unicode directoryDan Gudmundsson
2014-01-21Fix testing with unicode pathsDan Gudmundsson
re needs unicode option
2014-01-10Handle binary input in console helpersJosé Valim
The standard_input may be set to binary mode via io:getopts/2 and in case such cases the "i/0" console helper got stuck as it was unable to match new lines in binaries.
2014-01-09Merge branch 'sv/faster-orddict-from_list/OTP-11552'Björn Gustavsson
* sv/faster-orddict-from_list/OTP-11552: improve performance for orddict:from_list/1
2013-12-19improve performance for orddict:from_list/1Steve Vinoski
Improve the performance of orddict:from_list/1 by reimplementing it using the lists module in a way that preserves backward compatibility. The QuickCheck programs linked below were used to verify backward compatibility: * https://gist.github.com/vinoski/3bd216efa421c581174a * https://gist.github.com/vinoski/c6db70e8dc725083843d Both tests, which were run on R16B03, require the original orddict module to be renamed to olddict, and that code:unstick_mod/1 be applied to orddict in order to allow it to be replaced with the revised orddict. The first QuickCheck test first generates a list of pairs of terms, then uses the list to create both an original and revised orddict using from_list/1, then verifies that the results of the operation are the same for both instances. The second QuickCheck test is similar except that it first creates an instance of the original and revised orddicts and then folds over a randomly-generated list of orddict functions, applying each function to each orddict instance and verifying that the results match. The revised orddict:from_list/1 function was also tested to assess performance against the original orddict implementation. The test program used is available here: * https://gist.github.com/vinoski/61772a052f3501e1e128 Since an orddict instance is implemented as a list, the test program creates ordicts of length 1, 10, 100, and 1000 and uses them to assess performance at each length. Performance was measured using timer:tc/3 to time a number of iterations of various tests against the original orddict and against the revised orddict. To test from_list/1, orddicts of lengths 1, 10, 100, and 1000 are created from a list of random pairs with integer keys. For lengths greater than 1, two different tests are performed: one passing a list of pairs in sorted key order, and the other passing a list of pairs in reverse sorted key order. Since orddicts are ordered, these orderings effect worst-case and best-case behavior of the original orddict:from_list/2 implementation respectively. These tests were performed against R16B02 on a Macbook Pro with an Intel Core i7 processor running at 2.7GHz and 16GB of RAM running OS X 10.8.5, and on a Dell system with a 3.4GHz Intel Core i7 and 16GB of RAM running Ubuntu Linux 12.04. The tables below show results for OS X and Linux respectively. Each table lists the name of each test followed by two numbers, each a time in microseconds of the average of 10 runs of the test. The first number is the result for the original orddict, the second for the revised orddict. As the numbers for both platforms show, the revised from_list/1 function is always faster than the original version, in some cases quite a bit faster. Results from OS X: ------------------ from_list length 1: 1.789 0.116 from_list length 10 ordered: 10.082 3.040 from_list length 10 reverse ordered: 4.853 3.604 from_list length 100 ordered: 397.213 20.134 from_list length 100 reverse ordered: 25.473 20.745 from_list length 1000 ordered: 37490.26 251.46 from_list length 1000 reverse ordered: 307.94 215.96 Results from Linux: ------------------- from_list length 1: 0.146 0.025 from_list length 10 ordered: 4.729 0.815 from_list length 10 reverse ordered: 1.687 0.956 from_list length 100 ordered: 144.467 5.896 from_list length 100 reverse ordered: 6.694 5.816 from_list length 1000 ordered: 13755.19 79.413 from_list length 1000 reverse ordered: 91.54 64.308
2013-12-13Merge branch 'nox/eep37/OTP-11537'Björn Gustavsson
* nox/eep37/OTP-11537: Support EEP37 named funs in emacs erlang-mode Document named fun expressions Test named funs Support named funs in the debugger interpreter Update primary bootstrap for named funs in the shell Support named funs in the shell Update primary bootstrap for named funs EEP 37: Funs with names Support non top level letrecs in dialyzer
2013-12-13Merge branch 'rickard/otp-17-vsn'Rickard Green
* rickard/otp-17-vsn: Update versions of OTP, erts, kernel, and stdlib
2013-12-12Test named funsAnthony Ramine
2013-12-12Support named funs in the shellAnthony Ramine
The current code for the evaluation of ordinary funs is dependent on the order on variables in the fun environment as returned by erlang:fun_info(Fun, env). To avoid the problem in the future, make sure that we only have one free variable in the funs that we will need to inspect using erlang:fun_info(Fun, env).
2013-12-12EEP 37: Funs with namesAnthony Ramine
This adds optional names to fun expressions. A named fun expression is parsed as a tuple `{named_fun,Loc,Name,Clauses}` in erl_parse. If a fun expression has a name, it must be present and be the same in every of its clauses. The function name shadows the environment of the expression shadowing the environment and it is shadowed by the environment of the clauses' arguments. An unused function name triggers a warning unless it is prefixed by _, just as every variable. Variable _ is allowed as a function name. It is not an error to put a named function in a record field default value. When transforming to Core Erlang, the named fun Fun is changed into the following expression: letrec 'Fun'/Arity = fun (Args) -> let <Fun> = 'Fun'/Arity in Case in 'Fun'/Arity where Args is the list of arguments of 'Fun'/Arity and Case the Core Erlang expression corresponding to the clauses of Fun. This transformation allows us to entirely skip any k_var to k_local transformation in the fun's clauses bodies.
2013-12-10Merge tag 'OTP_R16B03'Magnus Lidén
The R16B03 release Conflicts: lib/sasl/vsn.mk
2013-12-10Update versions of OTP, erts, kernel, and stdlibRickard Green
Update versions of OTP, erts, kernel, and stdlib to comply with the new version scheme decided by the OTP technical board.
2013-12-09Prepare releaseOTP_R16B03Erlang/OTP
2013-12-07Merge branch 'rickard/garbage_collect/OTP-11388'Rickard Green
* rickard/garbage_collect/OTP-11388: Parallel check_process_code when code_server purge a module Functionality for disabling garbage collection Use asynchronous check_process_code in code_parallel_SUITE Execution of system tasks in context of another process Conflicts: bootstrap/lib/kernel/ebin/hipe_unified_loader.beam erts/preloaded/ebin/erlang.beam erts/preloaded/ebin/erts_internal.beam
2013-11-18Execution of system tasks in context of another processRickard Green
A process requesting a system task to be executed in the context of another process will be notified by a message when the task has executed. This message will be on the form: {RequestType, RequestId, Pid, Result}. A process requesting a system task to be executed can set priority on the system task. The requester typically set the same priority on the task as its own process priority, and by this avoiding priority inversion. A request for execution of a system task is made by calling the statically linked in NIF erts_internal:request_system_task(Pid, Prio, Request). This is an undocumented ERTS internal function that should remain so. It should *only* be called from BIF implementations. Currently defined system tasks are: * garbage_collect * check_process_code Further system tasks can and will be implemented in the future. The erlang:garbage_collect/[1,2] and erlang:check_process_code/[2,3] BIFs are now implemented using system tasks. Both the 'garbage_collect' and the 'check_process_code' operations perform or may perform garbage_collections. By doing these via the system task functionality all garbage collect operations in the system will be performed solely in the context of the process being garbage collected. This makes it possible to later implement functionality for disabling garbage collection of a process over context switches. Newly introduced BIFs: * erlang:garbage_collect/2 - The new second argument is an option list. Introduced option: * {async, RequestId} - making it possible for users to issue asynchronous garbage collect requests. * erlang:check_process_code/3 - The new third argument is an option list. Introduced options: * {async, RequestId} - making it possible for users to issue asynchronous check process code requests. * {allow_gc, boolean()} - making it possible to issue requests that aren't allowed to garbage collect (operation will abort if gc should be needed). These options have been introduced as a preparation for parallelization of check_process_code operations when the code_server is about to purge a module.
2013-11-07Merge branch 'maint'Fredrik Gustafsson
2013-11-07Merge branch 'asterite/atan2_spec/OTP-11465' into maintFredrik Gustafsson
* asterite/atan2_spec/OTP-11465: Spec for atan2 should be atan2(Y, X), not atan2(X, Y)
2013-10-29Merge branch 'maint'Fredrik Gustafsson
2013-10-25Add XML marker for regexp syntaxHåkan Mattsson