Skip to content

Commit

Permalink
Merge pull request #1506 from MoarVM/set_sc_idx_during_deserialization
Browse files Browse the repository at this point in the history
Set sc.idx during deserialization to avoid costly lookup later
  • Loading branch information
niner committed Jun 10, 2021
2 parents 4751ca6 + 0d63dda commit 0a62f0c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/6model/serialization.c
Expand Up @@ -2283,6 +2283,7 @@ static void stub_stable(MVMThreadContext *tc, MVMSerializationReader *reader, MV

/* Set the STable's SC. */
MVM_sc_set_stable_sc(tc, st, reader->root.sc);
MVM_sc_set_idx_in_sc((MVMCollectable*) st, i);

/* Set STable read position, and set current read buffer to the
* location of the REPR data. */
Expand Down Expand Up @@ -2356,6 +2357,7 @@ static void stub_object(MVMThreadContext *tc, MVMSerializationReader *reader, MV

/* Set the object's SC. */
MVM_sc_set_obj_sc(tc, obj, reader->root.sc);
MVM_sc_set_idx_in_sc((MVMCollectable*)obj, i);
}

/* Deserializes a context. */
Expand Down

0 comments on commit 0a62f0c

Please sign in to comment.