Optimize vtable calls (#20696)
authorFadi Hanna <fadim@microsoft.com>
Tue, 13 Nov 2018 20:44:49 +0000 (12:44 -0800)
committerGitHub <noreply@github.com>
Tue, 13 Nov 2018 20:44:49 +0000 (12:44 -0800)
commitd2cd0df600cfa697d30cf7ef5a7cf1c3c33b9959
tree5780e415551b7aa0d43cc18d04c977c014a4d3a3
parentd8bfe11f24598e6e909e6e49aea8fba3925c91b7
Optimize vtable calls (#20696)

* Implementation of R2R vtable call thunks. These thunks will fetch the target code pointer from the vtable of the input thisPtr, and jump to that address.
This is especially helpful with generics, since we can avoid a generic dictionary lookup cost for a simple vtable call.
Overall, these thunks cause the CPU to have less branch mispredictions, and give a small performance boost to vtable calls.

These stubs are under VirtualCallStubManager so that the managed debugger can handle stepping through them.
src/vm/amd64/virtualcallstubcpu.hpp
src/vm/arm/stubs.cpp
src/vm/arm/virtualcallstubcpu.hpp
src/vm/arm64/virtualcallstubcpu.hpp
src/vm/i386/virtualcallstubcpu.hpp
src/vm/jitinterface.cpp
src/vm/loaderallocator.cpp
src/vm/prestub.cpp
src/vm/virtualcallstub.cpp
src/vm/virtualcallstub.h
src/zap/zapinfo.cpp