aboutsummaryrefslogtreecommitdiff
path: root/src/ejit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ejit.c')
-rw-r--r--src/ejit.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/ejit.c b/src/ejit.c
index 94c69e6..8247bfe 100644
--- a/src/ejit.c
+++ b/src/ejit.c
@@ -48,9 +48,12 @@ static void update_gpr(struct ejit_func *f, struct ejit_gpr r0)
struct gpr_stat *gpr = gpr_stats_at(&f->gpr, r0.r);
/* presumably first time we see this gpr */
/** @todo are branches faster than a memory write? */
- if (gpr->prio == 0)
+ if (gpr->prio == 0) {
+ gpr->start = insns_len(&f->insns);
gpr->r = r0;
+ }
+ gpr->end = insns_len(&f->insns);
gpr->prio += f->prio;
}
@@ -60,9 +63,12 @@ static void update_fpr(struct ejit_func *f, struct ejit_fpr f0)
fpr_stats_append(&f->fpr, zero_fpr_stat());
struct fpr_stat *fpr = fpr_stats_at(&f->fpr, f0.f);
- if (fpr->prio == 0)
+ if (fpr->prio == 0) {
+ fpr->start = insns_len(&f->insns);
fpr->f = f0;
+ }
+ fpr->end = insns_len(&f->insns);
fpr->prio += f->prio;
}