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 | .LEVEL 1.1 |
michael@0 | 2 | |
michael@0 | 3 | curframesz .EQU 128 |
michael@0 | 4 | ; SharedStub has stack size of 128 bytes |
michael@0 | 5 | |
michael@0 | 6 | lastframesz .EQU 64 |
michael@0 | 7 | ; the StubN C++ function has a small stack size of 64 bytes |
michael@0 | 8 | |
michael@0 | 9 | .SPACE $TEXT$,SORT=8 |
michael@0 | 10 | .SUBSPA $CODE$,QUAD=0,ALIGN=4,ACCESS=0x2c,CODE_ONLY,SORT=24 |
michael@0 | 11 | SharedStub |
michael@0 | 12 | .PROC |
michael@0 | 13 | .CALLINFO CALLER,FRAME=80,SAVE_RP,ARGS_SAVED |
michael@0 | 14 | |
michael@0 | 15 | .ENTRY |
michael@0 | 16 | STW %rp,-20(%sp) |
michael@0 | 17 | LDO 128(%sp),%sp |
michael@0 | 18 | |
michael@0 | 19 | STW %r19,-32(%r30) |
michael@0 | 20 | STW %r26,-36-curframesz(%r30) ; save arg0 in previous frame |
michael@0 | 21 | |
michael@0 | 22 | LDO -80(%r30),%r28 |
michael@0 | 23 | FSTD,MA %fr5,8(%r28) ; save darg0 |
michael@0 | 24 | FSTD,MA %fr7,8(%r28) ; save darg1 |
michael@0 | 25 | FSTW,MA %fr4L,4(%r28) ; save farg0 |
michael@0 | 26 | FSTW,MA %fr5L,4(%r28) ; save farg1 |
michael@0 | 27 | FSTW,MA %fr6L,4(%r28) ; save farg2 |
michael@0 | 28 | FSTW,MA %fr7L,4(%r28) ; save farg3 |
michael@0 | 29 | |
michael@0 | 30 | ; Former value of register 26 is already properly saved by StubN, |
michael@0 | 31 | ; but register 25-23 are not because of the arguments mismatch |
michael@0 | 32 | STW %r25,-40-curframesz-lastframesz(%r30) ; save r25 |
michael@0 | 33 | STW %r24,-44-curframesz-lastframesz(%r30) ; save r24 |
michael@0 | 34 | STW %r23,-48-curframesz-lastframesz(%r30) ; save r23 |
michael@0 | 35 | COPY %r26,%r25 ; method index is arg1 |
michael@0 | 36 | LDW -36-curframesz-lastframesz(%r30),%r26 ; self is arg0 |
michael@0 | 37 | LDO -40-curframesz-lastframesz(%r30),%r24 ; normal args is arg2 |
michael@0 | 38 | LDO -80(%r30),%r23 ; floating args is arg3 |
michael@0 | 39 | |
michael@0 | 40 | BL .+8,%r2 |
michael@0 | 41 | ADDIL L'PrepareAndDispatch-$PIC_pcrel$0+4,%r2 |
michael@0 | 42 | LDO R'PrepareAndDispatch-$PIC_pcrel$1+8(%r1),%r1 |
michael@0 | 43 | $PIC_pcrel$0 |
michael@0 | 44 | LDSID (%r1),%r31 |
michael@0 | 45 | $PIC_pcrel$1 |
michael@0 | 46 | MTSP %r31,%sr0 |
michael@0 | 47 | .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR,RTNVAL=GR |
michael@0 | 48 | ;in=23-26;out=28; |
michael@0 | 49 | BLE 0(%sr0,%r1) |
michael@0 | 50 | COPY %r31,%r2 |
michael@0 | 51 | |
michael@0 | 52 | LDW -32(%r30),%r19 |
michael@0 | 53 | |
michael@0 | 54 | LDW -148(%sp),%rp |
michael@0 | 55 | BVE (%rp) |
michael@0 | 56 | .EXIT |
michael@0 | 57 | LDO -128(%sp),%sp |
michael@0 | 58 | |
michael@0 | 59 | |
michael@0 | 60 | .PROCEND ;in=26;out=28; |
michael@0 | 61 | |
michael@0 | 62 | .ALIGN 8 |
michael@0 | 63 | .SPACE $TEXT$ |
michael@0 | 64 | .SUBSPA $CODE$ |
michael@0 | 65 | .IMPORT PrepareAndDispatch,CODE |
michael@0 | 66 | .EXPORT SharedStub,ENTRY,PRIV_LEV=3,ARGW0=GR,RTNVAL=GR,LONG_RETURN |
michael@0 | 67 | .END |
michael@0 | 68 |