Skip to content

Commit

Permalink
Eliminate inlined_and_not_lexical flag
Browse files Browse the repository at this point in the history
This isn't sufficient, and wasn't being set in the right way anyway,
thus hiding another bug. It will be replaced with a more correct and
more precise mechanism.
  • Loading branch information
jnthn committed Nov 30, 2017
1 parent c6bee06 commit f60ceaa
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 13 deletions.
1 change: 0 additions & 1 deletion src/core/bytecode.c
Expand Up @@ -654,7 +654,6 @@ void MVM_bytecode_finish_frame(MVMThreadContext *tc, MVMCompUnit *cu,
sf->body.handlers[j].label_reg = read_int16(pos, 0);
pos += 2;
}
sf->body.handlers[j].inlined_and_not_lexical = 0;
}
}

Expand Down
4 changes: 0 additions & 4 deletions src/core/exceptions.c
Expand Up @@ -103,8 +103,6 @@ static MVMint32 search_frame_handlers(MVMThreadContext *tc, MVMFrame *f,
void **labels = f->spesh_cand->jitcode->labels;
void *cur_label = f->jit_entry_label;
for (i = 0; i < num_handlers; i++) {
if (mode == MVM_EX_THROW_LEX && fhs[i].inlined_and_not_lexical)
continue;
if (!handler_can_handle(f, &fhs[i], cat, payload))
continue;
if (cur_label >= labels[jhs[i].start_label] &&
Expand All @@ -126,8 +124,6 @@ static MVMint32 search_frame_handlers(MVMThreadContext *tc, MVMFrame *f,
pc = (MVMuint32)(f->return_address - MVM_frame_effective_bytecode(f));
for (i = 0; i < num_handlers; i++) {
MVMFrameHandler *fh = &(MVM_frame_effective_handlers(f)[i]);
if (mode == MVM_EX_THROW_LEX && fh->inlined_and_not_lexical)
continue;
if (!handler_can_handle(f, fh, cat, payload))
continue;
if (pc >= fh->start_offset && pc <= fh->end_offset && !in_handler_stack(tc, fh, f)) {
Expand Down
6 changes: 0 additions & 6 deletions src/core/exceptions.h
Expand Up @@ -49,12 +49,6 @@ struct MVMFrameHandler {
/* Register containing a label in case we have a labeled loop. We need to
* be able to check for its identity when handling e.g. `next LABEL`. */
MVMuint16 label_reg;

/* Is this handler actually a clone of a caller's handler performed during
* inlining of something, and is that something not lexically enclosed in
* the thing it was inlined into? If yes,this flag will be set. We need to
* ignore such handlers when searching for matching lexical handlers only. */
MVMuint16 inlined_and_not_lexical;
};

/* An active (currently executing) exception handler. */
Expand Down
2 changes: 0 additions & 2 deletions src/spesh/inline.c
Expand Up @@ -533,8 +533,6 @@ static void merge_graph(MVMThreadContext *tc, MVMSpeshGraph *inliner,
for (i = inliner->num_handlers; i < total_handlers; i++) {
inliner->handlers[i].block_reg += inliner->num_locals;
inliner->handlers[i].label_reg += inliner->num_locals;
if (inliner->sf != inlinee->sf->body.outer)
inliner->handlers[i].inlined_and_not_lexical = 1;
}
}

Expand Down

0 comments on commit f60ceaa

Please sign in to comment.