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
25 $Id: asmpart.S 8274 2007-08-08 15:58:17Z twisti $
35 #include "vm/jit/abi-asm.h"
36 #include "vm/jit/methodheader.h"
44 /* export functions ***********************************************************/
46 .globl asm_vm_call_method
47 .globl asm_vm_call_method_int
48 .globl asm_vm_call_method_long
49 .globl asm_vm_call_method_float
50 .globl asm_vm_call_method_double
52 .globl asm_vm_call_method_exception_handler
53 .globl asm_vm_call_method_end
55 .globl asm_call_jit_compiler
57 .globl asm_handle_nat_exception
58 .globl asm_handle_exception
60 .globl asm_abstractmethoderror
62 #if defined(ENABLE_REPLACEMENT)
63 .globl asm_replacement_out
64 .globl asm_replacement_in
69 .globl asm_compare_and_swap
70 .globl asm_memory_barrier
73 /* asm_vm_call_method **********************************************************
75 * This function calls a Java-method (which possibly needs compilation) *
76 * with up to 4 address parameters. *
78 * This functions calls the JIT-compiler which eventually translates the *
79 * method into machine code. *
82 * javaobject_header *asm_calljavamethod (methodinfo *m, *
83 * void *arg1, void *arg2, void *arg3, void *arg4); *
85 *******************************************************************************/
89 .long 0 /* catch type all */
90 .long 0 /* exception handler pc */
92 .long 0 /* start pc */
93 .long 1 /* extable size */
94 .long 0 /* line number table start */
95 .long 0 /* line number table size */
100 .long 0 /* frame size */
101 .long 0 /* codeinfo pointer */
104 asm_vm_call_method_int:
105 asm_vm_call_method_long:
106 asm_vm_call_method_float:
107 asm_vm_call_method_double:
109 stw r0,LA_LR_OFFSET(sp)
110 stwu sp,-40*4(sp) /* keep stack 16-byte aligned */
112 stw s0,8*4(sp) /* save used callee saved registers */
113 stw a0,9*4(sp) /* save method PV */
115 #if defined(__DARWIN__)
116 stw itmp1,10*4(sp) /* register r11 is callee saved */
118 stw pv,11*4(sp) /* save PV register */
120 stw itmp3,12*4(sp) /* registers r14-r31 are callee saved */
121 stfd ftmp1,14*4(sp) /* registers f14-f31 are callee saved */
124 #if defined(__DARWIN__)
140 SAVE_TEMPORARY_REGISTERS(18) /* the offset has to be even */
143 mr t0,a1 /* address of data structure */
144 mr t1,a2 /* stack argument count */
146 mr s0,sp /* save SP */
148 lwz a0,0*8+4(t0) /* we are on big-endian */
166 #if defined(__DARWIN__)
175 beq L_asm_vm_call_method_stack_copy_done
177 slwi t2,t1,3 /* calculate stackframe size (* 8) */
179 sub sp,sp,t2 /* create stackframe */
180 mr t2,sp /* temporary stack pointer */
182 L_asm_vm_call_method_stack_copy_loop:
183 #if defined(__DARWIN__)
184 lwz t3,21*8+0(t0) /* load argument */
187 lwz t3,16*8+0(t0) /* load argument */
190 stw t3,0(t2) /* store argument on stack */
193 addi t0,t0,8 /* load address of next argument */
194 addi t2,t2,8 /* increase stack pointer */
195 addi t1,t1,-1 /* subtract 1 argument */
197 bgt L_asm_vm_call_method_stack_copy_loop
199 L_asm_vm_call_method_stack_copy_done:
200 addi mptr,s0,9*4 /* get address of PV */
201 lwz pv,0*4(mptr) /* load PV */
206 #if defined(__DARWIN__)
207 addi pv,itmp1,lo16(asm_vm_call_method - 1b)
209 addi pv,itmp1,(asm_vm_call_method - 1b)@l
212 L_asm_vm_call_method_return:
213 mr sp,s0 /* restore the SP */
215 lwz s0,8*4(sp) /* restore used callee saved registers*/
217 #if defined(__DARWIN__)
218 lwz itmp1,10*4(sp) /* register r11 is callee saved */
220 lwz pv,11*4(sp) /* save PV register */
223 lfd ftmp1,14*4(sp) /* registers f14-f31 are callee saved */
226 #if defined(__DARWIN__)
242 RESTORE_TEMPORARY_REGISTERS(18) /* the offset has to be even */
245 lwz r0,40*4+LA_LR_OFFSET(sp)
250 asm_vm_call_method_exception_handler:
252 bl builtin_throw_exception
253 b L_asm_vm_call_method_return
255 asm_vm_call_method_end:
259 /* asm_call_jit_compiler *******************************************************
261 Invokes the compiler for untranslated JavaVM methods.
263 *******************************************************************************/
265 asm_call_jit_compiler:
266 L_asm_call_jit_compiler: /* required for PIC code */
268 stw r0,LA_LR_OFFSET(sp) /* save return address */
269 stwu sp,-(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)(sp)
271 #if defined(__DARWIN__)
272 stw a0,LA_SIZE+(4+0)*4(sp)
273 stw a1,LA_SIZE+(4+1)*4(sp)
274 stw a2,LA_SIZE+(4+2)*4(sp)
275 stw a3,LA_SIZE+(4+3)*4(sp)
276 stw a4,LA_SIZE+(4+4)*4(sp)
277 stw a5,LA_SIZE+(4+5)*4(sp)
278 stw a6,LA_SIZE+(4+6)*4(sp)
279 stw a7,LA_SIZE+(4+7)*4(sp)
281 stfd fa0,LA_SIZE+(4+8)*4(sp)
282 stfd fa1,LA_SIZE+(4+10)*4(sp)
283 stfd fa2,LA_SIZE+(4+12)*4(sp)
284 stfd fa3,LA_SIZE+(4+14)*4(sp)
285 stfd fa4,LA_SIZE+(4+16)*4(sp)
286 stfd fa5,LA_SIZE+(4+18)*4(sp)
287 stfd fa6,LA_SIZE+(4+20)*4(sp)
288 stfd fa7,LA_SIZE+(4+22)*4(sp)
289 stfd fa8,LA_SIZE+(4+24)*4(sp)
290 stfd fa9,LA_SIZE+(4+26)*4(sp)
291 stfd fa10,LA_SIZE+(4+28)*4(sp)
292 stfd fa11,LA_SIZE+(4+30)*4(sp)
293 stfd fa12,LA_SIZE+(4+32)*4(sp)
295 SAVE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS)
300 addi a2,sp,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)
301 lwz a3,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)+LA_LR_OFFSET(sp)
303 mr pv,v0 /* move address to pv register */
305 #if defined(__DARWIN__)
306 lwz a0,LA_SIZE+(4+0)*4(sp)
307 lwz a1,LA_SIZE+(4+1)*4(sp)
308 lwz a2,LA_SIZE+(4+2)*4(sp)
309 lwz a3,LA_SIZE+(4+3)*4(sp)
310 lwz a4,LA_SIZE+(4+4)*4(sp)
311 lwz a5,LA_SIZE+(4+5)*4(sp)
312 lwz a6,LA_SIZE+(4+6)*4(sp)
313 lwz a7,LA_SIZE+(4+7)*4(sp)
315 lfd fa0,LA_SIZE+(4+8)*4(sp)
316 lfd fa1,LA_SIZE+(4+10)*4(sp)
317 lfd fa2,LA_SIZE+(4+12)*4(sp)
318 lfd fa3,LA_SIZE+(4+14)*4(sp)
319 lfd fa4,LA_SIZE+(4+16)*4(sp)
320 lfd fa5,LA_SIZE+(4+18)*4(sp)
321 lfd fa6,LA_SIZE+(4+20)*4(sp)
322 lfd fa7,LA_SIZE+(4+22)*4(sp)
323 lfd fa8,LA_SIZE+(4+24)*4(sp)
324 lfd fa9,LA_SIZE+(4+26)*4(sp)
325 lfd fa10,LA_SIZE+(4+28)*4(sp)
326 lfd fa11,LA_SIZE+(4+30)*4(sp)
327 lfd fa12,LA_SIZE+(4+32)*4(sp)
329 RESTORE_ARGUMENT_REGISTERS(LA_SIZE_IN_POINTERS)
332 lwz itmp1,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)+LA_LR_OFFSET(sp)
335 addi sp,sp,(LA_SIZE + 4*4 + INT_ARG_CNT*4 + FLT_ARG_CNT*8)
337 mr. pv,pv /* test for exception */
338 beq L_asm_call_jit_compiler_exception
340 mtctr pv /* move method address to control reg */
341 bctr /* and call the Java method */
343 L_asm_call_jit_compiler_exception:
345 stw r0,LA_LR_OFFSET(sp)
346 stwu sp,-LA_SIZE_ALIGNED(sp) /* preserve linkage area */
347 bl exceptions_get_and_clear_exception
348 lwz xpc,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
350 addi sp,sp,LA_SIZE_ALIGNED
352 mr xptr,v0 /* get exception */
353 addi xpc,xpc,-4 /* exception address is ra - 4 */
354 b L_asm_handle_nat_exception
357 /********************* function asm_handle_exception ***************************
359 * This function handles an exception. It does not use the usual calling *
360 * conventions. The exception pointer is passed in REG_ITMP1 and the *
361 * pc from the exception raising position is passed in REG_ITMP2. It searches *
362 * the local exception table for a handler. If no one is found, it unwinds *
363 * stacks and continues searching the callers. *
365 * void asm_handle_exception (exceptionptr, exceptionpc); *
367 *******************************************************************************/
369 asm_handle_nat_exception:
370 L_asm_handle_nat_exception: /* required for PIC code */
371 L_asm_handle_exception_stack_loop:
373 addi sp,sp,-(LA_SIZE+((4+6)*4)) /* allocate stack (+4 for darwin) */
374 stw xptr,LA_SIZE+(4+0)*4(sp) /* save exception pointer */
375 stw xpc,LA_SIZE+(4+1)*4(sp) /* save exception pc */
376 stw r0,LA_SIZE+(4+3)*4(sp) /* save return address */
378 stw itmp3,LA_SIZE+(4+4)*4(sp) /* save maybe-leaf flag (cleared) */
380 mr a0,r0 /* pass return address */
381 bl md_codegen_get_pv_from_pc /* get PV from RA */
382 stw v0,LA_SIZE+(4+2)*4(sp) /* save data segment pointer */
384 lwz a0,LA_SIZE+(4+0)*4(sp) /* pass xptr */
385 lwz a1,LA_SIZE+(4+1)*4(sp) /* pass xpc */
386 lwz a2,LA_SIZE+(4+2)*4(sp) /* pass PV (v0 == a0) */
387 addi a3,sp,LA_SIZE+((4+6)*4) /* pass Java SP */
389 b L_asm_handle_exception_continue
391 asm_handle_exception:
392 L_asm_handle_exception: /* required for PIC code */
393 addi sp,sp,-(ARG_CNT+TMP_CNT)*8 /* create maybe-leaf stackframe */
395 #if defined(__DARWIN__)
397 SAVE_ARGUMENT_REGISTERS(0) /* we save arg and temp registers in */
398 SAVE_TEMPORARY_REGISTERS(ARG_CNT) /* case this is a leaf method */
401 addi sp,sp,-(LA_SIZE+(4+6)*4) /* allocate stack */
402 stw xptr,LA_SIZE+(4+0)*4(sp) /* save xptr */
403 stw pv,LA_SIZE+(4+2)*4(sp) /* save PV */
404 mflr r0 /* save RA */
405 stw r0,LA_SIZE+(4+3)*4(sp)
406 li t0,1 /* set maybe-leaf flag */
407 stw t0,LA_SIZE+(4+4)*4(sp) /* save maybe-leaf flag */
409 mr a0,xptr /* pass exception pointer */
410 mr a1,xpc /* pass exception pc */
411 mr a2,pv /* pass data segment pointer */
412 addi a3,sp,LA_SIZE+(ARG_CNT+TMP_CNT)*8+(4+6)*4
414 L_asm_handle_exception_continue:
415 bl exceptions_handle_exception
418 beq L_asm_handle_exception_not_catched
420 mr xpc,v0 /* move handlerpc into xpc */
421 lwz xptr,LA_SIZE+(4+0)*4(sp) /* restore xptr */
422 lwz pv,LA_SIZE+(4+2)*4(sp) /* restore PV */
423 lwz r0,LA_SIZE+(4+3)*4(sp) /* restore RA */
425 lwz t0,LA_SIZE+(4+4)*4(sp) /* get maybe-leaf flag */
426 addi sp,sp,LA_SIZE+(4+6)*4 /* free stack frame */
429 beq L_asm_handle_exception_no_leaf
431 #if defined(__DARWIN__)
433 RESTORE_ARGUMENT_REGISTERS(0) /* if this is a leaf method, we have */
434 RESTORE_TEMPORARY_REGISTERS(ARG_CNT)/* to restore arg and temp registers */
437 addi sp,sp,(ARG_CNT+TMP_CNT)*8 /* remove maybe-leaf stackframe */
439 L_asm_handle_exception_no_leaf:
440 mtctr xpc /* jump to the handler */
443 L_asm_handle_exception_not_catched:
444 lwz xptr,LA_SIZE+(4+0)*4(sp) /* restore xptr */
445 lwz pv,LA_SIZE+(4+2)*4(sp) /* restore PV */
446 lwz r0,LA_SIZE+(4+3)*4(sp) /* restore RA */
448 lwz t0,LA_SIZE+(4+4)*4(sp) /* get maybe-leaf flag */
449 addi sp,sp,LA_SIZE+(4+6)*4 /* free stack frame */
452 beq L_asm_handle_exception_no_leaf_stack
454 addi sp,sp,(ARG_CNT+TMP_CNT)*8 /* remove maybe-leaf stackframe */
455 li t0,0 /* clear the maybe-leaf flag */
457 L_asm_handle_exception_no_leaf_stack:
458 lwz t1,FrameSize(pv) /* get frame size */
459 add t1,sp,t1 /* pointer to save area */
461 lwz t2,IsLeaf(pv) /* is leaf procedure */
463 bne L_asm_handle_exception_no_ra_restore
465 lwz r0,LA_LR_OFFSET(t1) /* restore ra */
468 L_asm_handle_exception_no_ra_restore:
469 mflr xpc /* the new xpc is ra */
470 mr t4,xpc /* save RA */
471 lwz t2,IntSave(pv) /* t2 = saved int register count */
474 mflr t3 /* t3 = current pc */
475 #if defined(__DARWIN__)
476 addi t3,t3,lo16(ex_int2-ex_int1)
478 addi t3,t3,(ex_int2-ex_int1)@l
480 slwi t2,t2,2 /* t2 = register count * 4 */
481 subf t3,t2,t3 /* t3 = IntSave - t2 */
497 subf t1,t2,t1 /* t1 = t1 - register count * 4 */
503 #if defined(__DARWIN__)
504 addi t3,t3,lo16(ex_flt2-ex_flt1)
506 addi t3,t3,(ex_flt2-ex_flt1)@l
508 slwi t2,t2,2 /* t2 = register count * 4 */
509 subf t3,t2,t3 /* t3 = FltSave - t2 */
525 mtlr t4 /* restore RA */
526 lwz t1,FrameSize(pv) /* get frame size */
527 add sp,sp,t1 /* unwind stack */
528 b L_asm_handle_exception_stack_loop
531 /* asm_abstractmethoderror *****************************************************
533 Creates and throws an AbstractMethodError.
535 *******************************************************************************/
537 asm_abstractmethoderror:
539 stw r0,LA_LR_OFFSET(sp)
540 stwu sp,-LA_SIZE_ALIGNED(sp) /* preserve linkage area */
541 addi a0,sp,LA_SIZE_ALIGNED /* pass java sp */
542 mr a1,r0 /* pass exception address */
543 bl exceptions_asm_new_abstractmethoderror
544 lwz r0,LA_SIZE_ALIGNED+LA_LR_OFFSET(sp)
545 mtlr r0 /* restore return address */
546 addi sp,sp,LA_SIZE_ALIGNED
548 mr xptr,v0 /* get exception pointer */
549 mr xpc,r0 /* we can't use r0 directly in addi */
550 addi xpc,xpc,-4 /* exception address is ra - 4 */
551 b L_asm_handle_nat_exception
554 #if defined(ENABLE_REPLACEMENT)
556 /* asm_replacement_out *********************************************************
558 This code is jumped to from the replacement-out stubs that are executed
559 when a thread reaches an activated replacement point.
561 The purpose of asm_replacement_out is to read out the parts of the
562 execution state that cannot be accessed from C code, store this state,
563 and then call the C function replace_me.
566 16 start of stack inside method to replace
567 0 rplpoint * info on the replacement point that was reached
569 NOTE: itmp3 has been clobbered by the replacement-out stub!
571 *******************************************************************************/
573 /* some room to accomodate changes of the stack frame size during replacement */
574 /* XXX we should find a cleaner solution here */
575 #define REPLACEMENT_ROOM 512
577 #define sizeexecutionstate_ALIGNED ((sizeexecutionstate + 15) & ~15)
580 /* create stack frame */
581 addi sp,sp,-(sizeexecutionstate_ALIGNED + REPLACEMENT_ROOM)
583 /* save link register */
586 /* save registers in execution state */
587 stw r0 ,( 0*4+offes_intregs)(sp)
588 stw r1 ,( 1*4+offes_intregs)(sp)
589 stw r2 ,( 2*4+offes_intregs)(sp)
590 stw r3 ,( 3*4+offes_intregs)(sp)
591 stw r4 ,( 4*4+offes_intregs)(sp)
592 stw r5 ,( 5*4+offes_intregs)(sp)
593 stw r6 ,( 6*4+offes_intregs)(sp)
594 stw r7 ,( 7*4+offes_intregs)(sp)
595 stw r8 ,( 8*4+offes_intregs)(sp)
596 stw r9 ,( 9*4+offes_intregs)(sp)
597 stw r10,(10*4+offes_intregs)(sp)
598 stw r11,(11*4+offes_intregs)(sp)
599 stw r12,(12*4+offes_intregs)(sp)
600 stw r13,(13*4+offes_intregs)(sp)
601 stw r14,(14*4+offes_intregs)(sp)
602 stw r15,(15*4+offes_intregs)(sp)
603 stw r16,(16*4+offes_intregs)(sp) /* link register stored as itmp3 */
604 stw r17,(17*4+offes_intregs)(sp)
605 stw r18,(18*4+offes_intregs)(sp)
606 stw r19,(19*4+offes_intregs)(sp)
607 stw r20,(20*4+offes_intregs)(sp)
608 stw r21,(21*4+offes_intregs)(sp)
609 stw r22,(22*4+offes_intregs)(sp)
610 stw r23,(23*4+offes_intregs)(sp)
611 stw r24,(24*4+offes_intregs)(sp)
612 stw r25,(25*4+offes_intregs)(sp)
613 stw r26,(26*4+offes_intregs)(sp)
614 stw r27,(27*4+offes_intregs)(sp)
615 stw r28,(28*4+offes_intregs)(sp)
616 stw r29,(29*4+offes_intregs)(sp)
617 stw r30,(30*4+offes_intregs)(sp)
618 stw r31,(31*4+offes_intregs)(sp)
620 stfd fr0 ,( 0*8+offes_fltregs)(sp)
621 stfd fr1 ,( 1*8+offes_fltregs)(sp)
622 stfd fr2 ,( 2*8+offes_fltregs)(sp)
623 stfd fr3 ,( 3*8+offes_fltregs)(sp)
624 stfd fr4 ,( 4*8+offes_fltregs)(sp)
625 stfd fr5 ,( 5*8+offes_fltregs)(sp)
626 stfd fr6 ,( 6*8+offes_fltregs)(sp)
627 stfd fr7 ,( 7*8+offes_fltregs)(sp)
628 stfd fr8 ,( 8*8+offes_fltregs)(sp)
629 stfd fr9 ,( 9*8+offes_fltregs)(sp)
630 stfd fr10,(10*8+offes_fltregs)(sp)
631 stfd fr11,(11*8+offes_fltregs)(sp)
632 stfd fr12,(12*8+offes_fltregs)(sp)
633 stfd fr13,(13*8+offes_fltregs)(sp)
634 stfd fr14,(14*8+offes_fltregs)(sp)
635 stfd fr15,(15*8+offes_fltregs)(sp)
636 stfd fr16,(16*8+offes_fltregs)(sp)
637 stfd fr17,(17*8+offes_fltregs)(sp)
638 stfd fr18,(18*8+offes_fltregs)(sp)
639 stfd fr19,(19*8+offes_fltregs)(sp)
640 stfd fr20,(20*8+offes_fltregs)(sp)
641 stfd fr21,(21*8+offes_fltregs)(sp)
642 stfd fr22,(22*8+offes_fltregs)(sp)
643 stfd fr23,(23*8+offes_fltregs)(sp)
644 stfd fr24,(24*8+offes_fltregs)(sp)
645 stfd fr25,(25*8+offes_fltregs)(sp)
646 stfd fr26,(26*8+offes_fltregs)(sp)
647 stfd fr27,(27*8+offes_fltregs)(sp)
648 stfd fr28,(28*8+offes_fltregs)(sp)
649 stfd fr29,(29*8+offes_fltregs)(sp)
650 stfd fr30,(30*8+offes_fltregs)(sp)
651 stfd fr31,(31*8+offes_fltregs)(sp)
653 /* calculate sp of method */
654 addi itmp1,sp,(sizeexecutionstate_ALIGNED + REPLACEMENT_ROOM + 4*4)
655 stw itmp1,(offes_sp)(sp)
658 stw pv,(offes_pv)(sp)
660 /* call replace_me */
661 lwz a0,-(4*4)(itmp1) /* arg0: rplpoint * */
662 mr a1,sp /* arg1: execution state */
663 addi sp,sp,-(LA_SIZE_ALIGNED)
664 b replace_me /* call C function replace_me */
666 /* asm_replacement_in **********************************************************
668 This code writes the given execution state and jumps to the replacement
671 This function never returns!
673 NOTE: itmp3 is not restored!
676 void asm_replacement_in(executionstate *es, replace_safestack_t *st);
678 *******************************************************************************/
681 /* a0 == executionstate *es */
682 /* a1 == replace_safestack_t *st */
685 mr s1,a1 /* replace_safestack_t *st */
686 mr s2,a0 /* executionstate *es == safe stack */
688 /* switch to the safe stack */
691 /* reserve linkage area */
692 addi sp,sp,-(LA_SIZE_ALIGNED)
694 /* call replace_build_execution_state(st) */
696 bl replace_build_execution_state
699 lwz sp,(offes_sp)(s2)
701 /* build stack frame */
702 addi sp,sp,-(sizeexecutionstate_ALIGNED)
704 /* call replace_free_safestack(st,& of allocated executionstate_t) */
707 addi sp,sp,-(LA_SIZE_ALIGNED) /* reserve linkage area */
708 bl replace_free_safestack
709 addi sp,sp,+(LA_SIZE_ALIGNED) /* tear down linkage area */
712 lwz pv,(offes_pv)(sp)
714 /* copy registers from execution state */
715 lwz r0 ,( 0*4+offes_intregs)(sp)
718 lwz a0 ,( 3*4+offes_intregs)(sp)
719 lwz r4 ,( 4*4+offes_intregs)(sp)
720 lwz r5 ,( 5*4+offes_intregs)(sp)
721 lwz r6 ,( 6*4+offes_intregs)(sp)
722 lwz r7 ,( 7*4+offes_intregs)(sp)
723 lwz r8 ,( 8*4+offes_intregs)(sp)
724 lwz r9 ,( 9*4+offes_intregs)(sp)
725 lwz r10,(10*4+offes_intregs)(sp)
726 lwz r11,(11*4+offes_intregs)(sp)
727 lwz r12,(12*4+offes_intregs)(sp)
729 lwz r14,(14*4+offes_intregs)(sp)
730 lwz r15,(15*4+offes_intregs)(sp)
731 lwz r16,(16*4+offes_intregs)(sp) /* itmp3, later to link register */
732 lwz r17,(17*4+offes_intregs)(sp)
733 lwz r18,(18*4+offes_intregs)(sp)
734 lwz r19,(19*4+offes_intregs)(sp)
735 lwz r20,(20*4+offes_intregs)(sp)
736 lwz r21,(21*4+offes_intregs)(sp)
737 lwz r22,(22*4+offes_intregs)(sp)
738 lwz r23,(23*4+offes_intregs)(sp)
739 lwz r24,(24*4+offes_intregs)(sp)
740 lwz r25,(25*4+offes_intregs)(sp)
741 lwz r26,(26*4+offes_intregs)(sp)
742 lwz r27,(27*4+offes_intregs)(sp)
743 lwz r28,(28*4+offes_intregs)(sp)
744 lwz r29,(29*4+offes_intregs)(sp)
745 lwz r30,(30*4+offes_intregs)(sp)
746 lwz r31,(31*4+offes_intregs)(sp)
748 lfd fr0 ,( 0*8+offes_fltregs)(sp)
749 lfd fr1 ,( 1*8+offes_fltregs)(sp)
750 lfd fr2 ,( 2*8+offes_fltregs)(sp)
751 lfd fr3 ,( 3*8+offes_fltregs)(sp)
752 lfd fr4 ,( 4*8+offes_fltregs)(sp)
753 lfd fr5 ,( 5*8+offes_fltregs)(sp)
754 lfd fr6 ,( 6*8+offes_fltregs)(sp)
755 lfd fr7 ,( 7*8+offes_fltregs)(sp)
756 lfd fr8 ,( 8*8+offes_fltregs)(sp)
757 lfd fr9 ,( 9*8+offes_fltregs)(sp)
758 lfd fr10,(10*8+offes_fltregs)(sp)
759 lfd fr11,(11*8+offes_fltregs)(sp)
760 lfd fr12,(12*8+offes_fltregs)(sp)
761 lfd fr13,(13*8+offes_fltregs)(sp)
762 lfd fr14,(14*8+offes_fltregs)(sp)
763 lfd fr15,(15*8+offes_fltregs)(sp)
764 lfd fr16,(16*8+offes_fltregs)(sp)
765 lfd fr17,(17*8+offes_fltregs)(sp)
766 lfd fr18,(18*8+offes_fltregs)(sp)
767 lfd fr19,(19*8+offes_fltregs)(sp)
768 lfd fr20,(20*8+offes_fltregs)(sp)
769 lfd fr21,(21*8+offes_fltregs)(sp)
770 lfd fr22,(22*8+offes_fltregs)(sp)
771 lfd fr23,(23*8+offes_fltregs)(sp)
772 lfd fr24,(24*8+offes_fltregs)(sp)
773 lfd fr25,(25*8+offes_fltregs)(sp)
774 lfd fr26,(26*8+offes_fltregs)(sp)
775 lfd fr27,(27*8+offes_fltregs)(sp)
776 lfd fr28,(28*8+offes_fltregs)(sp)
777 lfd fr29,(29*8+offes_fltregs)(sp)
778 lfd fr30,(30*8+offes_fltregs)(sp)
779 lfd fr31,(31*8+offes_fltregs)(sp)
781 /* restore link register */
787 lwz itmp3,offes_pc(sp)
789 /* remove stack frame */
791 addi sp,sp,+(sizeexecutionstate_ALIGNED)
793 /* jump to new code */
798 #endif /* defined(ENABLE_REPLACEMENT) */
800 /*********************************************************************/
828 /* asm_compare_and_swap ********************************************************
832 *******************************************************************************/
834 asm_compare_and_swap:
847 /* asm_memory_barrier **********************************************************
851 *******************************************************************************/
858 #if defined(__DARWIN__)
860 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
862 L_builtin_throw_exception$stub:
863 .indirect_symbol _builtin_throw_exception
865 bcl 20,31,L00$_builtin_throw_exception
866 L00$_builtin_throw_exception:
868 addis r11,r11,ha16(L_builtin_throw_exception$lazy_ptr - L00$_builtin_throw_exception)
870 lwzu r12,lo16(L_builtin_throw_exception$lazy_ptr - L00$_builtin_throw_exception)(r11)
875 L_builtin_throw_exception$lazy_ptr:
876 .indirect_symbol _builtin_throw_exception
877 .long dyld_stub_binding_helper
880 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
882 L_md_codegen_get_pv_from_pc$stub:
883 .indirect_symbol _md_codegen_get_pv_from_pc
885 bcl 20,31,L00$_md_codegen_get_pv_from_pc
886 L00$_md_codegen_get_pv_from_pc:
888 addis r11,r11,ha16(L_md_codegen_get_pv_from_pc$lazy_ptr - L00$_md_codegen_get_pv_from_pc)
890 lwzu r12,lo16(L_md_codegen_get_pv_from_pc$lazy_ptr - L00$_md_codegen_get_pv_from_pc)(r11)
895 L_md_codegen_get_pv_from_pc$lazy_ptr:
896 .indirect_symbol _md_codegen_get_pv_from_pc
897 .long dyld_stub_binding_helper
900 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
902 L_exceptions_handle_exception$stub:
903 .indirect_symbol _exceptions_handle_exception
905 bcl 20,31,L00$_exceptions_handle_exception
906 L00$_exceptions_handle_exception:
908 addis r11,r11,ha16(L_exceptions_handle_exception$lazy_ptr - L00$_exceptions_handle_exception)
910 lwzu r12,lo16(L_exceptions_handle_exception$lazy_ptr - L00$_exceptions_handle_exception)(r11)
915 L_exceptions_handle_exception$lazy_ptr:
916 .indirect_symbol _exceptions_handle_exception
917 .long dyld_stub_binding_helper
920 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
922 L_stacktrace_create_extern_stackframeinfo$stub:
923 .indirect_symbol _stacktrace_create_extern_stackframeinfo
925 bcl 20,31,L00$_stacktrace_create_extern_stackframeinfo
926 L00$_stacktrace_create_extern_stackframeinfo:
928 addis r11,r11,ha16(L_stacktrace_create_extern_stackframeinfo$lazy_ptr - L00$_stacktrace_create_extern_stackframeinfo)
930 lwzu r12,lo16(L_stacktrace_create_extern_stackframeinfo$lazy_ptr - L00$_stacktrace_create_extern_stackframeinfo)(r11)
935 L_stacktrace_create_extern_stackframeinfo$lazy_ptr:
936 .indirect_symbol _stacktrace_create_extern_stackframeinfo
937 .long dyld_stub_binding_helper
940 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
942 L_jit_asm_compile$stub:
943 .indirect_symbol _jit_asm_compile
945 bcl 20,31,L00$_jit_asm_compile
946 L00$_jit_asm_compile:
948 addis r11,r11,ha16(L_jit_asm_compile$lazy_ptr - L00$_jit_asm_compile)
950 lwzu r12,lo16(L_jit_asm_compile$lazy_ptr - L00$_jit_asm_compile)(r11)
955 L_jit_asm_compile$lazy_ptr:
956 .indirect_symbol _jit_asm_compile
957 .long dyld_stub_binding_helper
960 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
962 L_stacktrace_remove_stackframeinfo$stub:
963 .indirect_symbol _stacktrace_remove_stackframeinfo
965 bcl 20,31,L00$_stacktrace_remove_stackframeinfo
966 L00$_stacktrace_remove_stackframeinfo:
968 addis r11,r11,ha16(L_stacktrace_remove_stackframeinfo$lazy_ptr - L00$_stacktrace_remove_stackframeinfo)
970 lwzu r12,lo16(L_stacktrace_remove_stackframeinfo$lazy_ptr - L00$_stacktrace_remove_stackframeinfo)(r11)
975 L_stacktrace_remove_stackframeinfo$lazy_ptr:
976 .indirect_symbol _stacktrace_remove_stackframeinfo
977 .long dyld_stub_binding_helper
980 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
982 L_exceptions_get_and_clear_exception$stub:
983 .indirect_symbol _exceptions_get_and_clear_exception
985 bcl 20,31,L00$_exceptions_get_and_clear_exception
986 L00$_exceptions_get_and_clear_exception:
988 addis r11,r11,ha16(L_exceptions_get_and_clear_exception$lazy_ptr - L00$_exceptions_get_and_clear_exception)
990 lwzu r12,lo16(L_exceptions_get_and_clear_exception$lazy_ptr - L00$_exceptions_get_and_clear_exception)(r11)
995 L_exceptions_get_and_clear_exception$lazy_ptr:
996 .indirect_symbol _exceptions_get_and_clear_exception
997 .long dyld_stub_binding_helper
1000 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1002 L_exceptions_asm_new_abstractmethoderror$stub:
1003 .indirect_symbol _exceptions_asm_new_abstractmethoderror
1005 bcl 20,31,L00$_exceptions_asm_new_abstractmethoderror
1006 L00$_exceptions_asm_new_abstractmethoderror:
1008 addis r11,r11,ha16(L_exceptions_asm_new_abstractmethoderror$lazy_ptr - L00$_exceptions_asm_new_abstractmethoderror)
1010 lwzu r12,lo16(L_exceptions_asm_new_abstractmethoderror$lazy_ptr - L00$_exceptions_asm_new_abstractmethoderror)(r11)
1014 .lazy_symbol_pointer
1015 L_exceptions_asm_new_abstractmethoderror$lazy_ptr:
1016 .indirect_symbol _exceptions_asm_new_abstractmethoderror
1017 .long dyld_stub_binding_helper
1020 # if defined(ENABLE_REPLACEMENT)
1022 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1025 .indirect_symbol _replace_me
1027 bcl 20,31,L00$_replace_me
1030 addis r11,r11,ha16(L_replace_me$lazy_ptr - L00$_replace_me)
1032 lwzu r12,lo16(L_replace_me$lazy_ptr - L00$_replace_me)(r11)
1036 .lazy_symbol_pointer
1037 L_replace_me$lazy_ptr:
1038 .indirect_symbol _replace_me
1039 .long dyld_stub_binding_helper
1042 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1044 L_replace_build_execution_state$stub:
1045 .indirect_symbol _replace_build_execution_state
1047 bcl 20,31,L00$_replace_build_execution_state
1048 L00$_replace_build_execution_state:
1050 addis r11,r11,ha16(L_replace_build_execution_state$lazy_ptr - L00$_replace_build_execution_state)
1052 lwzu r12,lo16(L_replace_build_execution_state$lazy_ptr - L00$_replace_build_execution_state)(r11)
1056 .lazy_symbol_pointer
1057 L_replace_build_execution_state$lazy_ptr:
1058 .indirect_symbol _replace_build_execution_state
1059 .long dyld_stub_binding_helper
1062 .section __TEXT,__picsymbolstub1,symbol_stubs,pure_instructions,32
1064 L_replace_free_safestack$stub:
1065 .indirect_symbol _replace_free_safestack
1067 bcl 20,31,L00$_replace_free_safestack
1068 L00$_replace_free_safestack:
1070 addis r11,r11,ha16(L_replace_free_safestack$lazy_ptr - L00$_replace_free_safestack)
1072 lwzu r12,lo16(L_replace_free_safestack$lazy_ptr - L00$_replace_free_safestack)(r11)
1076 .lazy_symbol_pointer
1077 L_replace_free_safestack$lazy_ptr:
1078 .indirect_symbol _replace_free_safestack
1079 .long dyld_stub_binding_helper
1081 # endif /* ENABLE_REPLACEMENT */
1083 #endif /* defined(__DARWIN__) */
1086 /* disable exec-stacks ********************************************************/
1088 #if defined(__linux__) && defined(__ELF__)
1089 .section .note.GNU-stack,"",%progbits
1094 * These are local overrides for various environment variables in Emacs.
1095 * Please do not remove this and leave it at the end of the file, where
1096 * Emacs will automagically detect them.
1097 * ---------------------------------------------------------------------
1100 * indent-tabs-mode: t
1104 * vim:noexpandtab:sw=4:ts=4: