xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc_solaris.s

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_sparc_solaris.s	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,49 @@
     1.4 +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + *
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +        .global SharedStub
    1.11 +
    1.12 +/*
    1.13 +    in the frame for the function that called SharedStub are the
    1.14 +    rest of the parameters we need
    1.15 +
    1.16 +*/
    1.17 +
    1.18 +SharedStub:
    1.19 +! we don't create a new frame yet, but work within the frame of the calling
    1.20 +! function to give ourselves the other parameters we want
    1.21 +
    1.22 +        mov     %o0, %o1            ! shuffle the index up to 2nd place
    1.23 +        mov     %i0, %o0            ! the original 'this'
    1.24 +        add     %fp, 72, %o2        ! previous stack top adjusted to the first argument slot (beyond 'this')
    1.25 +! save off the original incoming parameters that arrived in 
    1.26 +! registers, the ABI guarantees the space for us to do this
    1.27 +        st      %i1, [%fp + 72]
    1.28 +        st      %i2, [%fp + 76]
    1.29 +        st      %i3, [%fp + 80]
    1.30 +        st      %i4, [%fp + 84]
    1.31 +        st      %i5, [%fp + 88]
    1.32 +! now we can build our own stack frame
    1.33 +        save    %sp,-(64 + 32),%sp   ! room for the register window and
    1.34 +                                    ! struct pointer, rounded up to 0 % 32
    1.35 +! our function now appears to have been called
    1.36 +! as SharedStub(nsISupports* that, uint32_t index, uint32_t* args)
    1.37 +! so we can just copy these through
    1.38 +        
    1.39 +        mov     %i0, %o0
    1.40 +        mov     %i1, %o1
    1.41 +        mov     %i2, %o2
    1.42 +        call    PrepareAndDispatch
    1.43 +        nop
    1.44 +        mov     %o0,%i0             ! propagate return value
    1.45 +        b .LL1
    1.46 +        nop
    1.47 +.LL1:
    1.48 +        ret
    1.49 +        restore
    1.50 +
    1.51 +       .size    SharedStub, .-SharedStub
    1.52 +       .type    SharedStub, #function

mercurial