Age | Commit message (Collapse) | Author | |
---|---|---|---|
2017-12-12 | erts: Remove some straggling ERTS_SMP | Sverker Eriksson | |
2017-12-08 | Merge pull request #1634 from bjorng/bjorn/get_stacktrace-syntax/OTP-14692 | Björn Gustavsson | |
Add syntax in try/catch to retrieve the stacktrace directly | |||
2017-12-04 | Merge branch 'maint' | Björn Gustavsson | |
* maint: fix output formatting in several HiPE debug BIFs | |||
2017-11-30 | Add syntax in try/catch to retrieve the stacktrace directly | Björn Gustavsson | |
This commit adds a new syntax for retrieving the stacktrace without calling erlang:get_stacktrace/0. That allow us to deprecate erlang:get_stacktrace/0 and ultimately remove it. The problem with erlang:get_stacktrace/0 is that it can keep huge terms in a process for an indefinite time after an exception. The stacktrace can be huge after a 'function_clause' exception or a failed call to a BIF or operator, because the arguments for the call will be included in the stacktrace. For example: 1> catch abs(lists:seq(1, 1000)). {'EXIT',{badarg,[{erlang,abs, [[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20|...]], []}, {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,674}]}, {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,431}]}, {shell,exprs,7,[{file,"shell.erl"},{line,687}]}, {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]}, {shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}]}} 2> erlang:get_stacktrace(). [{erlang,abs, [[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22, 23,24|...]], []}, {erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,674}]}, {erl_eval,expr,5,[{file,"erl_eval.erl"},{line,431}]}, {shell,exprs,7,[{file,"shell.erl"},{line,687}]}, {shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]}, {shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}] 3> We can extend the syntax for clauses in try/catch to optionally bind the stacktrace to a variable. Here is an example using the current syntax: try Expr catch C:E -> Stk = erlang:get_stacktrace(), . . . In the new syntax, it would look like: try Expr catch C:E:Stk -> . . . Only a variable (not a pattern) is allowed in the stacktrace position, to discourage matching of the stacktrace. (Matching would also be expensive, because the raw format of the stacktrace would have to be converted to the cooked form before matching.) Note that: try Expr catch E -> . . . is a shorthand for: try Expr catch throw:E -> . . . If the stacktrace is to be retrieved for a throw, the 'throw:' prefix must be explicitly included: try Expr catch throw:E:Stk -> . . . | |||
2017-11-16 | HiPE: Unique ref receive opt | Magnus Lång | |
2017-11-15 | Merge PR-1621 from margnus1/hipe-literal-tag | Sverker Eriksson | |
HiPE: Support for literal tag, tests and bugfixes | |||
2017-11-11 | fix output formatting in several HiPE debug BIFs | Mikael Pettersson | |
Fix formatting in hipe_bifs:show_pcb/1, hipe_bifs:show_estack/1, and hipe_bifs:show_nstack/1. fflush(stdout) before switching from printf() to erts_printf() to avoid garbled output. Adjust field lengths to work on both 64- and 32-bit systems. Tested on Linux/x86_64 (64-bit) and Linux/ARMv7 (32-bit). | |||
2017-11-07 | Merge branch 'sverker/cleanup-hipe_bs_validate_unicode' | Sverker Eriksson | |
* sverker/cleanup-hipe_bs_validate_unicode: erts: Remove obsolete hipe primop bs_validate_unicode | |||
2017-11-07 | Merge branch 'maint' | Sverker Eriksson | |
2017-11-06 | erts: Remove obsolete hipe primop bs_validate_unicode | Sverker Eriksson | |
which was replaced by 'is_unicode' in 5369e34a892bfd8ab5aa98df330e3bbf19497b71 but kept for ABI compatibility in OTP-20.*. | |||
2017-11-05 | HiPE: Support literal tags | Magnus Lång | |
Literal tags are used by the VM as an alternative to reserving a large virtual memory space in order to be able to quickly identify which terms are literals. The use of literal tags harms performance, but is useful to support systems where allocating a large amount of virtual memory is not an option. | |||
2017-11-05 | HiPE: Make is_divisible a primop | Magnus Lång | |
Since gcunsafe values are live over is_divisible calls (although only the happy path, which never GCd), it should be a primop so there cannot be any GCs. | |||
2017-11-05 | fix output formatting in hipe_bifs:show_heap/1 | Mikael Pettersson | |
When the code switches from printf() to erts_printf() the output becomes garbled. Fixed by fflush()ing stdout first. Fixed formatting of the "H E A P" banner for 64-bit systems. | |||
2017-11-03 | Merge branch 'maint' | Sverker Eriksson | |
2017-11-03 | Fix bug in hipe for <<X/utf32>> | Sverker Eriksson | |
by introducing new primop 'is_unicode' with no exception (ab)use and no GC. Replaces bs_validate_unicode which is kept for backward compat for now. | |||
2017-11-03 | Prevent hipe_bs_validate_unicode from doing GC | Sverker Eriksson | |
Fix for x86_64 only. The calling native code can not handle a GC as it has a raw pointer where to write the binary data. If a GC happens the data (utf32) will be written to the old deallocated heap. | |||
2017-10-01 | Eliminate the OpCode() macro | Björn Gustavsson | |
Introduce the IsOpCode() macro that can be used to compare instructions. | |||
2017-10-01 | Refactor macros for accessing Beam instructions | Björn Gustavsson | |
The BeamOp() macro in erl_vm.h is clumsy to use. All users cast the return value to BeamInstr. Define new macros that are easier to use. In the future, we might want to pack an operand into the same word as the pointer to the instruction, so we will define two macros. BeamIsOpCode() is used to rewrite code like this: if (Instr == (BeamInstr) BeamOp(op_i_func_info_IaaI) { ... } to: if (BeamIsOpCode(Instr, op_i_func_info_IaaI)) { ... } BeamOpCodeAddr(op_apply_bif) is used when we need the address for an instruction. Also elimiminate the global variables em_* in beam_emu.c. They are not really needed. Use the BeamOpCodeAddr() macro instead. | |||
2017-08-31 | ops.tab: Mark infrequently used instructions as %cold | Björn Gustavsson | |
Instructions that used to be implemented in beam_emu.c were not marked as cold as it would make no difference. | |||
2017-08-11 | Break out most instructions from beam_emu.c | Björn Gustavsson | |
2017-07-17 | erts: Replace usage of all erts_smp prefixes to just erts | Lukas Larsson | |
2017-07-17 | erts: Cleanup configure and makefiles after non-smp removal | Lukas Larsson | |
2017-07-17 | erts: Cleanup removal of non-smp emulators | Lukas Larsson | |
2017-07-17 | erts: Remove ERTS_SMP and USE_THREAD defines | Lukas Larsson | |
This refactor was done using the unifdef tool like this: for file in $(find erts/ -name *.[ch]); do unifdef -t -f defile -o $file $file; done where defile contained: #define ERTS_SMP 1 #define USE_THREADS 1 #define DDLL_SMP 1 #define ERTS_HAVE_SMP_EMU 1 #define SMP 1 #define ERL_BITS_REENTRANT 1 #define ERTS_USE_ASYNC_READY_Q 1 #define FDBLOCK 1 #undef ERTS_POLL_NEED_ASYNC_INTERRUPT_SUPPORT #define ERTS_POLL_ASYNC_INTERRUPT_SUPPORT 0 #define ERTS_POLL_USE_WAKEUP_PIPE 1 #define ERTS_POLL_USE_UPDATE_REQUESTS_QUEUE 1 #undef ERTS_HAVE_PLAIN_EMU #undef ERTS_SIGNAL_STATE | |||
2017-07-06 | Allow toggling lock counting at runtime | John Högberg | |
The implementation is still hidden behind ERTS_ENABLE_LOCK_COUNT, and all categories are still enabled by default, but the actual counting can be toggled at will. OTP-13170 | |||
2017-05-04 | Update copyright year | Raimo Niskanen | |
2017-04-12 | erts: Introduce struct binary_internals | Sverker Eriksson | |
to replace macro ERTS_INTERNAL_BINARY_FIELDS as header in Binary and friends. | |||
2017-04-11 | erts: Init refc=1 in erts_bin_nrml_alloc | Sverker Eriksson | |
Only term_to_binary needed some extra attention as it used to initialize refc as 0 instead of 1. | |||
2017-04-05 | erts: Remove hipe_bifs:remove_refs_from/1 | Sverker Eriksson | |
which serves no purpose after all the hipe load&purge fixes merged at 32729cab75325de58bf127e6e8836348071b8682 | |||
2017-04-04 | Refactor hipe specific code to use ErtsCodeInfo | Sverker Eriksson | |
instead of ugly negative indexing. | |||
2017-03-30 | Add a missing 0 to an address, which was suspiciously missing | Kostis Sagonas | |
2017-03-27 | Make hipe_bifs:alloc_data/3 pad addr to alignment | Magnus Lång | |
7814ec18b made hipe_bifs:alloc_data/3 expect alignments greater than 8 from erts_alloc(), which is not something that it guarantees. Fix it up so that it pads the allocation up to the required alignment, in case it does not initially satisfy the alignment requirement. | |||
2017-03-17 | erts: Change HIPE allocations from sys_alloc | Sverker Eriksson | |
to long lived, short lived and native stack. | |||
2017-02-28 | erts: Refactor MOVE_CONS to inline function | Björn-Egil Dahlberg | |
2017-02-28 | erts: Refactor MOVE_BOXED to inline function | Björn-Egil Dahlberg | |
2017-02-19 | erts: Drop workarounds for ErLLVM w/ LLVM < 3.9 | Magnus Lång | |
2017-02-14 | erts: Add deallocation veto for magic destructors | Sverker Eriksson | |
A magic destructor can return 0 and thereby take control and prolong the lifetime of a magic binary. | |||
2017-02-06 | Use magic refs for code loading state | Rickard Green | |
2017-02-06 | Merge branch 'maint' | Rickard Green | |
* maint: Atomic reference count of binaries also in non-SMP Conflicts: erts/emulator/beam/erl_fun.c | |||
2017-02-06 | Merge branch 'rickard/binary-refc' into maint | Rickard Green | |
OTP-14202 * rickard/binary-refc: Atomic reference count of binaries also in non-SMP Conflicts: erts/emulator/beam/beam_bp.c | |||
2017-02-06 | Atomic reference count of binaries also in non-SMP | Rickard Green | |
NIF resources was not handled in a thread-safe manner in the runtime system without SMP support. As a consequence of this fix, the following driver functions are now thread-safe also in the runtime system without SMP support: - driver_free_binary() - driver_realloc_binary() - driver_binary_get_refc() - driver_binary_inc_refc() - driver_binary_dec_refc() | |||
2017-01-23 | Merge branch 'sverker/ASSERT_IN_ENV' | Sverker Eriksson | |
* sverker/ASSERT_IN_ENV: erts: Add macro ERTS_PROC_LOCKS_HIGHER_THAN erts: Cleanup and extra assertions in nif_SUITE.c erts: Cleanup enif_make_reverse_list erts: Add assertions for correct ErlNifEnv erts: Make erts_dbg_within_proc available # Conflicts: # erts/emulator/beam/erl_gc.h | |||
2017-01-17 | Merge branch 'maint' | Rickard Green | |
* maint: Remove debug printout and unnecessary GC | |||
2017-01-17 | Remove debug printout and unnecessary GC | Rickard Green | |
2017-01-12 | Perform potentially long GC on dirty schedulers if available | Rickard Green | |
2017-01-12 | Support for dirty BIFs | Rickard Green | |
2017-01-04 | erts: Make erts_dbg_within_proc available | Sverker Eriksson | |
for debug assertions. | |||
2016-12-06 | erts: Fix missing HiPE trampolines on arm | Magnus Lång | |
8bb80fe76f5b replaced the "__arm__" macro used to test for the arm architecture in hipe_bif0 with the "arm" macro, which is not universally available. As this replacement is not motivated in the commit message, nor replicated in any other file that uses the "__arm__" macro, this seems to be an accident, and this commit reverts the replacement. When compiled in an environment without the "arm" macro, upgrading hipe code would occasionally not patch relocations to the new module due to being out of range for a shortjump, and a trampoline not being provided to do a longjump. Since this type of relocation patches are not expected to be able to fail, there is no error handling, and aside from a "hipe_redirect_to_module: patch failed" message, code upgrade would proceed and lead to various incorrect behaviour. | |||
2016-11-17 | erts: Fix all -Wundef errors | Sverker Eriksson | |
2016-10-28 | erts: Exclude random beam functions from hipe stacktrace | Sverker Eriksson | |