Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | |
michael@0 | 5 | .set r0,0; .set sp,1; .set RTOC,2; .set r3,3; .set r4,4 |
michael@0 | 6 | .set r5,5; .set r6,6; .set r7,7; .set r8,8; .set r9,9 |
michael@0 | 7 | .set r10,10; .set r11,11; .set r12,12; .set r13,13; .set r14,14 |
michael@0 | 8 | .set r15,15; .set r16,16; .set r17,17; .set r18,18; .set r19,19 |
michael@0 | 9 | .set r20,20; .set r21,21; .set r22,22; .set r23,23; .set r24,24 |
michael@0 | 10 | .set r25,25; .set r26,26; .set r27,27; .set r28,28; .set r29,29 |
michael@0 | 11 | .set r30,30; .set r31,31 |
michael@0 | 12 | .set f0,0; .set f1,1; .set f2,2; .set f3,3; .set f4,4 |
michael@0 | 13 | .set f5,5; .set f6,6; .set f7,7; .set f8,8; .set f9,9 |
michael@0 | 14 | .set f10,10; .set f11,11; .set f12,12; .set f13,13; .set f14,14 |
michael@0 | 15 | .set f15,15; .set f16,16; .set f17,17; .set f18,18; .set f19,19 |
michael@0 | 16 | .set f20,20; .set f21,21; .set f22,22; .set f23,23; .set f24,24 |
michael@0 | 17 | .set f25,25; .set f26,26; .set f27,27; .set f28,28; .set f29,29 |
michael@0 | 18 | .set f30,30; .set f31,31 |
michael@0 | 19 | |
michael@0 | 20 | # Define the correct name of the stub function based on the object model |
michael@0 | 21 | |
michael@0 | 22 | define(STUB_NAME, |
michael@0 | 23 | ifelse(AIX_OBJMODEL, ibm, |
michael@0 | 24 | `Stub'$1`__EI14nsXPTCStubBaseFv', |
michael@0 | 25 | `Stub'$1`__14nsXPTCStubBaseFv')) |
michael@0 | 26 | |
michael@0 | 27 | define(STUB_ENTRY, ` |
michael@0 | 28 | .rename H.10.NO_SYMBOL{PR},"" |
michael@0 | 29 | .rename H.18.'STUB_NAME($1)`{TC},"'STUB_NAME($1)`" |
michael@0 | 30 | .csect H.10.NO_SYMBOL{PR} |
michael@0 | 31 | .globl .'STUB_NAME($1)` |
michael@0 | 32 | .globl 'STUB_NAME($1)`{DS} |
michael@0 | 33 | |
michael@0 | 34 | .'STUB_NAME($1)`: |
michael@0 | 35 | li r12, '$1` |
michael@0 | 36 | b .SharedStub |
michael@0 | 37 | nop |
michael@0 | 38 | |
michael@0 | 39 | |
michael@0 | 40 | .toc |
michael@0 | 41 | T.18.'STUB_NAME($1)`: |
michael@0 | 42 | .tc H.18.'STUB_NAME($1)`{TC},'STUB_NAME($1)`{DS} |
michael@0 | 43 | .csect 'STUB_NAME($1)`{DS} |
michael@0 | 44 | .long .'STUB_NAME($1)` |
michael@0 | 45 | .long TOC{TC0} |
michael@0 | 46 | .long 0x00000000 |
michael@0 | 47 | ') |
michael@0 | 48 | |
michael@0 | 49 | define(SENTINEL_ENTRY, `') |
michael@0 | 50 | |
michael@0 | 51 | include(xptcstubsdef.inc) |
michael@0 | 52 | |
michael@0 | 53 | .rename H.10.NO_SYMBOL{PR},"" |
michael@0 | 54 | .rename H.18.SharedStub{TC},"SharedStub" |
michael@0 | 55 | |
michael@0 | 56 | # .text section |
michael@0 | 57 | .csect H.10.NO_SYMBOL{PR} |
michael@0 | 58 | .globl .SharedStub |
michael@0 | 59 | .globl SharedStub{DS} |
michael@0 | 60 | .extern .PrepareAndDispatch |
michael@0 | 61 | |
michael@0 | 62 | .SharedStub: |
michael@0 | 63 | mflr r0 |
michael@0 | 64 | stw r0,8(sp) |
michael@0 | 65 | |
michael@0 | 66 | stwu sp,-176(sp) # room for linkage (24), fprData (104), gprData(28) |
michael@0 | 67 | # outgoing params to PrepareAndDispatch (20) |
michael@0 | 68 | |
michael@0 | 69 | stw r4,44(sp) # link area (24) + PrepareAndDispatch params (20) |
michael@0 | 70 | stw r5,48(sp) |
michael@0 | 71 | stw r6,52(sp) |
michael@0 | 72 | stw r7,56(sp) |
michael@0 | 73 | stw r8,60(sp) |
michael@0 | 74 | stw r9,64(sp) |
michael@0 | 75 | stw r10,68(sp) |
michael@0 | 76 | stfd f1,72(sp) |
michael@0 | 77 | stfd f2,80(sp) |
michael@0 | 78 | stfd f3,88(sp) |
michael@0 | 79 | stfd f4,96(sp) |
michael@0 | 80 | stfd f5,104(sp) |
michael@0 | 81 | stfd f6,112(sp) |
michael@0 | 82 | stfd f7,120(sp) |
michael@0 | 83 | stfd f8,128(sp) |
michael@0 | 84 | stfd f9,136(sp) |
michael@0 | 85 | stfd f10,144(sp) |
michael@0 | 86 | stfd f11,152(sp) |
michael@0 | 87 | stfd f12,156(sp) |
michael@0 | 88 | stfd f13,164(sp) |
michael@0 | 89 | |
michael@0 | 90 | addi r6,sp,44 # gprData |
michael@0 | 91 | |
michael@0 | 92 | addi r7,sp,72 # fprData |
michael@0 | 93 | # r3 has the 'self' pointer already |
michael@0 | 94 | mr r4,r12 # methodIndex selector (it is now LATER) |
michael@0 | 95 | addi r5,sp,232 # pointer to callers args area, beyond r3-r10 |
michael@0 | 96 | # mapped range |
michael@0 | 97 | |
michael@0 | 98 | bl .PrepareAndDispatch |
michael@0 | 99 | nop |
michael@0 | 100 | |
michael@0 | 101 | |
michael@0 | 102 | lwz r0,184(sp) |
michael@0 | 103 | addi sp,sp,176 |
michael@0 | 104 | mtlr r0 |
michael@0 | 105 | blr |
michael@0 | 106 | |
michael@0 | 107 | # .data section |
michael@0 | 108 | |
michael@0 | 109 | .toc # 0x00000038 |
michael@0 | 110 | T.18.SharedStub: |
michael@0 | 111 | .tc H.18.SharedStub{TC},SharedStub{DS} |
michael@0 | 112 | |
michael@0 | 113 | .csect SharedStub{DS} |
michael@0 | 114 | .long .SharedStub # "\0\0\0\0" |
michael@0 | 115 | .long TOC{TC0} # "\0\0\0008" |
michael@0 | 116 | .long 0x00000000 # "\0\0\0\0" |
michael@0 | 117 | # End csect SharedStub{DS} |
michael@0 | 118 | |
michael@0 | 119 | # .bss section |