aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/beam_emu.c
AgeCommit message (Collapse)Author
2012-05-10Remove stale code for hybrid heap and incremental GCBjörn Gustavsson
The hybrid heap emulator was last working in the non-SMP R11B run-time system. When the constant pools were introduced in R12B, the hybrid heap emulator was not updated to handle them. At this point, the harm from reduced readability of the code is greater than any potential usefulness of keeping the code.
2012-03-30Update copyright yearsBjörn-Egil Dahlberg
2012-03-22Use distinct function-entry probes for local and global callsBjörn Gustavsson
It seems useful to be able to filter out (for example) just the global calls.
2012-03-22Correct calculation of stack depth in call/return probesBjörn Gustavsson
2012-03-22Add probes for all kind of callsBjörn Gustavsson
2012-03-22Ifdef all dynamic trace codePatrik Nyblom
2012-03-22Correct some errors in the user tag spreadingPatrik Nyblom
2012-03-22Change to more specific configure options for dtracePatrik Nyblom
2012-03-22Add user tag spreading functionality to VM and use in filePatrik Nyblom
User tags in a dynamic trace enabled VM are spread throughout the system in the same way as seq_trace tokens. This is used by the file module and various other modules to get hold of the tag from the user process without changing the protocol.
2012-03-22Update dtrace for changes in R15Björn-Egil Dahlberg
2012-03-22Add DTrace support for OS X, Solaris, and Linux (via SystemTap), 3/4Scott Lystig Fritchie
Add probes to the virtual machine, except (mostly) the efile_drv.c driver and other file I/O-related source files.
2011-11-30Merge branch 'bjorn/deprecate-tuple-funs/OTP-9649'Björn Gustavsson
* bjorn/deprecate-tuple-funs/OTP-9649: erts: Warn the first time a tuple fun is called otp_mibs: Eliminate use of tuple fun os_mon: Eliminate use of tuple fun asn1: Eliminate use of tuple fun parsetools: Eliminate use of tuple fun mnesia tests: Eliminate use of tuple fun snmp: Eliminate use of tuple fun wrap_log_reader_SUITE: Eliminate use of tuple fun big_SUITE: Eliminate use of tuple fun file_SUITE: Eliminate use of tuple fun fprof: Eliminate use of tuple fun xref_compiler: Eliminate use of tuple fun shell: Eliminate use of tuple funs erl_eval: Eliminate use of tuple funs user_sup: Eliminate use of tuple fun
2011-11-30erts: Warn the first time a tuple fun is calledBjörn Gustavsson
2011-11-25beam_emu.c: Eliminate warnings when NO_JUMP_TABLE is definedBjörn Gustavsson
2011-11-25beam_emu.c: Use the correct void* type for computed gotosBjörn Gustavsson
gcc don't care about the type, but clang does and will issue a warning.
2011-11-18Merge branch 'pan/binary_match_scope/OTP-9701'Patrik Nyblom
* pan/binary_match_scope/OTP-9701: Remove remaining gcc 4.6 assigned-but-not-used warnings from erts Remove GCC 4.6 set-but-not-used warning from erl_bif_binary Make binary:match with scope return correct values
2011-11-17erts: Rename macros used by float instructions without FPESverker Eriksson
No semantic change, just code clarification. Use unique macro names instead of redefining the original ones.
2011-11-16Remove remaining gcc 4.6 assigned-but-not-used warnings from ertsPatrik Nyblom
2011-11-13Merge branch 'rickard/thr-progress-block/OTP-9631'Rickard Green
* rickard/thr-progress-block/OTP-9631: Replace system block with thread progress block
2011-11-13Replace system block with thread progress blockRickard Green
The ERTS internal system block functionality has been replaced by new functionality for blocking the system. The old system block functionality had contention issues and complexity issues. The new functionality piggy-backs on thread progress tracking functionality needed by newly introduced lock-free synchronization in the runtime system. When the functionality for blocking the system isn't used there is more or less no overhead at all. This since the functionality for tracking thread progress is there and needed anyway.
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-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-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-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-09-06BEAM: Unify allocation of X and float registersBjörn Gustavsson
In the half-word emulator, smp emulator, and non-smp emulator the X register and float register arrays were allocated in different ways. Always allocate the registers and store the pointers to the allocated register arrays in the scheduler data.
2011-08-16beam_emu: Factor out saving of stack trace from save_stacktrace()Björn Gustavsson
Put the actual saving of the continuation pointers on the stack in the new function erts_save_stacktrace() so that it can be reused. The code is too tricky and complicated to allow it to become duplicated.
2011-08-16Fix decrement of continuation pointersBjörn Gustavsson
2011-08-16Refactor building of the exception stacktraceBjörn Gustavsson
As a preparation for providing information about the source location for an MFA item in an exception stacktrace, refactor the code that builds the exception stacktrace. Basically we need two passes over the saved continuation counters: a first pass to calculate the needed heap space and a second pass to actually build the stacktrace.
2011-08-16emulator: Add a fourth element in exception stacktracesBjörn Gustavsson
This commit is a preparation for introducing location information (filename/line number) in stacktraces in exceptions. Currently a stack trace looks like: [{Mod1,Function1,Arity1}, . . . {ModN,FunctionN,ArityN}] Add a forth element to each tuple that can be used indication the filename and line number of the source file: [{Mod1,Function1,Arity1,Location1}, . . . {ModN,FunctionN,ArityN,LocationN}] In this commit, the fourth element will just be an empty list, and we will change all code that look at or manipulate stacktraces.
2011-08-16compiler, emulator: Introduce the line/1 instructionBjörn Gustavsson
Introduce the line/1 instruction in the compiler and the BEAM virtual machine. It will not yet be generated by the compiler and will not actually carry any information.
2011-08-03Fix construction of <<0:((1 bsl 32)-1)>>Björn Gustavsson
Attempting to construct <<0:((1 bsl 32)-1)>>, the largest bitstring allowed in a 32 bit emulator, would cause an emulator crash because of integer overflow. Fix the problem by using an Uint64 to avoid integer overflow. Do not attempt to handle construction of <<0:((1 bsl 64)-1>> in a 64-bit emulator, because that will certainly cause the emulator to terminate anyway because of insufficient memory.
2011-05-13Merge branch 'rickard/barriers/OTP-9281' into devRickard Green
* rickard/barriers/OTP-9281: Silence warnings Fix build with hipe on amd64 Reduce number of atomic ops Use 32-bit atomic for port snapshot Remove pointless erts_ports_alive variable Ensure quick break Ensure that all rehashing information are seen when done Ensure that stack updates are seen when stack is released Add needed barriers for write_concurrency tables Homogenize memory barriers on atomics
2011-05-13Silence warningsRickard Green
2011-05-11Eliminate alias warning in gcc 4.5.2Björn Gustavsson
2011-04-14Merge branch 'maint-r14' into devSverker Eriksson
Conflicts: erts/vsn.mk
2011-04-11Fix thread unsafe accessRickard Green
Fix thread unsafe access to process status field introduced in OTP-9125.
2011-04-11Only set status P_WAITING when neededRickard Green
The status of a process was unnecessarily set to waiting before the process was enqueued in a run queue. This bug was harmless up until OTP-R14B01. In OTP-R14B02 erlang:hibernate/3 was fixed (OTP-9125). After the introduction of OTP-9125, the previously harmless process status bug sometimes caused erroneous badarg exceptions from process_info().
2011-03-29Fix duplicate entries in stacktraces after calling certain BIFsBjörn Gustavsson
Calling a BIF thaf is called as a function (such as process_info/{1,2}) would leave a non-zero value in c_p->cp, which would lead to duplicate entries in the stacktrace.
2011-03-10Merge branch 'pg/fix-hibernate-with-hipe' into devSverker Eriksson
* pg/fix-hibernate-with-hipe: Update copyright years Fix NULL-free bug in hibernate on debug emulator Fix several bugs related to hibernate/3 and HiPE Conflicts: erts/emulator/test/hibernate_SUITE.erl OTP-9125
2011-03-04erts: Initialize register that may be referenced by garbage collectionBjörn Gustavsson
The call_fun() function in the BEAM emulator is supposed to to put the fun term in the x register following the actual arguments and environment for the fun. But if the fun is not loaded and a call to the error_handler:undefined_lambda/3 function is set up, the x(3) register will not be initialized. The lack of initialization is very unlikely to cause a problem in practice, because all of the following things must happen: 1) An unloaded fun must be called (i.e. the fun must have been received from another node or from a file or dets table). 2) The process must be scheduled out before the call to the error_handler:undefined_lambda/3 function can take place. 3) The process must be garbage collected before the process is scheduled in. 4) The x(3) register must contain a stale cons or box pointer that happens to point into the the heap of the currently executing process. (Because of the literal pool, the GC will never copy anything that is outside of the heap.) I was not able to write a test case that would force an emulator crash.
2011-03-02Merge branch 'pan/halfword-tmp-heap-fixes/OTP-8332' into devPatrik Nyblom
* pan/halfword-tmp-heap-fixes/OTP-8332: Fix assymetric (Un)UseTmpHeap in erl_process.c Conflicts: erts/emulator/beam/beam_emu.c
2011-02-25Merge branch 'rickard/temp_alloc_check/OTP-9028' into devRickard Green
* rickard/temp_alloc_check/OTP-9028: Verify that temp allocated memory is released
2011-02-23beam_emu: Eliminate redundant #ifdefBjörn Gustavsson
The halfword emulator used to require special handling, but no longer does.
2011-02-23beam_emu: Remove unnecessary decrement of I in "case_end r"Björn Gustavsson
It is not necessary to decrement I, because an exception is about to be generated. Furthermore, I pointing *before* the instruction that caused the exception may cause problems in the future.
2011-02-10Verify that temp allocated memory is releasedRickard Green