summaryrefslogtreecommitdiff
path: root/src/vm/callsiteinspect.h
blob: df7b9002e705bc435eacc1d74ffaf4d0eee52f56 (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.

#pragma once

struct CallsiteDetails
{
    // The signature of the current call
    MetaSig MetaSig;

    // The current call frame
    FramedMethodFrame *Frame;

    // The relevant method for the callsite
    MethodDesc *MethodDesc;

    // Is the callsite for a delegate
    // Note the relevant method may _not_ be a delegate
    BOOL IsDelegate;

    // Flags for callsite
    enum
    {
        None            = 0x0,
        BeginInvoke     = 0x01,
        EndInvoke       = 0x02,
        Ctor            = 0x04,
    };
    INT32 Flags;
};

namespace CallsiteInspect
{
    // Get all arguments and associated argument details at the supplied callsite
    void GetCallsiteArgs(
        _In_ CallsiteDetails &callsite,
        _Outptr_ PTRARRAYREF *args,
        _Outptr_ BOOLARRAYREF *argsIsByRef,
        _Outptr_ PTRARRAYREF *argsTypes);

    // Properly propagate out parameters
    void PropagateOutParametersBackToCallsite(
        _In_ PTRARRAYREF outParams,
        _In_ OBJECTREF retVal,
        _In_ CallsiteDetails &callsite);
}