aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam
AgeCommit message (Collapse)Author
2017-10-30Merge branch 'lukas/erts/misc_fixes'Lukas Larsson
* lukas/erts/misc_fixes: erts: Fix a bunch of compiler warnings kernel: Fix gen_tcp_misc indentation erts: Fail port_SUITE:huge_env if error code > 127 erts: Add lcnt prototype for dist locks update
2017-10-30erts: Fix a bunch of compiler warningsLukas Larsson
2017-10-30Merge pull request #1610 from bjorng/bjorn/erts/is_builtin/ERL-500/OTP-14713Björn Gustavsson
Correct erlang:is_builtin/3 for apply/2 and yield/0
2017-10-30Merge branch 'maint'Björn Gustavsson
* maint: erl_process_dump: Don't assume that literals can be found Remove one superfluous closing parenthesis in oam_intro.xml
2017-10-30erl_process_dump: Don't assume that literals can be foundBjörn Gustavsson
Native code does not register its literals in the code header for the loaded code. Therefore, a literal created by native code can not be found by mark_literal(). Ignore literals that can't be found instead of crashing (the crasdump_viewer will report such literals as incomplete heap data, but will not crash).
2017-10-27Correct erlang:is_builtin/3 for apply/2 and yield/0Björn Gustavsson
erlang:is_builtin(erlang, M, F) returns false for apply/2 and yield/0. The documentation for erlang:is_builtin/3 says that it returns true for BIFs that are implemented in C. apply/2 and yield/0 are implemented in C (as BEAM instructions), and therefore the correct return value is true. Also see a similar argument that was made for apply/3 in the past: http://erlang.org/pipermail/erlang-bugs/2015-October/005101.html https://bugs.erlang.org/browse/ERL-500
2017-10-25Merge branch 'maint'John Högberg
* maint: Updated OTP version Update release notes Update version numbers erts: Fix so that bind correct schedulers Update version Fix error handling when decoding an AVP with an alternate dictionary Remove unused function arguments Fix faulty recursion vsn -> 2.1.2 Update appup for ERIERL-14684 Fix speling error 'sndbuf' -> 'recbuf' Add zlib:set_controlling_process/2
2017-10-25Merge branch 'maint-20' into maintJohn Högberg
* maint-20: Updated OTP version Update release notes Update version numbers erts: Fix so that bind correct schedulers Update version Fix error handling when decoding an AVP with an alternate dictionary Remove unused function arguments Fix faulty recursion vsn -> 2.1.2 Update appup for ERIERL-14684 Fix speling error 'sndbuf' -> 'recbuf' Add zlib:set_controlling_process/2
2017-10-23erts: Fix so that bind correct schedulersLukas Larsson
When the cpu ids and scheduler ids don't match, the end schedulers could end up not being bound when they should be. example: > taskset -c 1-3 erl +S 4 +sbts > erlang:system_info(scheduler_bindings). {1,2,3,unbound} This fix makes it so that all cores are used to bind schedulers.
2017-10-23Merge branch 'bjorn/compiler/match-literals'Björn Gustavsson
* bjorn/compiler/match-literals: Optimize instructions for comparing a register with a literal Optimize matching of literals for single-valued types
2017-10-21Optimize instructions for comparing a register with a literalBjörn Gustavsson
We can avoid calling eq() from the is_eq_exact_literal/3 and is_ne_exact_literal/3 instructions if the source operand is an immediate (since a literal is either a boxed or a list, never an immediate).
2017-10-20Merge branch 'maint'Björn Gustavsson
* maint: Bump version of crash dumps to 0.4 Verify that binaries of different sizes are dumped correctly Don't dump literal areas that are not referenced at all Dump literals separately to avoid incomplete heap data Implement dumping of maps in crash dumps Buffer writing of crash dumps Conflicts: erts/emulator/beam/erl_alloc.types
2017-10-18erts: Add lcnt prototype for dist locks updateLukas Larsson
2017-10-18Bump version of crash dumps to 0.4Björn Gustavsson
2017-10-18Don't dump literal areas that are not referenced at allBjörn Gustavsson
2017-10-18Dump literals separately to avoid incomplete heap dataBjörn Gustavsson
When a literal was used from several processes, the literal would be dumped in only one of the processes. The other processes that referenced the literals would have incomplete heap data.
2017-10-18Implement dumping of maps in crash dumpsBjörn Gustavsson
Maps would be dumped as the atom 'undefined', which is not very informative.
2017-10-18Buffer writing of crash dumpsBjörn Gustavsson
Writing of crash dumps were done using unbuffered IO. This is slow since many small writes are done. Use a FILE* with an allocated buffer to obtain buffered IO. I wrote a small test program that created 50000 binaries of 200 bytes each and then created a crash dump. The crash dumping was an order of magnitude faster with buffered IO than without.
2017-10-17Merge branch 'sverker/on_load-nonblocking/OTP-14680'Sverker Eriksson
* sverker/on_load-nonblocking/OTP-14680: erts: Remove scheduler blocking during finish_after_on_load_2
2017-10-13Merge pull request #1596 from bjorng/bjorn/enhance-try-catchBjörn Gustavsson
(Slightly) optimize catch and try/catch OTP-14683
2017-10-12Merge branch 'lukas/erts/use_SIGRTMIN_for_sys_suspend/OTP-14682'Lukas Larsson
* lukas/erts/use_SIGRTMIN_for_sys_suspend/OTP-14682: erts: Use SIGRTMIN on linux for sys_suspend
2017-10-12erts: Use SIGRTMIN on linux for sys_suspendLukas Larsson
The Linux real-time signal is better used on Linux for suspending schedulers during shutdown as it doesn't collide with SIGUSR2 usage of other applications.
2017-10-12Merge branch 'rickard/null-chars/ERL-370/OTP-14543'Rickard Green
* rickard/null-chars/ERL-370/OTP-14543: Don't allow null chars in various strings Conflicts: erts/emulator/beam/erl_alloc.types erts/preloaded/ebin/erlang.beam
2017-10-12Merge branch 'maint'Rickard Green
* maint: Revert "Merge branch 'rickard/null-char-filenames/ERL-370/OTP-14543' into maint"
2017-10-12Revert "Merge branch 'rickard/null-char-filenames/ERL-370/OTP-14543' into maint"Rickard Green
This reverts commit 0717a2194e863f3a78595184ccc5637697f03353, reversing changes made to 71a40658a0cef8b3e25df3a8e48a72d0563a89bf.
2017-10-12erts: Remove scheduler blocking during finish_after_on_load_2Sverker Eriksson
for normal case. We still block for default trace and hipe.
2017-10-12Merge branch 'maint'Lukas Larsson
Conflicts: erts/emulator/beam/beam_bp.c erts/emulator/beam/erl_process.c
2017-10-12Merge branch 'lukas/erts/tracing/recv_exit_signal_deadlock/OTP-14678' into maintLukas Larsson
* lukas/erts/tracing/recv_exit_signal_deadlock/OTP-14678: erts: Fix lock order when recv tracing trapped exit signal
2017-10-12Merge branch 'lukas/erts/fix_caller_trace_for_apply_bifs/OTP-14677' into maintLukas Larsson
* lukas/erts/fix_caller_trace_for_apply_bifs/OTP-14677: erts: Fix caller trace for apply bifs
2017-10-12erts: Fix lock order when recv tracing trapped exit signalLukas Larsson
2017-10-11Don't allow null chars in various stringsRickard Green
Various places that now reject null chars inside strings - Primitive file operations reject it in filenames. - Primitive environment variable operations reject it in names and values. - os:cmd() reject it in its input. Also '=' characters are rejected by primitive environment variable operations in environment variable names. Documentation has been updated to document null characters in these types of data as invalid. Currently these operations accept null chars at the end of strings, but that will change in the future.
2017-10-09Slightly speed up try/catchBjörn Gustavsson
The try_end and try_case instructions are implemented the same way (try_case is translated to try_end by the loader). We can do better than that. We know that try_case will only be executed when an exception has been caught. Therefore, we know that x(0) is the non-value and that x(1) through x(3) need to be shifted down to x(0) through x(2). There is no need to test x(0) before shifting down. try_end does not need the register shifting code at all.
2017-10-09Merge branch 'sverker/bad-dist-msg-bug/ERIERL-80/OTP-14661' into maint-20Erlang/OTP
* sverker/bad-dist-msg-bug/ERIERL-80/OTP-14661: erts: Fix bug when detecting bad dist message Add distribution_SUITE:bad_dist_ext_size
2017-10-09erts: Fix caller trace for apply bifsLukas Larsson
Bifs that are called through the export entry using i_call_last could have their cp set to return_trace, just like any other call. So we have to unwind the trace stack to get the correct cp. Not doing this creates a lot of issues for fprof.
2017-10-09Merge branch 'bjorn/erts/pack-with-opcode/OTP-14325'Björn Gustavsson
OTP-14327 OTP-14340 * bjorn/erts/pack-with-opcode/OTP-14325: Pack operands for combined instructions into the instruction word beam_makeops: Use named arguments for the code generation functions Optimize packing for "optional use" operands beam_makeops: Print the instruction name for fatal packing errors Introduce a syntax for marking operands as "optional use" beam_makeops: Refactor parsing of specific instructions Optimize instruction prefetch Pack operands into the instruction word Use 32-bits pointers to C code Move LD flags for hipe from Makefile.in to configure.in beam_disasm: Correct printing of y registers ops.tab: Slightly optimize badmatch on a Y register macros.tab: Fix assertion in SET_I_REL()
2017-10-05Introduce a syntax for marking operands as "optional use"Björn Gustavsson
Introduce a syntax to mark an operand that is not always used when an instrution is executed. Example of such operands are the fail label for is_nil or the number of live registers for an allocate instruction. Use a question mark to annotate optional use: is_nil f? xy allocate t t?
2017-10-05Optimize instruction prefetchBjörn Gustavsson
2017-10-05Pack operands into the instruction wordBjörn Gustavsson
On 64-bit machines where the C code is always at address below 4Gb, pack one or more operands into the instruction word.
2017-10-05Use 32-bits pointers to C codeBjörn Gustavsson
On a 64-bit machine, we only need 32 bits to store a pointer to the C code that implements a BEAM instruction. Refactor the code to only use the lower 32 bits of each instruction word, and take care to preserve the high 32 bits.
2017-10-05beam_disasm: Correct printing of y registersBjörn Gustavsson
2017-10-05ops.tab: Slightly optimize badmatch on a Y registerBjörn Gustavsson
2017-10-05macros.tab: Fix assertion in SET_I_REL()Björn Gustavsson
9a50a5d5fc1 changed the update of I, but forgot to update the preceding assertion.
2017-10-02Merge branch 'maint'Sverker Eriksson
2017-10-02Merge branch 'sverker/bad-dist-msg-bug/ERIERL-80/OTP-14661' into maintSverker Eriksson
2017-10-02erts: Fix bug when detecting bad dist messageSverker Eriksson
We can't just leave it in queue with dist_ext=NULL. Two symptoms seen: 1. 'receive' trying to deref dist_ext as NULL. 2. GC think it's a term and put THE_NON_VALUE in root set.
2017-10-02Merge branch 'bjorn/erts/improve-beam-ops'Björn Gustavsson
* bjorn/erts/improve-beam-ops: Move out variables from the head of combined instructions Change operand from 'P' to 'Q' for i_apply_last and i_apply_fun_last Add CHECK_ALIGNED() for testing storage destinations instrs.tab: Add missing -no_next directives beam_load.c: Generalize the 'P' operator in the packing engine Break out most of the initialization from process_main() Eliminate the OpCode() macro Eliminate unnecessary and inconsistent casts Refactor macros for accessing Beam instructions beam_emu: Make order of macros consistent beam_SUITE: Strengthen test of packed registers
2017-10-02Merge pull request #1589 from bjorng/bjorn/erts/instruction-offsetsBjörn Gustavsson
Point out the correct line number in stack traces
2017-10-02Merge branch 'maint'Rickard Green
* maint: Don't allow null in filenames
2017-10-02Merge branch 'lukas/erts/poll-thread/OTP-14346'Lukas Larsson
* lukas/erts/poll-thread/OTP-14346: (25 commits) erts: Trigger ready events when erts_io_control fails erts: enif_select steal test kernel: Rewrite gen_udp_SUITE:read_packet tc erts: disable kernel-poll on OS X vsn < 16 erts: Fix msacc testcase with new poll-thread erts: Add testcases to test IOp and IOt options erts: get_internal_state(check_io_debug) now prints to error_logger erts: Remove eager check io erts: Move all I/O polling to a seperate thread erts: Fix smp_select testcase to use ERL_DRV_USE erts: Fix msacc unmanaged state counter erts: Optimize port_task quick allocator erts: Add ERTS_THR_PREF_QUICK_ALLOC_IMPL erts: Update suspend of scheduler to handle multiple pollsets erts: Add multiple poll sets erts: Some code cleanup for gdb to work better erts: temp_alloc can no longer be disabled erts: Refactor check_io to use one static struct erts: Replace check_io spinlock with lock-less list insertion erts: Add number of enif_select's to check_io_debug ...
2017-10-02erts: get_internal_state(check_io_debug) now prints to error_loggerLukas Larsson