[interp] Fix GetFunctionPointer (#13708)
commit474305cbce2eaba12186d61583ab358bc5957abe
authorVlad Brezae <brezaevlad@gmail.com>
Thu, 4 Apr 2019 20:19:50 +0000 (4 23:19 +0300)
committerBernhard Urban <bernhard.urban@xamarin.com>
Thu, 4 Apr 2019 20:19:50 +0000 (4 22:19 +0200)
tree7228b5523a2d1ef6f2e4e6b0da92313e75ab7966
parent4b46c5fca4c5c7dc2754150179d3b76e2fb93643
[interp] Fix GetFunctionPointer (#13708)

This method returns a function pointer that can be called with a calli instruction. On interpreter we use a pointer to InterpMethod while on jit we use the native code address. Normally, GetFunctionPointer should return the InterpMethod pointer if called from interp or the native code address if called from jit. Since we don't have any information about the execution engine of the caller, we solve this by intrinsifying all these calls, that happen in the interpreter.

Passing such function pointers between jitted and interp code is probably still unreliable.

Fixes https://github.com/mono/mono/issues/13654
mono/mini/interp/interp.c
mono/mini/interp/mintops.def
mono/mini/interp/transform.c