;/*
-; Copyright (C) 2013 Digia Plc. and/or its subsidiary(-ies)
+; Copyright (C) 2014 Apple Inc. All rights reserved.
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions
; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
;*/
-EXTERN cti_vm_throw : near
-PUBLIC ctiTrampoline
-PUBLIC ctiVMThrowTrampoline
-PUBLIC ctiOpThrowNotCaught
+EXTERN getHostCallReturnValueWithExecState : near
-_TEXT SEGMENT
-
-ctiTrampoline PROC
- ; Dump register parameters to their home address
- mov qword ptr[rsp+20h], r9
- mov qword ptr[rsp+18h], r8
- mov qword ptr[rsp+10h], rdx
- mov qword ptr[rsp+8h], rcx
-
- push rbp
- mov rbp, rsp
- push r12
- push r13
- push r14
- push r15
- push rbx
+PUBLIC getHostCallReturnValue
- ; Decrease rsp to point to the start of our JITStackFrame
- sub rsp, 58h
- mov r12, 512
- mov r14, 0FFFF000000000000h
- mov r15, 0FFFF000000000002h
- mov r13, r8
- call rcx
- add rsp, 58h
- pop rbx
- pop r15
- pop r14
- pop r13
- pop r12
- pop rbp
- ret
-ctiTrampoline ENDP
-
-ctiVMThrowTrampoline PROC
- mov rcx, rsp
- call cti_vm_throw
- int 3
-ctiVMThrowTrampoline ENDP
+_TEXT SEGMENT
-ctiOpThrowNotCaught PROC
- add rsp, 58h
- pop rbx
- pop r15
- pop r14
- pop r13
- pop r12
- pop rbp
+getHostCallReturnValue PROC
+ mov rcx, rbp
+ ; Allocate space for all 4 parameter registers, and align stack pointer to 16 bytes boundary by allocating another 8 bytes.
+ ; The stack alignment is needed to fix a crash in the CRT library on a floating point instruction.
+ sub rsp, 40
+ call getHostCallReturnValueWithExecState
+ add rsp, 40
ret
-ctiOpThrowNotCaught ENDP
+getHostCallReturnValue ENDP
_TEXT ENDS
-END
\ No newline at end of file
+END