aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
AgeCommit message (Collapse)Author
2018-02-01Merge pull request #1701 from bjorng/bjorn/get_hd_tlBjörn Gustavsson
Eliminate get_list/3 internally in the compiler
2018-01-29erts: Refactor hipe x86_64 trampolinesSverker Eriksson
2018-01-29make HiPE work on x86_64 when PIE is enabledbhuztez
Currently HiPE amd64 assumes the runtime system code is loaded into the low 2G of the address space. However, this is not the case when PIE is enabled, it is loaded into a random location. So trampolines are required to call BIFs, and also we have first to load the address of sse2_fnegate_mask to a regisiter before xorpd in fchs.
2018-01-26Eliminate get_list/3 internally in the compilerBjörn Gustavsson
Instructions that produce more than one result complicate optimizations. get_list/3 is one of two instructions that produce multiple results (get_map_elements/3 is the other). Introduce the get_hd/2 and get_tl/2 instructions that return the head and tail of a cons cell, respectively, and use it internally in all optimization passes. For efficiency, we still want to use get_list/3 if both head and tail are used, so we will translate matching pairs of get_hd and get_tl back to get_list instructions.
2018-01-24Merge branch 'maint'Sverker Eriksson
2018-01-24Merge branch 'sverker/hipe-load-fixing/OTP-14891' into maintSverker Eriksson
2018-01-24Merge branch 'maint'Sverker Eriksson
2018-01-24Merge PR-1684 from sverker/float_to_list-rounding-bug/OTP-14890Sverker Eriksson
Fix rounding bug in float_to_list/2
2018-01-22Don't build a stacktrace if it's only passed to erlang:raise/3Björn Gustavsson
Consider the following function: function({function,Name,Arity,CLabel,Is0}, Lc0) -> try %% Optimize the code for the function. catch Class:Error:Stack -> io:format("Function: ~w/~w\n", [Name,Arity]), erlang:raise(Class, Error, Stack) end. The stacktrace is retrieved, but it is only used in the call to erlang:raise/3. There is no need to build a stacktrace in this function. We can avoid the building if we introduce an instruction called raw_raise/3 that works exactly like the erlang:raise/3 BIF except that its third argument must be a raw stacktrace.
2018-01-22Merge branch 'bjorn/erts/beam_debug'Björn Gustavsson
* bjorn/erts/beam_debug: beam_debug: Fix printing of f operand for catch_yf beam_debug: Print out strings for bs_match_string/bs_put_string beam_debug: Print the MFA in the i_make_fun/2 instruction
2018-01-19Optimize matching of an 'utf8' segment in the binary syntaxBjörn Gustavsson
Matching out an 8-bit integer is faster than matching out an utf8-encoded code point, even if the value of the code point is less than 128. The reason is that matching out an 8-bit integer is specially optimized to avoid a function call. Do a similar optimization for matching out an utf8 segment.
2018-01-19beam_debug: Fix printing of f operand for catch_yfBjörn Gustavsson
2018-01-18beam_debug: Print out strings for bs_match_string/bs_put_stringBjörn Gustavsson
2018-01-18beam_debug: Print the MFA in the i_make_fun/2 instructionBjörn Gustavsson
2018-01-17Fix slow hipe executionSverker Eriksson
particularly slow erlc when compiler is hipe compiled. hipe_unified_loader:load did not patch external call sites and instead caused a double hipe mode switch per call. hipe_unified_loader:load is only used for early modules first loaded as beam and by code:atomic_load and friends.
2018-01-17Merge branch 'maint'Lukas Larsson
2018-01-17Merge branch 'fhunleth/binary_to_integer_chec/PR-1671/OTP-14879' into maintLukas Larsson
* fhunleth/binary_to_integer_chec/PR-1671/OTP-14879: Fail if ':' is passed to binary_to_integer/2
2018-01-16Merge branch 'sverker/build-proc-bin'Sverker Eriksson
2018-01-16Merge branch 'maint'Hans Bolinder
* maint: stdlib: Handle Unicode when formatting stacktraces
2018-01-16Merge branch 'hasse/stdlib/unicode_stacktrace/OTP-14847/ERL-553' into maintHans Bolinder
* hasse/stdlib/unicode_stacktrace/OTP-14847/ERL-553: stdlib: Handle Unicode when formatting stacktraces
2018-01-15Merge branch 'maint'Sverker Eriksson
2018-01-15Merge branch 'sverker/cuddle-big-bin-tests' into maintSverker Eriksson
2018-01-15erts: Refactor and cleanup sys_double_to_chars_fastSverker Eriksson
Replace long long with Uint64
2018-01-15erts: Fix float_to_list(F, [{decimals,D}]).Sverker Eriksson
Example symptom: 1> float_to_list(0.145, [{decimals,1}]). "0.2" There were two problems in sys_double_to_chars_fast 1. Most serious was adding 0.55555555 / (10^D) instead of 0.5 / (10^D) which imposed a 5.5% risk of a faulty rounding up. 2. Using fixpoint for frac_part which lost significant bits if F < 0.5
2018-01-15stdlib: Handle Unicode when formatting stacktracesHans Bolinder
See also ERL-553 and ERL-544 (commit c3ddb0f).
2018-01-11Merge branch 'maint'Rickard Green
* maint: Fix encoding of filenames in stacktraces
2018-01-11Merge branch 'rickard/file-encoding-stacktraces/OTP-14847/ERL-544' into maintRickard Green
* rickard/file-encoding-stacktraces/OTP-14847/ERL-544: Fix encoding of filenames in stacktraces
2018-01-11Fix encoding of filenames in stacktracesRickard Green
2018-01-08Remove sender punishmentJohn Högberg
The reduction cost of sending messages is now constant and will no longer scale according to the length of the receiving process' message queue.
2018-01-08Merge branch 'john/erts/putenv-thread-safety/OTP-14666'John Högberg
2018-01-05erts: Refactor more usage of erts_build_proc_binSverker Eriksson
2018-01-04erts: Add non fatal big binary creation for test purposeSverker Eriksson
2018-01-04erts: Refactor ProcBin creationSverker Eriksson
into utility functions.
2018-01-03Fail if ':' is passed to binary_to_integer/2Frank Hunleth
Before: 1> binary_to_integer(<<":">>, 16). 3 After: 1> binary_to_integer(<<":">>, 16). ** exception error: bad argument in function binary_to_integer/2 called as binary_to_integer(<<":">>,16) Prior to this change, both list_to_integer/2 and binary_to_integer/2 would convert strings with values between ASCII '9' up to '0'+base for base > 10. For example, when converting in base 16, you could pass ':', ';', '<', '=', '>', and '?' without getting an exception. This was due to a missing check in c2int_is_invalid_char(). This change adds the missing check and a regression test for passing ':'. It also simplifies the code and tightens up an out-of-bounds check to make it off-by-one rather than off-by-two.
2018-01-03Merge branch 'maint'Sverker Eriksson
2018-01-03Merge PR-1664 from sverker/sverker/hipe-bs_put_utf8-gc-bug OTP-14850Sverker Eriksson
Fix GC bug for HiPE primop bs_put_utf8
2018-01-03Add PRIMOP_ABI_VSN to erts checksumSverker Eriksson
in order to detect incompatible changes in primop interface (which we just did for bs_put_utf8) and refuse hipe loading.
2018-01-03Fix bug in hipe primop bs_put_utf8Sverker Eriksson
by preventing it from doing GC, which generated code relies on.
2018-01-03Disallow NULs in filename-encoded stringsJohn Högberg
Previously we accepted trailing NULs, which was backwards compatible as such usage never resulted in misbehavior in the first place. The downside is that it prevented erts_native_filename_need from returning an accurate number of *actual characters*, needlessly complicating encoding-agnostic code like erts_osenv.
2018-01-03Alter erl_ddll:load dependency search path on WindowsJohn Högberg
The standard search order does not include the directory that the loaded DLL resides in, requiring dirty $PATH hacks to get things working, which is not an option now that os:putenv/2 is divorced from the OS environment.
2018-01-03Replace the libc environment with a thread-safe emulationJohn Högberg
putenv(3) and friends aren't thread-safe regardless of how you slice it; a global lock around all environment operations (like before) keeps things safe as far as our own operations go, but we have absolutely no control over what libc or a library dragged in by a driver/NIF does -- they're free to call getenv(3) or putenv(3) without honoring our lock. This commit solves this by setting up an "emulated" environment which can't be touched without going through our interfaces. Third-party libraries can still shoot themselves in the foot but benign uses of os:putenv/2 will no longer risk crashing the emulator.
2017-12-21Merge branch 'maint'Sverker Eriksson
2017-12-21Merge branch 'sverker/cuddle-valgrind' into maintSverker Eriksson
2017-12-19Merge branch 'sverker/cleanup-some-ERTS_SMP'Sverker Eriksson
2017-12-19Merge branch 'dgud/kernel/refc_sched_wall_time/OTP-11694'Dan Gudmundsson
* dgud/kernel/refc_sched_wall_time/OTP-11694: test: spawn scheduler_wall_time flag holder Turn on scheduler_wall_time in an alive process Redirect system_flag(scheduler_wall_time,_) to kernel_refc kernel: add a resource reference counter
2017-12-19Redirect system_flag(scheduler_wall_time,_) to kernel_refcRickard Green
2017-12-12erts: Trim driver_SUITE:smp_select for slow valgrindSverker Eriksson
Symptom: "Closing pipe in state Waiting. Event lost?" Snake oil: Do erlang:yield() instead of busy spinning in "Waiting" state.
2017-12-12erts: Remove some straggling ERTS_SMPSverker Eriksson
2017-12-08Merge pull request #1634 from bjorng/bjorn/get_stacktrace-syntax/OTP-14692Björn Gustavsson
Add syntax in try/catch to retrieve the stacktrace directly
2017-12-07Merge branch 'john/erts/fix-invalid-name-xlat'John Högberg