Skip to content

Commit 024d04a

Browse files
committed
Add GC/spesh debug flag to stats/planning stage.
1 parent 4632487 commit 024d04a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/spesh/plan.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,11 +110,17 @@ MVMSpeshPlan * MVM_spesh_plan(MVMThreadContext *tc, MVMObject *updated_static_fr
110110
MVMSpeshPlan *plan = MVM_calloc(1, sizeof(MVMSpeshPlan));
111111
MVMint64 updated = MVM_repr_elems(tc, updated_static_frames);
112112
MVMint64 i;
113+
#if MVM_GC_DEBUG
114+
tc->in_spesh = 1;
115+
#endif
113116
for (i = 0; i < updated; i++) {
114117
MVMObject *sf = MVM_repr_at_pos_o(tc, updated_static_frames, i);
115118
plan_for_sf(tc, plan, (MVMStaticFrame *)sf);
116119
}
117120
sort_plan(tc, plan->planned, plan->num_planned);
121+
#if MVM_GC_DEBUG
122+
tc->in_spesh = 0;
123+
#endif
118124
return plan;
119125
}
120126

src/spesh/stats.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,9 @@ void MVM_spesh_stats_update(MVMThreadContext *tc, MVMSpeshLog *sl, MVMObject *sf
308308
MVMuint32 i;
309309
MVMuint32 n = sl->body.used;
310310
SimStack sims;
311+
#if MVM_GC_DEBUG
312+
tc->in_spesh = 1;
313+
#endif
311314
sim_stack_init(tc, &sims);
312315
for (i = 0; i < n; i++) {
313316
MVMSpeshLogEntry *e = &(sl->body.entries[i]);
@@ -382,6 +385,9 @@ void MVM_spesh_stats_update(MVMThreadContext *tc, MVMSpeshLog *sl, MVMObject *sf
382385
}
383386
}
384387
sim_stack_destroy(tc, &sims);
388+
#if MVM_GC_DEBUG
389+
tc->in_spesh = 0;
390+
#endif
385391
}
386392

387393
void MVM_spesh_stats_gc_mark(MVMThreadContext *tc, MVMSpeshStats *ss, MVMGCWorklist *worklist) {

0 commit comments

Comments
 (0)