diff options
author | Jan Kotas <jkotas@microsoft.com> | 2016-06-20 21:25:39 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2016-06-20 21:25:39 +0300 |
commit | ca5ecca0b6335cee40bb1eae7ce53ea95548b309 (patch) | |
tree | fdd8f9d42968969c69856f022f91bd52712603a7 /src/Native/Runtime/i386 | |
parent | 579e324be4d0b25436ad895f180bcaef7f0d66b9 (diff) |
Cleanup RhExceptionHandling_ functions
Now that nutc generated code does not use them anymore, it is possible to cleanup RhExceptionHandling_ functions to not depend on GetReturnAddress intrinsic.
The binder generate wrappers around checked math helpers were calling RhExceptionHandling_ methods as well. I have changed these checked math helpers to be implemented in C# instead of using the wrappers. It makes them faster (e.g. checked multiplication is 20% faster on x86 now).
[tfs-changeset: 1613638]
Diffstat (limited to 'src/Native/Runtime/i386')
-rw-r--r-- | src/Native/Runtime/i386/DivModHelpers.asm | 10 | ||||
-rw-r--r-- | src/Native/Runtime/i386/MiscStubs.asm | 22 |
2 files changed, 6 insertions, 26 deletions
diff --git a/src/Native/Runtime/i386/DivModHelpers.asm b/src/Native/Runtime/i386/DivModHelpers.asm index 67e40ccf6..91229c26e 100644 --- a/src/Native/Runtime/i386/DivModHelpers.asm +++ b/src/Native/Runtime/i386/DivModHelpers.asm @@ -73,16 +73,18 @@ FASTCALL_ENDFUNC ;; make it look like the managed code called this directly ;; by popping the parameters and putting the return address in the proper place ThrowClasslibOverflowException proc - pop eax + pop ecx add esp,16 - push eax + push ecx + ;; passing return address in ecx jmp RhExceptionHandling_ThrowClasslibOverflowException ThrowClasslibOverflowException endp ThrowClasslibDivideByZeroException proc - pop eax + pop ecx add esp,16 - push eax + push ecx + ;; passing return address in ecx jmp RhExceptionHandling_ThrowClasslibDivideByZeroException ThrowClasslibDivideByZeroException endp diff --git a/src/Native/Runtime/i386/MiscStubs.asm b/src/Native/Runtime/i386/MiscStubs.asm index a6a355bca..62b3c9020 100644 --- a/src/Native/Runtime/i386/MiscStubs.asm +++ b/src/Native/Runtime/i386/MiscStubs.asm @@ -98,28 +98,6 @@ RhpCheckCctor2__SlowPath: FASTCALL_ENDFUNC -;; -;; Input: -;; ecx: address of location on stack containing return address. -;; -;; Outpt: -;; eax: proper (unhijacked) return address -;; -;; Trashes: ecx, edx -;; -FASTCALL_FUNC RhpLoadReturnAddress, 0 - - INLINE_GETTHREAD eax, edx - cmp ecx, [eax + OFFSETOF__Thread__m_ppvHijackedReturnAddressLocation] - je GetHijackedReturnAddress - mov eax, [ecx] - ret - -GetHijackedReturnAddress: - mov eax, [eax + OFFSETOF__Thread__m_pvHijackedReturnAddress] - ret - -FASTCALL_ENDFUNC ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; |