Age | Commit message (Collapse) | Author |
|
|
|
HiPE: Support for literal tag, tests and bugfixes
|
|
* sverker/cleanup-hipe_bs_validate_unicode:
erts: Remove obsolete hipe primop bs_validate_unicode
|
|
|
|
which was replaced by 'is_unicode' in 5369e34a892bfd8ab5aa98df330e3bbf19497b71
but kept for ABI compatibility in OTP-20.*.
|
|
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.
|
|
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.
|
|
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.
|
|
|
|
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.
|
|
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.
|
|
Introduce the IsOpCode() macro that can be used to compare
instructions.
|
|
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.
|
|
Instructions that used to be implemented in beam_emu.c
were not marked as cold as it would make no difference.
|
|
|
|
|
|
|
|
|
|
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
|
|
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
|
|
|
|
to replace macro ERTS_INTERNAL_BINARY_FIELDS
as header in Binary and friends.
|
|
Only term_to_binary needed some extra attention
as it used to initialize refc as 0 instead of 1.
|
|
which serves no purpose after all the
hipe load&purge fixes merged at
32729cab75325de58bf127e6e8836348071b8682
|
|
instead of ugly negative indexing.
|
|
|
|
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.
|
|
to long lived, short lived and native stack.
|
|
|
|
|
|
|
|
A magic destructor can return 0 and thereby take control
and prolong the lifetime of a magic binary.
|
|
|
|
* maint:
Atomic reference count of binaries also in non-SMP
Conflicts:
erts/emulator/beam/erl_fun.c
|
|
OTP-14202
* rickard/binary-refc:
Atomic reference count of binaries also in non-SMP
Conflicts:
erts/emulator/beam/beam_bp.c
|
|
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()
|
|
* 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
|
|
* maint:
Remove debug printout and unnecessary GC
|
|
|
|
|
|
|
|
for debug assertions.
|
|
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.
|
|
|
|
|
|
|
|
|
|
Conflicts:
erts/emulator/beam/beam_bif_load.c
erts/emulator/beam/beam_load.c
and added macro DBG_TRACE_MFA_P in beam_load.h
|
|
with hash table mod2mfa_tab
|
|
|