Age | Commit message (Collapse) | Author |
|
The hipe_mfa_info_table lock is currently a mutex, causing
unnecessary contention and serialization of lookups for
apply-like constructs.
- change the lock from a mutex to an rwmutex
- split hipe_get_na_nofail_locked into a "try" path which
only needs a read lock, and a "slow" path which requires
a write lock
- reimplement hipe_get_na_nofail (used by apply ops etc) to
first call the "try" path with a read lock, and if that
fails the "slow" path with a write lock
- reimplement hipe_get_na_nofail_locked (used by maintenance
code) to call the "try" path and then optionally the "slow"
path, but without taking locks since its caller already has
the write lock
- adjust remaining lock ops to take/release full write lock
- use _rwlocked as suffix on functions requiring a write lock
- change hipe_mfa_get_trampoline to call get_locked not put_locked,
allowing it to take a read lock instead of a write lock
- change hipe_find_mfa_from_ra() to only take a read lock
|
|
HiPE on ARM is currently severely broken if the rest of the VM is
compiled to run in Thumb mode -- calling native code quickly ends
up executing code in the wrong mode and crashing the VM. This is
a problem on e.g. Ubuntu which configures its system GCC to generate
Thumb by default. It can also be triggered by overriding CC or
CFLAGS when compiling the VM.
There were three issues that caused the breakage:
1. Assembly-coded functions in hipe_arm_glue.S weren't explicitly
tagged as functions, preventing the linker from generating the
correct mode-switching call instructions for calls from C to
these functions.
Fixed by tagging those symbols as functions.
2. A few BIF wrappers were so simple that they performed tailcalls
to the C BIFs. This fails to switch mode when C is in Thumb.
Fixed by performing ordinary recursive calls when C is in Thumb.
3. The assembly-coded source files weren't explicitly tagged as ARM.
Tested with the HiPE testsuite on ARMv7, with the VM built as ARM
and as Thumb. Also manually inspected the object code for the beam
executable and checked that call sites from C to HiPE's ARM runtime
code and vice versa used the correct mode-switching instructions.
|
|
* sv/isfinite/OTP-12268:
Use isfinite() instead of finite() when available
|
|
OS X Mavericks builds result in a number of warnings about finite() being
deprecated, like these:
beam/erl_arith.c:451:7: warning: 'finite' is deprecated: first deprecated in OS X 10.9 [-Wdeprecated-declarations]
ERTS_FP_ERROR(p, f1.fd, goto badarith);
^
sys/unix/erl_unix_sys.h:319:33: note: expanded from macro 'ERTS_FP_ERROR'
^
sys/unix/erl_unix_sys.h:244:51: note: expanded from macro '__ERTS_FP_ERROR'
^
/usr/include/math.h:718:12: note: 'finite' has been explicitly marked deprecated here
extern int finite(double) __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_9, __IPHONE_NA, __IPHONE_NA);
Add checks to use isfinite() instead of finite() where available. Verified
on OS X Mavericks 10.9.5 and Ubuntu 12.04.
|
|
Symptom: base64_SUITE:roundtrip crashes with hipe compiled stdlib.
Problem: HIPE_WRAPPER_BIF_DISABLE_GC pushed a "trap frame", but the frame
was only popped if the call was recursive.
Solution: Only reserve "trap frame" if BIF call is recursive.
|
|
The trap_frame got pushed twice, first by the wrapper then by
hipe_push_beam_trap_frame as it was looking at F_DISABLE_GC.
|
|
Position-independent code is mandatory on OS X. We use r11 as an intermediate
register to fill BIF_P->hipe.bif_callee. This fixes the following error when
doing `make debug FLAVOR=smp`:
clang -cc1as: fatal error: error in backend: 32-bit absolute addressing is not supported in 64-bit mode
|
|
Replace the 'erlang:binary_to_term/1' and 'erlang:binary_to_term/2'
Erlang wrappers taking care of failure after yield with management
of this in the hidden yield BIF.
|
|
- erlang:list_to_binary/1
- erlang:iolist_to_binary/1
- erlang:list_to_bitstring/1
- binary:list_to_bin/1
|
|
- erlang:binary_to_list/1
- erlang:binary_to_list/3
- erlang:bitstring_to_list/1
|
|
* yiannist/hipe-llvm-backend:
Support the LLVM backend in HiPE
Implement the LLVM backend
Extend RTL API to support the LLVM backend
Add support for llvm unique symbols in hipe_gensym
Add a BIF that only returns the atom ok
Move some common code in hipe_pack_constants
Add better specs in hipe_pack_constants and cleanup
OTP-11801
|
|
* sverk/valgrind-leaks:
erts: Suppress false leak in hipe_thread_signal_init
erts: Fix leak in nif_SUITE:resource_takeover (again)
|
|
A call in llvm_fix_pinned_regs/0 is inserted in the beginning of LLVM unwind
blocks (i.e. code executed when an LLVM 'invoke' call triggers an exception)
in order to get the BP and SP registers right. This is needed because LLVM
exception handling doesn't provide the return value (that also contains the
values for these registers, as defined in the HiPE Calling Convention for
LLVM) on the 'landingpad's.
|
|
|
|
This commit is a preparation for eliminating a race condition
loading the native code for modules whose BEAM code has already
been loaded. Here we introduce two new BIFs so that looking up
a fun entry is separate from setting the native address in the
fun entry.
|
|
* sverk/hipe-disable-gc-bug:
erts: Fix heap overwrite by hipe "trap frames" when GC is disabled
ASSERT that GC is not tried with "need" when GC is disabled
|
|
by trapping BIFs like term_to_binary and binary_to_term.
|
|
|
|
|
|
A process requesting a system task to be executed in the context of
another process will be notified by a message when the task has
executed. This message will be on the form:
{RequestType, RequestId, Pid, Result}.
A process requesting a system task to be executed can set priority
on the system task. The requester typically set the same priority
on the task as its own process priority, and by this avoiding
priority inversion. A request for execution of a system task is
made by calling the statically linked in NIF
erts_internal:request_system_task(Pid, Prio, Request). This is an
undocumented ERTS internal function that should remain so. It
should *only* be called from BIF implementations.
Currently defined system tasks are:
* garbage_collect
* check_process_code
Further system tasks can and will be implemented in the future.
The erlang:garbage_collect/[1,2] and erlang:check_process_code/[2,3]
BIFs are now implemented using system tasks. Both the
'garbage_collect' and the 'check_process_code' operations perform
or may perform garbage_collections. By doing these via the
system task functionality all garbage collect operations in the
system will be performed solely in the context of the process
being garbage collected. This makes it possible to later implement
functionality for disabling garbage collection of a process over
context switches.
Newly introduced BIFs:
* erlang:garbage_collect/2 - The new second argument is an option
list. Introduced option:
* {async, RequestId} - making it possible for users to issue
asynchronous garbage collect requests.
* erlang:check_process_code/3 - The new third argument is an
option list. Introduced options:
* {async, RequestId} - making it possible for users to issue
asynchronous check process code requests.
* {allow_gc, boolean()} - making it possible to issue requests
that aren't allowed to garbage collect (operation will abort
if gc should be needed).
These options have been introduced as a preparation for
parallelization of check_process_code operations when the
code_server is about to purge a module.
|
|
|
|
|
|
|
|
|
|
* ks/hipe_bif-remove_refs_from/OTP-10851:
Fixed test to allow for lists:foreach/2 call
Change the return value of hipe_bifs:remove_refs_from/1
|
|
|
|
In order to avoid an ummatched return warning in erts and make the code
more sane, the return value of the bif was changed from [] to 'ok'.
(Probably more hipe_bifs need such changes but they will have to wait.)
While at it, the code of various functions in hipe_unified_loader was
shortened by using lists:foreach/1 instead of explicit recursion.
|
|
|
|
Use am_undefined as it seems to be more releable to exist.
|
|
Changes in "struct process" has made native code more depenedent on if the
executing emulator is smp enabled or not.
This commit will make a default built hipe compiler (without -xcomp)
to ask the running emulator about process struct offsets. This will
make native code work (again) as long as the same emulator is used for
compilation as well as execution of the native code.
|
|
rickard/r16/port-optimizations/OTP-10336
* rickard/port-optimizations/OTP-10336:
Change annotate level for emacs-22 in cerl
Update etp-commands
Add documentation on communication in Erlang
Add support for busy port message queue
Add driver callback epilogue
Implement true asynchronous signaling between processes and ports
Add erl_drv_[send|output]_term
Move busy port flag
Use rwlock for driver list
Optimize management of port tasks
Improve configuration of process and port tables
Remove R9 compatibility features
Use ptab functionality also for ports
Prepare for use of ptab functionality also for ports
Atomic port state
Generalize process table implementation
Implement functionality for delaying thread progress from unmanaged threads
Conflicts:
erts/doc/src/erl_driver.xml
erts/doc/src/erlang.xml
erts/emulator/beam/beam_bif_load.c
erts/emulator/beam/beam_bp.c
erts/emulator/beam/beam_emu.c
erts/emulator/beam/bif.c
erts/emulator/beam/copy.c
erts/emulator/beam/erl_alloc.c
erts/emulator/beam/erl_alloc.types
erts/emulator/beam/erl_bif_info.c
erts/emulator/beam/erl_bif_port.c
erts/emulator/beam/erl_bif_trace.c
erts/emulator/beam/erl_init.c
erts/emulator/beam/erl_message.c
erts/emulator/beam/erl_port_task.c
erts/emulator/beam/erl_process.c
erts/emulator/beam/erl_process.h
erts/emulator/beam/erl_process_lock.c
erts/emulator/beam/erl_trace.c
erts/emulator/beam/export.h
erts/emulator/beam/global.h
erts/emulator/beam/io.c
erts/emulator/sys/unix/sys.c
erts/emulator/sys/vxworks/sys.c
erts/emulator/test/port_SUITE.erl
erts/etc/unix/cerl.src
erts/preloaded/ebin/erlang.beam
erts/preloaded/ebin/prim_inet.beam
erts/preloaded/src/prim_inet.erl
lib/hipe/cerl/erl_bif_types.erl
lib/kernel/doc/src/inet.xml
lib/kernel/src/inet.erl
|
|
|
|
|
|
|
|
* egil/darwin-fixes:
erl_interface: Avoid redefinition of ALIGNBYTES
erts: Fix '#ifdef' for unused static functions
erts: Remove forgotten vxworks includes
hipe: Cast offsetof to int in hipe_arch_print_pcb
|
|
|
|
|
|
Conflicts:
lib/ssl/src/ssl_connection.erl
|
|
Previously done for ppc in c469d8ce14e9544a297d9af48c9da43137122d9a
|
|
|
|
* Silence compiler warning
* This is the same style as the rest of the debug printing in hipe.
Keeping to the same style, though changing the printing format
would probably be better. Not a critical change.
|
|
Conflicts:
lib/diameter/autoconf/vxworks/sed.general
xcomp/README.md
|
|
|
|
Conflicts:
erts/preloaded/ebin/init.beam
|
|
* sverk/hipelibs-code_server-crash-maint:
Fix init:restart with hipelibs
kernel: Disable hipe compilation for hipe_unified_loader
|
|
* maint:
Fix assembler comments for hipe on ppc
odbc: remove "-" in hostname from generated unique table name
|
|
Change to preprocessor comments to work on all OS.
|
|
This is a workaround for init:restart.
The root problem is that delete/purge_module does not
clean up internal hipe bookkeeping (hipe_mfa_info's)
properly.
Symptom: Execution of deallocated beam code.
|
|
Tuple funs were deprecated in R15B (in commit a4029940e309518f5500).
|
|
|