2 * Copyright (C) 2011, 2015 Apple Inc. All rights reserved.
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution.
13 * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 #ifndef CCallHelpers_h
27 #define CCallHelpers_h
31 #include "AssemblyHelpers.h"
36 #if CPU(MIPS) || (OS(WINDOWS) && CPU(X86_64))
37 #define POKE_ARGUMENT_OFFSET 4
39 #define POKE_ARGUMENT_OFFSET 0
42 class CCallHelpers
: public AssemblyHelpers
{
44 CCallHelpers(VM
* vm
, CodeBlock
* codeBlock
= 0)
45 : AssemblyHelpers(vm
, codeBlock
)
49 // The most general helper for setting arguments that fit in a GPR, if you can compute each
50 // argument without using any argument registers. You usually want one of the setupArguments*()
51 // methods below instead of this. This thing is most useful if you have *a lot* of arguments.
52 template<typename Functor
>
53 void setupArgument(unsigned argumentIndex
, const Functor
& functor
)
55 unsigned numberOfRegs
= GPRInfo::numberOfArgumentRegisters
; // Disguise the constant from clang's tautological compare warning.
56 if (argumentIndex
< numberOfRegs
) {
57 functor(GPRInfo::toArgumentRegister(argumentIndex
));
61 functor(GPRInfo::nonArgGPR0
);
62 poke(GPRInfo::nonArgGPR0
, POKE_ARGUMENT_OFFSET
+ argumentIndex
- GPRInfo::numberOfArgumentRegisters
);
65 // These methods used to sort arguments into the correct registers.
66 // On X86 we use cdecl calling conventions, which pass all arguments on the
67 // stack. On other architectures we may need to sort values into the
69 #if !NUMBER_OF_ARGUMENT_REGISTERS
70 unsigned m_callArgumentOffset
;
71 void resetCallArguments() { m_callArgumentOffset
= 0; }
73 // These methods are using internally to implement the callOperation methods.
74 void addCallArgument(GPRReg value
)
76 poke(value
, m_callArgumentOffset
++);
78 void addCallArgument(TrustedImm32 imm
)
80 poke(imm
, m_callArgumentOffset
++);
82 void addCallArgument(TrustedImmPtr pointer
)
84 poke(pointer
, m_callArgumentOffset
++);
86 void addCallArgument(FPRReg value
)
88 storeDouble(value
, Address(stackPointerRegister
, m_callArgumentOffset
* sizeof(void*)));
89 m_callArgumentOffset
+= sizeof(double) / sizeof(void*);
92 ALWAYS_INLINE
void setupArguments(FPRReg arg1
)
95 addCallArgument(arg1
);
98 ALWAYS_INLINE
void setupArguments(FPRReg arg1
, FPRReg arg2
)
100 resetCallArguments();
101 addCallArgument(arg1
);
102 addCallArgument(arg2
);
105 ALWAYS_INLINE
void setupArguments(GPRReg arg1
)
107 resetCallArguments();
108 addCallArgument(arg1
);
111 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
)
113 resetCallArguments();
114 addCallArgument(arg1
);
115 addCallArgument(arg2
);
118 ALWAYS_INLINE
void setupArguments(TrustedImmPtr arg1
, GPRReg arg2
)
120 resetCallArguments();
121 addCallArgument(arg1
);
122 addCallArgument(arg2
);
125 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
)
127 resetCallArguments();
128 addCallArgument(arg1
);
129 addCallArgument(arg2
);
130 addCallArgument(arg3
);
133 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
, TrustedImmPtr arg4
)
135 resetCallArguments();
136 addCallArgument(arg1
);
137 addCallArgument(arg2
);
138 addCallArgument(arg3
);
139 addCallArgument(arg4
);
142 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
, TrustedImm32 arg4
, GPRReg arg5
)
144 resetCallArguments();
145 addCallArgument(arg1
);
146 addCallArgument(arg2
);
147 addCallArgument(arg3
);
148 addCallArgument(arg4
);
149 addCallArgument(arg5
);
152 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
, TrustedImm32 arg4
, GPRReg arg5
, GPRReg arg6
)
154 resetCallArguments();
155 addCallArgument(arg1
);
156 addCallArgument(arg2
);
157 addCallArgument(arg3
);
158 addCallArgument(arg4
);
159 addCallArgument(arg5
);
160 addCallArgument(arg6
);
163 ALWAYS_INLINE
void setupArguments(TrustedImmPtr arg1
)
165 resetCallArguments();
166 addCallArgument(arg1
);
169 ALWAYS_INLINE
void setupArgumentsExecState()
171 resetCallArguments();
172 addCallArgument(GPRInfo::callFrameRegister
);
175 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
)
177 resetCallArguments();
178 addCallArgument(GPRInfo::callFrameRegister
);
179 addCallArgument(arg1
);
182 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
)
184 resetCallArguments();
185 addCallArgument(GPRInfo::callFrameRegister
);
186 addCallArgument(arg1
);
189 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
)
191 resetCallArguments();
192 addCallArgument(GPRInfo::callFrameRegister
);
193 addCallArgument(arg1
);
196 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
)
198 resetCallArguments();
199 addCallArgument(GPRInfo::callFrameRegister
);
200 addCallArgument(arg1
);
201 addCallArgument(arg2
);
204 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
)
206 resetCallArguments();
207 addCallArgument(GPRInfo::callFrameRegister
);
208 addCallArgument(arg1
);
209 addCallArgument(arg2
);
212 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImm32 arg2
)
214 resetCallArguments();
215 addCallArgument(GPRInfo::callFrameRegister
);
216 addCallArgument(arg1
);
217 addCallArgument(arg2
);
220 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
)
222 resetCallArguments();
223 addCallArgument(GPRInfo::callFrameRegister
);
224 addCallArgument(arg1
);
225 addCallArgument(arg2
);
228 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
)
230 resetCallArguments();
231 addCallArgument(GPRInfo::callFrameRegister
);
232 addCallArgument(arg1
);
233 addCallArgument(arg2
);
236 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImm32 arg2
)
238 resetCallArguments();
239 addCallArgument(GPRInfo::callFrameRegister
);
240 addCallArgument(arg1
);
241 addCallArgument(arg2
);
244 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImmPtr arg2
)
246 resetCallArguments();
247 addCallArgument(GPRInfo::callFrameRegister
);
248 addCallArgument(arg1
);
249 addCallArgument(arg2
);
252 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImm32 arg2
)
254 resetCallArguments();
255 addCallArgument(GPRInfo::callFrameRegister
);
256 addCallArgument(arg1
);
257 addCallArgument(arg2
);
260 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImm32 arg2
, TrustedImm32 arg3
)
262 resetCallArguments();
263 addCallArgument(GPRInfo::callFrameRegister
);
264 addCallArgument(arg1
);
265 addCallArgument(arg2
);
266 addCallArgument(arg3
);
269 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
)
271 resetCallArguments();
272 addCallArgument(GPRInfo::callFrameRegister
);
273 addCallArgument(arg1
);
274 addCallArgument(arg2
);
275 addCallArgument(arg3
);
278 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
)
280 resetCallArguments();
281 addCallArgument(GPRInfo::callFrameRegister
);
282 addCallArgument(arg1
);
283 addCallArgument(arg2
);
284 addCallArgument(arg3
);
287 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
)
289 resetCallArguments();
290 addCallArgument(GPRInfo::callFrameRegister
);
291 addCallArgument(arg1
);
292 addCallArgument(arg2
);
293 addCallArgument(arg3
);
296 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImm32 arg2
, GPRReg arg3
)
298 resetCallArguments();
299 addCallArgument(GPRInfo::callFrameRegister
);
300 addCallArgument(arg1
);
301 addCallArgument(arg2
);
302 addCallArgument(arg3
);
305 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, GPRReg arg3
)
307 resetCallArguments();
308 addCallArgument(GPRInfo::callFrameRegister
);
309 addCallArgument(arg1
);
310 addCallArgument(arg2
);
311 addCallArgument(arg3
);
314 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImm32 arg2
, TrustedImmPtr arg3
)
316 resetCallArguments();
317 addCallArgument(GPRInfo::callFrameRegister
);
318 addCallArgument(arg1
);
319 addCallArgument(arg2
);
320 addCallArgument(arg3
);
323 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImm32 arg2
, TrustedImm32 arg3
)
325 resetCallArguments();
326 addCallArgument(GPRInfo::callFrameRegister
);
327 addCallArgument(arg1
);
328 addCallArgument(arg2
);
329 addCallArgument(arg3
);
332 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
)
334 resetCallArguments();
335 addCallArgument(GPRInfo::callFrameRegister
);
336 addCallArgument(arg1
);
337 addCallArgument(arg2
);
338 addCallArgument(arg3
);
341 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, TrustedImm32 arg5
)
343 resetCallArguments();
344 addCallArgument(GPRInfo::callFrameRegister
);
345 addCallArgument(arg1
);
346 addCallArgument(arg2
);
347 addCallArgument(arg3
);
348 addCallArgument(arg4
);
349 addCallArgument(arg5
);
352 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, GPRReg arg5
, TrustedImm32 arg6
)
354 resetCallArguments();
355 addCallArgument(GPRInfo::callFrameRegister
);
356 addCallArgument(arg1
);
357 addCallArgument(arg2
);
358 addCallArgument(arg3
);
359 addCallArgument(arg4
);
360 addCallArgument(arg5
);
361 addCallArgument(arg6
);
364 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
)
366 resetCallArguments();
367 addCallArgument(GPRInfo::callFrameRegister
);
368 addCallArgument(arg1
);
369 addCallArgument(arg2
);
370 addCallArgument(arg3
);
373 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImm32 arg3
)
375 resetCallArguments();
376 addCallArgument(GPRInfo::callFrameRegister
);
377 addCallArgument(arg1
);
378 addCallArgument(arg2
);
379 addCallArgument(arg3
);
382 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImmPtr arg3
)
384 resetCallArguments();
385 addCallArgument(GPRInfo::callFrameRegister
);
386 addCallArgument(arg1
);
387 addCallArgument(arg2
);
388 addCallArgument(arg3
);
391 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
)
393 resetCallArguments();
394 addCallArgument(GPRInfo::callFrameRegister
);
395 addCallArgument(arg1
);
396 addCallArgument(arg2
);
397 addCallArgument(arg3
);
400 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImmPtr arg2
, TrustedImmPtr arg3
)
402 resetCallArguments();
403 addCallArgument(GPRInfo::callFrameRegister
);
404 addCallArgument(arg1
);
405 addCallArgument(arg2
);
406 addCallArgument(arg3
);
409 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, TrustedImmPtr arg3
)
411 resetCallArguments();
412 addCallArgument(GPRInfo::callFrameRegister
);
413 addCallArgument(arg1
);
414 addCallArgument(arg2
);
415 addCallArgument(arg3
);
418 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
, GPRReg arg4
)
420 resetCallArguments();
421 addCallArgument(GPRInfo::callFrameRegister
);
422 addCallArgument(arg1
);
423 addCallArgument(arg2
);
424 addCallArgument(arg3
);
425 addCallArgument(arg4
);
428 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImm32 arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
430 resetCallArguments();
431 addCallArgument(GPRInfo::callFrameRegister
);
432 addCallArgument(arg1
);
433 addCallArgument(arg2
);
434 addCallArgument(arg3
);
435 addCallArgument(arg4
);
438 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImmPtr arg4
)
440 resetCallArguments();
441 addCallArgument(GPRInfo::callFrameRegister
);
442 addCallArgument(arg1
);
443 addCallArgument(arg2
);
444 addCallArgument(arg3
);
445 addCallArgument(arg4
);
448 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
)
450 resetCallArguments();
451 addCallArgument(GPRInfo::callFrameRegister
);
452 addCallArgument(arg1
);
453 addCallArgument(arg2
);
454 addCallArgument(arg3
);
455 addCallArgument(arg4
);
456 addCallArgument(arg5
);
459 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
)
461 resetCallArguments();
462 addCallArgument(GPRInfo::callFrameRegister
);
463 addCallArgument(arg1
);
464 addCallArgument(arg2
);
465 addCallArgument(arg3
);
466 addCallArgument(arg4
);
467 addCallArgument(arg5
);
470 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, GPRReg arg3
, GPRReg arg4
)
472 resetCallArguments();
473 addCallArgument(GPRInfo::callFrameRegister
);
474 addCallArgument(arg1
);
475 addCallArgument(arg2
);
476 addCallArgument(arg3
);
477 addCallArgument(arg4
);
480 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImm32 arg5
)
482 resetCallArguments();
483 addCallArgument(GPRInfo::callFrameRegister
);
484 addCallArgument(arg1
);
485 addCallArgument(arg2
);
486 addCallArgument(arg3
);
487 addCallArgument(arg4
);
488 addCallArgument(arg5
);
491 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
)
493 resetCallArguments();
494 addCallArgument(GPRInfo::callFrameRegister
);
495 addCallArgument(arg1
);
496 addCallArgument(arg2
);
497 addCallArgument(arg3
);
498 addCallArgument(arg4
);
501 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
)
503 resetCallArguments();
504 addCallArgument(GPRInfo::callFrameRegister
);
505 addCallArgument(arg1
);
506 addCallArgument(arg2
);
507 addCallArgument(arg3
);
508 addCallArgument(arg4
);
511 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, GPRReg arg5
)
513 resetCallArguments();
514 addCallArgument(GPRInfo::callFrameRegister
);
515 addCallArgument(arg1
);
516 addCallArgument(arg2
);
517 addCallArgument(arg3
);
518 addCallArgument(arg4
);
519 addCallArgument(arg5
);
522 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, GPRReg arg3
)
524 resetCallArguments();
525 addCallArgument(GPRInfo::callFrameRegister
);
526 addCallArgument(arg1
);
527 addCallArgument(arg2
);
528 addCallArgument(arg3
);
531 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
533 resetCallArguments();
534 addCallArgument(GPRInfo::callFrameRegister
);
535 addCallArgument(arg1
);
536 addCallArgument(arg2
);
537 addCallArgument(arg3
);
538 addCallArgument(arg4
);
541 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImm32 arg4
)
543 resetCallArguments();
544 addCallArgument(GPRInfo::callFrameRegister
);
545 addCallArgument(arg1
);
546 addCallArgument(arg2
);
547 addCallArgument(arg3
);
548 addCallArgument(arg4
);
551 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
)
553 resetCallArguments();
554 addCallArgument(GPRInfo::callFrameRegister
);
555 addCallArgument(arg1
);
556 addCallArgument(arg2
);
557 addCallArgument(arg3
);
558 addCallArgument(arg4
);
561 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImm32 arg2
, GPRReg arg3
, GPRReg arg4
)
563 resetCallArguments();
564 addCallArgument(GPRInfo::callFrameRegister
);
565 addCallArgument(arg1
);
566 addCallArgument(arg2
);
567 addCallArgument(arg3
);
568 addCallArgument(arg4
);
571 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
)
573 resetCallArguments();
574 addCallArgument(GPRInfo::callFrameRegister
);
575 addCallArgument(arg1
);
576 addCallArgument(arg2
);
577 addCallArgument(arg3
);
578 addCallArgument(arg4
);
581 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImm32 arg5
)
583 resetCallArguments();
584 addCallArgument(GPRInfo::callFrameRegister
);
585 addCallArgument(arg1
);
586 addCallArgument(arg2
);
587 addCallArgument(arg3
);
588 addCallArgument(arg4
);
589 addCallArgument(arg5
);
592 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImmPtr arg5
)
594 resetCallArguments();
595 addCallArgument(GPRInfo::callFrameRegister
);
596 addCallArgument(arg1
);
597 addCallArgument(arg2
);
598 addCallArgument(arg3
);
599 addCallArgument(arg4
);
600 addCallArgument(arg5
);
603 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, TrustedImmPtr arg6
)
605 resetCallArguments();
606 addCallArgument(GPRInfo::callFrameRegister
);
607 addCallArgument(arg1
);
608 addCallArgument(arg2
);
609 addCallArgument(arg3
);
610 addCallArgument(arg4
);
611 addCallArgument(arg5
);
612 addCallArgument(arg6
);
615 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImm32 arg5
, TrustedImmPtr arg6
)
617 resetCallArguments();
618 addCallArgument(GPRInfo::callFrameRegister
);
619 addCallArgument(arg1
);
620 addCallArgument(arg2
);
621 addCallArgument(arg3
);
622 addCallArgument(arg4
);
623 addCallArgument(arg5
);
624 addCallArgument(arg6
);
627 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
629 resetCallArguments();
630 addCallArgument(GPRInfo::callFrameRegister
);
631 addCallArgument(arg1
);
632 addCallArgument(arg2
);
633 addCallArgument(arg3
);
634 addCallArgument(arg4
);
637 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImmPtr arg4
)
639 resetCallArguments();
640 addCallArgument(GPRInfo::callFrameRegister
);
641 addCallArgument(arg1
);
642 addCallArgument(arg2
);
643 addCallArgument(arg3
);
644 addCallArgument(arg4
);
647 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, GPRReg arg3
, GPRReg arg4
)
649 resetCallArguments();
650 addCallArgument(GPRInfo::callFrameRegister
);
651 addCallArgument(arg1
);
652 addCallArgument(arg2
);
653 addCallArgument(arg3
);
654 addCallArgument(arg4
);
657 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
)
659 resetCallArguments();
660 addCallArgument(GPRInfo::callFrameRegister
);
661 addCallArgument(arg1
);
662 addCallArgument(arg2
);
663 addCallArgument(arg3
);
664 addCallArgument(arg4
);
665 addCallArgument(arg5
);
668 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
)
670 resetCallArguments();
671 addCallArgument(GPRInfo::callFrameRegister
);
672 addCallArgument(arg1
);
673 addCallArgument(arg2
);
674 addCallArgument(arg3
);
675 addCallArgument(arg4
);
676 addCallArgument(arg5
);
679 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImmPtr arg5
)
681 resetCallArguments();
682 addCallArgument(GPRInfo::callFrameRegister
);
683 addCallArgument(arg1
);
684 addCallArgument(arg2
);
685 addCallArgument(arg3
);
686 addCallArgument(arg4
);
687 addCallArgument(arg5
);
690 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImmPtr arg5
)
692 resetCallArguments();
693 addCallArgument(GPRInfo::callFrameRegister
);
694 addCallArgument(arg1
);
695 addCallArgument(arg2
);
696 addCallArgument(arg3
);
697 addCallArgument(arg4
);
698 addCallArgument(arg5
);
701 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImm32 arg5
)
703 resetCallArguments();
704 addCallArgument(GPRInfo::callFrameRegister
);
705 addCallArgument(arg1
);
706 addCallArgument(arg2
);
707 addCallArgument(arg3
);
708 addCallArgument(arg4
);
709 addCallArgument(arg5
);
712 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, GPRReg arg6
)
714 resetCallArguments();
715 addCallArgument(GPRInfo::callFrameRegister
);
716 addCallArgument(arg1
);
717 addCallArgument(arg2
);
718 addCallArgument(arg3
);
719 addCallArgument(arg4
);
720 addCallArgument(arg5
);
721 addCallArgument(arg6
);
725 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, TrustedImm32 arg6
)
727 resetCallArguments();
728 addCallArgument(GPRInfo::callFrameRegister
);
729 addCallArgument(arg1
);
730 addCallArgument(arg2
);
731 addCallArgument(arg3
);
732 addCallArgument(arg4
);
733 addCallArgument(arg5
);
734 addCallArgument(arg6
);
737 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, GPRReg arg6
, TrustedImmPtr arg7
)
739 resetCallArguments();
740 addCallArgument(GPRInfo::callFrameRegister
);
741 addCallArgument(arg1
);
742 addCallArgument(arg2
);
743 addCallArgument(arg3
);
744 addCallArgument(arg4
);
745 addCallArgument(arg5
);
746 addCallArgument(arg6
);
747 addCallArgument(arg7
);
750 ALWAYS_INLINE
void setupArgumentsWithExecState(FPRReg arg1
, GPRReg arg2
)
752 resetCallArguments();
753 addCallArgument(GPRInfo::callFrameRegister
);
754 addCallArgument(arg1
);
755 addCallArgument(arg2
);
758 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, FPRReg arg3
)
760 resetCallArguments();
761 addCallArgument(GPRInfo::callFrameRegister
);
762 addCallArgument(arg1
);
763 addCallArgument(arg2
);
764 addCallArgument(arg3
);
766 #endif // !NUMBER_OF_ARGUMENT_REGISTERS
767 // These methods are suitable for any calling convention that provides for
768 // at least 4 argument registers, e.g. X86_64, ARMv7.
769 #if NUMBER_OF_ARGUMENT_REGISTERS >= 4
770 template<GPRReg destA
, GPRReg destB
>
771 void setupTwoStubArgsGPR(GPRReg srcA
, GPRReg srcB
)
773 // Assuming that srcA != srcB, there are 7 interesting states the registers may be in:
774 // (1) both are already in arg regs, the right way around.
775 // (2) both are already in arg regs, the wrong way around.
776 // (3) neither are currently in arg registers.
777 // (4) srcA in in its correct reg.
778 // (5) srcA in in the incorrect reg.
779 // (6) srcB in in its correct reg.
780 // (7) srcB in in the incorrect reg.
782 // The trivial approach is to simply emit two moves, to put srcA in place then srcB in
783 // place (the MacroAssembler will omit redundant moves). This apporach will be safe in
784 // cases 1, 3, 4, 5, 6, and in cases where srcA==srcB. The two problem cases are 2
785 // (requires a swap) and 7 (must move srcB first, to avoid trampling.)
788 // Handle the easy cases - two simple moves.
791 } else if (srcA
!= destB
) {
792 // Handle the non-swap case - just put srcB in place first.
799 template<GPRReg destA
, GPRReg destB
, GPRReg destC
>
800 void setupThreeStubArgsGPR(GPRReg srcA
, GPRReg srcB
, GPRReg srcC
)
802 // If neither of srcB/srcC are in our way, then we can move srcA into place.
803 // Then we can use setupTwoStubArgs to fix srcB/srcC.
804 if (srcB
!= destA
&& srcC
!= destA
) {
806 setupTwoStubArgsGPR
<destB
, destC
>(srcB
, srcC
);
810 // If neither of srcA/srcC are in our way, then we can move srcB into place.
811 // Then we can use setupTwoStubArgs to fix srcA/srcC.
812 if (srcA
!= destB
&& srcC
!= destB
) {
814 setupTwoStubArgsGPR
<destA
, destC
>(srcA
, srcC
);
818 // If neither of srcA/srcB are in our way, then we can move srcC into place.
819 // Then we can use setupTwoStubArgs to fix srcA/srcB.
820 if (srcA
!= destC
&& srcB
!= destC
) {
822 setupTwoStubArgsGPR
<destA
, destB
>(srcA
, srcB
);
826 // If we get here, we haven't been able to move any of srcA/srcB/srcC.
827 // Since all three are blocked, then all three must already be in the argument register.
828 // But are they in the right ones?
830 // First, ensure srcA is in place.
834 // If srcA wasn't in argumentGPR1, one of srcB/srcC must be.
835 ASSERT(srcB
== destA
|| srcC
== destA
);
836 // If srcB was in argumentGPR1 it no longer is (due to the swap).
837 // Otherwise srcC must have been. Mark him as moved.
844 // Either srcB & srcC need swapping, or we're all done.
845 ASSERT((srcB
== destB
|| srcC
== destC
)
846 || (srcB
== destC
|| srcC
== destB
));
852 #if CPU(X86_64) || CPU(ARM64)
853 template<FPRReg destA
, FPRReg destB
>
854 void setupTwoStubArgsFPR(FPRReg srcA
, FPRReg srcB
)
856 // Assuming that srcA != srcB, there are 7 interesting states the registers may be in:
857 // (1) both are already in arg regs, the right way around.
858 // (2) both are already in arg regs, the wrong way around.
859 // (3) neither are currently in arg registers.
860 // (4) srcA in in its correct reg.
861 // (5) srcA in in the incorrect reg.
862 // (6) srcB in in its correct reg.
863 // (7) srcB in in the incorrect reg.
865 // The trivial approach is to simply emit two moves, to put srcA in place then srcB in
866 // place (the MacroAssembler will omit redundant moves). This apporach will be safe in
867 // cases 1, 3, 4, 5, 6, and in cases where srcA==srcB. The two problem cases are 2
868 // (requires a swap) and 7 (must move srcB first, to avoid trampling.)
871 // Handle the easy cases - two simple moves.
872 moveDouble(srcA
, destA
);
873 moveDouble(srcB
, destB
);
878 // Handle the non-swap case - just put srcB in place first.
879 moveDouble(srcB
, destB
);
880 moveDouble(srcA
, destA
);
884 ASSERT(srcB
== destA
&& srcA
== destB
);
885 // Need to swap; pick a temporary register.
887 if (destA
!= FPRInfo::argumentFPR3
&& destA
!= FPRInfo::argumentFPR3
)
888 temp
= FPRInfo::argumentFPR3
;
889 else if (destA
!= FPRInfo::argumentFPR2
&& destA
!= FPRInfo::argumentFPR2
)
890 temp
= FPRInfo::argumentFPR2
;
892 ASSERT(destA
!= FPRInfo::argumentFPR1
&& destA
!= FPRInfo::argumentFPR1
);
893 temp
= FPRInfo::argumentFPR1
;
895 moveDouble(destA
, temp
);
896 moveDouble(destB
, destA
);
897 moveDouble(temp
, destB
);
900 void setupStubArguments(GPRReg arg1
, GPRReg arg2
)
902 setupTwoStubArgsGPR
<GPRInfo::argumentGPR1
, GPRInfo::argumentGPR2
>(arg1
, arg2
);
905 void setupStubArguments(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
)
907 setupThreeStubArgsGPR
<GPRInfo::argumentGPR1
, GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
>(arg1
, arg2
, arg3
);
910 #if CPU(X86_64) || CPU(ARM64)
911 ALWAYS_INLINE
void setupArguments(FPRReg arg1
)
913 moveDouble(arg1
, FPRInfo::argumentFPR0
);
916 ALWAYS_INLINE
void setupArguments(FPRReg arg1
, FPRReg arg2
)
918 setupTwoStubArgsFPR
<FPRInfo::argumentFPR0
, FPRInfo::argumentFPR1
>(arg1
, arg2
);
921 ALWAYS_INLINE
void setupArgumentsWithExecState(FPRReg arg1
, GPRReg arg2
)
923 #if OS(WINDOWS) && CPU(X86_64)
924 // On Windows, arguments map to designated registers based on the argument positions, even when there are interlaced scalar and floating point arguments.
925 // See http://msdn.microsoft.com/en-us/library/zthk2dkh.aspx
926 moveDouble(arg1
, FPRInfo::argumentFPR1
);
927 move(arg2
, GPRInfo::argumentGPR2
);
929 moveDouble(arg1
, FPRInfo::argumentFPR0
);
930 move(arg2
, GPRInfo::argumentGPR1
);
932 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
935 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, FPRReg arg3
)
937 #if OS(WINDOWS) && CPU(X86_64)
938 // On Windows, arguments map to designated registers based on the argument positions, even when there are interlaced scalar and floating point arguments.
939 // See http://msdn.microsoft.com/en-us/library/zthk2dkh.aspx
940 moveDouble(arg3
, FPRInfo::argumentFPR3
);
942 moveDouble(arg3
, FPRInfo::argumentFPR0
);
944 setupStubArguments(arg1
, arg2
);
945 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
949 ALWAYS_INLINE
void setupArguments(FPRReg arg1
)
951 moveDouble(arg1
, FPRInfo::argumentFPR0
);
954 ALWAYS_INLINE
void setupArguments(FPRReg arg1
, FPRReg arg2
)
956 if (arg2
!= FPRInfo::argumentFPR0
) {
957 moveDouble(arg1
, FPRInfo::argumentFPR0
);
958 moveDouble(arg2
, FPRInfo::argumentFPR1
);
959 } else if (arg1
!= FPRInfo::argumentFPR1
) {
960 moveDouble(arg2
, FPRInfo::argumentFPR1
);
961 moveDouble(arg1
, FPRInfo::argumentFPR0
);
964 moveDouble(FPRInfo::argumentFPR0
, ARMRegisters::d2
);
965 moveDouble(FPRInfo::argumentFPR1
, FPRInfo::argumentFPR0
);
966 moveDouble(ARMRegisters::d2
, FPRInfo::argumentFPR1
);
970 ALWAYS_INLINE
void setupArgumentsWithExecState(FPRReg arg1
, GPRReg arg2
)
972 moveDouble(arg1
, FPRInfo::argumentFPR0
);
973 move(arg2
, GPRInfo::argumentGPR1
);
974 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
977 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, FPRReg arg3
)
979 moveDouble(arg3
, FPRInfo::argumentFPR0
);
980 setupStubArguments(arg1
, arg2
);
981 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
984 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32
, FPRReg arg2
, GPRReg arg3
)
986 moveDouble(arg2
, FPRInfo::argumentFPR0
);
987 move(arg3
, GPRInfo::argumentGPR1
);
988 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
991 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32
, FPRReg arg4
)
993 moveDouble(arg4
, FPRInfo::argumentFPR0
);
994 setupStubArguments(arg1
, arg2
);
995 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
999 ALWAYS_INLINE
void setupArguments(FPRReg arg1
)
1001 assembler().vmov(GPRInfo::argumentGPR0
, GPRInfo::argumentGPR1
, arg1
);
1004 ALWAYS_INLINE
void setupArguments(FPRReg arg1
, FPRReg arg2
)
1006 assembler().vmov(GPRInfo::argumentGPR0
, GPRInfo::argumentGPR1
, arg1
);
1007 assembler().vmov(GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
, arg2
);
1010 ALWAYS_INLINE
void setupArgumentsWithExecState(FPRReg arg1
, GPRReg arg2
)
1012 move(arg2
, GPRInfo::argumentGPR3
);
1013 assembler().vmov(GPRInfo::argumentGPR1
, GPRInfo::argumentGPR2
, arg1
);
1014 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1017 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, FPRReg arg3
)
1019 setupStubArguments(arg1
, arg2
);
1020 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1021 assembler().vmov(GPRInfo::argumentGPR3
, GPRInfo::nonArgGPR0
, arg3
);
1022 poke(GPRInfo::nonArgGPR0
);
1025 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, FPRReg arg2
, GPRReg arg3
)
1027 poke(arg3
, POKE_ARGUMENT_OFFSET
);
1028 move(arg1
, GPRInfo::argumentGPR1
);
1029 assembler().vmov(GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
, arg2
);
1030 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1033 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, FPRReg arg4
)
1035 setupStubArguments(arg1
, arg2
);
1036 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1037 move(arg3
, GPRInfo::argumentGPR3
);
1038 assembler().vmov(GPRInfo::nonArgGPR0
, GPRInfo::nonArgGPR1
, arg4
);
1039 poke(GPRInfo::nonArgGPR0
, POKE_ARGUMENT_OFFSET
);
1040 poke(GPRInfo::nonArgGPR1
, POKE_ARGUMENT_OFFSET
+ 1);
1042 #endif // CPU(ARM_HARDFP)
1044 ALWAYS_INLINE
void setupArguments(FPRReg arg1
)
1046 moveDouble(arg1
, FPRInfo::argumentFPR0
);
1049 ALWAYS_INLINE
void setupArguments(FPRReg arg1
, FPRReg arg2
)
1051 if (arg2
!= FPRInfo::argumentFPR0
) {
1052 moveDouble(arg1
, FPRInfo::argumentFPR0
);
1053 moveDouble(arg2
, FPRInfo::argumentFPR1
);
1054 } else if (arg1
!= FPRInfo::argumentFPR1
) {
1055 moveDouble(arg2
, FPRInfo::argumentFPR1
);
1056 moveDouble(arg1
, FPRInfo::argumentFPR0
);
1059 swapDouble(FPRInfo::argumentFPR0
, FPRInfo::argumentFPR1
);
1063 ALWAYS_INLINE
void setupArgumentsWithExecState(FPRReg arg1
, GPRReg arg2
)
1065 assembler().vmov(GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
, arg1
);
1066 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1070 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, FPRReg arg3
)
1072 setupStubArguments(arg1
, arg2
);
1073 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1077 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, FPRReg arg2
, GPRReg arg3
)
1079 setupArgumentsWithExecState(arg2
, arg3
);
1082 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, FPRReg arg4
)
1084 setupArgumentsWithExecState(arg1
, arg2
, arg4
);
1087 ALWAYS_INLINE
void setupArguments(FPRReg arg1
)
1089 moveDouble(arg1
, FPRInfo::argumentFPR0
);
1092 ALWAYS_INLINE
void setupArguments(FPRReg arg1
, FPRReg arg2
)
1094 if (arg2
!= FPRInfo::argumentFPR0
) {
1095 moveDouble(arg1
, FPRInfo::argumentFPR0
);
1096 moveDouble(arg2
, FPRInfo::argumentFPR1
);
1097 } else if (arg1
!= FPRInfo::argumentFPR1
) {
1098 moveDouble(arg2
, FPRInfo::argumentFPR1
);
1099 moveDouble(arg1
, FPRInfo::argumentFPR0
);
1101 swapDouble(FPRInfo::argumentFPR0
, FPRInfo::argumentFPR1
);
1104 ALWAYS_INLINE
void setupArgumentsWithExecState(FPRReg arg1
, GPRReg arg2
)
1106 moveDouble(arg1
, FPRInfo::argumentFPR0
);
1107 move(arg2
, GPRInfo::argumentGPR1
);
1108 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1111 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, FPRReg arg3
)
1113 moveDouble(arg3
, FPRInfo::argumentFPR0
);
1114 setupStubArguments(arg1
, arg2
);
1115 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1118 #error "JIT not supported on this platform."
1121 ALWAYS_INLINE
void setupArguments(GPRReg arg1
)
1123 move(arg1
, GPRInfo::argumentGPR0
);
1126 ALWAYS_INLINE
void setupArguments(TrustedImmPtr arg1
, GPRReg arg2
)
1128 move(arg2
, GPRInfo::argumentGPR1
);
1129 move(arg1
, GPRInfo::argumentGPR0
);
1132 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
)
1134 setupTwoStubArgsGPR
<GPRInfo::argumentGPR0
, GPRInfo::argumentGPR1
>(arg1
, arg2
);
1137 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
)
1139 setupThreeStubArgsGPR
<GPRInfo::argumentGPR0
, GPRInfo::argumentGPR1
, GPRInfo::argumentGPR2
>(arg1
, arg2
, arg3
);
1142 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
, TrustedImmPtr arg4
)
1144 setupTwoStubArgsGPR
<GPRInfo::argumentGPR0
, GPRInfo::argumentGPR1
>(arg1
, arg2
);
1145 move(arg3
, GPRInfo::argumentGPR2
);
1146 move(arg4
, GPRInfo::argumentGPR3
);
1149 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
1151 setupThreeStubArgsGPR
<GPRInfo::argumentGPR0
, GPRInfo::argumentGPR1
, GPRInfo::argumentGPR2
>(arg1
, arg2
, arg3
);
1152 move(arg4
, GPRInfo::argumentGPR3
);
1155 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, TrustedImmPtr arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
1157 setupTwoStubArgsGPR
<GPRInfo::argumentGPR0
, GPRInfo::argumentGPR2
>(arg1
, arg3
);
1158 move(arg2
, GPRInfo::argumentGPR1
);
1159 move(arg4
, GPRInfo::argumentGPR3
);
1162 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
, TrustedImm32 arg4
, GPRReg arg5
, GPRReg arg6
)
1164 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 1);
1165 poke(arg5
, POKE_ARGUMENT_OFFSET
);
1166 setupTwoStubArgsGPR
<GPRInfo::argumentGPR0
, GPRInfo::argumentGPR1
>(arg1
, arg2
);
1167 move(arg3
, GPRInfo::argumentGPR2
);
1168 move(arg4
, GPRInfo::argumentGPR3
);
1171 ALWAYS_INLINE
void setupArguments(TrustedImmPtr arg1
)
1173 move(arg1
, GPRInfo::argumentGPR0
);
1176 ALWAYS_INLINE
void setupArgumentsExecState()
1178 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1181 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
)
1183 move(arg1
, GPRInfo::argumentGPR1
);
1184 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1187 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
)
1189 move(arg1
, GPRInfo::argumentGPR1
);
1190 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1193 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
)
1195 move(arg1
, GPRInfo::argumentGPR1
);
1196 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1199 #if OS(WINDOWS) && CPU(X86_64)
1200 ALWAYS_INLINE
void setupArgumentsWithExecStateForCallWithSlowPathReturnType(TrustedImm32 arg1
)
1202 move(arg1
, GPRInfo::argumentGPR2
);
1203 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR1
);
1207 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
)
1209 setupStubArguments(arg1
, arg2
);
1210 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1213 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
)
1215 move(arg1
, GPRInfo::argumentGPR1
);
1216 move(arg2
, GPRInfo::argumentGPR2
);
1217 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1219 #if CPU(X86_64) || CPU(ARM64)
1220 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImm64 arg2
)
1222 move(arg1
, GPRInfo::argumentGPR1
);
1223 move(arg2
, GPRInfo::argumentGPR2
);
1224 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1227 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm64 arg1
, GPRReg arg2
)
1229 move(arg2
, GPRInfo::argumentGPR2
); // Move this first, so setting arg1 does not trample!
1230 move(arg1
, GPRInfo::argumentGPR1
);
1231 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1234 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImm32 arg2
)
1236 move(arg1
, GPRInfo::argumentGPR1
);
1237 move(arg2
, GPRInfo::argumentGPR2
);
1238 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1241 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, ImmPtr arg2
)
1243 move(arg1
, GPRInfo::argumentGPR1
);
1244 move(arg2
, GPRInfo::argumentGPR2
);
1245 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1248 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
)
1250 move(arg2
, GPRInfo::argumentGPR2
); // Move this first, so setting arg1 does not trample!
1251 move(arg1
, GPRInfo::argumentGPR1
);
1252 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1255 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
)
1257 move(arg2
, GPRInfo::argumentGPR2
); // Move this first, so setting arg1 does not trample!
1258 move(arg1
, GPRInfo::argumentGPR1
);
1259 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1262 ALWAYS_INLINE
void setupArgumentsWithExecState(ImmPtr arg1
, GPRReg arg2
)
1264 move(arg2
, GPRInfo::argumentGPR2
); // Move this first, so setting arg1 does not trample!
1265 move(arg1
, GPRInfo::argumentGPR1
);
1266 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1269 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImm32 arg2
)
1271 move(arg1
, GPRInfo::argumentGPR1
);
1272 move(arg2
, GPRInfo::argumentGPR2
);
1273 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1276 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImmPtr arg2
)
1278 move(arg1
, GPRInfo::argumentGPR1
);
1279 move(arg2
, GPRInfo::argumentGPR2
);
1280 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1283 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImm32 arg2
)
1285 move(arg1
, GPRInfo::argumentGPR1
);
1286 move(arg2
, GPRInfo::argumentGPR2
);
1287 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1290 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImm32 arg2
, TrustedImm32 arg3
)
1292 move(arg1
, GPRInfo::argumentGPR1
);
1293 move(arg2
, GPRInfo::argumentGPR2
);
1294 move(arg3
, GPRInfo::argumentGPR3
);
1295 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1298 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
)
1300 setupStubArguments(arg1
, arg2
, arg3
);
1301 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1304 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
)
1306 setupStubArguments(arg1
, arg2
);
1307 move(arg3
, GPRInfo::argumentGPR3
);
1308 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1311 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImm32 arg2
, GPRReg arg3
)
1313 setupTwoStubArgsGPR
<GPRInfo::argumentGPR1
, GPRInfo::argumentGPR3
>(arg1
, arg3
);
1314 move(arg2
, GPRInfo::argumentGPR2
);
1315 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1318 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, GPRReg arg3
)
1320 setupTwoStubArgsGPR
<GPRInfo::argumentGPR1
, GPRInfo::argumentGPR3
>(arg1
, arg3
);
1321 move(arg2
, GPRInfo::argumentGPR2
);
1322 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1325 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImm32 arg2
, TrustedImmPtr arg3
)
1327 move(arg1
, GPRInfo::argumentGPR1
);
1328 move(arg2
, GPRInfo::argumentGPR2
);
1329 move(arg3
, GPRInfo::argumentGPR3
);
1330 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1333 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
)
1335 move(arg1
, GPRInfo::argumentGPR1
);
1336 move(arg2
, GPRInfo::argumentGPR2
);
1337 move(arg3
, GPRInfo::argumentGPR3
);
1338 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1341 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImm32 arg2
, TrustedImm32 arg3
)
1343 move(arg1
, GPRInfo::argumentGPR1
);
1344 move(arg2
, GPRInfo::argumentGPR2
);
1345 move(arg3
, GPRInfo::argumentGPR3
);
1346 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1349 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, TrustedImmPtr arg3
)
1351 move(arg1
, GPRInfo::argumentGPR1
);
1352 move(arg2
, GPRInfo::argumentGPR2
);
1353 move(arg3
, GPRInfo::argumentGPR3
);
1354 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1357 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
)
1359 setupStubArguments(arg1
, arg2
);
1360 move(arg3
, GPRInfo::argumentGPR3
);
1361 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1364 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImm32 arg2
, GPRReg arg3
)
1366 move(arg3
, GPRInfo::argumentGPR3
);
1367 move(arg1
, GPRInfo::argumentGPR1
);
1368 move(arg2
, GPRInfo::argumentGPR2
);
1369 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1372 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImmPtr arg2
, GPRReg arg3
)
1374 move(arg3
, GPRInfo::argumentGPR3
);
1375 move(arg1
, GPRInfo::argumentGPR1
);
1376 move(arg2
, GPRInfo::argumentGPR2
);
1377 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1380 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, GPRReg arg3
)
1382 move(arg3
, GPRInfo::argumentGPR3
);
1383 move(arg1
, GPRInfo::argumentGPR1
);
1384 move(arg2
, GPRInfo::argumentGPR2
);
1385 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1388 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
)
1390 move(arg3
, GPRInfo::argumentGPR3
);
1391 move(arg1
, GPRInfo::argumentGPR1
);
1392 move(arg2
, GPRInfo::argumentGPR2
);
1393 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1396 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, TrustedImm32 arg3
)
1398 move(arg2
, GPRInfo::argumentGPR2
);
1399 move(arg1
, GPRInfo::argumentGPR1
);
1400 move(arg3
, GPRInfo::argumentGPR3
);
1401 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1404 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
)
1406 setupTwoStubArgsGPR
<GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
>(arg2
, arg3
);
1407 move(arg1
, GPRInfo::argumentGPR1
);
1408 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1411 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
)
1413 setupTwoStubArgsGPR
<GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
>(arg2
, arg3
);
1414 move(arg1
, GPRInfo::argumentGPR1
);
1415 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1418 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImm32 arg3
)
1420 move(arg2
, GPRInfo::argumentGPR2
); // In case arg2 is argumentGPR1.
1421 move(arg1
, GPRInfo::argumentGPR1
);
1422 move(arg3
, GPRInfo::argumentGPR3
);
1423 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1426 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImmPtr arg3
)
1428 move(arg2
, GPRInfo::argumentGPR2
); // In case arg2 is argumentGPR1.
1429 move(arg1
, GPRInfo::argumentGPR1
);
1430 move(arg3
, GPRInfo::argumentGPR3
);
1431 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1434 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
)
1436 move(arg1
, GPRInfo::argumentGPR1
);
1437 move(arg2
, GPRInfo::argumentGPR2
);
1438 move(arg3
, GPRInfo::argumentGPR3
);
1439 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1442 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImmPtr arg2
, TrustedImmPtr arg3
)
1444 move(arg1
, GPRInfo::argumentGPR1
);
1445 move(arg2
, GPRInfo::argumentGPR2
);
1446 move(arg3
, GPRInfo::argumentGPR3
);
1447 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1450 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImm32 arg2
, TrustedImm32 arg3
)
1452 move(arg1
, GPRInfo::argumentGPR1
);
1453 move(arg2
, GPRInfo::argumentGPR2
);
1454 move(arg3
, GPRInfo::argumentGPR3
);
1455 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1458 #endif // NUMBER_OF_ARGUMENT_REGISTERS >= 4
1459 // These methods are suitable for any calling convention that provides for
1460 // exactly 4 argument registers, e.g. ARMv7.
1461 #if NUMBER_OF_ARGUMENT_REGISTERS == 4
1463 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
)
1465 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1466 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1469 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
)
1471 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1472 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1475 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, GPRReg arg5
)
1477 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1478 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1479 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1482 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImmPtr arg5
)
1484 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1485 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1486 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1489 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, GPRReg arg3
, GPRReg arg4
)
1491 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1492 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1495 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
, GPRReg arg4
)
1497 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1498 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1501 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
)
1503 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1504 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1507 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
1509 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1510 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1513 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImm32 arg4
)
1515 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1516 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1519 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImmPtr arg4
)
1521 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1522 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1525 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImm32 arg5
)
1527 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1528 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1529 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1532 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
, TrustedImm32 arg6
)
1534 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1535 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1536 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1537 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1540 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImm32 arg5
)
1542 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1543 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1544 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1547 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImmPtr arg5
)
1549 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1550 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1551 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1554 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
)
1556 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1557 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1558 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1561 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImm32 arg4
)
1563 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1564 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1567 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImm32 arg4
, TrustedImm32 arg5
)
1569 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1570 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1571 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1574 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImm32 arg2
, GPRReg arg3
, GPRReg arg4
)
1576 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1577 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1580 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
1582 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1583 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1586 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
)
1588 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1589 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1590 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1593 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImm32 arg5
)
1595 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1596 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1597 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1600 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
)
1602 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1603 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1606 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
1608 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1609 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1612 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImmPtr arg4
)
1614 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1615 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1618 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
)
1620 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1621 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1624 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
)
1626 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1627 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1630 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImmPtr arg4
)
1632 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1633 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1636 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
)
1638 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1639 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1642 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
)
1644 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1645 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1646 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1649 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, TrustedImm32 arg5
)
1651 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1652 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1653 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1656 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImmPtr arg5
)
1658 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1659 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1660 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1663 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImm32 arg5
)
1665 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1666 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1667 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1670 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
)
1672 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1673 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1674 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1677 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, GPRReg arg3
, GPRReg arg4
)
1679 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1680 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1683 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImm32 arg5
)
1685 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1686 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1687 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1690 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
)
1692 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1693 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1694 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1697 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImm32 arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
)
1699 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1700 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1701 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1704 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, TrustedImmPtr arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImm32 arg5
)
1706 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1707 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1708 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1711 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
)
1713 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1714 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1715 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1718 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
, GPRReg arg4
, TrustedImm32 arg5
)
1720 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1721 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1722 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1725 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, GPRReg arg6
)
1727 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1728 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1729 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1730 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1733 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, TrustedImm32 arg6
)
1735 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1736 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1737 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1738 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1741 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
, TrustedImm32 arg6
)
1743 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1744 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1745 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1746 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1749 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, GPRReg arg6
, TrustedImmPtr arg7
)
1751 poke(arg7
, POKE_ARGUMENT_OFFSET
+ 3);
1752 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1753 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1754 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1755 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1758 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
, GPRReg arg4
, GPRReg arg5
)
1760 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1761 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1762 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1765 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, TrustedImm32 arg5
, TrustedImmPtr arg6
)
1767 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1768 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1769 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1770 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1773 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, TrustedImmPtr arg6
)
1775 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1776 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1777 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1778 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1781 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImm32 arg5
, TrustedImmPtr arg6
)
1783 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1784 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1785 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1786 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1789 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, TrustedImm32 arg6
)
1791 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1792 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1793 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1794 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1797 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, GPRReg arg5
, GPRReg arg6
)
1799 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1800 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1801 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1802 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1805 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, GPRReg arg5
, TrustedImm32 arg6
)
1807 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1808 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1809 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1810 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1813 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, TrustedImmPtr arg6
)
1815 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1816 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1817 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1818 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1821 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, GPRReg arg6
, GPRReg arg7
)
1823 poke(arg7
, POKE_ARGUMENT_OFFSET
+ 3);
1824 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1825 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1826 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1827 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1830 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, GPRReg arg5
, GPRReg arg6
, GPRReg arg7
)
1832 poke(arg7
, POKE_ARGUMENT_OFFSET
+ 3);
1833 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1834 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1835 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1836 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1839 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, GPRReg arg4
, GPRReg arg5
, GPRReg arg6
, GPRReg arg7
, TrustedImmPtr arg8
)
1841 poke(arg8
, POKE_ARGUMENT_OFFSET
+ 4);
1842 poke(arg7
, POKE_ARGUMENT_OFFSET
+ 3);
1843 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1844 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1845 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1846 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1849 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImm32 arg5
, GPRReg arg6
, GPRReg arg7
)
1851 poke(arg7
, POKE_ARGUMENT_OFFSET
+ 3);
1852 poke(arg6
, POKE_ARGUMENT_OFFSET
+ 2);
1853 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1854 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1855 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1858 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
, TrustedImm32 arg4
, GPRReg arg5
)
1860 poke(arg5
, POKE_ARGUMENT_OFFSET
);
1861 setupTwoStubArgsGPR
<GPRInfo::argumentGPR0
, GPRInfo::argumentGPR1
>(arg1
, arg2
);
1862 move(arg3
, GPRInfo::argumentGPR2
);
1863 move(arg4
, GPRInfo::argumentGPR3
);
1866 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, TrustedImm32 arg5
)
1868 poke(arg5
, POKE_ARGUMENT_OFFSET
+ 1);
1869 poke(arg4
, POKE_ARGUMENT_OFFSET
);
1870 setupArgumentsWithExecState(arg1
, arg2
, arg3
);
1872 #endif // NUMBER_OF_ARGUMENT_REGISTERS == 4
1874 #if NUMBER_OF_ARGUMENT_REGISTERS >= 5
1875 void setupStubArguments134(GPRReg arg1
, GPRReg arg3
, GPRReg arg4
)
1877 setupThreeStubArgsGPR
<GPRInfo::argumentGPR1
, GPRInfo::argumentGPR3
, GPRInfo::argumentGPR4
>(arg1
, arg3
, arg4
);
1880 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
1882 setupThreeStubArgsGPR
<GPRInfo::argumentGPR1
, GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
>(arg1
, arg2
, arg3
);
1883 move(arg4
, GPRInfo::argumentGPR4
);
1884 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1887 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, TrustedImm32 arg3
, GPRReg arg4
)
1889 setupTwoStubArgsGPR
<GPRInfo::argumentGPR1
, GPRInfo::argumentGPR4
>(arg1
, arg4
);
1890 move(arg2
, GPRInfo::argumentGPR2
);
1891 move(arg3
, GPRInfo::argumentGPR3
);
1892 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1895 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, TrustedImmPtr arg2
, GPRReg arg3
, GPRReg arg4
)
1897 setupStubArguments134(arg1
, arg3
, arg4
);
1898 move(arg2
, GPRInfo::argumentGPR2
);
1899 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1902 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImmPtr arg4
)
1904 setupTwoStubArgsGPR
<GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
>(arg2
, arg3
);
1905 move(arg1
, GPRInfo::argumentGPR1
);
1906 move(arg4
, GPRInfo::argumentGPR4
);
1907 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1910 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, TrustedImm32 arg3
, TrustedImm32 arg4
)
1912 move(arg2
, GPRInfo::argumentGPR2
); // In case arg2 is argumentGPR1.
1913 move(arg1
, GPRInfo::argumentGPR1
);
1914 move(arg3
, GPRInfo::argumentGPR3
);
1915 move(arg4
, GPRInfo::argumentGPR4
);
1916 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1919 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, TrustedImmPtr arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImm32 arg5
)
1921 move(arg3
, GPRInfo::argumentGPR3
);
1922 move(arg1
, GPRInfo::argumentGPR1
);
1923 move(arg2
, GPRInfo::argumentGPR2
);
1924 move(arg4
, GPRInfo::argumentGPR4
);
1925 move(arg5
, GPRInfo::argumentGPR5
);
1926 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1929 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImm32 arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
, TrustedImm32 arg5
)
1931 setupTwoStubArgsGPR
<GPRInfo::argumentGPR2
, GPRInfo::argumentGPR4
>(arg2
, arg4
);
1932 move(arg1
, GPRInfo::argumentGPR1
);
1933 move(arg3
, GPRInfo::argumentGPR3
);
1934 move(arg5
, GPRInfo::argumentGPR5
);
1935 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1938 ALWAYS_INLINE
void setupArgumentsWithExecState(TrustedImmPtr arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
, TrustedImm32 arg5
)
1940 setupTwoStubArgsGPR
<GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
>(arg2
, arg3
);
1941 move(arg1
, GPRInfo::argumentGPR1
);
1942 move(arg4
, GPRInfo::argumentGPR4
);
1943 move(arg5
, GPRInfo::argumentGPR5
);
1944 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1947 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, GPRReg arg3
, TrustedImm32 arg4
)
1949 setupThreeStubArgsGPR
<GPRInfo::argumentGPR1
, GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
>(arg1
, arg2
, arg3
);
1950 move(arg4
, GPRInfo::argumentGPR4
);
1951 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1954 ALWAYS_INLINE
void setupArgumentsWithExecState(GPRReg arg1
, GPRReg arg2
, TrustedImm32 arg3
, GPRReg arg4
)
1956 setupThreeStubArgsGPR
<GPRInfo::argumentGPR1
, GPRInfo::argumentGPR2
, GPRInfo::argumentGPR4
>(arg1
, arg2
, arg4
);
1957 move(arg3
, GPRInfo::argumentGPR3
);
1958 move(GPRInfo::callFrameRegister
, GPRInfo::argumentGPR0
);
1961 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, TrustedImmPtr arg2
, GPRReg arg3
, GPRReg arg4
, TrustedImmPtr arg5
)
1963 setupThreeStubArgsGPR
<GPRInfo::argumentGPR0
, GPRInfo::argumentGPR2
, GPRInfo::argumentGPR3
>(arg1
, arg3
, arg4
);
1964 move(arg2
, GPRInfo::argumentGPR1
);
1965 move(arg5
, GPRInfo::argumentGPR4
);
1968 ALWAYS_INLINE
void setupArguments(GPRReg arg1
, GPRReg arg2
, TrustedImmPtr arg3
, TrustedImm32 arg4
, GPRReg arg5
)
1970 setupThreeStubArgsGPR
<GPRInfo::argumentGPR0
, GPRInfo::argumentGPR1
, GPRInfo::argumentGPR4
>(arg1
, arg2
, arg5
);
1971 move(arg3
, GPRInfo::argumentGPR2
);
1972 move(arg4
, GPRInfo::argumentGPR3
);
1976 void setupArguments(JSValueRegs arg1
)
1979 setupArguments(arg1
.gpr());
1981 setupArguments(arg1
.payloadGPR(), arg1
.tagGPR());
1985 void setupResults(GPRReg destA
, GPRReg destB
)
1987 GPRReg srcA
= GPRInfo::returnValueGPR
;
1988 GPRReg srcB
= GPRInfo::returnValueGPR2
;
1990 if (destA
== InvalidGPRReg
)
1992 else if (destB
== InvalidGPRReg
)
1994 else if (srcB
!= destA
) {
1995 // Handle the easy cases - two simple moves.
1998 } else if (srcA
!= destB
) {
1999 // Handle the non-swap case - just put srcB in place first.
2006 void setupResults(JSValueRegs regs
)
2009 move(GPRInfo::returnValueGPR
, regs
.gpr());
2011 setupResults(regs
.payloadGPR(), regs
.tagGPR());
2015 void jumpToExceptionHandler()
2017 // genericUnwind() leaves the handler CallFrame* in vm->callFrameForThrow,
2018 // the topVMEntryFrame for the handler in vm->vmEntryFrameForThrow,
2019 // and the address of the handler in vm->targetMachinePCForThrow.
2020 loadPtr(&vm()->targetMachinePCForThrow
, GPRInfo::regT1
);
2021 jump(GPRInfo::regT1
);
2027 #endif // ENABLE(JIT)
2029 #endif // CCallHelpers_h