[runtime] Default llvm to self-init+direct native calls (#13312)
commit04d65f29866cc7cfdcfced9a04ec54b4d7e2637e
authorAlexander Kyte <alexmkyte@gmail.com>
Tue, 19 Mar 2019 15:13:11 +0000 (19 11:13 -0400)
committerGitHub <noreply@github.com>
Tue, 19 Mar 2019 15:13:11 +0000 (19 11:13 -0400)
treeaf8bdd6c2f2f0f9bac9cd07fb3b0aff2a35c6866
parent6cb5c7f9cf4aff6781d7c24dc6282409f4761813
[runtime] Default llvm to self-init+direct native calls (#13312)

* [runtime] Default llvm to self-init

Now the init code is behind llvm_plt_init. Setting
--aot=llvm-plt will bring back the legacy llvm+plt behavior

* [llvm] Mark managed methods no-inline by llvm

* [runtime] Clean up self-disabling machinery

* [llvm] Skip self-init on cctors

* [runtime] Always make ctors call their cctors

* [runtime] Improve mono_print_unwind_info, add cases

* [runtime] Fix too-early eager calling of cctors

We emitted all of the lazy checks and init around a specific static
method, but still were initializing it when we initialized methods
that access it. This made static cctors run before they were supposed
to.

The problem was that the call site here has method == NULL, because
we don't compute it. That's expected, as we don't compute the method
along this path.

This initial "&&" looks like it was supposed to avoid calling the method
on a null MonoMethod reference. This preserves that, while fixing the
control flow issues.

* [runtime] Associate init_method native code with MonoMethod

* [runtime] Future-proof against aot init wrapper subtype mixups

* [runtime] Fix goto in AOT-init change for c++

* [runtime] Move docs for llvm-disable-self-init into runtime

* [runtime] Fix bitcode, remove unneeded wrapper around init icall

* [llvm] Include global prefix in init name

* [comment] Describe debugging usage of llvm self-init disable flag

* [aot] Consolidate mangler string append lines

* [llvm] Make self-init documentation changes

* [llvm] Rename self-init funcs, mini_llvmonly_ to mini_llvm_

* [runtime] Enable inlining for methods without init
mono/metadata/marshal-ilgen.c
mono/metadata/marshal.c
mono/metadata/marshal.h
mono/mini/aot-compiler.c
mono/mini/aot-runtime.c
mono/mini/llvmonly-runtime.c
mono/mini/llvmonly-runtime.h
mono/mini/mini-llvm.c
mono/mini/mini-runtime.c
mono/mini/mini-runtime.h
mono/mini/unwind.c