aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
AgeCommit message (Collapse)Author
2016-02-02Merge branch 'maint'Zandra
Conflicts: erts/emulator/beam/beam_emu.c
2016-02-02Better list_to_integerDmytro Lytovchenko
Now tries to use whole width of signed long (Sint) and this halves amount of multiplications needed to parse long integers. New code is 2-3 times faster than the old code for large inputs (tens and hundreds of digits), behavior should not change for small inputs. Test ran 10k times with GC forced between attempts. Was (R17): 720 el base 10: 0.14682 sec; base 16: 0.192722 sec; base 36: 0.337118 sec. 2800 el base 10: 1.794133 sec; base 16: 2.735106 sec; base 36: 4.761108 sec. 6500 el base 10: 9.316434 sec; base 16: 14.109469 sec; base 36: 25.319263 sec. Now (R19 Dev) 720 el base 10: 0.10265 sec; base 16: 0.10851 sec; base 36: 0.160478 sec. 2800 el base 10: 1.002793 sec; base 16: 1.360649 sec; base 36: 2.174309 sec. 6500 el base 10: 4.722197 sec; base 16: 6.60522 sec; base 36: 10.552795 sec. Added test for corner cases and sign bit corruption. Replaced macros with inline and hid it inside C file to not pollute global namespace Old bug in #define LG2_LOOKUP: Replaced with inline function and table recalculated for all bases 2 to 36 (was 2 to 64)
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-02-02erts: Make msacc alloctor type thread safeSverker Eriksson
LONG_LIVED is not thread safe on non-smp and can only be used by scheduler.
2016-02-02Silence compilerBjörn-Egil Dahlberg
2016-02-02erts: Refactor perf counter internal interfaceLukas Larsson
perf counter is now part of the function pointer interface and also the function returns the value instead of writing to a memory buffer.
2016-02-02erts: Fix msacc win32 debug compile errorLukas Larsson
2016-02-02erts: Add microstate accountingLukas Larsson
Microstate accounting is a way to track which state the different threads within ERTS are in. The main usage area is to pin point performance bottlenecks by checking which states the threads are in and then from there figuring out why and where to optimize. Since checking whether microstate accounting is on or off is relatively expensive if done in a short loop only a few of the states are enabled by default and more states can be enabled through configure. I've done some benchmarking and the overhead with it turned off is not noticible and with it on it is a fraction of a percent. If you enable the extra states, depending on the benchmark, the ovehead when turned off is about 1% and when turned on somewhere inbetween 5-15%. OTP-12345
2016-02-02erts, kernel: Add os:perf_counter functionLukas Larsson
The perf_counter is a very very cheap and high resolution timer that can be used to timestamp system events. It does not have monoticity guarantees, but should on most OS's expose a monotonous time. A special instruction has been created for this counter to further speed up fetching it. OTP-12908
2016-02-02erts: Add ERTS_WRITE_UNLIKELYLukas Larsson
ERTS_WRITE_UNLIKELY can be used to place global variables in a specific section where only data that is very rarely modified sits. This is used to improve cache locality.
2016-02-02Merge branch 'maint'Rickard Green
* maint: Introduce time management in native APIs Introduce time warp safe replacement for safe_fixed option Introduce time warp safe trace timestamp formats Conflicts: erts/emulator/beam/erl_bif_trace.c erts/emulator/beam/erl_driver.h erts/emulator/beam/erl_nif.h erts/emulator/beam/erl_trace.c erts/preloaded/ebin/erlang.beam
2016-02-02Merge branch 'rickard/monotonic-time-improvements/OTP-13222' into maintRickard Green
* rickard/monotonic-time-improvements/OTP-13222: Introduce time management in native APIs Introduce time warp safe replacement for safe_fixed option Introduce time warp safe trace timestamp formats
2016-01-29Remove faulty assertsRickard Green
2016-01-28Merge branch 'master' into sverk/hipe-line-table-bug/master/OTP-13282Sverker Eriksson
2016-01-28erts: Fix bug concerning line information for hipe modulesSverker Eriksson
Line table was left uninitialized for hipe (stub) modules causing process_info(OtherPid, current_location) to crash.
2016-01-27erts: When erts_alloc fails, the emulator no longer abortsLukas Larsson
2016-01-26Merge branch 'lukas/erts/gc_info/OTP-13265'Lukas Larsson
* lukas/erts/gc_info/OTP-13265: erts: Add garbage_collection_info to process_info/2 Conflicts: erts/emulator/beam/erl_bif_info.c
2016-01-25Moved do_list_to_integer from bif.c to big.cDmytro Lytovchenko
2016-01-22Merge branch 'maint'Rickard Green
* maint: Fix HL timer hard debug implementation Fix stack alignment problem in ethread test on arm Skip time_SUITE:timestamp on timewarp test
2016-01-22Merge branch 'rickard/test-fix' into maintRickard Green
* rickard/test-fix: Fix HL timer hard debug implementation Fix stack alignment problem in ethread test on arm Skip time_SUITE:timestamp on timewarp test
2016-01-21erts: Fix faulty assert for non-smpSverker Eriksson
2016-01-21erts: Add checks for thread safe allocationSverker Eriksson
Assert thread unsafe allocator is only created on non-smp and only called by the main thread. Removed test of unsafe allocator in custom thread.
2016-01-21Introduce time management in native APIsRickard Green
2016-01-20Introduce time warp safe replacement for safe_fixed optionRickard Green
The new time warp safe option is safe_fixed_monotonic_time which gives erlang:monotonic_time(). The safe_fixed option was also slightly changed. It now gives erlang:timestamp() instead of erlang:now(). This has however not been documented, so it is considered a compatible change. The above effects both ets, and dets. This commit also include the bugfix OTP-13239 for dets:info(Tab, safe_fixed). The timestamp in the result returned by dets:info(Tab, safe_fixed) was unintentionally broken as a result of the time API rewrites in OTP 18.0.
2016-01-20Introduce time warp safe trace timestamp formatsRickard Green
New timestamp options for trace, sequential trace, and system profile: - monotonic_timestamp - strict_monotonic_timestamp
2016-01-20Merge branch 'maint'Rickard Green
* maint: Fix dirty scheduler check in handle_aux_work
2016-01-19Merge branch 'sverk/safe-purging/OTP-13122'Sverker Eriksson
* sverk/safe-purging/OTP-13122: erts: Ignore unexpected messages to erts_code_purger erts: Optimize erlang:check_process_code erts: Refactor check_process_code/3 erts: Make copy_literals more fail safe erts: Move copy_literals/2 from erlang to erts_internal erts: Make erlang:purge_module/1 safe erts: Refactor code:purge/1 and code:soft_purge/1 erts: Introduce erts_code_purger
2016-01-18Fix dirty scheduler check in handle_aux_workSteve Vinoski
2016-01-18erts: Fix race between receive timeout and exit signalSverker Eriksson
Must re-read 'state' after seizing proc locks as other thread may have set EXITING.
2016-01-14Merge branch 'maint'Rickard Green
* maint: Do not allow aux work on dirty schedulers
2016-01-14Merge branch 'vinoski/dirty-sched-no-aux-work/OTP-13236' into maintRickard Green
* vinoski/dirty-sched-no-aux-work/OTP-13236: Do not allow aux work on dirty schedulers
2016-01-13erts: Optimize erlang:check_process_codeSverker Eriksson
by ignoring literals. erts_internal:check_process_code will be called again anyway (with option {copy_literals, true}) before the module is actually purged. No need to check literals twice.
2016-01-13erts: Make copy_literals more fail safeSverker Eriksson
* Same process must do enable-disable. * System process will force it and never get 'aborted'
2016-01-13erts: Move copy_literals/2 from erlang to erts_internalSverker Eriksson
as it's not a public interface.
2016-01-13erts: Make erlang:purge_module/1 safeSverker Eriksson
Problem: erlang:purge_module/1 is not safe in the sense that very bad things may happen if the code to be purged is still referred to by live processes. Introduce erts_internal:purge_module which is the same as the old erlang:purge_module BIF (except it returns false if no such old module). Implement erlang:purge_module in Erlang and let it invoke erts_code_purger for safe purging where all clogging processes first are killed.
2016-01-13Merge branch 'sverk/fvisibility-hidden/OTP-13227'Sverker Eriksson
* sverk/fvisibility-hidden/OTP-13227: erts: Allow -fvisibility=hidden for NIFs and drivers erts: Cleanup erl_driver.h for windows erts: Refactor ERL_NIF_INIT macro
2016-01-13erts: Introduce erts_code_purgerSverker Eriksson
as a system process with preloaded code.
2016-01-08erts: Allow -fvisibility=hidden for NIFs and driversSverker Eriksson
as is strongly recommended by gcc man page. We use __attribute__ ((visibility("default"))) to make sure the init functions are properly exported.
2016-01-08erts: Cleanup erl_driver.h for windowsSverker Eriksson
The comment is misleading and no need to "export" static windows drivers. DRIVER_INIT for dynamic windows drivers is defined in erl_win_dyn_driver.h
2016-01-08erts: Refactor ERL_NIF_INIT macroSverker Eriksson
2016-01-07Merge branch 'sverk/proc-dict-opt'Sverker Eriksson
OTP-13167 * sverk/proc-dict-opt: erts: Add new test case pdict_SUITE:mixed erts: Add 'fill_heap' to erts_debug:state_internal_state erts: Rename proc dict size to arraySize erts: Refactor proc dict with 'usedSlots' erts: Add sizeMask for faster proc dict indexing erts: Remove ProcDict.used erts: Add proc dict macros ERTS_PD_START/SIZE erts: Optimize away function "array_put" in proc dict erts: Optimize hashing in process dictionary
2016-01-07Merge branch 'sverk/check_process_code-fix'Sverker Eriksson
* sverk/check_process_code-fix: erts: Fix bug in check_process_code for literals
2015-12-30Merge branch 'maint'Rickard Green
* maint: Light weight statistics of run queue lengths Conflicts: erts/preloaded/ebin/erlang.beam
2015-12-30Merge branch 'rickard/rq-len/OTP-13201' into maintRickard Green
* rickard/rq-len/OTP-13201: Light weight statistics of run queue lengths
2015-12-30Light weight statistics of run queue lengthsRickard Green
- statistics(total_run_queue_lengths) - statistics(run_queue_lengths) - statistics(total_active_tasks) - statistics(active_tasks) Conflicts: erts/emulator/beam/erl_process.c
2015-12-30Merge branch 'maint'Rickard Green
* maint: Use monotonic time for call_time trace
2015-12-30Merge branch 'rickard/ohmq-fixup/OTP-13047'Rickard Green
* rickard/ohmq-fixup/OTP-13047: Fix asynchronous BIF timer cancellation message reply
2015-12-30Fix HL timer hard debug implementationRickard Green
2015-12-29Fix asynchronous BIF timer cancellation message replyRickard Green
2015-12-23Use monotonic time for call_time traceRickard Green