~ubuntu-branches/ubuntu/gutsy/virtualbox-ose/gutsy

« back to all changes in this revision

Viewing changes to src/libs/xpcom18a4/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_sparc_solaris_GCC.s

  • Committer: Bazaar Package Importer
  • Author(s): Steve Kowalik
  • Date: 2007-09-08 16:44:58 UTC
  • Revision ID: james.westby@ubuntu.com-20070908164458-wao29470vqtr8ksy
Tags: upstream-1.5.0-dfsg2
ImportĀ upstreamĀ versionĀ 1.5.0-dfsg2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
 
2
 *
 
3
 * The contents of this file are subject to the Netscape Public
 
4
 * License Version 1.1 (the "License"); you may not use this file
 
5
 * except in compliance with the License. You may obtain a copy of
 
6
 * the License at http://www.mozilla.org/NPL/
 
7
 *
 
8
 * Software distributed under the License is distributed on an "AS
 
9
 * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
 
10
 * implied. See the License for the specific language governing
 
11
 * rights and limitations under the License.
 
12
 *
 
13
 * The Original Code is mozilla.org code.
 
14
 *
 
15
 * The Initial Developer of the Original Code is Netscape
 
16
 * Communications Corporation.  Portions created by Netscape are
 
17
 * Copyright (C) 1998 Netscape Communications Corporation. All
 
18
 * Rights Reserved.
 
19
 *
 
20
 * Contributor(s): 
 
21
 */
 
22
 
 
23
/* Platform specific code to invoke XPCOM methods on native objects */
 
24
        .global XPTC_InvokeByIndex
 
25
/*
 
26
    XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
 
27
                   PRUint32 paramCount, nsXPTCVariant* params);
 
28
    
 
29
*/
 
30
XPTC_InvokeByIndex:
 
31
        save    %sp,-(64 + 32),%sp   ! room for the register window and
 
32
                                    ! struct pointer, rounded up to 0 % 32
 
33
        mov     %i2,%o0             ! paramCount
 
34
        call    invoke_count_words  ! returns the required stack size in %o0
 
35
        mov     %i3,%o1             ! params
 
36
        
 
37
        sll     %o0,2,%l0           ! number of bytes
 
38
        sub     %sp,%l0,%sp         ! create the additional stack space
 
39
            
 
40
        mov     %sp,%o0             ! pointer for copied args
 
41
        add     %o0,72,%o0          ! step past the register window, the
 
42
                                    ! struct result pointer and the 'this' slot
 
43
        mov     %i2,%o1             ! paramCount
 
44
        call    invoke_copy_to_stack
 
45
        mov     %i3,%o2             ! params
 
46
!
 
47
!   calculate the target address from the vtable
 
48
!
 
49
        add     %i1,1,%i1           ! vTable is zero-based, index is 1 based (?)        
 
50
        ld      [%i0],%l1           ! *that --> vTable
 
51
        sll     %i1,3,%i1
 
52
        add     %i1,%l1,%l1         ! vTable[index * 8], l1 now points to vTable entry
 
53
        lduh    [%l1],%l0           ! this adjustor
 
54
        sll     %l0,16,%l0          ! sign extend to 32 bits
 
55
        sra     %l0,16,%l0
 
56
        add     %l0,%i0,%i0         ! adjust this
 
57
        ld      [%l1 + 4],%l0       ! target address
 
58
 
 
59
.L5:    ld      [%sp + 88],%o5
 
60
.L4:    ld      [%sp + 84],%o4
 
61
.L3:    ld      [%sp + 80],%o3
 
62
.L2:    ld      [%sp + 76],%o2
 
63
.L1:    ld      [%sp + 72],%o1
 
64
.L0:
 
65
        jmpl    %l0,%o7             ! call the routine
 
66
! always have a 'this', from the incoming 'that'
 
67
        mov     %i0,%o0
 
68
        
 
69
        mov     %o0,%i0             ! propagate return value
 
70
        ret
 
71
        restore