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 | /* -*- Mode: asm; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
michael@0 | 2 | * Version: MPL 1.1 |
michael@0 | 3 | * |
michael@0 | 4 | * This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 5 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 6 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 7 | |
michael@0 | 8 | .LEVEL 1.1 |
michael@0 | 9 | .TEXT |
michael@0 | 10 | .ALIGN 4 |
michael@0 | 11 | |
michael@0 | 12 | curframesz: |
michael@0 | 13 | .EQU 128 |
michael@0 | 14 | |
michael@0 | 15 | |
michael@0 | 16 | ; SharedStub has stack size of 128 bytes |
michael@0 | 17 | |
michael@0 | 18 | lastframesz: |
michael@0 | 19 | .EQU 64 |
michael@0 | 20 | |
michael@0 | 21 | ; the StubN C++ function has a small stack size of 64 bytes |
michael@0 | 22 | |
michael@0 | 23 | |
michael@0 | 24 | .globl SharedStub |
michael@0 | 25 | .type SharedStub, @function |
michael@0 | 26 | |
michael@0 | 27 | SharedStub: |
michael@0 | 28 | .PROC |
michael@0 | 29 | .CALLINFO CALLER,FRAME=80,SAVE_RP |
michael@0 | 30 | |
michael@0 | 31 | .ENTRY |
michael@0 | 32 | STW %rp,-20(%sp) |
michael@0 | 33 | LDO 128(%sp),%sp |
michael@0 | 34 | |
michael@0 | 35 | STW %r19,-32(%r30) |
michael@0 | 36 | STW %r26,-36-curframesz(%r30) ; save arg0 in previous frame |
michael@0 | 37 | |
michael@0 | 38 | LDO -80(%r30),%r28 |
michael@0 | 39 | FSTD,MA %fr5,8(%r28) ; save darg0 |
michael@0 | 40 | FSTD,MA %fr7,8(%r28) ; save darg1 |
michael@0 | 41 | FSTW,MA %fr4L,4(%r28) ; save farg0 |
michael@0 | 42 | FSTW,MA %fr5L,4(%r28) ; save farg1 |
michael@0 | 43 | FSTW,MA %fr6L,4(%r28) ; save farg2 |
michael@0 | 44 | FSTW,MA %fr7L,4(%r28) ; save farg3 |
michael@0 | 45 | |
michael@0 | 46 | ; Former value of register 26 is already properly saved by StubN, |
michael@0 | 47 | ; but register 25-23 are not because of the argument mismatch |
michael@0 | 48 | STW %r25,-40-curframesz-lastframesz(%r30) ; save r25 |
michael@0 | 49 | STW %r24,-44-curframesz-lastframesz(%r30) ; save r24 |
michael@0 | 50 | STW %r23,-48-curframesz-lastframesz(%r30) ; save r23 |
michael@0 | 51 | COPY %r26,%r25 ; method index is arg1 |
michael@0 | 52 | LDW -36-curframesz-lastframesz(%r30),%r26 ; self is arg0 |
michael@0 | 53 | LDO -40-curframesz-lastframesz(%r30),%r24 ; normal args is arg2 |
michael@0 | 54 | LDO -80(%r30),%r23 ; floating args is arg3 |
michael@0 | 55 | |
michael@0 | 56 | .CALL ARGW0=GR,ARGW1=GR,ARGW2=GR,ARGW3=GR,RTNVAL=GR ;in=23-26;out=28; |
michael@0 | 57 | BL PrepareAndDispatch, %r31 |
michael@0 | 58 | COPY %r31,%r2 |
michael@0 | 59 | |
michael@0 | 60 | LDW -32(%r30),%r19 |
michael@0 | 61 | |
michael@0 | 62 | LDW -148(%sp),%rp |
michael@0 | 63 | LDO -128(%sp),%sp |
michael@0 | 64 | |
michael@0 | 65 | |
michael@0 | 66 | BV,N (%rp) |
michael@0 | 67 | NOP |
michael@0 | 68 | NOP |
michael@0 | 69 | |
michael@0 | 70 | .EXIT |
michael@0 | 71 | .PROCEND ;in=26;out=28; |
michael@0 | 72 | |
michael@0 | 73 | .SIZE SharedStub, .-SharedStub |