aboutsummaryrefslogtreecommitdiffstats
path: root/lib
AgeCommit message (Collapse)Author
2010-05-20v3_core tests: Cover handling of pattern aliasesBjörn Gustavsson
2010-05-20v3_core: Remove a clause in is_simple/1 that cannot matchBjörn Gustavsson
The is_simple/1 function does not need to handle #c_binary{}, since it will never be called with a #c_binary{} argument.
2010-05-20v3_core: Remove unused support for generating compilation errorsBjörn Gustavsson
The state record #core{} has a "es" field that can be used for causing a compilation error. Since incorrect programs have been rejected much earlier by erl_lint, no errors were actually stored in the "es" fields. Therefore, get rid of the "es" field and the support for generating a compilation error in the v3_core module.
2010-05-20Remove stray support for the put_literal/2 instructionBjörn Gustavsson
put_literal/2 was an experimental instruction added in R11 to support literals, but before the R12 release support for literals was implemented for all instruction, making the put_literal/2 instruction redundant. Although the beam_disasm module supports dissambley of instructions in older releases, there is no reason to have it support experimental instructions.
2010-05-20Remove stray support for the bs_bits_to_bytes2/2 instructionBjörn Gustavsson
bs_bits_to_bytes2/2 was an experimental instruction added in R11, but was removed in R12. Although the beam_disasm and beam_validator modules do support instructions in older releases, there is no reason to have them support experimental instructions.
2010-05-20Remove the bs_bits_to_bytes/3 instructionBjörn Gustavsson
The last compiler to generate code that uses the bs_bits_to_bytes/3 instruction was the R11 compiler. Since we don't support loading R11 *.beam files in R14, removing the remaining support for the instruction.
2010-05-20Cover handling of 'math' BIFsBjörn Gustavsson
Extend float_SUITE to cover the handling of all BIFs in the 'math' module. This change will increase test coverage of erl_bifs and erl_type.
2010-05-20beam_bool: Remove a clause in live_regs/1 that cannot matchBjörn Gustavsson
live_regs/1 folds over a list of tuples, so a clause matching an element being an empty list can never match. If the list for some unfathomable reason would contain an empty list, there will be an internal compiler error and no *.beam file will be created. Thus this change is safe.
2010-05-20beam_bool: Cover handling of bs_context_to_binary in initialized_regs/2Björn Gustavsson
Add a test case (derived from dets_v9:scan_skip/8), to cover the clause in initialized_regs/2 that handles bs_context_to_binary.
2010-05-20beam_bool: Remove a clause in initialized_regs/2 that cannot matchBjörn Gustavsson
When scanning a reversed instruction sequence for a function, it is impossible to reach the end of the list, because each function must have a fun_info/4 instruction followed by a label/1 instruction at the beginning, and there is a clause that will handle those instructions. If for some unfathomable reason the end of the list would be reached, with this change there will be an internal compiler error and no *.beam file will be created. Thus this change is safe.
2010-05-20beam_block: Remove a clause that will never be executedBjörn Gustavsson
Since the introduction of literals in R12B, empty tuples are literals. Thus the put_tuple/2 instruction is always followed by at least one put/1 instruction. Therefore the alloc_may_pass/1 function in beam_block no longer needs a clause for for "put_tuple", because the clause for "put" will always be reached first (since the instruction stream is scanned in reverse execution order). Note that if the compiler would generate a "put_tuple 0 Dst" instruction for some unfathomable reason, we should still be because the run-time system will now refuse to load a module containing such an instruction.
2010-05-20compile: Remove code that is only executed on SolarisBjörn Gustavsson
On Solaris only, the 'time' option would include the process size for the Erlang virtual machine in its output. Since few compiler developers use Solaris nowadays, remove the code.
2010-05-20Do not cover-analyze core_scanBjörn Gustavsson
Compiling from *.core files is not a supported feature, and writing test cases to improve the coverage of core_scan will not help us to find more bugs in the compiler.
2010-05-20core_SUITE_data: Don't ignore *.core files in this directoryBjörn Gustavsson
2010-05-20Merge branch 'pan/otp_8217_binary' into devErlang/OTP
* pan/otp_8217_binary: Add documentation for binary module Add more tests and make some go easier on small systems Correct Boyer More and trapping for longest_common_suffix Add longer timetrap to testcases and add binary to app file Add guard BIFs binary_part/2,3 Add binary:{encode,decode}_unsigned({1,2} Add referenced_byte_size/1 Add binary:list_to_bin/1 and binary:copy/1,2 Add bin_to_list/{1,2,3} Add binary:longest_common_prefix/longest_common_suffix Add binary:part to erl_bif_binary.c Move binary module bif's to erl_bif_binary.c Count reductions for process even when not trapping Add random compare testcase Teach BIF's binary:match/matches interrupting/restarting Teach binary.c the semantics to take longest instead of shortest match Initial commit of the binary EEP OTP-8217 Implement EEP31 The module binary from EEP31 (and EEP9) is implemented.
2010-05-20Honor internal APIIngela Anderton Andin
2010-05-20Fixed internal APIIngela Anderton Andin
2010-05-19Merge branch 'dp/shell-line-editing' into devErlang/OTP
* dp/shell-line-editing: Readline-style line edit history OTP-8635 dp/shell-line-editing The shell's line editing has been improved to more resemble the behaviour of readline and other shells. (Thanks to Dave Peticolas)
2010-05-18Fix indentation of records with line breaks inside listsMagnus Henoch
Trying to indent this piece of code by hitting TAB on each line: foo() -> [#foo{ foo = foo}]. used to cause an error. Fix by ignoring errors when trying to skip backwards from a record. Also add this test case to test.erl.orig and test.erl.indented.
2010-05-18inferior-erlang: specify command to run, uniquify buffer namesMagnus Henoch
Add a new feature to the command inferior-erlang: when called with a prefix argument, prompt for the command to execute to start the Erlang shell. When possible (i.e., in Emacs 23 and later), allow tab completion as in a normal shell. Also create the shell buffer in such a way that, if uniquify-buffer-name-style is not nil and several Erlang shell buffers are started in different directories, the names of those buffers reflect their working directories instead of being *erlang*, *erlang*<2>, etc.
2010-05-18Associate files using interpreter "escript" with Erlang modeMagnus Henoch
A file whose first line contains "#!/usr/bin/env escript" should be opened in erlang-mode, even if its name doesn't end in ".erl". Add an entry to interpreter-mode-alist to that effect.
2010-05-18Fixed extended_key_usage test so that it really tests what we want it to test.Ingela Anderton Andin
2010-05-18Commented out currently unsupported code. To be supported or removed in the ↵Ingela Anderton Andin
future.
2010-05-18Add Emacs EUnit utility feature: run current test function.Chris Bernard
This determines the current test function under point (cursor), whether the active buffer contains a test module (foo_tests) or the module itself (foo), then compiles the source module (and test module if present) and runs that test function. Since this added a third testing feature, there was some natural duplication that needed to be factored out. The notion of 'compile and run tests' was decoupled from exactly which tests should be run. The definitions of default keybindings were converted to a list for clarity and conciseness.
2010-05-17Add documentation for binary modulePatrik Nyblom
Correct behaviour of copy/2 witn 0 copies.
2010-05-17Add more tests and make some go easier on small systemsPatrik Nyblom
Even more tests added to cover more error cases, some tests made easier on systems with small memories and timeouts made longer due to timetraps on solaris daily builds.
2010-05-17Correct Boyer More and trapping for longest_common_suffixPatrik Nyblom
Add testcases and clean up to get better code coverage.
2010-05-17Add longer timetrap to testcases and add binary to app filePatrik Nyblom
2010-05-17Add guard BIFs binary_part/2,3Patrik Nyblom
Add the gc_bif's to the VM. Add infrastructure for gc_bif's (guard bifs that can gc) with two and. three arguments in VM (loader and VM). Add compiler support for gc_bif with three arguments. Add compiler (and interpreter) support for new guard BIFs. Add testcases for new guard BIFs in compiler and emulator.
2010-05-17Add binary:{encode,decode}_unsigned({1,2}Patrik Nyblom
Add testcases for encode/decode_unsigned/1,2.
2010-05-17Add referenced_byte_size/1Patrik Nyblom
Add testcases for referenced_byte_size/1. Add failure tests for referenced_byte_size.
2010-05-17Add binary:list_to_bin/1 and binary:copy/1,2Patrik Nyblom
Add testcases for binary:list_to_bin/1 and binary:copy/1,2. Add reference implementation of list_to_bin/1.
2010-05-17Add bin_to_list/{1,2,3}Patrik Nyblom
Add testcases for bin_to_list. Teach binref.erl bin_to_list.
2010-05-17Add binary:longest_common_prefix/longest_common_suffixPatrik Nyblom
Add allcoator parameter to erts_get_aligned_binary_bytes_extra. Add testcases for the functions above. Add reference implementation for the functions above.
2010-05-17Add binary:part to erl_bif_binary.cPatrik Nyblom
Change name of the 'scope' option for binary:match/matches. Add split and replace to binary.erl. Cleanup comments etc in binary.erl and atom.names Add testcases for part, split, replace and scopes.
2010-05-17Count reductions for process even when not trappingPatrik Nyblom
Set loop factors to 10. Teach erts_debug:set_internal_state to limit loop factor for binary. Add random tests for matches and match with multiple searchstrings.
2010-05-17Add random compare testcasePatrik Nyblom
Fix heap-hole when trapping in binary.c Fix boyer more segfaulting when searchstring is longer than haystack
2010-05-17Teach binary.c the semantics to take longest instead of shortest matchPatrik Nyblom
Add testcase embryos and reference implementation. Change name of compile function according to EEP31.
2010-05-17Initial commit of the binary EEPPatrik Nyblom
2010-05-17Removed/commented out currently dead code.Ingela Anderton Andin
2010-05-12timer: Update specs and apply tidier cleanupsKostis Sagonas
2010-05-12Merge branch 'bg/compiler-attributes' into devErlang/OTP
* bg/compiler-attributes: Remove opaque declarations from the attributes
2010-05-12hipe_beam_to_icode: Correct names of new recv_* instructionsKostis Sagonas
The bug was introduced in d60f055697cfe8e7f94be4d291d49bb00a66bc52.
2010-05-12OTP-8629 stdlib: prepare erl_parse.yrl for future extensionHans Bolinder
2010-05-12OTP-8628 stdlib: correction lists(3)Hans Bolinder
The documentation of lists:keysort/2 states that the sort is stable.
2010-05-12Remove opaque declarations from the attributesBjörn Gustavsson
-opaque declarations should not be retained in the attributes (because they will be loaded along with the code and are not useful). While at it, filter away those Dialyzer attributes as early as possible - in v3_kernel.
2010-05-12Add support for the format_status callback to gen_eventSteve Vinoski
The gen_server and gen_fsm behaviors support the format_status callback to allow developers to specialize how callback module state appears within the return value of sys:get_status and within logged output resulting from abnormal process termination. This patch adds similar support to gen_event. Event handlers that export a format_status/2 function, which is an optional callback, and are registered with an event manager will now have their format_status callbacks invoked when sys:get_status is called on the event manager. The term returned from format_status for this case replaces the default handler state in the sys:get_status return value. This patch also extends gen_event to call an event handler's format_status function (if it exports one) should the handler terminate abnormally. The term returned from format_status is logged in place of the handler's state. This is intended to allow developers to control how much output is logged in the case of abnormal termination. The documentation is appropriately extended and new unit tests are added to cover the new gen_event format_status functionality.
2010-05-12Extend format_status for gen_server/gen_fsm termination error loggingSteve Vinoski
When a gen_server or gen_fsm process terminates abnormally, sometimes the text representation of the process state can occupy many lines of the error log, depending on the definition of the state term. Developers sometimes would like a way to trim out parts of the state from the log if those parts don't contribute to documenting the circumstances of the error, thereby helping to reduce the amount of logged output. Since the format_status callback can already format and specialize gen_server and gen_fsm state for inclusion in the term returned from sys:get_status, this patch extends format_status in a backward-compatible way to also be able to specialize the state logged for abnormal gen_server and gen_fsm termination, and includes new unit tests to verify the new functionality. This patch also eliminates the previous restriction that the status returned by format_status must be a list. It can now be any term. The documentation is extended to cover the new usage for format_status, and it's been improved to recommend a form for the normal case that allows the returned status to fit well with the rest of the term returned by sys:get_status. The documentation is clear that this form is only recommended, not required.
2010-05-12Merge branch 'bg/opt-receive' into devErlang/OTP
* bg/opt-receive: Test that gen_server:call/2,3 are fast even with a huge message queue erts: Add tests for the receive optimization Update primary bootstrap erts: Implement recv_mark/1 and recv_set/1 for real compiler tests: Cover the error handling code in beam_receive compiler test: Test optimization of receive statements Optimize selective receives in the presence of a large message queue Introduce the new recv_mark/1 and recv_mark/1 instructions Compile tests that communicate with R12 nodes with the r12 option Move p_run/2 to test_lib gen: Inline wait_resp_mon/2 to help the compiler optimize OTP-8623 bg/opt-receive reveive statements that can only read out a newly created reference are now specially optimized so that it will execute in constant time regardless of the number of messages in the receive queue for the process. That optimization will benefit calls to gen_server:call(). (See gen:do_call/4 for an example of a receive statement that will be optimized.)
2010-05-11OTP-8620 Updates of ct_sshPeter Andersson