Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Vorlicek <janvorli@microsoft.com>2016-08-12 03:47:07 +0300
committerJan Vorlicek <janvorli@microsoft.com>2016-08-12 03:47:07 +0300
commitbe6ba12cce4c4404729c4d4a5b462b458a36b8dc (patch)
treeaf8a94986645fbd3098714b5d7d893e620a7a77c /src/Native/Runtime/amd64
parent91a33c98269c5f06ec980c30ef79fec06fccf3ce (diff)
This fixes debugger step-in in the interface dispatch changes
[tfs-changeset: 1622102]
Diffstat (limited to 'src/Native/Runtime/amd64')
-rw-r--r--src/Native/Runtime/amd64/StubDispatch.asm23
-rw-r--r--src/Native/Runtime/amd64/UniversalTransition.asm16
2 files changed, 35 insertions, 4 deletions
diff --git a/src/Native/Runtime/amd64/StubDispatch.asm b/src/Native/Runtime/amd64/StubDispatch.asm
index b81a35ce4..83ab0a6f1 100644
--- a/src/Native/Runtime/amd64/StubDispatch.asm
+++ b/src/Native/Runtime/amd64/StubDispatch.asm
@@ -7,7 +7,12 @@ include AsmMacros.inc
ifdef FEATURE_CACHED_INTERFACE_DISPATCH
+ifdef LEGACY_INTERFACE_DISPATCH
EXTERN RhpResolveInterfaceMethodCacheMiss : PROC
+endif ;; LEGACY_INTERFACE_DISPATCH
+
+EXTERN RhpCidResolve : PROC
+EXTERN RhpUniversalTransition_DebugStepTailCall : PROC
;; Macro that generates code to check a single cache entry.
@@ -75,6 +80,22 @@ ALTERNATE_ENTRY RhpInitialDynamicInterfaceDispatch
LEAF_END RhpInitialInterfaceDispatch, _TEXT
+ifndef LEGACY_INTERFACE_DISPATCH
+;; Cache miss case, call the runtime to resolve the target and update the cache.
+;; Use universal transition helper to allow an exception to flow out of resolution
+LEAF_ENTRY RhpInterfaceDispatchSlow, _TEXT
+ ;; r10 contains indirection cell address, move to r11 where it will be passed by
+ ;; the universal transition thunk as an argument to RhpCidResolve
+ mov r11, r10
+ lea r10, RhpCidResolve
+ jmp RhpUniversalTransition_DebugStepTailCall
+EXTERN RhpCidResolve : PROC
+
+LEAF_END RhpInterfaceDispatchSlow, _TEXT
+endif ;; !LEGACY_INTERFACE_DISPATCH
+
+ifdef LEGACY_INTERFACE_DISPATCH
+;; CORE_RT code, which uses legacy RhpResolveInterfaceCacheMissFunction
;; Cache miss case, call the runtime to resolve the target and update the cache.
NESTED_ENTRY RhpInterfaceDispatchSlow, _TEXT
@@ -161,7 +182,7 @@ RIDS_ReservedStack equ 20h + 60h + 40h + 8h ;; Scratch space, transition fra
add rsp, RIDS_ReservedStack
TAILJMP_RAX
NESTED_END RhpInterfaceDispatchSlow, _TEXT
-
+endif ;; LEGACY_INTERFACE_DISPATCH
diff --git a/src/Native/Runtime/amd64/UniversalTransition.asm b/src/Native/Runtime/amd64/UniversalTransition.asm
index f2639c7c6..ecc413e77 100644
--- a/src/Native/Runtime/amd64/UniversalTransition.asm
+++ b/src/Native/Runtime/amd64/UniversalTransition.asm
@@ -85,7 +85,9 @@ DISTANCE_FROM_CHILDSP_TO_CALLERSP equ DISTANCE_FROM_CHILDSP_TO_RET
; everything between the base of the ReturnBlock and the top of the StackPassedArgs.
;
-NESTED_ENTRY RhpUniversalTransition, _TEXT
+UNIVERSAL_TRANSITION macro FunctionName
+
+NESTED_ENTRY Rhp&FunctionName, _TEXT
alloc_stack DISTANCE_FROM_CHILDSP_TO_RETADDR
@@ -124,7 +126,7 @@ endif ; TRASH_SAVED_ARGUMENT_REGISTERS
mov rdx, r11
lea rcx, [rsp + DISTANCE_FROM_CHILDSP_TO_RETURN_BLOCK]
call r10
-LABELED_RETURN_ADDRESS ReturnFromUniversalTransition
+LABELED_RETURN_ADDRESS ReturnFrom&FunctionName
; restore fp argument registers
movdqa xmm0, [rsp + DISTANCE_FROM_CHILDSP_TO_FP_REGS ]
@@ -146,8 +148,16 @@ LABELED_RETURN_ADDRESS ReturnFromUniversalTransition
TAILJMP_RAX
-NESTED_END RhpUniversalTransition, _TEXT
+NESTED_END Rhp&FunctionName, _TEXT
+
+ endm
+ ; To enable proper step-in behavior in the debugger, we need to have two instances
+ ; of the thunk. For the first one, the debugger steps into the call in the function,
+ ; for the other, it steps over it.
+ UNIVERSAL_TRANSITION UniversalTransition
+ UNIVERSAL_TRANSITION UniversalTransition_DebugStepTailCall
+
endif
end