@@ -10,12 +10,20 @@ Smallest struct with data.
10
10
10 struct arguments will exhaust available registers.""" ),
11
11
FunctionType (List .filled (10 , struct3bytesInt), int64, """
12
12
Not a multiple of word size, not a power of two.
13
+ 10 struct arguments will exhaust available registers.""" ),
14
+ FunctionType (List .filled (10 , struct3bytesInt2), int64, """
15
+ Not a multiple of word size, not a power of two.
16
+ With alignment rules taken into account size is 4 bytes.
13
17
10 struct arguments will exhaust available registers.""" ),
14
18
FunctionType (List .filled (10 , struct4bytesInt), int64, """
15
19
Exactly word size on 32-bit architectures.
16
20
10 struct arguments will exhaust available registers.""" ),
17
21
FunctionType (List .filled (10 , struct7bytesInt), int64, """
18
22
Sub word size on 64 bit architectures.
23
+ 10 struct arguments will exhaust available registers.""" ),
24
+ FunctionType (List .filled (10 , struct7bytesInt2), int64, """
25
+ Sub word size on 64 bit architectures.
26
+ With alignment rules taken into account size is 8 bytes.
19
27
10 struct arguments will exhaust available registers.""" ),
20
28
FunctionType (List .filled (10 , struct8bytesInt), int64, """
21
29
Exactly word size struct on 64bit architectures.
@@ -29,12 +37,13 @@ On x64, arguments go in int registers because it is not only float.
29
37
FunctionType (List .filled (10 , struct9bytesInt), int64, """
30
38
Argument is a single byte over a multiple of word size.
31
39
10 struct arguments will exhaust available registers.
40
+ Struct only has 1-byte aligned fields to test struct alignment itself.
32
41
Tests upper bytes in the integer registers that are partly filled.
33
42
Tests stack alignment of non word size stack arguments.""" ),
34
43
FunctionType (List .filled (10 , struct9bytesInt2), int64, """
35
44
Argument is a single byte over a multiple of word size.
45
+ With alignment rules taken into account size is 12 or 16 bytes.
36
46
10 struct arguments will exhaust available registers.
37
- Struct only has 1-byte aligned fields to test struct alignment itself.
38
47
""" ),
39
48
FunctionType (List .filled (6 , struct12bytesFloat), float, """
40
49
Arguments in FPU registers on arm hardfp and arm64.
@@ -198,23 +207,29 @@ Test alignment and padding of 64 byte int within struct."""),
198
207
Smallest struct with data.""" ),
199
208
FunctionType (struct3bytesInt.memberTypes, struct3bytesInt, """
200
209
Smaller than word size return value on all architectures.""" ),
210
+ FunctionType (struct3bytesInt2.memberTypes, struct3bytesInt2, """
211
+ Smaller than word size return value on all architectures.
212
+ With alignment rules taken into account size is 4 bytes.""" ),
201
213
FunctionType (struct4bytesInt.memberTypes, struct4bytesInt, """
202
214
Word size return value on 32 bit architectures..""" ),
203
215
FunctionType (struct7bytesInt.memberTypes, struct7bytesInt, """
204
216
Non-wordsize return value.""" ),
217
+ FunctionType (struct7bytesInt2.memberTypes, struct7bytesInt2, """
218
+ Non-wordsize return value.
219
+ With alignment rules taken into account size is 8 bytes.""" ),
205
220
FunctionType (struct8bytesInt.memberTypes, struct8bytesInt, """
206
221
Return value in integer registers on many architectures.""" ),
207
222
FunctionType (struct8bytesFloat.memberTypes, struct8bytesFloat, """
208
223
Return value in FP registers on many architectures.""" ),
209
224
FunctionType (struct8BytesMixed.memberTypes, struct8BytesMixed, """
210
225
Return value split over FP and integer register in x64.""" ),
211
226
FunctionType (struct9bytesInt.memberTypes, struct9bytesInt, """
212
- Return value in two integer registers on x64.
213
- The second register only contains a single byte.""" ),
214
- FunctionType (struct9bytesInt2.memberTypes, struct9bytesInt2, """
215
227
The minimum alignment of this struct is only 1 byte based on its fields.
216
228
Test that the memory backing these structs is the right size and that
217
229
dart:ffi trampolines do not write outside this size.""" ),
230
+ FunctionType (struct9bytesInt2.memberTypes, struct9bytesInt2, """
231
+ Return value in two integer registers on x64.
232
+ With alignment rules taken into account size is 12 or 16 bytes.""" ),
218
233
FunctionType (struct12bytesFloat.memberTypes, struct12bytesFloat, """
219
234
Return value in FPU registers, but does not use all registers on arm hardfp
220
235
and arm64.""" ),
@@ -297,8 +312,10 @@ final structs = [
297
312
struct0bytes,
298
313
struct1byteInt,
299
314
struct3bytesInt,
315
+ struct3bytesInt2,
300
316
struct4bytesInt,
301
317
struct7bytesInt,
318
+ struct7bytesInt2,
302
319
struct8bytesInt,
303
320
struct8bytesFloat,
304
321
struct8BytesMixed,
@@ -324,14 +341,18 @@ final structs = [
324
341
final struct0bytes = StructType ([]);
325
342
326
343
final struct1byteInt = StructType ([int8]);
327
- final struct3bytesInt = StructType ([int16, int8]);
344
+ final struct3bytesInt = StructType (List .filled (3 , uint8));
345
+ final struct3bytesInt2 = StructType .disambiguate ([int16, int8], "2ByteAligned" );
328
346
final struct4bytesInt = StructType ([int16, int16]);
329
- final struct7bytesInt = StructType ([int32, int16, int8]);
347
+ final struct7bytesInt = StructType (List .filled (7 , uint8));
348
+ final struct7bytesInt2 =
349
+ StructType .disambiguate ([int32, int16, int8], "4ByteAligned" );
330
350
final struct8bytesInt = StructType ([int16, int16, int32]);
331
351
final struct8bytesFloat = StructType ([float, float]);
332
352
final struct8BytesMixed = StructType ([float, int16, int16]);
333
- final struct9bytesInt = StructType ([int64, int8]);
334
- final struct9bytesInt2 = StructType .disambiguate (List .filled (9 , uint8), "2" );
353
+ final struct9bytesInt = StructType (List .filled (9 , uint8));
354
+ final struct9bytesInt2 =
355
+ StructType .disambiguate ([int64, int8], "4Or8ByteAligned" );
335
356
final struct12bytesFloat = StructType ([float, float, float]);
336
357
337
358
/// The largest homogenous float that goes into FPU registers on softfp and
0 commit comments