1 /* src/vm/jit/powerpc/asmpart.S - Java-C interface functions for PowerPC
3 Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
8 This file is part of CACAO.
10 This program is free software.text; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY ; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
33 #include "vm/jit/abi-asm.h"
34 #include "vm/jit/methodheader.h"
42 /* export functions ***********************************************************/
44 .globl asm_vm_call_method
45 .globl asm_vm_call_method_int
46 .globl asm_vm_call_method_long
47 .globl asm_vm_call_method_float
48 .globl asm_vm_call_method_double
50 .globl asm_vm_call_method_exception_handler
51 .globl asm_vm_call_method_end
53 .globl asm_call_jit_compiler
55 .globl asm_handle_nat_exception
56 .globl asm_handle_exception
58 .globl asm_abstractmethoderror
60 #if defined(ENABLE_REPLACEMENT)
61 .globl asm_replacement_out
62 .globl asm_replacement_in
67 .globl asm_compare_and_swap
68 .globl asm_memory_barrier
71 /* asm_vm_call_method **********************************************************
73 * This function calls a Java-method (which possibly needs compilation) *
74 * with up to 4 address parameters. *
76 * This functions calls the JIT-compiler which eventually translates the *
77 * method into machine code. *
80 * javaobject_header *asm_calljavamethod (methodinfo *m, *
81 * void *arg1, void *arg2, void *arg3, void *arg4); *
83 *******************************************************************************/
87 .long 0 /* catch type all */
88 .long 0 /* exception handler pc */
90 .long 0 /* start pc */
91 .long 1 /* extable size */
92 .long 0 /* line number table start */
93 .long 0 /* line number table size */
98 .long 0 /* frame size */
99 .long 0 /* codeinfo pointer */
102 asm_vm_call_method_int:
103 asm_vm_call_method_long:
104 asm_vm_call_method_float:
105 asm_vm_call_method_double:
107 stw r0,LA_LR_OFFSET(sp)
108 stwu sp,-40*4(sp) /* keep stack 16-byte aligned */
110 stw s0,8*4(sp) /* save used callee saved registers */
111 stw a0,9*4(sp) /* save method PV */
113 #if defined(__DARWIN__)
114 stw itmp1,10*4(sp) /* register r11 is callee saved */
116 stw pv,11*4(sp) /* save PV register */
118 stw itmp3,12*4(sp) /* registers r14-r31 are callee saved */
119 stfd ftmp1,14*4(sp) /* registers f14-f31 are callee saved */
122 #if defined(__DARWIN__)
138 SAVE_TEMPORARY_REGISTERS(18) /* the offset has to be even */
141 mr t0,a1 /* address of data structure */
142 mr t1,a2 /* stack argument count */
144 mr s0,sp /* save SP */
146 lwz a0,0*8+4(t0) /* we are on big-endian */
164 #if defined(__DARWIN__)
173 beq L_asm_vm_call_method_stack_copy_done
175 slwi t2,t1,3 /* calculate stackframe size (* 8) */
177 sub sp,sp,t2 /* create stackframe */
178 mr t2,sp /* temporary stack pointer */
180 L_asm_vm_call_method_stack_copy_loop:
181 #if defined(__DARWIN__)
182 lwz t3,21*8+0(t0) /* load argument */
185 lwz t3,16*8+0(t0) /* load argument */
188 stw t3,0(t2) /* store argument on stack */
191 addi t0,t0,8 /* load address of next argument */
192 addi t2,t2,8 /* increase stack pointer */
193 addi t1,t1,-1 /* subtract 1 argument */
195 bgt L_asm_vm_call_method_stack_copy_loop
197 L_asm_vm_call_method_stack_copy_done:
198 addi mptr,s0,9*4 /* get address of PV */
199 lwz pv,0*4(mptr) /* load PV */
204 #if defined(__DARWIN__)
205 addi pv,itmp1,lo16(asm_vm_call_method - 1b)
207 addi pv,itmp1,(asm_vm_call_method - 1b)@l
210 L_asm_vm_call_method_return:
211 mr sp,s0 /* restore the SP */
213 lwz s0,8*4(sp) /* restore used callee saved registers*/
215 #if defined(__DARWIN__)
216 lwz itmp1,10*4(sp) /* register r11 is callee saved */
218 lwz pv,11*4(sp) /* save PV register */
221 lfd ftmp1,14*4(sp) /* registers f14-f31 are callee saved */
224 #if defined(__DARWIN__)
240 RESTORE_TEMPORARY_REGISTERS(18) /* the offset has to be even */
243 lwz r0,40*4+LA_LR_OFFSET(sp)
248 asm_vm_call_method_exception_handler:
250 bl builtin_throw_exception
251 b L_asm_vm_call_method_return
253 asm_vm_call_method_end:
257 /* asm_call_jit_compiler *******************************************************
259 Invokes the compiler for untranslated JavaVM methods.
261 *******************************************************************************/
263 asm_call_jit_compiler:
264 L_asm_call_jit_compiler: /* required for PIC code */
266 stw r0,LA_LR_OFFSET(sp) /* save return address */
267 stwu sp,-(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)(sp)
269 #if defined(__DARWIN__)
270 stw a0,LA_SIZE+(4+0)*4(sp)
271 stw a1,LA_SIZE+(4+1)*4(sp)
272 stw a2,LA_SIZE+(4+2)*4(sp)
273 stw a3,LA_SIZE+(4+3)*4(sp)
274 stw a4,LA_SIZE+(4+4)*4(sp)
275 stw a5,LA_SIZE+(4+5)*4(sp)
276 stw a6,LA_SIZE+(4+6)*4(sp)
277 stw a7,LA_SIZE+(4+7)*4(sp)
279 stfd fa0,LA_SIZE+(4+8)*4(sp)
280 stfd fa1,LA_SIZE+(4+10)*4(sp)
281 stfd fa2,LA_SIZE+(4+12)*4(sp)
282 stfd fa3,LA_SIZE+(4+14)*4(sp)
283 stfd fa4,LA_SIZE+(4+16)*4(sp)
284 stfd fa5,LA_SIZE+(4+18)*4(sp)
285 stfd fa6,LA_SIZE+(4+20)*4(sp)
286 stfd fa7,LA_SIZE+(4+22)*4(sp)
287 stfd fa8,LA_SIZE+(4+24)*4(sp)
288 stfd fa9,LA_SIZE+(4+26)*4(sp)
289 stfd fa10,LA_SIZE+(4+28)*4(sp)
290 stfd fa11,LA_SIZE+(4+30)*4(sp)
291 stfd fa12,LA_SIZE+(4+32)*4(sp)
293 SAVE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS)
298 addi a2,sp,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)
299 lwz a3,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)+LA_LR_OFFSET(sp)
301 mr pv,v0 /* move address to pv register */
303 #if defined(__DARWIN__)
304 lwz a0,LA_SIZE+(4+0)*4(sp)
305 lwz a1,LA_SIZE+(4+1)*4(sp)
306 lwz a2,LA_SIZE+(4+2)*4(sp)
307 lwz a3,LA_SIZE+(4+3)*4(sp)
308 lwz a4,LA_SIZE+(4+4)*4(sp)
309 lwz a5,LA_SIZE+(4+5)*4(sp)
310 lwz a6,LA_SIZE+(4+6)*4(sp)
311 lwz a7,LA_SIZE+(4+7)*4(sp)
313 lfd fa0,LA_SIZE+(4+8)*4(sp)
314 lfd fa1,LA_SIZE+(4+10)*4(sp)
315 lfd fa2,LA_SIZE+(4+12)*4(sp)
316 lfd fa3,LA_SIZE+(4+14)*4(sp)
317 lfd fa4,LA_SIZE+(4+16)*4(sp)
318 lfd fa5,LA_SIZE+(4+18)*4(sp)
319 lfd fa6,LA_SIZE+(4+20)*4(sp)
320 lfd fa7,LA_SIZE+(4+22)*4(sp)
321 lfd fa8,LA_SIZE+(4+24)*4(sp)
322 lfd fa9,LA_SIZE+(4+26)*4(sp)
323 lfd fa10,LA_SIZE+(4+28)*4(sp)
324 lfd fa11,LA_SIZE+(4+30)*4(sp)
325 lfd fa12,LA_SIZE+(4+32)*4(sp)
327 RESTORE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS)
330 lwz itmp1,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)+LA_LR_OFFSET(sp)
333 addi sp,sp,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)
335 mr. pv,pv /* test for exception */
336 beq L_asm_call_jit_compiler_exception
338 mtctr pv /* move method address to control reg */
339 bctr /* and call the Java method */
341 L_asm_call_jit_compiler_exception:
343 stw r0,LA_LR_OFFSET(sp)
344 stwu sp,-LA_SIZE_ALIGNED(sp) /* preserve linkage area */
345 bl exceptions_get_and_clear_exception
346 lwz xpc,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
348 addi sp,sp,LA_SIZE_ALIGNED
350 mr xptr,v0 /* get exception */
351 addi xpc,xpc,-4 /* exception address is ra - 4 */
352 b L_asm_handle_nat_exception
355 /********************* function asm_handle_exception ***************************
357 * This function handles an exception. It does not use the usual calling *
358 * conventions. The exception pointer is passed in REG_ITMP1 and the *
359 * pc from the exception raising position is passed in REG_ITMP2. It searches *
360 * the local exception table for a handler. If no one is found, it unwinds *
361 * stacks and continues searching the callers. *
363 * void asm_handle_exception (exceptionptr, exceptionpc); *
365 *******************************************************************************/
367 asm_handle_nat_exception:
368 L_asm_handle_nat_exception: /* required for PIC code */
369 L_asm_handle_exception_stack_loop:
371 addi sp,sp,-(LA_SIZE+((4+6)*4)) /* allocate stack (+4 for darwin) */
372 stw xptr,LA_SIZE+(4+0)*4(sp) /* save exception pointer */
373 stw xpc,LA_SIZE+(4+1)*4(sp) /* save exception pc */
374 stw r0,LA_SIZE+(4+3)*4(sp) /* save return address */
376 stw itmp3,LA_SIZE+(4+4)*4(sp) /* save maybe-leaf flag (cleared) */
378 mr a0,r0 /* pass return address */
379 bl md_codegen_get_pv_from_pc /* get PV from RA */
380 stw v0,LA_SIZE+(4+2)*4(sp) /* save data segment pointer */
382 lwz a0,LA_SIZE+(4+0)*4(sp) /* pass xptr */
383 lwz a1,LA_SIZE+(4+1)*4(sp) /* pass xpc */
384 lwz a2,LA_SIZE+(4+2)*4(sp) /* pass PV (v0 == a0) */
385 addi a3,sp,LA_SIZE+((4+6)*4) /* pass Java SP */
387 b L_asm_handle_exception_continue
389 asm_handle_exception:
390 L_asm_handle_exception: /* required for PIC code */
391 addi sp,sp,-(ARG_CNT+TMP_CNT)*8 /* create maybe-leaf stackframe */
393 #if defined(__DARWIN__)
395 SAVE_ARGUMENT_REGISTERS(0) /* we save arg and temp registers in */
396 SAVE_TEMPORARY_REGISTERS(ARG_CNT) /* case this is a leaf method */
399 addi sp,sp,-(LA_SIZE+(4+6)*4) /* allocate stack */
400 stw xptr,LA_SIZE+(4+0)*4(sp) /* save xptr */
401 stw pv,LA_SIZE+(4+2)*4(sp) /* save PV */
402 mflr r0 /* save RA */
403 stw r0,LA_SIZE+(4+3)*4(sp)
404 li t0,1 /* set maybe-leaf flag */
405 stw t0,LA_SIZE+(4+4)*4(sp) /* save maybe-leaf flag */
407 mr a0,xptr /* pass exception pointer */
408 mr a1,xpc /* pass exception pc */
409 mr a2,pv /* pass data segment pointer */
410 addi a3,sp,LA_SIZE+(ARG_CNT+TMP_CNT)*8+(4+6)*4
412 L_asm_handle_exception_continue:
413 bl exceptions_handle_exception
416 beq L_asm_handle_exception_not_catched
418 mr xpc,v0 /* move handlerpc into xpc */
419 lwz xptr,LA_SIZE+(4+0)*4(sp) /* restore xptr */
420 lwz pv,LA_SIZE+(4+2)*4(sp) /* restore PV */
421 lwz r0,LA_SIZE+(4+3)*4(sp) /* restore RA */
423 lwz t0,LA_SIZE+(4+4)*4(sp) /* get maybe-leaf flag */
424 addi sp,sp,LA_SIZE+(4+6)*4 /* free stack frame */
427 beq L_asm_handle_exception_no_leaf
429 #if defined(__DARWIN__)
431 RESTORE_ARGUMENT_REGISTERS(0) /* if this is a leaf method, we have */
432 RESTORE_TEMPORARY_REGISTERS(ARG_CNT)/* to restore arg and temp registers */
435 addi sp,sp,(ARG_CNT+TMP_CNT)*8 /* remove maybe-leaf stackframe */
437 L_asm_handle_exception_no_leaf:
438 mtctr xpc /* jump to the handler */
441 L_asm_handle_exception_not_catched:
442 lwz xptr,LA_SIZE+(4+0)*4(sp) /* restore xptr */
443 lwz pv,LA_SIZE+(4+2)*4(sp) /* restore PV */
444 lwz r0,LA_SIZE+(4+3)*4(sp) /* restore RA */
446 lwz t0,LA_SIZE+(4+4)*4(sp) /* get maybe-leaf flag */
447 addi sp,sp,LA_SIZE+(4+6)*4 /* free stack frame */
450 beq L_asm_handle_exception_no_leaf_stack
452 addi sp,sp,(ARG_CNT+TMP_CNT)*8 /* remove maybe-leaf stackframe */
453 li t0,0 /* clear the maybe-leaf flag */
455 L_asm_handle_exception_no_leaf_stack:
456 lwz t1,FrameSize(pv) /* get frame size */
457 add t1,sp,t1 /* pointer to save area */
459 lwz t2,IsLeaf(pv) /* is leaf procedure */
461 bne L_asm_handle_exception_no_ra_restore
463 lwz r0,LA_LR_OFFSET(t1) /* restore ra */
466 L_asm_handle_exception_no_ra_restore:
467 mflr xpc /* the new xpc is ra */
468 mr t4,xpc /* save RA */
469 lwz t2,IntSave(pv) /* t2 = saved int register count */
472 mflr t3 /* t3 = current pc */
473 #if defined(__DARWIN__)
474 addi t3,t3,lo16(ex_int2-ex_int1)
476 addi t3,t3,(ex_int2-ex_int1)@l
478 slwi t2,t2,2 /* t2 = register count * 4 */
479 subf t3,t2,t3 /* t3 = IntSave - t2 */
495 subf t1,t2,t1 /* t1 = t1 - register count * 4 */
501 #if defined(__DARWIN__)
502 addi t3,t3,lo16(ex_flt2-ex_flt1)
504 addi t3,t3,(ex_flt2-ex_flt1)@l
506 slwi t2,t2,2 /* t2 = register count * 4 */
507 subf t3,t2,t3 /* t3 = FltSave - t2 */
523 mtlr t4 /* restore RA */
524 lwz t1,FrameSize(pv) /* get frame size */
525 add sp,sp,t1 /* unwind stack */
526 b L_asm_handle_exception_stack_loop
529 /* asm_abstractmethoderror *****************************************************
531 Creates and throws an AbstractMethodError.
533 *******************************************************************************/
535 asm_abstractmethoderror:
537 stw r0,LA_LR_OFFSET(sp)
538 stwu sp,-LA_SIZE_ALIGNED(sp) /* preserve linkage area */
539 addi a0,sp,LA_SIZE_ALIGNED /* pass java sp */
540 mr a1,r0 /* pass exception address */
541 bl exceptions_asm_new_abstractmethoderror
542 lwz r0,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
543 mtlr r0 /* restore return address */
544 addi sp,sp,LA_SIZE_ALIGNED
546 mr xptr,v0 /* get exception pointer */
547 mr xpc,r0 /* we can't use r0 directly in addi */
548 addi xpc,xpc,-4 /* exception address is ra - 4 */
549 b L_asm_handle_nat_exception
552 #if defined(ENABLE_REPLACEMENT)
554 /* asm_replacement_out *********************************************************
556 This code is jumped to from the replacement-out stubs that are executed
557 when a thread reaches an activated replacement point.
559 The purpose of asm_replacement_out is to read out the parts of the
560 execution state that cannot be accessed from C code, store this state,
561 and then call the C function replace_me.
564 16 start of stack inside method to replace
565 0 rplpoint * info on the replacement point that was reached
567 NOTE: itmp3 has been clobbered by the replacement-out stub!
569 *******************************************************************************/
571 /* some room to accomodate changes of the stack frame size during replacement */
572 /* XXX we should find a cleaner solution here */
573 #define REPLACEMENT_ROOM 512
575 #define sizeexecutionstate_ALIGNED ((sizeexecutionstate + 15) & ~15)
578 /* create stack frame */
579 addi sp,sp,-(sizeexecutionstate_ALIGNED + REPLACEMENT_ROOM)
581 /* save link register */
584 /* save registers in execution state */
585 stw r0 ,( 0*4+offes_intregs)(sp)
586 stw r1 ,( 1*4+offes_intregs)(sp)
587 stw r2 ,( 2*4+offes_intregs)(sp)
588 stw r3 ,( 3*4+offes_intregs)(sp)
589 stw r4 ,( 4*4+offes_intregs)(sp)
590 stw r5 ,( 5*4+offes_intregs)(sp)
591 stw r6 ,( 6*4+offes_intregs)(sp)
592 stw r7 ,( 7*4+offes_intregs)(sp)
593 stw r8 ,( 8*4+offes_intregs)(sp)
594 stw r9 ,( 9*4+offes_intregs)(sp)
595 stw r10,(10*4+offes_intregs)(sp)
596 stw r11,(11*4+offes_intregs)(sp)
597 stw r12,(12*4+offes_intregs)(sp)
598 stw r13,(13*4+offes_intregs)(sp)
599 stw r14,(14*4+offes_intregs)(sp)
600 stw r15,(15*4+offes_intregs)(sp)
601 stw r16,(16*4+offes_intregs)(sp) /* link register stored as itmp3 */
602 stw r17,(17*4+offes_intregs)(sp)
603 stw r18,(18*4+offes_intregs)(sp)
604 stw r19,(19*4+offes_intregs)(sp)
605 stw r20,(20*4+offes_intregs)(sp)
606 stw r21,(21*4+offes_intregs)(sp)
607 stw r22,(22*4+offes_intregs)(sp)
608 stw r23,(23*4+offes_intregs)(sp)
609 stw r24,(24*4+offes_intregs)(sp)
610 stw r25,(25*4+offes_intregs)(sp)
611 stw r26,(26*4+offes_intregs)(sp)
612 stw r27,(27*4+offes_intregs)(sp)
613 stw r28,(28*4+offes_intregs)(sp)
614 stw r29,(29*4+offes_intregs)(sp)
615 stw r30,(30*4+offes_intregs)(sp)
616 stw r31,(31*4+offes_intregs)(sp)
618 stfd fr0 ,( 0*8+offes_fltregs)(sp)
619 stfd fr1 ,( 1*8+offes_fltregs)(sp)
620 stfd fr2 ,( 2*8+offes_fltregs)(sp)
621 stfd fr3 ,( 3*8+offes_fltregs)(sp)
622 stfd fr4 ,( 4*8+offes_fltregs)(sp)
623 stfd fr5 ,( 5*8+offes_fltregs)(sp)
624 stfd fr6 ,( 6*8+offes_fltregs)(sp)
625 stfd fr7 ,( 7*8+offes_fltregs)(sp)
626 stfd fr8 ,( 8*8+offes_fltregs)(sp)
627 stfd fr9 ,( 9*8+offes_fltregs)(sp)
628 stfd fr10,(10*8+offes_fltregs)(sp)
629 stfd fr11,(11*8+offes_fltregs)(sp)
630 stfd fr12,(12*8+offes_fltregs)(sp)
631 stfd fr13,(13*8+offes_fltregs)(sp)
632 stfd fr14,(14*8+offes_fltregs)(sp)
633 stfd fr15,(15*8+offes_fltregs)(sp)
634 stfd fr16,(16*8+offes_fltregs)(sp)
635 stfd fr17,(17*8+offes_fltregs)(sp)
636 stfd fr18,(18*8+offes_fltregs)(sp)
637 stfd fr19,(19*8+offes_fltregs)(sp)
638 stfd fr20,(20*8+offes_fltregs)(sp)
639 stfd fr21,(21*8+offes_fltregs)(sp)
640 stfd fr22,(22*8+offes_fltregs)(sp)
641 stfd fr23,(23*8+offes_fltregs)(sp)
642 stfd fr24,(24*8+offes_fltregs)(sp)
643 stfd fr25,(25*8+offes_fltregs)(sp)
644 stfd fr26,(26*8+offes_fltregs)(sp)
645 stfd fr27,(27*8+offes_fltregs)(sp)
646 stfd fr28,(28*8+offes_fltregs)(sp)
647 stfd fr29,(29*8+offes_fltregs)(sp)
648 stfd fr30,(30*8+offes_fltregs)(sp)
649 stfd fr31,(31*8+offes_fltregs)(sp)
651 /* calculate sp of method */
652 addi itmp1,sp,(sizeexecutionstate_ALIGNED + REPLACEMENT_ROOM + 4*4)
653 stw itmp1,(offes_sp)(sp)
656 stw pv,(offes_pv)(sp)
658 /* call replace_me */
659 lwz a0,-(4*4)(itmp1) /* arg0: rplpoint * */
660 mr a1,sp /* arg1: execution state */
661 addi sp,sp,-(LA_SIZE_ALIGNED)
662 b replace_me /* call C function replace_me */
664 /* asm_replacement_in **********************************************************
666 This code writes the given execution state and jumps to the replacement
669 This function never returns!
671 NOTE: itmp3 is not restored!
674 void asm_replacement_in(executionstate *es, replace_safestack_t *st);
676 *******************************************************************************/
679 /* a0 == executionstate *es */
680 /* a1 == replace_safestack_t *st */
683 mr s1,a1 /* replace_safestack_t *st */
684 mr s2,a0 /* executionstate *es == safe stack */
686 /* switch to the safe stack */
689 /* reserve linkage area */
690 addi sp,sp,-(LA_SIZE_ALIGNED)
692 /* call replace_build_execution_state(st) */
694 bl replace_build_execution_state
697 lwz sp,(offes_sp)(s2)
699 /* build stack frame */
700 addi sp,sp,-(sizeexecutionstate_ALIGNED)
702 /* call replace_free_safestack(st,& of allocated executionstate_t) */
705 addi sp,sp,-(LA_SIZE_ALIGNED) /* reserve linkage area */
706 bl replace_free_safestack
707 addi sp,sp,+(LA_SIZE_ALIGNED) /* tear down linkage area */
710 lwz pv,(offes_pv)(sp)
712 /* copy registers from execution state */
713 lwz r0 ,( 0*4+offes_intregs)(sp)
716 lwz a0 ,( 3*4+offes_intregs)(sp)
717 lwz r4 ,( 4*4+offes_intregs)(sp)
718 lwz r5 ,( 5*4+offes_intregs)(sp)
719 lwz r6 ,( 6*4+offes_intregs)(sp)
720 lwz r7 ,( 7*4+offes_intregs)(sp)
721 lwz r8 ,( 8*4+offes_intregs)(sp)
722 lwz r9 ,( 9*4+offes_intregs)(sp)
723 lwz r10,(10*4+offes_intregs)(sp)
724 lwz r11,(11*4+offes_intregs)(sp)
725 lwz r12,(12*4+offes_intregs)(sp)
727 lwz r14,(14*4+offes_intregs)(sp)
728 lwz r15,(15*4+offes_intregs)(sp)
729 lwz r16,(16*4+offes_intregs)(sp) /* itmp3, later to link register */
730 lwz r17,(17*4+offes_intregs)(sp)
731 lwz r18,(18*4+offes_intregs)(sp)
732 lwz r19,(19*4+offes_intregs)(sp)
733 lwz r20,(20*4+offes_intregs)(sp)
734 lwz r21,(21*4+offes_intregs)(sp)
735 lwz r22,(22*4+offes_intregs)(sp)
736 lwz r23,(23*4+offes_intregs)(sp)
737 lwz r24,(24*4+offes_intregs)(sp)
738 lwz r25,(25*4+offes_intregs)(sp)
739 lwz r26,(26*4+offes_intregs)(sp)
740 lwz r27,(27*4+offes_intregs)(sp)
741 lwz r28,(28*4+offes_intregs)(sp)
742 lwz r29,(29*4+offes_intregs)(sp)
743 lwz r30,(30*4+offes_intregs)(sp)
744 lwz r31,(31*4+offes_intregs)(sp)
746 lfd fr0 ,( 0*8+offes_fltregs)(sp)
747 lfd fr1 ,( 1*8+offes_fltregs)(sp)
748 lfd fr2 ,( 2*8+offes_fltregs)(sp)
749 lfd fr3 ,( 3*8+offes_fltregs)(sp)
750 lfd fr4 ,( 4*8+offes_fltregs)(sp)
751 lfd fr5 ,( 5*8+offes_fltregs)(sp)
752 lfd fr6 ,( 6*8+offes_fltregs)(sp)
753 lfd fr7 ,( 7*8+offes_fltregs)(sp)
754 lfd fr8 ,( 8*8+offes_fltregs)(sp)
755 lfd fr9 ,( 9*8+offes_fltregs)(sp)
756 lfd fr10,(10*8+offes_fltregs)(sp)
757 lfd fr11,(11*8+offes_fltregs)(sp)
758 lfd fr12,(12*8+offes_fltregs)(sp)
759 lfd fr13,(13*8+offes_fltregs)(sp)
760 lfd fr14,(14*8+offes_fltregs)(sp)
761 lfd fr15,(15*8+offes_fltregs)(sp)
762 lfd fr16,(16*8+offes_fltregs)(sp)
763 lfd fr17,(17*8+offes_fltregs)(sp)
764 lfd fr18,(18*8+offes_fltregs)(sp)
765 lfd fr19,(19*8+offes_fltregs)(sp)
766 lfd fr20,(20*8+offes_fltregs)(sp)
767 lfd fr21,(21*8+offes_fltregs)(sp)
768 lfd fr22,(22*8+offes_fltregs)(sp)
769 lfd fr23,(23*8+offes_fltregs)(sp)
770 lfd fr24,(24*8+offes_fltregs)(sp)
771 lfd fr25,(25*8+offes_fltregs)(sp)
772 lfd fr26,(26*8+offes_fltregs)(sp)
773 lfd fr27,(27*8+offes_fltregs)(sp)
774 lfd fr28,(28*8+offes_fltregs)(sp)
775 lfd fr29,(29*8+offes_fltregs)(sp)
776 lfd fr30,(30*8+offes_fltregs)(sp)
777 lfd fr31,(31*8+offes_fltregs)(sp)
779 /* restore link register */
785 lwz itmp3,offes_pc(sp)
787 /* remove stack frame */
789 addi sp,sp,+(sizeexecutionstate_ALIGNED)
791 /* jump to new code */
796 #endif /* defined(ENABLE_REPLACEMENT) */
798 /*********************************************************************/
826 /* asm_compare_and_swap ********************************************************
830 *******************************************************************************/
832 asm_compare_and_swap:
845 /* asm_memory_barrier **********************************************************
849 *******************************************************************************/
856 #if defined(__DARWIN__)
858 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
860 L_builtin_throw_exception$stub:
861 .indirect_symbol _builtin_throw_exception
863 bcl 20,31,L00$_builtin_throw_exception
864 L00$_builtin_throw_exception:
866 addis r11,r11,ha16(L_builtin_throw_exception$lazy_ptr - L00$_builtin_throw_exception)
868 lwzu r12,lo16(L_builtin_throw_exception$lazy_ptr - L00$_builtin_throw_exception)(r11)
873 L_builtin_throw_exception$lazy_ptr:
874 .indirect_symbol _builtin_throw_exception
875 .long dyld_stub_binding_helper
878 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
880 L_md_codegen_get_pv_from_pc$stub:
881 .indirect_symbol _md_codegen_get_pv_from_pc
883 bcl 20,31,L00$_md_codegen_get_pv_from_pc
884 L00$_md_codegen_get_pv_from_pc:
886 addis r11,r11,ha16(L_md_codegen_get_pv_from_pc$lazy_ptr - L00$_md_codegen_get_pv_from_pc)
888 lwzu r12,lo16(L_md_codegen_get_pv_from_pc$lazy_ptr - L00$_md_codegen_get_pv_from_pc)(r11)
893 L_md_codegen_get_pv_from_pc$lazy_ptr:
894 .indirect_symbol _md_codegen_get_pv_from_pc
895 .long dyld_stub_binding_helper
898 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
900 L_exceptions_handle_exception$stub:
901 .indirect_symbol _exceptions_handle_exception
903 bcl 20,31,L00$_exceptions_handle_exception
904 L00$_exceptions_handle_exception:
906 addis r11,r11,ha16(L_exceptions_handle_exception$lazy_ptr - L00$_exceptions_handle_exception)
908 lwzu r12,lo16(L_exceptions_handle_exception$lazy_ptr - L00$_exceptions_handle_exception)(r11)
913 L_exceptions_handle_exception$lazy_ptr:
914 .indirect_symbol _exceptions_handle_exception
915 .long dyld_stub_binding_helper
918 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
920 L_stacktrace_create_extern_stackframeinfo$stub:
921 .indirect_symbol _stacktrace_create_extern_stackframeinfo
923 bcl 20,31,L00$_stacktrace_create_extern_stackframeinfo
924 L00$_stacktrace_create_extern_stackframeinfo:
926 addis r11,r11,ha16(L_stacktrace_create_extern_stackframeinfo$lazy_ptr - L00$_stacktrace_create_extern_stackframeinfo)
928 lwzu r12,lo16(L_stacktrace_create_extern_stackframeinfo$lazy_ptr - L00$_stacktrace_create_extern_stackframeinfo)(r11)
933 L_stacktrace_create_extern_stackframeinfo$lazy_ptr:
934 .indirect_symbol _stacktrace_create_extern_stackframeinfo
935 .long dyld_stub_binding_helper
938 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
940 L_jit_asm_compile$stub:
941 .indirect_symbol _jit_asm_compile
943 bcl 20,31,L00$_jit_asm_compile
944 L00$_jit_asm_compile:
946 addis r11,r11,ha16(L_jit_asm_compile$lazy_ptr - L00$_jit_asm_compile)
948 lwzu r12,lo16(L_jit_asm_compile$lazy_ptr - L00$_jit_asm_compile)(r11)
953 L_jit_asm_compile$lazy_ptr:
954 .indirect_symbol _jit_asm_compile
955 .long dyld_stub_binding_helper
958 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
960 L_stacktrace_remove_stackframeinfo$stub:
961 .indirect_symbol _stacktrace_remove_stackframeinfo
963 bcl 20,31,L00$_stacktrace_remove_stackframeinfo
964 L00$_stacktrace_remove_stackframeinfo:
966 addis r11,r11,ha16(L_stacktrace_remove_stackframeinfo$lazy_ptr - L00$_stacktrace_remove_stackframeinfo)
968 lwzu r12,lo16(L_stacktrace_remove_stackframeinfo$lazy_ptr - L00$_stacktrace_remove_stackframeinfo)(r11)
973 L_stacktrace_remove_stackframeinfo$lazy_ptr:
974 .indirect_symbol _stacktrace_remove_stackframeinfo
975 .long dyld_stub_binding_helper
978 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
980 L_exceptions_get_and_clear_exception$stub:
981 .indirect_symbol _exceptions_get_and_clear_exception
983 bcl 20,31,L00$_exceptions_get_and_clear_exception
984 L00$_exceptions_get_and_clear_exception:
986 addis r11,r11,ha16(L_exceptions_get_and_clear_exception$lazy_ptr - L00$_exceptions_get_and_clear_exception)
988 lwzu r12,lo16(L_exceptions_get_and_clear_exception$lazy_ptr - L00$_exceptions_get_and_clear_exception)(r11)
993 L_exceptions_get_and_clear_exception$lazy_ptr:
994 .indirect_symbol _exceptions_get_and_clear_exception
995 .long dyld_stub_binding_helper
998 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1000 L_exceptions_asm_new_abstractmethoderror$stub:
1001 .indirect_symbol _exceptions_asm_new_abstractmethoderror
1003 bcl 20,31,L00$_exceptions_asm_new_abstractmethoderror
1004 L00$_exceptions_asm_new_abstractmethoderror:
1006 addis r11,r11,ha16(L_exceptions_asm_new_abstractmethoderror$lazy_ptr - L00$_exceptions_asm_new_abstractmethoderror)
1008 lwzu r12,lo16(L_exceptions_asm_new_abstractmethoderror$lazy_ptr - L00$_exceptions_asm_new_abstractmethoderror)(r11)
1012 .lazy_symbol_pointer
1013 L_exceptions_asm_new_abstractmethoderror$lazy_ptr:
1014 .indirect_symbol _exceptions_asm_new_abstractmethoderror
1015 .long dyld_stub_binding_helper
1018 # if defined(ENABLE_REPLACEMENT)
1020 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1023 .indirect_symbol _replace_me
1025 bcl 20,31,L00$_replace_me
1028 addis r11,r11,ha16(L_replace_me$lazy_ptr - L00$_replace_me)
1030 lwzu r12,lo16(L_replace_me$lazy_ptr - L00$_replace_me)(r11)
1034 .lazy_symbol_pointer
1035 L_replace_me$lazy_ptr:
1036 .indirect_symbol _replace_me
1037 .long dyld_stub_binding_helper
1040 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1042 L_replace_build_execution_state$stub:
1043 .indirect_symbol _replace_build_execution_state
1045 bcl 20,31,L00$_replace_build_execution_state
1046 L00$_replace_build_execution_state:
1048 addis r11,r11,ha16(L_replace_build_execution_state$lazy_ptr - L00$_replace_build_execution_state)
1050 lwzu r12,lo16(L_replace_build_execution_state$lazy_ptr - L00$_replace_build_execution_state)(r11)
1054 .lazy_symbol_pointer
1055 L_replace_build_execution_state$lazy_ptr:
1056 .indirect_symbol _replace_build_execution_state
1057 .long dyld_stub_binding_helper
1060 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1062 L_replace_free_safestack$stub:
1063 .indirect_symbol _replace_free_safestack
1065 bcl 20,31,L00$_replace_free_safestack
1066 L00$_replace_free_safestack:
1068 addis r11,r11,ha16(L_replace_free_safestack$lazy_ptr - L00$_replace_free_safestack)
1070 lwzu r12,lo16(L_replace_free_safestack$lazy_ptr - L00$_replace_free_safestack)(r11)
1074 .lazy_symbol_pointer
1075 L_replace_free_safestack$lazy_ptr:
1076 .indirect_symbol _replace_free_safestack
1077 .long dyld_stub_binding_helper
1079 # endif /* ENABLE_REPLACEMENT */
1081 #endif /* defined(__DARWIN__) */
1084 /* disable exec-stacks ********************************************************/
1086 #if defined(__linux__) && defined(__ELF__)
1087 .section .note.GNU-stack,"",%progbits
1092 * These are local overrides for various environment variables in Emacs.
1093 * Please do not remove this and leave it at the end of the file, where
1094 * Emacs will automagically detect them.
1095 * ---------------------------------------------------------------------
1098 * indent-tabs-mode: t
1102 * vim:noexpandtab:sw=4:ts=4: