aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
AgeCommit message (Collapse)Author
2011-10-27erts: Make erl_nif.h compile with gcc on WindowsSverker Eriksson
and some added comments
2011-10-26erts-hipe: Change THE_NON_VALUE for HiPE enabled debug emulatorSverker Eriksson
This is a work-around as there are hipe BIFs that return untagged integers that may be intepreted as THE_NON_VALUE (24). Hipe bifs that return offsets as untagged integers: hipe_bs_put_utf8 hipe_bs_put_utf16be hipe_bs_put_utf16le Hipe bifs that return raw pointers: hipe_find_na_or_make_stub hipe_nonclosure_address
2011-10-26erts-hipe: Deliberate leak of native fun entriesSverker Eriksson
This is a workaround as hipe code upgrade/unloading does not work properly.
2011-10-26erts-hipe: Fix new trap conventions for x86, amd64 and ppcSverker Eriksson
2011-10-26Store the trap address in p->iBjörn Gustavsson
For cleanliness, store the trap address in p->i instead of in p->def_arg_reg[3].
2011-10-26Store the trap arguments in the X register arrayBjörn Gustavsson
Store arguments for a trap in the X register array to allow traps to have any number of arguments.
2011-10-26Simplify the instructions for calling BIFsBjörn Gustavsson
Taking advantage of the new calling convention for BIFs, we only need one instruction to handle BIFs with any number of arguments. This change eliminates the limit of three arguments for BIFs, but traps are still limited to three arguments.
2011-10-26Change the calling convention for BIFsBjörn Gustavsson
The current calling convention for BIFs makes it necessary to handle each arity specially, since each argument for the BIF also becomes an argument for the C function implementing the BIF, which makes it hard to allow BIFs with any number of arguments. Change the calling convention for BIFs, so that BIF arguments are passed in an array to the C function implementing the BIF.
2011-10-26Use the proper macros in all BIFsBjörn Gustavsson
As a preparation for changing the calling convention for BIFs, make sure that all BIFs use the macros. Also, eliminate all calls from one BIF to another, since that also breaks the calling convention abstraction.
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-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-14Merge branch 'rickard/atomics-api/OTP-9014' and OTP_R14B04Rickard Green
Conflicts: erts/aclocal.m4 erts/emulator/beam/erl_db.c erts/emulator/sys/win32/sys.c erts/include/internal/ethread_header_config.h.in
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-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-11Optimize comparison of huge floats and smaller 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-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-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-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.
2011-10-11Combine a 'call' instruction with the following 'end' instructionBjörn Gustavsson
A 'call' instruction in the loader transformation language is always followed by an 'end' instruction, so we can replace the 'call' instruction with a 'call_end' instruction.
2011-10-11Remove some unnecessary type constraints in transformationsBjörn Gustavsson
We don't need type constraints that essentially are assertions; the wrong type will be detected and loading aborted when no specific instruction can be found.
2011-10-11Get rid of redundant 'try_me_else' and 'fail' instructionsBjörn Gustavsson
If the left part of a transformation will always match, omit the the 'try_me_else' and 'fail' instructions. As part of this optimization, make it an error to have a transformation that can never be reached because of a previous transformation that will always match. (Remove one transformation from ops.tab that was found to be unreachable.)
2011-10-11Remove too_old_compiler handling for very old instruction variantsBjörn Gustavsson
is_list/2 and other test instructions with a zero label was last generated by the v1 BEAM compiler which was last supported in R6B. Since BEAM modules produced by that compiler will be rejected with a nice error message for other reasons (e.g. by the test for the module_info/0,1 functions), retaining those transformations serves no useful purpose.
2011-10-11Remove the special instructions for the hybrid heap emulatorBjörn Gustavsson
The hybrid-heap emulator is broken since R12, so there is no need to keep those instructions.
2011-10-11Remove optimization of 'move R R'Björn Gustavsson
Ancient versions of BEAM compiler could generate move instruction with the same source and destination registers, so the loader would optimize away such instructions.
2011-10-10Fix dlopen-leak of drivers with incorrect versionSverker Eriksson
2011-10-09Pre-build the tuples returned by os:type/0 and os:version/0Björn Gustavsson
Pre-building the tuples returned by os:type/0 (system_info(os_type)) and os:version() (system_info(os_version)) saves some run-time and avoids building garbage in the calling process.
2011-10-07erts: Remove valgrind limit for erts_alloc_permanent_cache_alignedSverker Eriksson
2011-10-06ETS: Fix faulty size calculation SIZEOF_EXTSEGSverker Eriksson
Probably not a bug in reallity, but it's simpler and safer to use offsetof for dynamic sizeof calculations.
2011-10-06ETS: Fix valgrind PossiblyLost in ETS hash tablesSverker Eriksson
Add an extra pointer to start of segment with the active segment table to get rid of PossiblyLost errors without the need of a too general suppression that may hide real memory leaks in ETS.
2011-09-29Merge branch 'dev' into majorBjörn-Egil Dahlberg
* dev: Update copyright years
2011-09-29Update copyright yearsBjörn-Egil Dahlberg
2011-09-29Merge branch 'dev' into majorLukas Larsson
* dev: Prevent valgrind warning for erts_alloc_permanent_cache_aligned [erts] Fix memory leak in erts_make_stub_module (hipe loading)
2011-09-28Prevent valgrind warning for erts_alloc_permanent_cache_alignedSverker Eriksson
2011-09-28[erts] Fix memory leak in erts_make_stub_module (hipe loading)Sverker Eriksson
Code area allocation was done twice; first in read_code_header() and then in erts_make_stub_module() itself.
2011-09-26Merge branch 'dev' into majorLars Thorsen
* dev: [erl_docgen] Missing header level in PDF bookmarks menu Fixed version, release notes and appup in prep for release. Fix lost wakeup of scheduler when enqueuing auxiliary work
2011-09-24Merge branch 'rickard/aux-work-bug/OTP-9567' into devRickard Green
* rickard/aux-work-bug/OTP-9567: Fix lost wakeup of scheduler when enqueuing auxiliary work
2011-09-22Fix lost wakeup of scheduler when enqueuing auxiliary workRickard Green
When auxiliary work was enqueued on a scheduler, the wakeup of the scheduler in order to handle this work could be lost. Wakeups in order to handle ordinary work were not effected by this bug. The bug only effected runtime systems with SMP support as follows: * Deallocation of some ETS data structures could be delayed. * On Linux systems not using the NPTL thread library (typically ancient systems with kernel versions prior to 2.6) and Windows systems, the {Port, {exit_status, Status}} message from a terminating port program could be delayed. That is, it only effected port programs which had been started by passing exit_status as an option to open_port/2.
2011-09-20Merge branch 'dev' into majorHenrik Nord
Conflicts: erts/aclocal.m4 erts/include/internal/ethread_header_config.h.in
2011-09-20Merge branch 'ta/docs-fixes' into devHenrik Nord
* ta/docs-fixes: Fix misspelling of intermediate Fix typos in erts/preloaded/src Fix more misspellings of compatibility Fix misspelling of kept Fix misspelling of compatibility in ssl_basic_SUITE Fix misspelling of compatibility Fix misspelling of accommodate Fix misspelling of exceed Fix misspelling of accidentally Fix misspelling of erroneous in xmerl_xsd Fix misspelling of erroneous Fix misspelling of successful Fix typos in instrument(3) Fix typos in dbg(3) dialyzer: fix a small typo in list_to_bitstring test Fix typos in cover.erl Fix typos (variable name) in erl_nif(3) Fix typos in mod_esi(3) Fix trivial typos in erlang(3) OTP-9555
2011-09-19Merge branch 'dev' into majorRickard Green