Skip to content

Commit

Permalink
ignore PHI and initialize ignored_bytes field
Browse files Browse the repository at this point in the history
  • Loading branch information
timo committed Nov 11, 2017
1 parent 88296b3 commit 8973149
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/spesh/codegen.c
Expand Up @@ -227,7 +227,7 @@ static void write_instructions(MVMThreadContext *tc, MVMSpeshGraph *g, SpeshWrit
/* If this op belongs to one of the instrumentations, remember its
* size so we can get a normalized bytecode size later on. */

if (ins->info->opcode >= MVM_OP_prof_enter) {
if (ins->info->opcode >= MVM_OP_prof_enter && ins->info->opcode != MVM_SSA_PHI) {
ws->ignored_bytes += ws->bytecode_pos - pos_at_beginning;
}

Expand All @@ -253,6 +253,7 @@ MVMSpeshCode * MVM_spesh_codegen(MVMThreadContext *tc, MVMSpeshGraph *g) {
SpeshWriterState *ws = MVM_malloc(sizeof(SpeshWriterState));
ws->bytecode_pos = 0;
ws->bytecode_alloc = 1024;
ws->ignored_bytes = 0;
ws->bytecode = MVM_malloc(ws->bytecode_alloc);
ws->bb_offsets = MVM_malloc(g->num_bbs * sizeof(MVMint32));
ws->num_fixups = 0;
Expand Down

0 comments on commit 8973149

Please sign in to comment.