Skip to content

Commit 47d02a8

Browse files
committed
Differentiate for the fourth argument on x64 Windows and Unix
- %r9 for Windows - %rcx for Unix
1 parent c04b080 commit 47d02a8

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

objc_msgSend.x86-64.S

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
# define FIRST_ARGUMENT %rcx
88
# define SECOND_ARGUMENT %rdx
99
# define THIRD_ARGUMENT %r8
10+
# define FOURTH_ARGUMENT %r9
1011
#else
1112
# define START_PROC(x) .cfi_startproc
1213
# define END_PROC(x) .cfi_endproc
@@ -15,6 +16,7 @@
1516
# define FIRST_ARGUMENT %rdi
1617
# define SECOND_ARGUMENT %rsi
1718
# define THIRD_ARGUMENT %rdx
19+
# define FOURTH_ARGUMENT %rcx
1820
#endif
1921

2022
.macro MSGSEND fnname receiver, sel
@@ -209,7 +211,7 @@
209211
5: # slowSend:
210212
push %rax # We need to preserve all registers that may contain arguments:
211213
push %rbx
212-
push %rcx
214+
push FOURTH_ARGUMENT
213215
push %r8
214216
push %r9
215217

@@ -258,7 +260,7 @@
258260

259261
pop %r9
260262
pop %r8
261-
pop %rcx
263+
pop FOURTH_ARGUMENT
262264
pop %rbx
263265
pop %rax
264266
jmp 7b

0 commit comments

Comments
 (0)