michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: .set r0,0; .set r1,1; .set RTOC,2; .set r3,3; .set r4,4 michael@0: .set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9 michael@0: .set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14 michael@0: .set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19 michael@0: .set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24 michael@0: .set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29 michael@0: .set r30,30; .set r31,31 michael@0: .set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4 michael@0: .set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9 michael@0: .set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14 michael@0: .set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19 michael@0: .set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24 michael@0: .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29 michael@0: .set f30,30; .set f31,31 michael@0: michael@0: #if _CALL_ELF == 2 michael@0: #define STACK_PARAMS 96 michael@0: #else michael@0: #define STACK_PARAMS 112 michael@0: #endif michael@0: michael@0: #if _CALL_ELF == 2 michael@0: .section ".text" michael@0: .type SharedStub,@function michael@0: .globl SharedStub michael@0: # Make the symbol hidden so that the branch from the stub does michael@0: # not go via a PLT. This is not only better for performance, michael@0: # but may be necessary to avoid linker errors since there is michael@0: # no place to restore the TOC register in a sibling call. michael@0: .hidden SharedStub michael@0: .align 2 michael@0: SharedStub: michael@0: 0: addis 2,12,(.TOC.-0b)@ha michael@0: addi 2,2,(.TOC.-0b)@l michael@0: .localentry SharedStub,.-SharedStub michael@0: #else michael@0: .section ".text" michael@0: .align 2 michael@0: .globl SharedStub michael@0: # Make the symbol hidden so that the branch from the stub does michael@0: # not go via a PLT. This is not only better for performance, michael@0: # but may be necessary to avoid linker errors since there is michael@0: # no place to restore the TOC register in a sibling call. michael@0: .hidden SharedStub michael@0: .section ".opd","aw" michael@0: .align 3 michael@0: michael@0: SharedStub: michael@0: .quad .SharedStub,.TOC.@tocbase michael@0: .previous michael@0: .type SharedStub,@function michael@0: michael@0: .SharedStub: michael@0: #endif michael@0: mflr r0 michael@0: michael@0: std r4, -56(r1) # Save all GPRS michael@0: std r5, -48(r1) michael@0: std r6, -40(r1) michael@0: std r7, -32(r1) michael@0: std r8, -24(r1) michael@0: std r9, -16(r1) michael@0: std r10, -8(r1) michael@0: michael@0: stfd f13, -64(r1) # ... and FPRS michael@0: stfd f12, -72(r1) michael@0: stfd f11, -80(r1) michael@0: stfd f10, -88(r1) michael@0: stfd f9, -96(r1) michael@0: stfd f8, -104(r1) michael@0: stfd f7, -112(r1) michael@0: stfd f6, -120(r1) michael@0: stfd f5, -128(r1) michael@0: stfd f4, -136(r1) michael@0: stfd f3, -144(r1) michael@0: stfd f2, -152(r1) michael@0: stfd f1, -160(r1) michael@0: michael@0: subi r6,r1,56 # r6 --> gprData michael@0: subi r7,r1,160 # r7 --> fprData michael@0: addi r5,r1,STACK_PARAMS # r5 --> extra stack args michael@0: michael@0: std r0, 16(r1) michael@0: michael@0: stdu r1,-288(r1) michael@0: # r3 has the 'self' pointer michael@0: # already michael@0: michael@0: mr r4,r11 # r4 is methodIndex selector, michael@0: # passed via r11 in the michael@0: # nsNSStubBase::StubXX() call michael@0: michael@0: bl PrepareAndDispatch michael@0: nop michael@0: michael@0: ld 1,0(r1) # restore stack michael@0: ld r0,16(r1) # restore LR michael@0: mtlr r0 michael@0: blr michael@0: michael@0: #if _CALL_ELF == 2 michael@0: .size SharedStub,.-SharedStub michael@0: #else michael@0: .size SharedStub,.-.SharedStub michael@0: #endif michael@0: michael@0: # Magic indicating no need for an executable stack michael@0: .section .note.GNU-stack, "", @progbits ; .previous