Skip to content

Commit

Permalink
allocate directly in gen2, fixes 14-while.t
Browse files Browse the repository at this point in the history
  • Loading branch information
FROGGS committed Sep 3, 2013
1 parent 556f294 commit e3ef9d7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/core/bytecode.c
Expand Up @@ -537,6 +537,9 @@ static void create_code_objects(MVMThreadContext *tc, MVMCompUnit *cu) {
* has more than just the executive bytecode, but also various declarations,
* like frames). Unpacks it and populates the compilation unit. */
void MVM_bytecode_unpack(MVMThreadContext *tc, MVMCompUnit *cu) {
/* Allocate directly in generation 2 so the object is not moving around. */
MVM_gc_allocate_gen2_default_set(tc);

/* Dissect the bytecode into its parts. */
ReaderState *rs = dissect_bytecode(tc, cu);
MVMCompUnitBody *cu_body = &cu->body;
Expand Down Expand Up @@ -571,6 +574,9 @@ void MVM_bytecode_unpack(MVMThreadContext *tc, MVMCompUnit *cu) {

/* Clean up reader state. */
cleanup_all(tc, rs);

/* Restore normal GC allocation. */
MVM_gc_allocate_gen2_default_clear(tc);
}

/* returns the annotation for that bytecode offset */
Expand Down

0 comments on commit e3ef9d7

Please sign in to comment.