diff options
author | David Wrighton <davidwr@microsoft.com> | 2016-10-04 02:40:35 +0300 |
---|---|---|
committer | David Wrighton <davidwr@microsoft.com> | 2016-10-04 02:40:35 +0300 |
commit | 8cbbe2e629cec5115874684f4f8840b89c8883d7 (patch) | |
tree | d0bc142721286babf164674eb8803e16bcfc49a9 /src/Native/Runtime/amd64 | |
parent | 99aa54c9e557bde77f0c2c17efa434307a637645 (diff) |
Add support for interface dispatch to have a codepath that supports resolution from a metadata token
- Instead of an interface/slot pair
- Cell information is now consolidated into a structure instead of being passed around as a tuple of interface/slot
- Encoding is more complex to avoid bloating the data format
- In addition to interface dispatch, the logic is also able to perform vtable dispatch
- Add support for the concept of dynamic modules
- A dynamic module provides a set of callbacks that are special around the behavior of interface dispatch
- ModuleList associates a DynamicModule with normal module. At some point we will consolidate the DynamicModule with the ModuleManager
Miscellaneous changes
- New variant of LockFreeReaderHashtable to be used with native pointers.
- Support for a cloned type to be cloned based on a direct pointer instead of an indirection
[tfs-changeset: 1630711]
Diffstat (limited to 'src/Native/Runtime/amd64')
-rw-r--r-- | src/Native/Runtime/amd64/StubDispatch.S | 6 | ||||
-rw-r--r-- | src/Native/Runtime/amd64/StubDispatch.asm | 16 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/Native/Runtime/amd64/StubDispatch.S b/src/Native/Runtime/amd64/StubDispatch.S index 2df605a35..bde82f42f 100644 --- a/src/Native/Runtime/amd64/StubDispatch.S +++ b/src/Native/Runtime/amd64/StubDispatch.S @@ -68,6 +68,12 @@ DEFINE_INTERFACE_DISPATCH_STUB 16 DEFINE_INTERFACE_DISPATCH_STUB 32 DEFINE_INTERFACE_DISPATCH_STUB 64 +;; Stub dispatch routine for dispatch to a vtable slot +LEAF_ENTRY RhpVTableOffsetDispatch, _TEXT + // UNIXTODO: Implement this function + int 3 +LEAF_END RhpTailCallTLSDispatchCell, _TEXT + // Initial dispatch on an interface when we don't have a cache yet. LEAF_ENTRY RhpInitialInterfaceDispatch, _TEXT ALTERNATE_ENTRY RhpInitialDynamicInterfaceDispatch diff --git a/src/Native/Runtime/amd64/StubDispatch.asm b/src/Native/Runtime/amd64/StubDispatch.asm index c718c6b20..6449739ee 100644 --- a/src/Native/Runtime/amd64/StubDispatch.asm +++ b/src/Native/Runtime/amd64/StubDispatch.asm @@ -109,6 +109,22 @@ DEFINE_INTERFACE_DISPATCH_STUB 16 DEFINE_INTERFACE_DISPATCH_STUB 32 DEFINE_INTERFACE_DISPATCH_STUB 64 +;; Stub dispatch routine for dispatch to a vtable slot +LEAF_ENTRY RhpVTableOffsetDispatch, _TEXT + ;; r10 currently contains the indirection cell address. + ;; load rax to point to the vtable offset (which is stored in the m_pCache field). + mov rax, [r10 + OFFSETOF__InterfaceDispatchCell__m_pCache] + + ;; Load the EEType from the object instance in rcx, and add it to the vtable offset + ;; to get the address in the vtable of what we want to dereference + add rax, [rcx] + + ;; Load the target address of the vtable into rax + mov rax, [rax] + + TAILJMP_RAX +LEAF_END RhpVTableOffsetDispatch, _TEXT + ;; Initial dispatch on an interface when we don't have a cache yet. LEAF_ENTRY RhpInitialInterfaceDispatch, _TEXT |