Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 51786 | Differences between
and this patch

Collapse All | Expand All

(-)config/mkdepend/imakemdep.h (+3 lines)
Lines 277-282 Link Here
277
# ifdef __i386__
277
# ifdef __i386__
278
	"-D__i386__",
278
	"-D__i386__",
279
# endif
279
# endif
280
# ifdef __x86_64__
281
	"-D__x86_64__",
282
# endif
280
# ifdef __GNUC__
283
# ifdef __GNUC__
281
	"-traditional",
284
	"-traditional",
282
# endif
285
# endif
(-)directory/c-sdk/ldap/libraries/liblber/lber-int.h (-5 / +4 lines)
Lines 236-258 Link Here
236
	     (((_l)&0xff0000)>>8) + (((_l)&0xff000000)>>24))
236
	     (((_l)&0xff0000)>>8) + (((_l)&0xff000000)>>24))
237
#define LBER_NTOHL(_l) LBER_HTONL(_l)
237
#define LBER_NTOHL(_l) LBER_HTONL(_l)
238
238
239
#elif !defined(__alpha) || defined(VMS)
239
#elif !defined(__x86_64__) && (!defined(__alpha) || defined(VMS))
240
240
241
#define LBER_HTONL( l )	htonl( l )
241
#define LBER_HTONL( l )	htonl( l )
242
#define LBER_NTOHL( l )	ntohl( l )
242
#define LBER_NTOHL( l )	ntohl( l )
243
243
244
#else /* __alpha */
244
#else /* __alpha */
245
/*
245
/*
246
 * htonl and ntohl on the DEC Alpha under OSF 1 seem to only swap the
246
 * htonl and ntohl on the 64-bit UNIX platforms only swap the lower-order
247
 * lower-order 32-bits of a (64-bit) long, so we define correct versions
247
 * 32-bits of a (64-bit) long, so we define correct versions here.
248
 * here.
249
 */
248
 */
250
#define LBER_HTONL( l )	(((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \
249
#define LBER_HTONL( l )	(((long)htonl( (l) & 0x00000000FFFFFFFF )) << 32 \
251
    			| htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
250
    			| htonl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
252
251
253
#define LBER_NTOHL( l )	(((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \
252
#define LBER_NTOHL( l )	(((long)ntohl( (l) & 0x00000000FFFFFFFF )) << 32 \
254
    			| ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
253
    			| ntohl( ( (l) & 0xFFFFFFFF00000000 ) >> 32 ))
255
#endif /* __alpha */
254
#endif /* __alpha || __x86_64__ */
256
255
257
256
258
/* function prototypes */
257
/* function prototypes */
(-)nsprpub/configure (+3 lines)
Lines 3729-3734 Link Here
3729
    ia64)
3729
    ia64)
3730
        PR_MD_ASFILES=os_Linux_ia64.s
3730
        PR_MD_ASFILES=os_Linux_ia64.s
3731
        ;;
3731
        ;;
3732
    x86_64)
3733
        PR_MD_ASFILES=os_Linux_x86_64.s
3734
        ;;
3732
    m68k)
3735
    m68k)
3733
        CFLAGS="$CFLAGS -m68020-60"
3736
        CFLAGS="$CFLAGS -m68020-60"
3734
        CXXFLAGS="$CXXFLAGS -m68020-60"
3737
        CXXFLAGS="$CXXFLAGS -m68020-60"
(-)nsprpub/configure.in (+3 lines)
Lines 1218-1223 Link Here
1218
    ia64)
1218
    ia64)
1219
        PR_MD_ASFILES=os_Linux_ia64.s
1219
        PR_MD_ASFILES=os_Linux_ia64.s
1220
        ;;
1220
        ;;
1221
    x86_64)
1222
        PR_MD_ASFILES=os_Linux_x86_64.s
1223
        ;;
1221
    m68k)
1224
    m68k)
1222
        CFLAGS="$CFLAGS -m68020-60"
1225
        CFLAGS="$CFLAGS -m68020-60"
1223
        CXXFLAGS="$CXXFLAGS -m68020-60"
1226
        CXXFLAGS="$CXXFLAGS -m68020-60"
(-)nsprpub/pr/include/md/_linux.cfg (+46 lines)
Lines 182-187 Link Here
182
#define PR_BYTES_PER_WORD_LOG2  3
182
#define PR_BYTES_PER_WORD_LOG2  3
183
#define PR_BYTES_PER_DWORD_LOG2 3
183
#define PR_BYTES_PER_DWORD_LOG2 3
184
184
185
#elif defined(__x86_64__)
186
187
#define IS_LITTLE_ENDIAN 1
188
#undef  IS_BIG_ENDIAN
189
#define IS_64
190
191
#define PR_BYTES_PER_BYTE   1
192
#define PR_BYTES_PER_SHORT  2
193
#define PR_BYTES_PER_INT    4
194
#define PR_BYTES_PER_INT64  8
195
#define PR_BYTES_PER_LONG   8
196
#define PR_BYTES_PER_FLOAT  4
197
#define PR_BYTES_PER_DOUBLE 8
198
#define PR_BYTES_PER_WORD   8
199
#define PR_BYTES_PER_DWORD  8
200
201
#define PR_BITS_PER_BYTE    8
202
#define PR_BITS_PER_SHORT   16
203
#define PR_BITS_PER_INT     32
204
#define PR_BITS_PER_INT64   64
205
#define PR_BITS_PER_LONG    64
206
#define PR_BITS_PER_FLOAT   32
207
#define PR_BITS_PER_DOUBLE  64
208
#define PR_BITS_PER_WORD    64
209
210
#define PR_BITS_PER_BYTE_LOG2   3
211
#define PR_BITS_PER_SHORT_LOG2  4
212
#define PR_BITS_PER_INT_LOG2    5
213
#define PR_BITS_PER_INT64_LOG2  6
214
#define PR_BITS_PER_LONG_LOG2   6
215
#define PR_BITS_PER_FLOAT_LOG2  5
216
#define PR_BITS_PER_DOUBLE_LOG2 6
217
#define PR_BITS_PER_WORD_LOG2   6
218
219
#define PR_ALIGN_OF_SHORT   2
220
#define PR_ALIGN_OF_INT     4
221
#define PR_ALIGN_OF_LONG    8
222
#define PR_ALIGN_OF_INT64   8
223
#define PR_ALIGN_OF_FLOAT   4
224
#define PR_ALIGN_OF_DOUBLE  8
225
#define PR_ALIGN_OF_POINTER 8
226
#define PR_ALIGN_OF_WORD    8
227
228
#define PR_BYTES_PER_WORD_LOG2  3
229
#define PR_BYTES_PER_DWORD_LOG2 3
230
185
#elif defined(__mc68000__)
231
#elif defined(__mc68000__)
186
232
187
#undef  IS_LITTLE_ENDIAN
233
#undef  IS_LITTLE_ENDIAN
(-)nsprpub/pr/include/md/_linux.h (+15 lines)
Lines 49-54 Link Here
49
#define _PR_SI_ARCHITECTURE "alpha"
49
#define _PR_SI_ARCHITECTURE "alpha"
50
#elif defined(__ia64__)
50
#elif defined(__ia64__)
51
#define _PR_SI_ARCHITECTURE "ia64"
51
#define _PR_SI_ARCHITECTURE "ia64"
52
#elif defined(__x86_64__)
53
#define _PR_SI_ARCHITECTURE "x86-64"
52
#elif defined(__mc68000__)
54
#elif defined(__mc68000__)
53
#define _PR_SI_ARCHITECTURE "m68k"
55
#define _PR_SI_ARCHITECTURE "m68k"
54
#elif defined(__sparc__)
56
#elif defined(__sparc__)
Lines 107-112 Link Here
107
#define _MD_ATOMIC_SET                _PR_ia64_AtomicSet
109
#define _MD_ATOMIC_SET                _PR_ia64_AtomicSet
108
#endif
110
#endif
109
111
112
#if defined(__x86_64__)
113
#define _PR_HAVE_ATOMIC_OPS
114
#define _MD_INIT_ATOMIC()
115
extern PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val);
116
#define _MD_ATOMIC_INCREMENT          _PR_x86_64_AtomicIncrement
117
extern PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val);
118
#define _MD_ATOMIC_DECREMENT          _PR_x86_64_AtomicDecrement
119
extern PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val);
120
#define _MD_ATOMIC_ADD                _PR_x86_64_AtomicAdd
121
extern PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval);
122
#define _MD_ATOMIC_SET                _PR_x86_64_AtomicSet
123
#endif
124
110
#define USE_SETJMP
125
#define USE_SETJMP
111
#if defined(__GLIBC__) && __GLIBC__ >= 2
126
#if defined(__GLIBC__) && __GLIBC__ >= 2
112
#define _PR_POLL_AVAILABLE
127
#define _PR_POLL_AVAILABLE
(-)nsprpub/pr/src/io/prprf.c (-1 / +4 lines)
Lines 51-57 Link Here
51
** Note: on some platforms va_list is defined as an array,
51
** Note: on some platforms va_list is defined as an array,
52
** and requires array notation.
52
** and requires array notation.
53
*/
53
*/
54
#if (defined(LINUX) && defined(__powerpc__)) || \
54
#if (defined(LINUX) && defined(__x86_64__))
55
#include <stdarg.h>
56
#define VARARGS_ASSIGN(foo, bar) __va_copy((foo), (bar))
57
#elif (defined(LINUX) && defined(__powerpc__)) || \
55
    (defined(LINUX) && defined(__s390__)) || \
58
    (defined(LINUX) && defined(__s390__)) || \
56
    (defined(LINUX) && defined(__s390x__)) || \
59
    (defined(LINUX) && defined(__s390x__)) || \
57
    defined(WIN16) || defined(QNX) || \
60
    defined(WIN16) || defined(QNX) || \
(-)nsprpub/pr/src/md/unix/os_Linux_x86_64.s (+91 lines)
Line 0 Link Here
1
/ -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2
/ 
3
/ The contents of this file are subject to the Mozilla 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/MPL/
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 the Netscape Portable Runtime (NSPR).
14
/ 
15
/ The Initial Developer of the Original Code is Netscape
16
/ Communications Corporation.  Portions created by Netscape are 
17
/ Copyright (C) 2000 Netscape Communications Corporation.  All
18
/ Rights Reserved.
19
/ 
20
/ Contributor(s):
21
/ 
22
/ Alternatively, the contents of this file may be used under the
23
/ terms of the GNU General Public License Version 2 or later (the
24
/ "GPL"), in which case the provisions of the GPL are applicable 
25
/ instead of those above.  If you wish to allow use of your 
26
/ version of this file only under the terms of the GPL and not to
27
/ allow others to use your version of this file under the MPL,
28
/ indicate your decision by deleting the provisions above and
29
/ replace them with the notice and other provisions required by
30
/ the GPL.  If you do not delete the provisions above, a recipient
31
/ may use your version of this file under either the MPL or the
32
/ GPL.
33
/ 
34
35
/ PRInt32 _PR_x86_64_AtomicIncrement(PRInt32 *val)
36
/
37
/ Atomically increment the integer pointed to by 'val' and return
38
/ the result of the increment.
39
/
40
    .text
41
    .globl _PR_x86_64_AtomicIncrement
42
    .align 4
43
_PR_x86_64_AtomicIncrement:
44
    movl $1, %eax
45
    lock
46
    xaddl %eax, (%rdi)
47
    incl %eax
48
    ret
49
50
/ PRInt32 _PR_x86_64_AtomicDecrement(PRInt32 *val)
51
/
52
/ Atomically decrement the integer pointed to by 'val' and return
53
/ the result of the decrement.
54
/
55
    .text
56
    .globl _PR_x86_64_AtomicDecrement
57
    .align 4
58
_PR_x86_64_AtomicDecrement:
59
    movl $-1, %eax
60
    lock
61
    xaddl %eax, (%rdi)
62
    decl %eax
63
    ret
64
65
/ PRInt32 _PR_x86_64_AtomicSet(PRInt32 *val, PRInt32 newval)
66
/
67
/ Atomically set the integer pointed to by 'val' to the new
68
/ value 'newval' and return the old value.
69
    .text
70
    .globl _PR_x86_64_AtomicSet
71
    .align 4
72
_PR_x86_64_AtomicSet:
73
    movl %esi, %eax
74
    lock
75
    xchgl %eax, (%rdi)
76
    ret
77
78
/ PRInt32 _PR_x86_64_AtomicAdd(PRInt32 *ptr, PRInt32 val)
79
/
80
/ Atomically add 'val' to the integer pointed to by 'ptr'
81
/ and return the result of the addition.
82
/
83
    .text
84
    .globl _PR_x86_64_AtomicAdd
85
    .align 4
86
_PR_x86_64_AtomicAdd:
87
    movl %esi, %eax
88
    lock
89
    xaddl %eax, (%rdi)
90
    addl %esi, %eax
91
    ret
(-)security/coreconf/Linux.mk (+5 lines)
Lines 66-71 Link Here
66
	OS_REL_CFLAGS	= -DLINUX1_2 -D_XOPEN_SOURCE
66
	OS_REL_CFLAGS	= -DLINUX1_2 -D_XOPEN_SOURCE
67
	CPU_ARCH	= ia64
67
	CPU_ARCH	= ia64
68
else
68
else
69
ifeq ($(OS_TEST),x86_64)
70
	OS_REL_CFLAGS	= -DLINUX1_2 -D_XOPEN_SOURCE
71
	CPU_ARCH	= x86_64
72
else
69
ifeq ($(OS_TEST),sparc)
73
ifeq ($(OS_TEST),sparc)
70
	OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
74
	OS_REL_CFLAGS   = -DLINUX1_2 -D_XOPEN_SOURCE
71
	CPU_ARCH        = sparc
75
	CPU_ARCH        = sparc
Lines 107-112 Link Here
107
endif
111
endif
108
endif
112
endif
109
endif
113
endif
114
endif
110
115
111
116
112
LIBC_TAG		= _glibc
117
LIBC_TAG		= _glibc
(-)xpcom/reflect/xptcall/src/md/unix/Makefile.in (+5 lines)
Lines 55-60 Link Here
55
# Migrate other platforms here after testing
55
# Migrate other platforms here after testing
56
#
56
#
57
ifneq (,$(filter Linux,$(OS_ARCH)))
57
ifneq (,$(filter Linux,$(OS_ARCH)))
58
# Linux/x86-64
59
ifeq (x86_64,$(OS_TEST))
60
CPPSRCS		:= xptcinvoke_x86_64_linux.cpp xptcstubs_x86_64_linux.cpp
61
else
58
ifeq (86,$(findstring 86,$(OS_TEST)))
62
ifeq (86,$(findstring 86,$(OS_TEST)))
59
CPPSRCS		:= xptcinvoke_gcc_x86_unix.cpp xptcstubs_gcc_x86_unix.cpp
63
CPPSRCS		:= xptcinvoke_gcc_x86_unix.cpp xptcstubs_gcc_x86_unix.cpp
60
endif
64
endif
Lines 66-71 Link Here
66
ASFILES		:= xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s
70
ASFILES		:= xptcstubs_asm_ipf64.s xptcinvoke_asm_ipf64.s
67
endif
71
endif
68
endif
72
endif
73
endif
69
#
74
#
70
# BeOS/Intel (uses the same unixish_x86 code)
75
# BeOS/Intel (uses the same unixish_x86 code)
71
#
76
#
(-)xpcom/reflect/xptcall/src/md/unix/xptcinvoke_x86_64_linux.cpp (+174 lines)
Line 0 Link Here
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
// Platform specific code to invoke XPCOM methods on native objects
3
4
#include "xptcprivate.h"
5
6
// 6 integral parameters are passed in registers
7
const PRUint32 GPR_COUNT = 6;
8
9
// 8 floating point parameters are passed in SSE registers
10
const PRUint32 FPR_COUNT = 8;
11
12
// Remember that these 'words' are 64-bit long
13
static inline void
14
invoke_count_words(PRUint32 paramCount, nsXPTCVariant * s,
15
                   PRUint32 & nr_gpr, PRUint32 & nr_fpr, PRUint32 & nr_stack)
16
{
17
    nr_gpr = 1; // skip one GP register for 'that'
18
    nr_fpr = 0;
19
    nr_stack = 0;
20
21
    /* Compute number of eightbytes of class MEMORY.  */
22
    for (uint32 i = 0; i < paramCount; i++, s++) {
23
        if (!s->IsPtrData()
24
            && (s->type == nsXPTType::T_FLOAT || s->type == nsXPTType::T_DOUBLE)) {
25
            if (nr_fpr < FPR_COUNT)
26
                nr_fpr++;
27
            else
28
                nr_stack++;
29
        }
30
        else {
31
            if (nr_gpr < GPR_COUNT)
32
                nr_gpr++;
33
            else
34
                nr_stack++;
35
        }
36
    }
37
}
38
39
static void
40
invoke_copy_to_stack(PRUint64 * d, PRUint32 paramCount, nsXPTCVariant * s,
41
                     PRUint64 * gpregs, double * fpregs)
42
{
43
    PRUint32 nr_gpr = 1; // skip one GP register for 'that'
44
    PRUint32 nr_fpr = 0;
45
    PRUint64 value;
46
47
    for (uint32 i = 0; i < paramCount; i++, s++) {
48
        if (s->IsPtrData())
49
            value = (PRUint64) s->ptr;
50
        else {
51
            switch (s->type) {
52
            case nsXPTType::T_FLOAT:                                break;
53
            case nsXPTType::T_DOUBLE:                               break;
54
            case nsXPTType::T_I8:     value = s->val.i8;            break;
55
            case nsXPTType::T_I16:    value = s->val.i16;           break;
56
            case nsXPTType::T_I32:    value = s->val.i32;           break;
57
            case nsXPTType::T_I64:    value = s->val.i64;           break;
58
            case nsXPTType::T_U8:     value = s->val.u8;            break;
59
            case nsXPTType::T_U16:    value = s->val.u16;           break;
60
            case nsXPTType::T_U32:    value = s->val.u32;           break;
61
            case nsXPTType::T_U64:    value = s->val.u64;           break;
62
            case nsXPTType::T_BOOL:   value = s->val.b;             break;
63
            case nsXPTType::T_CHAR:   value = s->val.c;             break;
64
            case nsXPTType::T_WCHAR:  value = s->val.wc;            break;
65
            default:                  value = (PRUint64) s->val.p;  break;
66
            }
67
        }
68
69
        if (!s->IsPtrData() && s->type == nsXPTType::T_DOUBLE) {
70
            if (nr_fpr < FPR_COUNT)
71
                fpregs[nr_fpr++] = s->val.d;
72
            else {
73
                *((double *)d) = s->val.d;
74
                d++;
75
            }
76
        }
77
        else if (!s->IsPtrData() && s->type == nsXPTType::T_FLOAT) {
78
            if (nr_fpr < FPR_COUNT)
79
                // The value in %xmm register is already prepared to
80
                // be retrieved as a float. Therefore, we pass the
81
                // value verbatim, as a double without conversion.
82
                fpregs[nr_fpr++] = s->val.d;
83
            else {
84
                *((float *)d) = s->val.f;
85
                d++;
86
            }
87
        }
88
        else {
89
            if (nr_gpr < GPR_COUNT)
90
                gpregs[nr_gpr++] = value;
91
            else
92
                *d++ = value;
93
        }
94
    }
95
}
96
97
extern "C"
98
XPTC_PUBLIC_API(nsresult)
99
XPTC_InvokeByIndex(nsISupports * that, PRUint32 methodIndex,
100
                   PRUint32 paramCount, nsXPTCVariant * params)
101
{
102
    PRUint32 nr_gpr, nr_fpr, nr_stack;
103
    invoke_count_words(paramCount, params, nr_gpr, nr_fpr, nr_stack);
104
    
105
    // Stack, if used, must be 16-bytes aligned
106
    if (nr_stack)
107
        nr_stack = (nr_stack + 1) & ~1;
108
109
    // Load parameters to stack, if necessary
110
    PRUint64 *stack = (PRUint64 *) __builtin_alloca(nr_stack * 8);
111
    PRUint64 gpregs[GPR_COUNT];
112
    double fpregs[FPR_COUNT];
113
    invoke_copy_to_stack(stack, paramCount, params, gpregs, fpregs);
114
115
    // Load FPR registers from fpregs[]
116
    register double d0 asm("xmm0");
117
    register double d1 asm("xmm1");
118
    register double d2 asm("xmm2");
119
    register double d3 asm("xmm3");
120
    register double d4 asm("xmm4");
121
    register double d5 asm("xmm5");
122
    register double d6 asm("xmm6");
123
    register double d7 asm("xmm7");
124
125
    switch (nr_fpr) {
126
#define ARG_FPR(N) \
127
    case N+1: d##N = fpregs[N];
128
        ARG_FPR(7);
129
        ARG_FPR(6);
130
        ARG_FPR(5);
131
        ARG_FPR(4);
132
        ARG_FPR(3);
133
        ARG_FPR(2);
134
        ARG_FPR(1);
135
        ARG_FPR(0);
136
    case 0:;
137
#undef ARG_FPR
138
    }
139
    
140
    // Load GPR registers from gpregs[]
141
    register PRUint64 a0 asm("rdi");
142
    register PRUint64 a1 asm("rsi");
143
    register PRUint64 a2 asm("rdx");
144
    register PRUint64 a3 asm("rcx");
145
    register PRUint64 a4 asm("r8");
146
    register PRUint64 a5 asm("r9");
147
    
148
    switch (nr_gpr) {
149
#define ARG_GPR(N) \
150
    case N+1: a##N = gpregs[N];
151
        ARG_GPR(5);
152
        ARG_GPR(4);
153
        ARG_GPR(3);
154
        ARG_GPR(2);
155
        ARG_GPR(1);
156
    case 1: a0 = (PRUint64) that;
157
    case 0:;
158
#undef ARG_GPR
159
    }
160
161
    // Ensure that assignments to SSE registers won't be optimized away
162
    asm("" ::
163
        "x" (d0), "x" (d1), "x" (d2), "x" (d3),
164
        "x" (d4), "x" (d5), "x" (d6), "x" (d7));
165
    
166
    // Get pointer to method
167
    PRUint64 methodAddress = *((PRUint64 *)that);
168
    methodAddress += 8 * methodIndex;
169
    methodAddress = *((PRUint64 *)methodAddress);
170
    
171
    typedef PRUint32 (*Method)(PRUint64, PRUint64, PRUint64, PRUint64, PRUint64, PRUint64);
172
    PRUint32 result = ((Method)methodAddress)(a0, a1, a2, a3, a4, a5);
173
    return result;
174
}
(-)xpcom/reflect/xptcall/src/md/unix/xptcstubs_x86_64_linux.cpp (+206 lines)
Line 0 Link Here
1
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3
// Implement shared vtbl methods.
4
5
#include "xptcprivate.h"
6
7
// The Linux/x86-64 ABI passes the first 6 integral parameters and the
8
// first 8 floating point parameters in registers (rdi, rsi, rdx, rcx,
9
// r8, r9 and xmm0-xmm7), no stack space is allocated for these by the
10
// caller.  The rest of the parameters are passed in the callers stack
11
// area.
12
13
const PRUint32 PARAM_BUFFER_COUNT   = 16;
14
const PRUint32 GPR_COUNT            = 6;
15
const PRUint32 FPR_COUNT            = 8;
16
17
// PrepareAndDispatch() is called by SharedStub() and calls the actual method.
18
//
19
// - 'args[]' contains the arguments passed on stack
20
// - 'gpregs[]' contains the arguments passed in integer registers
21
// - 'fpregs[]' contains the arguments passed in floating point registers
22
// 
23
// The parameters are mapped into an array of type 'nsXPTCMiniVariant'
24
// and then the method gets called.
25
26
extern "C" nsresult
27
PrepareAndDispatch(nsXPTCStubBase * self, PRUint32 methodIndex,
28
                   PRUint64 * args, PRUint64 * gpregs, double *fpregs)
29
{
30
    nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
31
    nsXPTCMiniVariant* dispatchParams = NULL;
32
    nsIInterfaceInfo* iface_info = NULL;
33
    const nsXPTMethodInfo* info;
34
    PRUint32 paramCount;
35
    PRUint32 i;
36
    nsresult result = NS_ERROR_FAILURE;
37
38
    NS_ASSERTION(self,"no self");
39
40
    self->GetInterfaceInfo(&iface_info);
41
    NS_ASSERTION(iface_info,"no interface info");
42
    if (! iface_info)
43
        return NS_ERROR_UNEXPECTED;
44
45
    iface_info->GetMethodInfo(PRUint16(methodIndex), &info);
46
    NS_ASSERTION(info,"no method info");
47
    if (! info)
48
        return NS_ERROR_UNEXPECTED;
49
50
    paramCount = info->GetParamCount();
51
52
    // setup variant array pointer
53
    if(paramCount > PARAM_BUFFER_COUNT)
54
        dispatchParams = new nsXPTCMiniVariant[paramCount];
55
    else
56
        dispatchParams = paramBuffer;
57
58
    NS_ASSERTION(dispatchParams,"no place for params");
59
    if (! dispatchParams)
60
        return NS_ERROR_OUT_OF_MEMORY;
61
62
    PRUint64* ap = args;
63
    PRUint32 nr_gpr = 1;    // skip one GPR register for 'that'
64
    PRUint32 nr_fpr = 0;
65
    PRUint64 value;
66
67
    for(i = 0; i < paramCount; i++) {
68
        const nsXPTParamInfo& param = info->GetParam(i);
69
        const nsXPTType& type = param.GetType();
70
        nsXPTCMiniVariant* dp = &dispatchParams[i];
71
	
72
        if (!param.IsOut() && type == nsXPTType::T_DOUBLE) {
73
            if (nr_fpr < FPR_COUNT)
74
                dp->val.d = fpregs[nr_fpr++];
75
            else
76
                dp->val.d = *(double*) ap++;
77
            continue;
78
        }
79
        else if (!param.IsOut() && type == nsXPTType::T_FLOAT) {
80
            if (nr_fpr < FPR_COUNT)
81
                // The value in %xmm register is already prepared to
82
                // be retrieved as a float. Therefore, we pass the
83
                // value verbatim, as a double without conversion.
84
                dp->val.d = *(double*) ap++;
85
            else
86
                dp->val.f = *(float*) ap++;
87
            continue;
88
        }
89
        else {
90
            if (nr_gpr < GPR_COUNT)
91
                value = gpregs[nr_gpr++];
92
            else
93
                value = *ap++;
94
        }
95
96
        if (param.IsOut() || !type.IsArithmetic()) {
97
            dp->val.p = (void*) value;
98
            continue;
99
        }
100
101
        switch (type) {
102
        case nsXPTType::T_I8:      dp->val.i8  = (PRInt8)   value; break;
103
        case nsXPTType::T_I16:     dp->val.i16 = (PRInt16)  value; break;
104
        case nsXPTType::T_I32:     dp->val.i32 = (PRInt32)  value; break;
105
        case nsXPTType::T_I64:     dp->val.i64 = (PRInt64)  value; break;
106
        case nsXPTType::T_U8:      dp->val.u8  = (PRUint8)  value; break;
107
        case nsXPTType::T_U16:     dp->val.u16 = (PRUint16) value; break;
108
        case nsXPTType::T_U32:     dp->val.u32 = (PRUint32) value; break;
109
        case nsXPTType::T_U64:     dp->val.u64 = (PRUint64) value; break;
110
        case nsXPTType::T_BOOL:    dp->val.b   = (PRBool)   value; break;
111
        case nsXPTType::T_CHAR:    dp->val.c   = (char)     value; break;
112
        case nsXPTType::T_WCHAR:   dp->val.wc  = (wchar_t)  value; break;
113
114
        default:
115
            NS_ASSERTION(0, "bad type");
116
            break;
117
        }
118
    }
119
120
    result = self->CallMethod((PRUint16) methodIndex, info, dispatchParams);
121
122
    NS_RELEASE(iface_info);
123
124
    if (dispatchParams != paramBuffer)
125
        delete [] dispatchParams;
126
127
    return result;
128
}
129
130
#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
131
// Linux/x86-64 uses gcc >= 3.1
132
#define STUB_ENTRY(n) \
133
asm(".section	\".text\"\n\t" \
134
    ".align	2\n\t" \
135
    ".if	" #n " < 10\n\t" \
136
    ".globl	_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
137
    ".type	_ZN14nsXPTCStubBase5Stub" #n "Ev,@function\n" \
138
    "_ZN14nsXPTCStubBase5Stub" #n "Ev:\n\t" \
139
    ".elseif	" #n " < 100\n\t" \
140
    ".globl	_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
141
    ".type	_ZN14nsXPTCStubBase6Stub" #n "Ev,@function\n" \
142
    "_ZN14nsXPTCStubBase6Stub" #n "Ev:\n\t" \
143
    ".elseif    " #n " < 1000\n\t" \
144
    ".globl     _ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
145
    ".type      _ZN14nsXPTCStubBase7Stub" #n "Ev,@function\n" \
146
    "_ZN14nsXPTCStubBase7Stub" #n "Ev:\n\t" \
147
    ".else\n\t" \
148
    ".err	\"stub number " #n " >= 1000 not yet supported\"\n\t" \
149
    ".endif\n\t" \
150
    "movl	$" #n ", %eax\n\t" \
151
    "jmp	SharedStub\n\t" \
152
    ".if	" #n " < 10\n\t" \
153
    ".size	_ZN14nsXPTCStubBase5Stub" #n "Ev,.-_ZN14nsXPTCStubBase5Stub" #n "Ev\n\t" \
154
    ".elseif	" #n " < 100\n\t" \
155
    ".size	_ZN14nsXPTCStubBase6Stub" #n "Ev,.-_ZN14nsXPTCStubBase6Stub" #n "Ev\n\t" \
156
    ".else\n\t" \
157
    ".size	_ZN14nsXPTCStubBase7Stub" #n "Ev,.-_ZN14nsXPTCStubBase7Stub" #n "Ev\n\t" \
158
    ".endif");
159
160
// static nsresult SharedStub(PRUint32 methodIndex)
161
asm(".section   \".text\"\n\t"
162
    ".align     2\n\t"
163
    ".type      SharedStub,@function\n\t"
164
    "SharedStub:\n\t"
165
    // make room for gpregs (48), fpregs (64)
166
    "pushq      %rbp\n\t"
167
    "movq       %rsp,%rbp\n\t"
168
    "subq       $112,%rsp\n\t"
169
    // save GP registers
170
    "movq       %rdi,-112(%rbp)\n\t"
171
    "movq       %rsi,-104(%rbp)\n\t"
172
    "movq       %rdx, -96(%rbp)\n\t"
173
    "movq       %rcx, -88(%rbp)\n\t"
174
    "movq       %r8 , -80(%rbp)\n\t"
175
    "movq       %r9 , -72(%rbp)\n\t"
176
    "leaq       -112(%rbp),%rcx\n\t"
177
    // save FP registers
178
    "movsd      %xmm0,-64(%rbp)\n\t"
179
    "movsd      %xmm1,-56(%rbp)\n\t"
180
    "movsd      %xmm2,-48(%rbp)\n\t"
181
    "movsd      %xmm3,-40(%rbp)\n\t"
182
    "movsd      %xmm4,-32(%rbp)\n\t"
183
    "movsd      %xmm5,-24(%rbp)\n\t"
184
    "movsd      %xmm6,-16(%rbp)\n\t"
185
    "movsd      %xmm7, -8(%rbp)\n\t"
186
    "leaq       -64(%rbp),%r8\n\t"
187
    // rdi has the 'self' pointer already
188
    "movl       %eax,%esi\n\t"
189
    "leaq       16(%rbp),%rdx\n\t"
190
    "call       PrepareAndDispatch@plt\n\t"
191
    "leave\n\t"
192
    "ret\n\t"
193
    ".size      SharedStub,.-SharedStub");
194
195
#define SENTINEL_ENTRY(n) \
196
nsresult nsXPTCStubBase::Sentinel##n() \
197
{ \
198
    NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
199
    return NS_ERROR_NOT_IMPLEMENTED; \
200
}
201
202
#include "xptcstubsdef.inc"
203
204
#else
205
#error "can't find a compiler to use"
206
#endif /* __GNUC__ */
(-)xpcom/reflect/xptcall/tests/TestXPTCInvoke.cpp (-9 / +244 lines)
Lines 87-92 Link Here
87
                                 float p17, float p18, float p19, float p20, 
87
                                 float p17, float p18, float p19, float p20, 
88
                                 float *retval) = 0;
88
                                 float *retval) = 0;
89
89
90
    NS_IMETHOD AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4,
91
			    PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8,
92
			    PRInt64 p9, PRInt32 p10, PRInt64* retval) = 0;
93
94
    NS_IMETHOD AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4,
95
			     PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8,
96
			     PRInt32 p9, PRInt64 p10, PRInt64* retval) = 0;
97
98
    NS_IMETHOD AddMixedFloats(float p1, float p2, double p3, double p4,
99
                              float p5, float p6, double p7, double p8,
100
                              float p9, double p10, float p11,
101
                              double *retval) = 0;
102
90
    NS_IMETHOD PassTwoStrings(const char* s1, const char* s2, char** retval) = 0;
103
    NS_IMETHOD PassTwoStrings(const char* s1, const char* s2, char** retval) = 0;
91
104
92
};
105
};
Lines 114-119 Link Here
114
                             float p5, float p6, float p7, float p8,
127
                             float p5, float p6, float p7, float p8,
115
                             float p9, float p10, float* retval);
128
                             float p9, float p10, float* retval);
116
129
130
    NS_IMETHOD AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4,
131
			    PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8,
132
			    PRInt64 p9, PRInt32 p10, PRInt64* retval);
133
134
    NS_IMETHOD AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4,
135
			     PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8,
136
			     PRInt32 p9, PRInt64 p10, PRInt64* retval);
137
138
    NS_IMETHOD AddMixedFloats(float p1, float p2, double p3, double p4,
139
                              float p5, float p6, double p7, double p8,
140
                              float p9, double p10, float p11,
141
                              double *retval);
142
117
    NS_IMETHOD AddManyManyFloats(float p1, float p2, float p3, float p4,
143
    NS_IMETHOD AddManyManyFloats(float p1, float p2, float p3, float p4,
118
                                 float p5, float p6, float p7, float p8,
144
                                 float p5, float p6, float p7, float p8,
119
                                 float p9, float p10, float p11, float p12, 
145
                                 float p9, float p10, float p11, float p12, 
Lines 211-216 Link Here
211
}
237
}
212
238
213
NS_IMETHODIMP
239
NS_IMETHODIMP
240
InvokeTestTarget::AddMixedFloats(float p1, float p2, double p3, double p4,
241
                                 float p5, float p6, double p7, double p8,
242
                                 float p9, double p10, float p11,
243
                                 double *retval)
244
{
245
#ifdef DEBUG_TESTINVOKE
246
    printf("%f, %f, %lf, %lf, %f, %f, %lf, %lf, %f, %lf, %f\n", 
247
           p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11);
248
#endif
249
    *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10 + p11;
250
    return NS_OK;
251
}
252
253
NS_IMETHODIMP
214
InvokeTestTarget::AddManyManyFloats(float p1, float p2, float p3, float p4,
254
InvokeTestTarget::AddManyManyFloats(float p1, float p2, float p3, float p4,
215
                                    float p5, float p6, float p7, float p8,
255
                                    float p5, float p6, float p7, float p8,
216
                                    float p9, float p10, float p11, float p12, 
256
                                    float p9, float p10, float p11, float p12, 
Lines 230-235 Link Here
230
}
270
}
231
271
232
NS_IMETHODIMP
272
NS_IMETHODIMP
273
InvokeTestTarget::AddMixedInts(PRInt64 p1, PRInt32 p2, PRInt64 p3, PRInt32 p4,
274
			       PRInt32 p5, PRInt64 p6, PRInt32 p7, PRInt32 p8,
275
			       PRInt64 p9, PRInt32 p10, PRInt64* retval)
276
{
277
    *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
278
    return NS_OK;
279
}
280
281
NS_IMETHODIMP
282
InvokeTestTarget::AddMixedInts2(PRInt32 p1, PRInt64 p2, PRInt32 p3, PRInt64 p4,
283
				PRInt64 p5, PRInt32 p6, PRInt64 p7, PRInt64 p8,
284
				PRInt32 p9, PRInt64 p10, PRInt64* retval)
285
{
286
    *retval = p1 + p2 + p3 + p4 + p5 + p6 + p7 + p8 + p9 + p10;
287
    return NS_OK;
288
}
289
290
NS_IMETHODIMP
233
InvokeTestTarget::PassTwoStrings(const char* s1, const char* s2, char** retval)
291
InvokeTestTarget::PassTwoStrings(const char* s1, const char* s2, char** retval)
234
{
292
{
235
    const char milk[] = "milk";
293
    const char milk[] = "milk";
Lines 309-322 Link Here
309
    else
367
    else
310
        printf("\tFAILED");
368
        printf("\tFAILED");
311
369
312
    if(NS_SUCCEEDED(test->PassTwoStrings("moo","cow",&outS))) {
370
    if(NS_SUCCEEDED(test->AddMixedInts(1,2,3,4,5,6,7,8,9,10,&out64)))
313
        printf(" = %s\n", outS);
371
     {
372
         LL_L2I(tmp32, out64);
373
         printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", (int)tmp32);
374
     }
375
     else
376
         printf("\tFAILED");
377
 
378
     if(NS_SUCCEEDED(test->AddMixedInts2(1,2,3,4,5,6,7,8,9,10,&out64)))
379
     {
380
          LL_L2I(tmp32, out64);
381
         printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n", (int)tmp32);
382
     }
383
     else
384
         printf("\tFAILED");
385
386
     if(NS_SUCCEEDED(test->AddMixedFloats(1,2,3,4,5,6,7,8,9,10,11,&outD)))
387
         printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = %f\n", (double)outD);
388
     else
389
         printf("\tFAILED");
390
391
     if (NS_SUCCEEDED(test->PassTwoStrings("moo","cow",&outS))) {
392
       printf(" = %s\n", outS);
314
        nsMemory::Free(outS);
393
        nsMemory::Free(outS);
315
    } else
394
      } else
316
        printf("\tFAILED");
395
        printf("\tFAILED");
317
396
318
319
320
    printf("calling via invoke:\n");
397
    printf("calling via invoke:\n");
321
398
322
    nsXPTCVariant var[21];
399
    nsXPTCVariant var[21];
Lines 388-395 Link Here
388
    var[2].flags = nsXPTCVariant::PTR_IS_DATA;
465
    var[2].flags = nsXPTCVariant::PTR_IS_DATA;
389
    var[2].ptr = &var[2].val.i64;
466
    var[2].ptr = &var[2].val.i64;
390
467
391
     if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 6, 3, var)))
468
    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 6, 3, var)))
392
         printf("\t2L * 2L = %d\n", (int)var[2].val.i64);
469
        printf("\t2L * 2L = %d\n", (int)var[2].val.i64);
393
    else
470
    else
394
        printf("\tFAILED");
471
        printf("\tFAILED");
395
472
Lines 559-564 Link Here
559
    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 10, 11, var)))
636
    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 10, 11, var)))
560
        printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %ff\n",
637
        printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %ff\n",
561
                (double) var[10].val.f);
638
                (double) var[10].val.f);
639
    else
640
        printf("\tFAILED");
562
641
563
    var[0].val.f = 1.0f;
642
    var[0].val.f = 1.0f;
564
    var[0].type = nsXPTType::T_FLOAT;
643
    var[0].type = nsXPTType::T_FLOAT;
Lines 649-654 Link Here
649
        printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 = %ff\n",
728
        printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 + 12 + 13 + 14 + 15 + 16 + 17 + 18 + 19 + 20 = %ff\n",
650
                (double) var[20].val.f);
729
                (double) var[20].val.f);
651
730
731
    var[0].val.i64 = 1;
732
    var[0].type = nsXPTType::T_I64;
733
    var[0].flags = 0;
734
735
    var[1].val.i32 = 2;
736
    var[1].type = nsXPTType::T_I32;
737
    var[1].flags = 0;
738
739
    var[2].val.i64 = 3;
740
    var[2].type = nsXPTType::T_I64;
741
    var[2].flags = 0;
742
743
    var[3].val.i32 = 4;
744
    var[3].type = nsXPTType::T_I32;
745
    var[3].flags = 0;
746
747
    var[4].val.i32 = 5;
748
    var[4].type = nsXPTType::T_I32;
749
    var[4].flags = 0;
750
751
    var[5].val.i64 = 6;
752
    var[5].type = nsXPTType::T_I64;
753
    var[5].flags = 0;
754
755
    var[6].val.i32 = 7;
756
    var[6].type = nsXPTType::T_I32;
757
    var[6].flags = 0;
758
759
    var[7].val.i32 = 8;
760
    var[7].type = nsXPTType::T_I32;
761
    var[7].flags = 0;
762
763
    var[8].val.i64 = 9;
764
    var[8].type = nsXPTType::T_I64;
765
    var[8].flags = 0;
766
767
    var[9].val.i32 = 10;
768
    var[9].type = nsXPTType::T_I32;
769
    var[9].flags = 0;
770
771
    var[10].val.i64 = 0;
772
    var[10].type = nsXPTType::T_I64;
773
    var[10].flags = nsXPTCVariant::PTR_IS_DATA;
774
    var[10].ptr = &var[10].val.i64;
775
776
    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 12, 11, var)))
777
        printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n",
778
	       (int)var[10].val.i64);
779
    else
780
        printf("\tFAILED");
781
782
    var[0].val.i32 = 1;
783
    var[0].type = nsXPTType::T_I32;
784
    var[0].flags = 0;
785
786
    var[1].val.i64 = 2;
787
    var[1].type = nsXPTType::T_I64;
788
    var[1].flags = 0;
789
790
    var[2].val.i32 = 3;
791
    var[2].type = nsXPTType::T_I32;
792
    var[2].flags = 0;
793
794
    var[3].val.i64 = 4;
795
    var[3].type = nsXPTType::T_I64;
796
    var[3].flags = 0;
797
798
    var[4].val.i64 = 5;
799
    var[4].type = nsXPTType::T_I64;
800
    var[4].flags = 0;
801
802
    var[5].val.i32 = 6;
803
    var[5].type = nsXPTType::T_I32;
804
    var[5].flags = 0;
805
806
    var[6].val.i64 = 7;
807
    var[6].type = nsXPTType::T_I64;
808
    var[6].flags = 0;
809
810
    var[7].val.i64 = 8;
811
    var[7].type = nsXPTType::T_I64;
812
    var[7].flags = 0;
813
814
    var[8].val.i32 = 9;
815
    var[8].type = nsXPTType::T_I32;
816
    var[8].flags = 0;
817
818
    var[9].val.i64 = 10;
819
    var[9].type = nsXPTType::T_I64;
820
    var[9].flags = 0;
821
822
    var[10].val.i64 = 0;
823
    var[10].type = nsXPTType::T_I64;
824
    var[10].flags = nsXPTCVariant::PTR_IS_DATA;
825
    var[10].ptr = &var[10].val.i64;
826
827
    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 13, 11, var)))
828
        printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 = %d\n",
829
	       (int)var[10].val.i64);
830
    else
831
        printf("\tFAILED");
832
833
    var[0].val.f = 1.0f;
834
    var[0].type = nsXPTType::T_FLOAT;
835
    var[0].flags = 0;
836
837
    var[1].val.f = 2.0f;
838
    var[1].type = nsXPTType::T_FLOAT;
839
    var[1].flags = 0;
840
841
    var[2].val.d = 3.0;
842
    var[2].type = nsXPTType::T_DOUBLE;
843
    var[2].flags = 0;
844
845
    var[3].val.d = 4.0;
846
    var[3].type = nsXPTType::T_DOUBLE;
847
    var[3].flags = 0;
848
849
    var[4].val.f = 5.0f;
850
    var[4].type = nsXPTType::T_FLOAT;
851
    var[4].flags = 0;
852
853
    var[5].val.f = 6.0f;
854
    var[5].type = nsXPTType::T_FLOAT;
855
    var[5].flags = 0;
856
857
    var[6].val.d = 7.0;
858
    var[6].type = nsXPTType::T_DOUBLE;
859
    var[6].flags = 0;
860
861
    var[7].val.d = 8.0;
862
    var[7].type = nsXPTType::T_DOUBLE;
863
    var[7].flags = 0;
864
865
    var[8].val.f = 9.0f;
866
    var[8].type = nsXPTType::T_FLOAT;
867
    var[8].flags = 0;
868
869
    var[9].val.d = 10.0;
870
    var[9].type = nsXPTType::T_DOUBLE;
871
    var[9].flags = 0;
872
873
    var[10].val.f = 11.0f;
874
    var[10].type = nsXPTType::T_FLOAT;
875
    var[10].flags = 0;
876
877
    var[11].val.d = 0.0;
878
    var[11].type = nsXPTType::T_DOUBLE;
879
    var[11].flags = nsXPTCVariant::PTR_IS_DATA;
880
    var[11].ptr = &var[11].val.d;
881
882
    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 14, 12, var)))
883
        printf("\t1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10 + 11 = %f\n",
884
                var[11].val.d);
885
    else
886
        printf("\tFAILED");
887
652
    var[0].val.p = (void*)"moo";
888
    var[0].val.p = (void*)"moo";
653
    var[0].type = nsXPTType::T_CHAR_STR;
889
    var[0].type = nsXPTType::T_CHAR_STR;
654
    var[0].flags = 0;
890
    var[0].flags = 0;
Lines 662-673 Link Here
662
    var[2].flags = nsXPTCVariant::PTR_IS_DATA;
898
    var[2].flags = nsXPTCVariant::PTR_IS_DATA;
663
    var[2].ptr = &var[2].val.p;
899
    var[2].ptr = &var[2].val.p;
664
    
900
    
665
    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 12, 3, var)))
901
    if(NS_SUCCEEDED(XPTC_InvokeByIndex(test, 15, 3, var)))
666
        printf(" = %s\n", var[2].val.p);
902
        printf(" = %s\n", var[2].val.p);
667
    else
903
    else
668
        printf("\tFAILED");
904
        printf("\tFAILED");
669
905
670
671
    DoMultipleInheritenceTest();
906
    DoMultipleInheritenceTest();
672
    DoMultipleInheritenceTest2();
907
    DoMultipleInheritenceTest2();
673
    // Disabled by default - takes too much time on slow machines
908
    // Disabled by default - takes too much time on slow machines

Return to bug 51786