1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
diff -up xulrunner-9.0/mozilla-beta/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp.696393 xulrunner-9.0/mozilla-beta/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp
--- xulrunner-9.0/mozilla-beta/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp.696393 2011-12-07 07:28:08.000000000 +0100
+++ xulrunner-9.0/mozilla-beta/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390.cpp 2011-12-09 15:06:10.584998410 +0100
@@ -200,52 +200,21 @@ invoke_copy_to_stack(PRUint32 paramCount
}
}
+typedef nsresult (*vtable_func)(nsISupports *, PRUint32, PRUint32, PRUint32, PRUint32, double, double);
+
EXPORT_XPCOM_API(nsresult)
NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
PRUint32 paramCount, nsXPTCVariant* params)
{
- PRUint32 *vtable = *(PRUint32 **)that;
- PRUint32 method = vtable[methodIndex];
+ vtable_func *vtable = *reinterpret_cast<vtable_func **>(that);
+ vtable_func method = vtable[methodIndex];
PRUint32 overflow = invoke_count_words (paramCount, params);
- PRUint32 result;
-
- __asm__ __volatile__
- (
- "lr 7,15\n\t"
- "ahi 7,-32\n\t"
-
- "lr 3,%3\n\t"
- "sll 3,2\n\t"
- "lcr 3,3\n\t"
- "l 2,0(15)\n\t"
- "la 15,0(3,7)\n\t"
- "st 2,0(15)\n\t"
+ PRUint32 *stack_space = reinterpret_cast<PRUint32 *>(__builtin_alloca((overflow + 8 /* 4 32-bits gpr + 2 64-bits fpr */) * 4));
- "lr 2,%1\n\t"
- "lr 3,%2\n\t"
- "la 4,96(15)\n\t"
- "lr 5,%3\n\t"
- "basr 14,%4\n\t"
+ invoke_copy_to_stack(paramCount, params, stack_space, overflow);
- "lr 2,%5\n\t"
- "ld 0,112(7)\n\t"
- "ld 2,120(7)\n\t"
- "lm 3,6,96(7)\n\t"
- "basr 14,%6\n\t"
+ PRUint32 *d_gpr = stack_space + overflow;
+ double *d_fpr = reinterpret_cast<double *>(d_gpr + 4);
- "la 15,32(7)\n\t"
-
- "lr %0,2\n\t"
- : "=r" (result)
- : "r" (paramCount),
- "r" (params),
- "r" (overflow),
- "a" (invoke_copy_to_stack),
- "a" (that),
- "a" (method)
- : "2", "3", "4", "5", "6", "7", "14", "cc", "memory", "%f0", "%f2"
- );
-
- return result;
+ return method(that, d_gpr[0], d_gpr[1], d_gpr[2], d_gpr[3], d_fpr[0], d_fpr[1]);
}
-
diff -up xulrunner-9.0/mozilla-beta/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp.696393 xulrunner-9.0/mozilla-beta/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp
--- xulrunner-9.0/mozilla-beta/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp.696393 2011-12-07 07:28:08.000000000 +0100
+++ xulrunner-9.0/mozilla-beta/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_linux_s390x.cpp 2011-12-09 15:07:07.609097348 +0100
@@ -194,55 +194,22 @@ invoke_copy_to_stack(PRUint32 paramCount
}
}
+typedef nsresult (*vtable_func)(nsISupports *, PRUint64, PRUint64, PRUint64, PRUint64, double, double, double, double);
+
EXPORT_XPCOM_API(nsresult)
NS_InvokeByIndex(nsISupports* that, PRUint32 methodIndex,
PRUint32 paramCount, nsXPTCVariant* params)
{
- PRUint64 *vtable = *(PRUint64 **)that;
- PRUint64 method = vtable[methodIndex];
+ vtable_func *vtable = *reinterpret_cast<vtable_func **>(that);
+ vtable_func method = vtable[methodIndex];
PRUint64 overflow = invoke_count_words (paramCount, params);
+ PRUint64 *stack_space = reinterpret_cast<PRUint64 *>(__builtin_alloca((overflow + 8 /* 4 64-bits gpr + 4 64-bits fpr */) * 8));
PRUint64 result;
- __asm__ __volatile__
- (
- "lgr 7,15\n\t"
- "aghi 7,-64\n\t"
-
- "lgr 3,%3\n\t"
- "sllg 3,3,3\n\t"
- "lcgr 3,3\n\t"
- "lg 2,0(15)\n\t"
- "la 15,0(3,7)\n\t"
- "stg 2,0(15)\n\t"
-
- "lgr 2,%1\n\t"
- "lgr 3,%2\n\t"
- "la 4,160(15)\n\t"
- "lgr 5,%3\n\t"
- "basr 14,%4\n\t"
+ invoke_copy_to_stack(paramCount, params, stack_space, overflow);
- "lgr 2,%5\n\t"
- "ld 0,192(7)\n\t"
- "ld 2,200(7)\n\t"
- "ld 4,208(7)\n\t"
- "ld 6,216(7)\n\t"
- "lmg 3,6,160(7)\n\t"
- "basr 14,%6\n\t"
+ PRUint64 *d_gpr = stack_space + overflow;
+ double *d_fpr = reinterpret_cast<double *>(d_gpr + 4);
- "la 15,64(7)\n\t"
-
- "lgr %0,2\n\t"
- : "=r" (result)
- : "r" ((PRUint64)paramCount),
- "r" (params),
- "r" (overflow),
- "a" (invoke_copy_to_stack),
- "a" (that),
- "a" (method)
- : "2", "3", "4", "5", "6", "7", "14", "cc", "memory",
- "%f0", "%f1", "%f2", "%f3", "%f4", "%f5", "%f6", "%f7"
- );
-
- return result;
+ return method(that, d_gpr[0], d_gpr[1], d_gpr[2], d_gpr[3], d_fpr[0], d_fpr[1], d_fpr[2], d_fpr[3]);
}
-
|