Add beginnings of mixed code execution support (#4613)
authorZoltan Varga <vargaz@gmail.com>
Thu, 30 Mar 2017 11:32:44 +0000 (07:32 -0400)
committerGitHub <noreply@github.com>
Thu, 30 Mar 2017 11:32:44 +0000 (07:32 -0400)
commit45837e1a5aeabb3ea3c17391e70e69e4618fe825
tree9da022baeea326d4ce3fb92f2c1d4c38e0588dea
parentdba0a9c56616a953bcf15b6851ab479887b6959a
Add beginnings of mixed code execution support (#4613)

* [interp] Fix a few problems exposed by the iltests.exe test suite.

The ENDFINALLY opcode should empty the stack. The INITBLK opcode is two bytes.

* [interp] Store the MonoMethod->RuntimeMethod mapping in a separate hash in MonoJitDomainInfo instead of using MonoDomain.jit_code_hash, the latter contains MonoMethod->MonoJitInfo mappings. Also avoid holding the domain lock while creating the RuntimeMethod structure.

* [interp] Add a mono_jit_compile_method_jit_only () function which always compiles its argument using the JIT/AOT.

* [interp] Print a warning when --interpreter is used with a runtime compiled without ENABLE_INTERPRETER.

* [interp] Fix the size of the icall enter trampoline on amd64. Fix some formatting issues.

* [interp] Add support for calling JITted code from the interpreter. This uses the gsharedvt_out wrappers used by bitcode to reduce the number of possible calling conventions since all arguments and the return value are passed/returned by value. Not enabled yet.

* [interp] Add a --interp= argument which allows passing of options to the interpreter. Add a 'jit=' option which is used to control the set of types whose methods will be called by exiting the interpreter.

* [interp] Add tests for mixed mode execution.

* [interp] Add support for calling interpreter code from JITted code.

* [interp] add mixedmode target to CI

* Revert a debug change.

* [runtime] Fix the locking in the gsharedvt/interp wrapper creation functions.

* [interp] Implement support for interp->jit calls with more than 8 arguments.
17 files changed:
mono/cil/cil-opcodes.xml
mono/cil/opcode.def
mono/metadata/marshal.h
mono/mini/Makefile.am.in
mono/mini/driver.c
mono/mini/interp/interp-internals.h
mono/mini/interp/interp.c
mono/mini/interp/interp.h
mono/mini/interp/mintops.def
mono/mini/interp/transform.c
mono/mini/method-to-ir.c
mono/mini/mini-generic-sharing.c
mono/mini/mini-runtime.c
mono/mini/mini.h
mono/mini/mixed.cs [new file with mode: 0644]
mono/mini/tramp-amd64.c
scripts/ci/run-test-interpreter.sh