Coverage Report

Created: 2018-07-03 15:31

/home/travis/build/MoarVM/MoarVM/src/spesh/log.h
Line
Count
Source (jump to first uncovered line)
1
/* Information about an inserted guard instruction due to logging. */
2
struct MVMSpeshLogGuard {
3
    /* Instruction and containing basic block. */
4
    MVMSpeshIns *ins;
5
    MVMSpeshBB  *bb;
6
7
    /* Have we made use of the gurad? */
8
    MVMuint32 used;
9
};
10
11
/* The default number of entries collected into a thread's spesh log buffer
12
 * before it is sent to a specialization worker. */
13
#define MVM_SPESH_LOG_DEFAULT_ENTRIES 16384
14
15
/* The number of spesh log buffers a thread can write before the spesh worker
16
 * thread allows it to write more (effectively, the limit on the number of
17
 * outstanding work per thread). Threads other than the main one getting a
18
 * bit less buffer space helps reduce memory use a bit. */
19
#define MVM_SPESH_LOG_QUOTA_MAIN_THREAD 2
20
#define MVM_SPESH_LOG_QUOTA 1
21
22
/* The number of logged invocations before we decide we've enough data for
23
 * the time being; should be at least the maximum threshold value in
24
 * thresholds.c, but we set it higher to allow more data collection. */
25
#define MVM_SPESH_LOG_LOGGED_ENOUGH 1000
26
27
/* Quick check if we are logging, to save function call overhead. */
28
0
MVM_STATIC_INLINE MVMint32 MVM_spesh_log_is_logging(MVMThreadContext *tc) {
29
0
    MVMFrame *cur_frame = tc->cur_frame;
30
0
    return cur_frame->spesh_cand == NULL && cur_frame->spesh_correlation_id && tc->spesh_log;
31
0
}
32
33
void MVM_spesh_log_initialize_thread(MVMThreadContext *tc, MVMint32 main_thread);
34
MVMSpeshLog * MVM_spesh_log_create(MVMThreadContext *tc, MVMThread *target_thread);
35
void MVM_spesh_log_new_compunit(MVMThreadContext *tc);
36
void MVM_spesh_log_entry(MVMThreadContext *tc, MVMint32 cid, MVMStaticFrame *sf, MVMCallsite *cs);
37
void MVM_spesh_log_osr(MVMThreadContext *tc);
38
void MVM_spesh_log_parameter(MVMThreadContext *tc, MVMuint16 arg_idx, MVMObject *param);
39
void MVM_spesh_log_type(MVMThreadContext *tc, MVMObject *value);
40
void MVM_spesh_log_static(MVMThreadContext *tc, MVMObject *value);
41
void MVM_spesh_log_decont(MVMThreadContext *tc, MVMuint8 *prev_op, MVMObject *value);
42
void MVM_spesh_log_invoke_target(MVMThreadContext *tc, MVMObject *invoke_target,
43
    MVMuint16 was_multi);
44
void MVM_spesh_log_return_type(MVMThreadContext *tc, MVMObject *value);
45
void MVM_spesh_log_plugin_resolution(MVMThreadContext *tc, MVMuint32 bytecode_offset,
46
        MVMuint16 guard_index);