1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
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/
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.
13
* The Original Code is mozilla.org code.
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
23
/* Platform specific code to invoke XPCOM methods on native objects */
24
.global XPTC_InvokeByIndex
26
XPTC_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
27
PRUint32 paramCount, nsXPTCVariant* params);
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
37
sll %o0,2,%l0 ! number of bytes
38
sub %sp,%l0,%sp ! create the additional stack space
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
47
! calculate the target address from the vtable
49
add %i1,1,%i1 ! vTable is zero-based, index is 1 based (?)
50
ld [%i0],%l1 ! *that --> vTable
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
56
add %l0,%i0,%i0 ! adjust this
57
ld [%l1 + 4],%l0 ! target address
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
65
jmpl %l0,%o7 ! call the routine
66
! always have a 'this', from the incoming 'that'
69
mov %o0,%i0 ! propagate return value