blob: 18da545afbcde6387f69d9cc39a188333149ac5f (
plain)
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
|
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
using System;
namespace ABIStress
{
internal class Config
{
internal const string TailCallerPrefix = "ABIStress_TailCaller";
internal const string TailCalleePrefix = "ABIStress_TailCallee";
internal const string PInvokerPrefix = "ABIStress_PInvoker";
internal const string PInvokeePrefix = "ABIStress_PInvokee";
internal const string InstantiatingStubPrefix = "ABIStress_InstantiatingStub_";
internal static StressModes StressModes { get; set; } = StressModes.None;
// The base seed. This value combined with the index of the
// caller/pinvoker/callee will uniquely determine how it is generated
// and which callee is used.
internal const int Seed = 0xeadbeef;
internal const int MinParams = 1;
internal static int MaxParams { get; set; } = 25;
// The number of callees to use. When stressing tailcalls, this is the number of tailcallee parameter lists to pregenerate.
// These parameter lists are pregenerated because we generate tailcallers
// by first selecting a random parameter list. A callee is then
// selected; to ensure we can actually do a fast tail call, we try to
// select a callee which requires less incoming arg space.
// For pinvokes this is the number of callees to use.
internal const int NumCallees = 10000;
internal static bool Verbose { get; set; }
}
[Flags]
internal enum StressModes
{
None = 0,
TailCalls = 0x1,
PInvokes = 0x2,
InstantiatingStubs = 0x4,
UnboxingStubs = 0x8,
SharedGenericUnboxingStubs = 0x10,
All = TailCalls | PInvokes | InstantiatingStubs | UnboxingStubs | SharedGenericUnboxingStubs,
}
}
|