Age | Commit message (Collapse) | Author |
|
|
|
Let sys.h define HAVE_OVERFLOW_CHECK_BUILTINS if the compiler supports
__builtin_mul_overflow() and the other overflow checking builtins.
The test is intentionally made in a sys.h and not as a configure test.
On Windows, beam_emu.c is always compiled using gcc, but the other
files are usually compiled with Microsoft's C compiler. With the
test in the header file, HAVE_OVERFLOW_CHECK_BUILTINS will be defined
when compiling beam_emu.c.
|
|
Starting in OTP 19 (in commit 9504c0dd71d0), the compiler emits
a test_unit instruction instead of a skip instruction at the end
of binary. We can do the same replacement in the loader to get
rid of the i_bs_skip_bits_all2 instruction.
|
|
On a 64-bit architecture, the size of any binary that would fit in the
memory must fit in a small, so we can fail immediately if the size
term is not a small.
|
|
The new compiler required adding support for Y register for all
binary matching instructions. That was (intentionally) done in a
naive way that simplicated duplicated the entire body of each
instruction.
Now it's time to be less naive. Rewrite the binary matching
instructions using micro instructions. Because some of the binary
instructions are huge, that will significantly decrease the size of
process_main().
When compiling with clang, a huge process_main() would mess up
profile-guide optimization resulting in a significant performance
degradation. On my Mac, profile-guide optimzation would decrease
the estone benchmark by 100K estones (about 20 percent). This commit
gives me back the lost estones.
|
|
Mark the obsoleted instructions bs_start_match2, bs_save2, bs_restore2, and
bs_context_to_binary as cold.
Remove support of a Y operand for bs_save2 and bs_restore2.
|
|
get_tuple_element with an Y register has become more frequent with
the new compiler.
|
|
The compiler used to generate "move Literal y(Y)" instructions very
rarely. Therefore, there was a transformation to avoid having a "move
c y" instruction.
With the new compiler, "move Literal y(Y)" instructions are relatively frequent, so we will need a "move c y" instruction.
|
|
|
|
|
|
|
|
Replace the won function for pid compare with the
(new) enif_compare_pids function.
OTP-15565
|
|
Add some more comments in order to increase readability.
OTP-15565
|
|
Implemented the activate_next function and added its
"users" acceptor, writer and reader (macro abuse).
After a request (accept, write or send) has been either
successfully completed or failed, another request should
be activated. Previously only one attempt was made, which
might leave the other (waiting) requestors hanging.
Now, instead we use a 'activate-next' function that pop's
the request (accept, wrote or read) queue until success
or its empty, thereby making sure that no waiting processes
is left hanging.
OTP-15565
|
|
|
|
Remove own function to make monitor printable (was a hack)
and make use of the new enif_make_monitor_term instead.
|
|
bmk/20190301/cleanup_through_macro_abuse/OTP-15565
|
|
Fixed some type size warnings (SCTP related). E.g:
On Solaris 11 (OpenIndiana Hipster) long and int is size 4,
but the way Sint32 def works it first "tests" for long size and
if that is correct, that is chosen (which it is on Solaris 11).
On linux long is size 8, so Sint32 will be defined as int.
...
On Solaris 11 the flags TCP_CONGESTION and SO_BINDTODEVICE
does not exist, so the function(s) n[set|get]opt_str_opt is never
used. So, in order to keep the compiler quiet, we add some if-def
to exclude these functions in this case.
|
|
|
|
The requestor (acceptor, writer and reader) functions are
virtually identical, so to ensure quality and not having
to write the exact same functions three times, we make
use of some macro magic for their declaration.
OTP-15565
|
|
Some more macro abuse for nif API callback functions.
OTP-15565
|
|
Some more macro abuse for nif API callback functions and
the operator (acceptor, writer and reader) queue wrapper functions
(search4pid, push, pop and unqueue).
OTP-15565
|
|
|
|
Make use of macro concat magic to simplify declarations.
OTP-15565
|
|
|
|
|
|
* siri/logger/os-timestamp/OTP-15625:
Update preloaded
[logger] Change timestamp from erlang:system_time to os:system_time
|
|
|
|
Tune BEAM instructions for the new compiler (part 1)
|
|
|
|
The is_nonempty_list test is very frequently followed by
get_tl, and frequently followed by get_hd.
|
|
It turns out that the combination of is_nonempty_list
and test_heap is no longer frequent.
|
|
|
|
The test_arity instruction is often followed by get_tuple_element.
|
|
|
|
Add a quiet logger mode (default) which limits the
printouts in the (erlang) shell (the web log will
be as verbose as usual).
Also added a way to configure the runtime of the ttest
cases.
|
|
Moved the old socket test modules into
its own (temporary?) directory.
|
|
The test case did not consider that the machine might have both
IPv4 (inet) and IPv6 (inet6) domain interfaces.
OTP-15635
|
|
The getnameinfo function has been fixed:
1) Faulty sockaddr decode success check
2) Incorrect (name info) return value
OTP-15636
|
|
Add a (basically) placeholder test suite for the net module.
OTP-15635
|
|
`swap x y` is rarely or never used. I found a single use of
`swap_temp x y x` in the sample of modules compiled by
`scripts/diffable`.
|
|
Of the `move_dup` instructions, only `move_dup x x x` was
frequently used. Remove the other register combinations.
With those instruction `move_dup` instructions removed, it
is necessary to add new predicates to avoid unsafe translation
to `move_shift` and `move2_par`.
Also add additional transformations to transform more `move`
instructions into `move2_par`. The existing transformation
would require the `move` instructions to be in the "right"
order in order to be transformed.
Remove `move3 x y x y x y` because it turns out to be rarely
executed.
|
|
inet_drv adds some arcane #defines to get SCTP working, which may
end up disabling madvise(2) locally in that file, breaking the
build in the process.
This commit disables madvise(2) altogether on Solaris as it's
far simpler than undoing the define dance in erl_mmap.h.
|
|
This reverts commit df130102cdeca8d35fec95a0c926fd1cfec54eab.
|
|
|
|
|
|
|
|
Make iolist_size/1 yield
OTP-15631
|
|
The iolist_size/1 function did not yield even if the input list was
very long and a call to the function did only consume a single
reduction. This commit fixes these problems.
|
|
* maint:
erts: Fix macro redefinition
|