aboutsummaryrefslogtreecommitdiffstats
path: root/erts
AgeCommit message (Collapse)Author
2011-11-07Merge branch 'egil/fix-compiler-warnings'Björn-Egil Dahlberg
* egil/fix-compiler-warnings: erts: Remove unused variable in enif_make_binary erts: Remove debug variable in list_to_binary erts: Remove cp on exiting and trapping processes erts: Remove debug variables in erl_db erts: Remove dead code in efile_drv erts: Remove lock_check debug variables erts: Remove unused variable in ttsl_drv erts: "initialized" is only used with CHLDWTHR erts: remove debug variables in beam_bp
2011-11-07Merge branch 'ta/nif-variadic-funs'Henrik Nord
OTP-9675
2011-11-07erts: Remove unused variable in enif_make_binaryBjörn-Egil Dahlberg
2011-11-07erts: Remove debug variable in list_to_binaryBjörn-Egil Dahlberg
2011-11-07erts: Remove cp on exiting and trapping processesBjörn-Egil Dahlberg
2011-11-07erts: Remove debug variables in erl_dbBjörn-Egil Dahlberg
2011-11-07erts: Remove dead code in efile_drvBjörn-Egil Dahlberg
2011-11-07erts: Remove lock_check debug variablesBjörn-Egil Dahlberg
2011-11-07erts: Remove unused variable in ttsl_drvBjörn-Egil Dahlberg
2011-11-07erts: "initialized" is only used with CHLDWTHRBjörn-Egil Dahlberg
2011-11-07erts: remove debug variables in beam_bpBjörn-Egil Dahlberg
2011-11-07Merge branch 'bjorn/fun-improvements/OTP-9667'Björn Gustavsson
* bjorn/fun-improvements/OTP-9667: sys_pre_expand: Remove incorrect comment compiler: Eliminate use of deprecated erlang:hash/2 beam_asm: Fix broken NewIndex in fun entries beam_asm: Strenghten the calculation of Uniq for funs
2011-11-07beam_asm: Strenghten the calculation of Uniq for funsBjörn Gustavsson
Funs are identified by a triple, <Module,Uniq,Index>, where Module is the module name, Uniq is a 27 bit hash value of some intermediate representation of the code for the fun, and index is a small integer. When a fun is loaded, the triple for the fun will be compared to previously loaded funs. If all elements in the triple in the newly loaded fun are the same, the newly loaded fun will replace the previous fun. The idea is that if Uniq are the same, the code for the fun is also the same. The problem is that Uniq is only based on the intermediate representation of the fun itself. If the fun calls local functions in the same module, Uniq may remain the same even if the behavior of the fun has been changed. See http://erlang.org/pipermail/erlang-bugs/2007-June/000368.htlm for an example. As a long-term plan to fix this problem, the NewIndex and NewUniq fields was added to each fun in the R8 release (where NewUniq is the MD5 of the BEAM code for the module). Unfortunately, it turns out that the compiler does not assign unique value to NewIndex (if it isn't tested, it doesn't work), so we cannot use the <Module,NewUniq,NewIndex> triple as identification. It would be possible to use <Module,NewUniq,Index>, but that seems ugly. Therefore, fix the problem by making Uniq more unique by taking 27 bits from the MD5 for the BEAM code. That only requires a change to the compiler. Also update a test case for cover, which now fails because of the stronger Uniq calculation. (The comment in test case about why the Pid2 process survived is not correct.)
2011-11-07EEP-23: Allow variables in fun M:F/ABjörn Gustavsson
Currently, the external fun syntax "fun M:F/A" only supports literals. That is, "fun lists:reverse/1" is allowed but not "fun M:F/A". In many real-life situations, some or all of M, F, A are not known until run-time, and one is forced to either use the undocumented erlang:make_fun/3 BIF or to use a "tuple fun" (which is deprecated). EEP-23 suggests that the parser (erl_parse) should immediately transform "fun M:F/A" to "erlang:make_fun(M, F, A)". We have not followed that approach in this implementation, because we want the abstract code to mirror the source code as closely as possible, and we also consider erlang:make_fun/3 to be an implementation detail that we might want to remove in the future. Instead, we will change the abstract format for "fun M:F/A" (in a way that is not backwards compatible), and while we are at it, we will move the translation from "fun M:F/A" to "erlang:make_fun(M, F, A)" from sys_pre_expand down to the v3_core pass. We will also update the debugger and xref to use the new format. We did consider making the abstract format backward compatible if no variables were used in the fun, but decided against it. Keeping it backward compatible would mean that there would be different abstract formats for the no-variable and variable case, and tools would have to handle both formats, probably forever. Reference: http://www.erlang.org/eeps/eep-0023.html
2011-11-02beam_loader: Support external funs in the literal poolBjörn Gustavsson
A future release of the compiler might want to treat external funs as literals. Make sure that the loader can cope with an export entry being created from both an entry in the literal pool and from the export table (i.e. if an external fun refers to an exported function in the same module).
2011-11-02beam_load.c: Clarify error message when loading unsupported BEAM filesBjörn Gustavsson
Make it clear for the user what has happened and how to fix it when an attempt is made to load a BEAM file containing new instructions that the current run-time system cannot handle. Suggested-by: Thomas Lindgren
2011-11-01Merge branch 'lukas/erts/large_float_cmp/OTP-9497'Lukas Larsson
* lukas/erts/large_float_cmp/OTP-9497: Update documentation after changes in integer and float comparison Do small optimisation on platforms with 32 bit Eterm Add tests for equality checking Optimize comparison of huge floats and smaller bignums Add tests for comparing large floats and small bignums Cleanup double_to_bignum conversion code Update size of tmp cmp bignum buffer Expand tests for float and number comparison Update heauristic to work on halfword Add heauristics bignum vs float checks Optimise bugnum and small comparison Add float vs integer comparison tests Update integer and floating point number comparisons
2011-10-27erts: Make erl_nif.h compile with gcc on WindowsSverker Eriksson
and some added comments
2011-10-27Remove unused */doc/src/make.dep filesBjörn Gustavsson
These dependency files was once used when building the documentation, but are no longer needed.
2011-10-27erts/z_SUITE: Eliminate use of deprecated regexp moduleBjörn Gustavsson
2011-10-27erts/nt_SUITE: Eliminate use of deprecated regexp moduleBjörn Gustavsson
2011-10-20Merge branch 'bjorn/unicode-noncharacters/OTP-9624'Björn Gustavsson
* bjorn/unicode-noncharacters/OTP-9624: Allow noncharacter code points in unicode encoding and decoding
2011-10-19Fix erroneous merge resolutionRickard Green
Previously removed code erroneously reappeared in a merge to the master branch (ec36499d7e329b4dc69a1a3be3422eac7907c260).
2011-10-18erts: convert variadic nif funs into inline funsTuncer Ayaz
2011-10-18Merge branch 'fm/enif_is_number'Henrik Nord
* fm/enif_is_number: Add NIF function enif_is_number Conflicts: erts/emulator/beam/erl_nif_api_funcs.h OTP-9629
2011-10-17Correct the docsHans Bolinder
2011-10-13Allow noncharacter code points in unicode encoding and decodingBjörn Gustavsson
The two noncharacter code points 16#FFFE and 16#FFFF were not allowed to be encoded or decoded using the unicode module or bit syntax. That causes an inconsistency, since the noncharacters 16#FDD0 to 16#FDEF could be encoded/decoded. There is two ways to fix that inconsistency. We have chosen to allow 16#FFFE and 16#FFFF to be encoded and decoded, because the noncharacters could be useful internally within an application and it will make encoding and decoding slightly faster. Reported-by: Alisdair Sullivan
2011-10-13make_preload: Don't output a C comment start inside a commentBjörn Gustavsson
We already avoid outputting a comment terminator ("*/") inside a comment to avoid causing a syntax error. Also avoid outputting the start of a comment ("/*") to avoid causing a compiler warning. Noticed-by: Tuncer Ayaz
2011-10-12Merge branch 'bjorn/erts/beam-loader-fixes'Björn Gustavsson
* bjorn/erts/beam-loader-fixes: Print transformtions sorted on the name of the first instruction Share code for call of predicate and transformation functions Simplify transformations of gc_bif[123] instructions Refactor 'too_old_compiler' handling Introduce 'try_me_else_fail' Combine 'store_var' with 'next_arg' Merge 'next_instr' and 'is_op' into 'next_instr' Merge 'new_instr' and 'store_op' into 'new_instr' Combine a 'call' instruction with the following 'end' instruction Remove some unnecessary type constraints in transformations Get rid of redundant 'try_me_else' and 'fail' instructions Add some more information in instruction comments In transformations, don't store variables that are never used Remove redundant 'next_arg' before 'next_instr' Generalize and rename is_set_var_instr() to is_instr() Remove too_old_compiler handling for very old instruction variants Remove the special instructions for the hybrid heap emulator Remove optimization of 'move R R'
2011-10-11Do small optimisation on platforms with 32 bit EtermLukas Larsson
On 32 bit we know that a comparison with a lossfull double and a short will always give the float is being superior. So therefore we only have to check the sign on the double.
2011-10-11Add tests for equality checkingLukas Larsson
Test for checking equality on all float exponents Test in equality for all comparison tests
2011-10-11Optimize comparison of huge floats and smaller bignumsLukas Larsson
2011-10-11Add tests for comparing large floats and small bignumsLukas Larsson
2011-10-11Cleanup double_to_bignum conversion codeLukas Larsson
2011-10-11Update size of tmp cmp bignum bufferLukas Larsson
This is needed for use on 32 bit with very large floats.
2011-10-11Expand tests for float and number comparisonLukas Larsson
2011-10-11Update heauristic to work on halfwordLukas Larsson
2011-10-11Add heauristics bignum vs float checksLukas Larsson
These tests are useful when the difference between the bignum and float is larger than one bignum segment.
2011-10-11Optimise bugnum and small comparisonLukas Larsson
As it is possible to assume that bignums are bigger than smalls, we can just check the sign of the bignum.
2011-10-11Add float vs integer comparison testsLukas Larsson
2011-10-11Update integer and floating point number comparisonsLukas Larsson
For floating point values which are greater than 9007199254740990.0 or smaller than -9007199254740990.0, the floating point numbers are now converted to integers during comparison with an integer. This makes number comparisons transitive for large floating point numbers.
2011-10-11Merge branch 'bjorn/some-configure-clean-ups'Björn Gustavsson
* bjorn/some-configure-clean-ups: erts/configure.in: Remove test for reversed setvbuf() arguments erts/configure.in: Remove broken support for System V erts/configure.in: Don't check for the presence of mach-o/dyld.h erts/configure.in: Remove useless --disable-fixalloc option
2011-10-11Print transformtions sorted on the name of the first instructionBjörn Gustavsson
2011-10-11Share code for call of predicate and transformation functionsBjörn Gustavsson
2011-10-11Simplify transformations of gc_bif[123] instructionsBjörn Gustavsson
Each gc_bif[123] instruction must have both a transformation in ops.tab and special code in gen_guard_bif[123](). Rewrite it to do most of the work in gen_guard_bif[123]().
2011-10-11Refactor 'too_old_compiler' handlingBjörn Gustavsson
In the handling of generic instructions, we used to always test whether the instruction was 'too_old_compiler' and abort loading with a special error message. Refactor the code so that we only do test if we an error has occurred. That will allow us to make the test more expensive in the future, allowing us to customize error messages for certain opcode without any cost in the successful case.
2011-10-11Introduce 'try_me_else_fail'Björn Gustavsson
2011-10-11Combine 'store_var' with 'next_arg'Björn Gustavsson
'store_var' is always followed by 'next_arg'.
2011-10-11Merge 'next_instr' and 'is_op' into 'next_instr'Björn Gustavsson
'next_instr' is always followed by 'is_op'.
2011-10-11Merge 'new_instr' and 'store_op' into 'new_instr'Björn Gustavsson
Since the 'new_instr' instruction always occurs before the 'store_op' instruction, we can merge the instructions into one. Also, there is no need to include the arity of the BEAM instruction as an operand, since the arity can be looked up based on the opcode.