aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/hipe
AgeCommit message (Collapse)Author
2016-02-24Merge branch 'master' into sverk/master/halt-INT_MINSverker Eriksson
2016-02-24erts: Change erl_exit into erts_exitSverker Eriksson
This is mostly a pure refactoring. Except for the buggy cases when calling erlang:halt() with a positive integer in the range -(INT_MIN+2) to -INT_MIN that got confused with ERTS_ABORT_EXIT, ERTS_DUMP_EXIT and ERTS_INTR_EXIT. Outcome OLD erl_exit(n, ) NEW erts_exit(n, ) ------- ------------------- ------------------------------------------- exit(Status) n = -Status <= 0 n = Status >= 0 crashdump+abort n > 0, ignore n n = ERTS_ERROR_EXIT < 0 The outcome of the old ERTS_ABORT_EXIT, ERTS_INTR_EXIT and ERTS_DUMP_EXIT are the same as before (even though their values have changed).
2016-02-18Merge branch 'sverk/erts-hipe_x86_signal-cleanups'Sverker Eriksson
OTP-13341 * sverk/erts-hipe_x86_signal-cleanups: hipe_sigaltstack: correct initialization of ss.ss_flags hipe_x86_signal: cleanups hipe_x86_signal: cleanups hipe_x86_signal: cleanups hipe_x86_signal: cleanups hipe_x86_signal: cleanups hipe_x86_signal: cleanups
2016-02-09hipe_sigaltstack: correct initialization of ss.ss_flagsMikael Pettersson
SS_ONSTACK may be set in oss, but it's not supposed to be set in ss, and some systems correctly reject that; current Linux kernels accept but ignore it in ss
2016-02-02Merge branch 'maint'Zandra
Conflicts: erts/emulator/beam/beam_emu.c
2016-02-02Merge branch 'margnus1/bs_unit_fix' into maintZandra
* margnus1/bs_unit_fix: hipe: Fix signed compares of unsigned sizes beam: Fix overflow bug in i_bs_add_jId hipe: Add tests for bad bit syntax float sizes Add a case testing the handling of guards involving binaries Add some more binary syntax construction tests hipe: Guard against enormous numbers in ranges hipe: Fix constructing huge binaries hipe: Fix binary constructions failing with badarith Add missing corner-case to bs_construct_SUITE hipe: Allow unsigned args in hipe_rtl_arith hipe: test unit size match in bs_put_binary_all hipe: test unit size match in bs_append Fix hipe_rtl_binary_construct:floorlog2/1 OTP-13272
2016-01-31hipe_x86_signal: cleanupsMikael Pettersson
- replace system-specific #ifndef around sigaction() override with a test for OVERRIDE_SIGACTION, #define or #undef that as appropriate in each system-specific block
2016-01-31hipe_x86_signal: cleanupsMikael Pettersson
- move extern declarations of LIBC_SIGACTION() from system-specific blocks to the common LIBC_SIGACTION block
2016-01-31hipe_x86_signal: cleanupsMikael Pettersson
- rename __next_sigaction to next_sigaction, to avoid defining _-prefixed symbols - factor out common code for declaring and initializing next_sigaction, system-specific code now only needs to #define NEXT_SIGACTION
2016-01-31hipe_x86_signal: cleanupsMikael Pettersson
- rename __SIGACTION to LIBC_SIGACTION, to avoid defining _-prefixed symbols
2016-01-31hipe_x86_signal: cleanupsMikael Pettersson
- add block for NetBSD, define dummy INIT() macro - eliminate ifndef NetBSD around INIT() invocation
2016-01-31hipe_x86_signal: cleanupsMikael Pettersson
- remove glibc < 2.3 code - move glibc-2.2 comment to glibc >= 2.3 block - remove obsolete "only supports" comment - remove support for broken sigaltstack() in pre-2.4 Linux kernels
2015-12-18Merge branch 'maint'Henrik Nord
Conflicts: OTP_VERSION erts/vsn.mk
2015-12-17hipe_x86_signal.c: add FreeBSD sigaction codeKenji Rikitake
* erts/emulator/hipe/hipe_x86_signal.c: add FreeBSD sigaction code, based on the Darwin (OS X) code
2015-12-15Merge branch 'lukas/erts/forker'Lukas Larsson
* lukas/erts/forker: (28 commits) erts: Never abort in the forked child erts: Mend ASSERT makro for erl_child_setup erts: Allow enomem failures in port_SUITE erts: iter_port sleep longer on freebsd erts: Allow one dangling fd if there is a gethost port erts: Only use forker StackAck on freebsd erts: It is not possible to exit the forker driver erts: Add forker StartAck for port start flowcontrol erts: Fix large open_port arg segfault for win32 erts: Fix memory leak at async open port kernel: Remove cmd server for unix os:cmd erts: Add testcase for huge port environment erts: Move os_pid to port hash to child setup erts: Handle all EINTR and EAGAIN cases in child setup erts: Make child_setup work with large environments erts: Fix forker driver ifdefs for win32 erts: Fix uds socket handling for os x erts: Fix dereferencing of unaligned integer for sparc erts: Flatten too long io vectors in uds write erts: Add fd count test for spawn_driver ... Conflicts: erts/emulator/beam/erl_node_tables.c erts/preloaded/src/erts_internal.erl
2015-12-15erts: Refactor out erts functions from hashLukas Larsson
2015-12-08Merge branch 'rickard/ohmq-fixup/OTP-13047'Rickard Green
* rickard/ohmq-fixup/OTP-13047: Replace off_heap_message_queue option with message_queue_data option Always use literal_alloc Distinguish between GC disabled by BIFs and other disabled GC Fix process_info(_, off_heap_message_queue) Off heap message queue test suite Remove unused variable Fix memory leaks
2015-12-08Distinguish between GC disabled by BIFs and other disabled GCRickard Green
Processes remember heap fragments that are known to be fully live due to creation in a just called BIF that yields in the live_hf_end field. This field must not be used if we have not disabled GC in a BIF. F_DELAY_GC has been introduced in order to distinguish between to two different scenarios. - F_DISABLE_GC should *only* be used by BIFs. This when the BIF needs to yield while preventig a GC. - F_DELAY_GC should only be used when GC is temporarily disabled while the process is scheduled. A process must not be scheduled out while F_DELAY_GC is set.
2015-12-04Merge branch 'maint'Zandra
2015-11-27hipe: test unit size match in bs_appendMagnus Lång
This feature was previously missing and expressions such as <<<<1:1>>/binary>> would succeed construction when compiled with HiPE. A primop is_divisible is introduced to handle the case when the unit size is not a power of two.
2015-11-14hipe_x86_signal: add support for musl libcMikael Pettersson
- change #if tests at default Solaris case to explicitly check for __sun__ - add new default case, instantiate it for musl
2015-11-13Merge branch 'rickard/gc-bump-reds/OTP-13097'Rickard Green
* rickard/gc-bump-reds/OTP-13097: Bump reductions on GC
2015-11-12Merge branch 'rickard/ohmq/OTP-13047'Rickard Green
* rickard/ohmq/OTP-13047: Fragmented young heap generation and off_heap_message_queue option Refactor GC Introduce literal tag Conflicts: erts/doc/src/erlang.xml erts/emulator/beam/erl_gc.c
2015-11-12Merge branch 'sverk/literal-memory-range'Rickard Green
* sverk/literal-memory-range: erts: Refactor line table in loaded beam code erts: Refactor header of loaded beam code fix check_process_code for separate literal area erts: Add support for fast erts_is_literal() erts: Refactor erl_mmap to allow several mapper instances erts: Add new allocator LITERAL erts: Fix strangeness in treatment of MSEG_ALIGN_BITS erts: Cleanup main carrier creation erts: Remove unused erts_have_erts_mmap erts: Refactor config test for posix_memalign
2015-11-12Bump reductions on GCRickard Green
2015-11-12Fragmented young heap generation and off_heap_message_queue optionRickard Green
* The youngest generation of the heap can now consist of multiple blocks. Heap fragments and message fragments are added to the youngest generation when needed without triggering a GC. After a GC the youngest generation is contained in one single block. * The off_heap_message_queue process flag has been added. When enabled all message data in the queue is kept off heap. When a message is selected from the queue, the message fragment (or heap fragment) containing the actual message is attached to the youngest generation. Messages stored off heap is not part of GC.
2015-11-12erts: Refactor header of loaded beam codeSverker Eriksson
to use a real C struct instead of array.
2015-11-12Introduce literal tagRickard Green
2015-10-13Merge branch 'kostis/hipe-native-bif-warning' into maintHenrik Nord
* kostis/hipe-native-bif-warning: Take out unused code that results in a gcc warning OTP-13041
2015-09-11erts: Add new allocator LITERALSverker Eriksson
2015-08-31Merge branch 'sverk/hipe-fix-literal-crc' into maintSverker Eriksson
* sverk/hipe-fix-literal-crc: erts,hipe,dialyzer: Fix hipe checkum of target runtime system erts: Change THE_NON_VALUE to not be hard coded in hipe compiler OTP-12962 OTP-12963 OTP-12964
2015-08-31erts,hipe,dialyzer: Fix hipe checkum of target runtime systemSverker Eriksson
Main problem: A faulty HIPE_LITERAL_CRC was not detected by the loader. Strangeness #1: Dialyzer should ask the hipe compiler about the target checksum, not an internal bif. Strangeness #2: The HIPE_SYSTEM_CRC checksum was based on the HIPE_LITERALS_CRC checksum. Solution: New HIPE_ERTS_CHECKSUM which is an bxor of the two (now independent) HIPE_LITERALS_CRC and HIPE_SYSTEM_CRC. HIPE_LITERALS_CRC represents values that are assumed to stay constant for different VM configurations of the same arch, and are therefor hard coded into the hipe compiler. HIPE_SYSTEM_CRC represents values that may differ between VM variants. By default the hipe compiler asks the running VM for this checksum, in order to create beam files for the same running VM. The hipe compiler can be configured (with "make XCOMP=yes ...") to create beam files for another VM variant, in which case HIPE_SYSTEM_CRC is also hard coded. ToDo: Treat all erts properties the same. Either ask the running VM or hard coded into hipe (if XCOMP=yes). This will simplify and reduce the risk of dangerous mismatches. One concern might be the added overhead from more frequent calls to hipe_bifs:get_rts_param.
2015-08-28erts: Fix hipe bug for maps:merge/2Sverker Eriksson
Add forgotten HIPE_WRAPPER_BIF_DISABLE_GC which could lead to stack-heap overrun if unlucky with the yielding during maps:merge when called by native hipe code.
2015-08-28erts: Beautify hipe wrapper macroSverker Eriksson
2015-08-24erts: Change THE_NON_VALUE to not be hard coded in hipe compilerSverker Eriksson
Instead ask running VM for the value of THE_NON_VALUE, which is different between opt and debug VM. Same hipe compiler can now compile for both opt and debug VM.
2015-08-20Take out unused code that results in a gcc warningKostis Sagonas
These ifdef-ed lines were once upon a time needed, but the recent changes in the time mechanism of OTP render them unused and result in a warning on architectures which are not 64-bit.
2015-06-18Change license text to APLv2Bruce Yinhe
2015-05-27Change hipe_bifs:system_crc/1 to hipe_bifs:system_crc/0Magnus Henoch
The macro HIPE_SYSTEM_CRC used to contain a hidden cookie from the VM that generated hipe_literals.hrl. This means that BEAM files containing that macro would be tied to a particular version of the VM. Change hipe_bifs:system_crc such that it doesn't require a hidden cookie to return the desired value.
2015-05-08Merge branch 'rickard/timer-optimization/OTP-12650'Rickard Green
* rickard/timer-optimization/OTP-12650: Optimized timer implementation Reusable red-black tree implementation Conflicts: erts/emulator/beam/erl_bif_timer.c
2015-05-08Optimized timer implementationRickard Green
2015-05-06Merge branch 'sverk/hipe_match_wbin/OTP-12667'Sverker Eriksson
* sverk/hipe_match_wbin/OTP-12667: erts: Add debug assertions for match state sanity hipe: Add test for matching of writable binary erts,hipe: Optimize away calls to emasculate_binary erts,hipe: Fix bug in binary matching of writable binary Conflicts: erts/emulator/hipe/hipe_bif0.c
2015-04-22erts/hipe: unbreak arity 4 BIFsMikael Pettersson
This fixes arity 4 BIF support in HiPE, following its introduction on master (OTP 18) via the nox/ets-update_counter-4 merge. - define standard_bif_interface_4, nbif_4_gc_after_bif, and nbif_4_simple_exception on ARM: unbreaks the build on ARM - remove bogus stack re-alignment from standard_bif_interface_4 on AMD64: for 4-arg BIFs the stack is already aligned, and the code would misalign the C stack which violates the ABI and may cause alignment faults in vectorized code - the nbif_4_simple_exception OPD name on PPC64 was incorrectly using the nbif_3_simple_exception OPD name: this would have caused a multiple definition error in the assembler or linker In addition there are a few cleanups: - fix standard_bif_interface_N comment on x86 - fix standard_bif_interface_4 comment on SPARC - separate nbif_N_simple_exception blocks by empty lines on PPC, like on ARM, to clearly show which things belong together - fix standard_bif_interface_N comment on ARM - fix standard_bif_interface_4 on AMD64 to match the indentation and spacing conventions of the rest of that file
2015-04-21erts,hipe: Optimize away calls to emasculate_binarySverker Eriksson
Only call emasculate_binary if ProcBin.flags is set, which means it's a writable binary.
2015-04-20erts,hipe: Fix bug in binary matching of writable binarySverker Eriksson
Seen symptom: Hipe compiled code with <<C/utf8, ...>> = Bin does sometimes not match even though Bin contains a valid utf8 character. There might be other possible binary matching symptoms, as the problem is not utf8 specific. Problem: A writable binary was not "emasculated" when the matching started (as it should) by the hipe compiled code. Fix: Add a new primop emasculate_binary(Bin) that is called when a matchstate is created. ToDo: There are probably room for optimization. For example only call emasculate_binary if ProcBin.flags is set.
2015-03-16Merge branch 'nox/ets-update_counter-4'Zandra Hird
* nox/ets-update_counter-4: Create new BIF ets:update_counter/4 Allow 4-ary BIFs OTP-12563
2015-03-12Merge branch 'maint'Henrik Nord
Conflicts: erts/emulator/hipe/hipe_bif0.c
2015-03-12Create new BIF ets:update_counter/4Anthony Ramine
Conflicts: erts/emulator/beam/bif.tab lib/stdlib/src/ets.erl
2015-02-26hipe: change mfa_info_table lock to rwmutexMikael Pettersson
The hipe_mfa_info_table lock is currently a mutex, causing unnecessary contention and serialization of lookups for apply-like constructs. - change the lock from a mutex to an rwmutex - split hipe_get_na_nofail_locked into a "try" path which only needs a read lock, and a "slow" path which requires a write lock - reimplement hipe_get_na_nofail (used by apply ops etc) to first call the "try" path with a read lock, and if that fails the "slow" path with a write lock - reimplement hipe_get_na_nofail_locked (used by maintenance code) to call the "try" path and then optionally the "slow" path, but without taking locks since its caller already has the write lock - adjust remaining lock ops to take/release full write lock - use _rwlocked as suffix on functions requiring a write lock - change hipe_mfa_get_trampoline to call get_locked not put_locked, allowing it to take a read lock instead of a write lock - change hipe_find_mfa_from_ra() to only take a read lock
2015-02-24Allow 4-ary BIFsAnthony Ramine
2015-02-19remove perfctr supportMikael Pettersson
Perfctr is a Linux kernel extension that allows programmatic access to the performance monitoring counters found in most current CPUs. However, development of perfctr ceased after 2010, and it cannot be used with Linux kernels newer than 2.6.32. Therefore the perfctr support code in the Erlang VM is effectively dead code, so this patch removes it.