/
candidate.h
65 lines (47 loc) · 1.97 KB
/
candidate.h
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
/* A specialization candidate. */
struct MVMSpeshCandidate {
/* The callsite we should have for a match. */
MVMCallsite *cs;
/* Length of the specialized bytecode in bytes. */
MVMuint32 bytecode_size;
/* The specialized bytecode. */
MVMuint8 *bytecode;
/* Frame handlers for this specialization. */
MVMFrameHandler *handlers;
/* Spesh slots, used to hold information for fast access. */
MVMCollectable **spesh_slots;
/* Number of spesh slots. */
MVMuint32 num_spesh_slots;
/* The number of deoptimization mappings we have. */
MVMuint32 num_deopts;
/* Deoptimization mappings. */
MVMint32 *deopts;
/* Bit field of named args used to put in place during deopt, since we
* typically don't update the array in specialized code. */
MVMuint64 deopt_named_used_bit_field;
/* Deopt information produced by escape analysis and scalar replacement. */
MVMSpeshPEADeopt deopt_pea;
/* Number of inlines and inlines table; see graph.h for description of
* the table format. */
MVMint32 num_inlines;
MVMSpeshInline *inlines;
/* The list of local types (only set up if we do inlines). */
MVMuint16 *local_types;
/* The list of lexical types (only set up if we do inlines). */
MVMuint16 *lexical_types;
/* Number of locals the specialized code has (may be different from the
* original frame thanks to inlining). */
MVMuint16 num_locals;
/* Number of lexicals the specialized code has. */
MVMuint16 num_lexicals;
/* Memory sizes to allocate for work/env, taking into account inlining. */
MVMuint32 work_size;
MVMuint32 env_size;
/* Number of handlers. */
MVMuint32 num_handlers;
/* JIT-code structure. */
MVMJitCode *jitcode;
};
/* Functions for creating and clearing up specializations. */
void MVM_spesh_candidate_add(MVMThreadContext *tc, MVMSpeshPlanned *p);
void MVM_spesh_candidate_destroy(MVMThreadContext *tc, MVMSpeshCandidate *candidate);