# HG changeset patch # User Shinji KONO # Date 1545560645 -32400 # Node ID 76e1cf5455ef1f725e973ebbe01bb980a60b1afc # Parent c83ff0b5a2edcab19352a4d7962e615a16810d87 add cbc_gc test diff -r c83ff0b5a2ed -r 76e1cf5455ef CbC-examples/c-next.c --- a/CbC-examples/c-next.c Thu Nov 22 19:45:33 2018 +0900 +++ b/CbC-examples/c-next.c Sun Dec 23 19:24:05 2018 +0900 @@ -24,7 +24,7 @@ MVMuint8 *bytecode_start; /* Points to the base of the current register set for the frame we - * * are presently in. */ + * are presently in. */ MVMRegister *reg_base; /* Points to the current compilation unit. */ @@ -43,16 +43,30 @@ __code cbc_no_op(INTERP); __code cbc_exit(INTERP); __code cbc_next(INTERP); +__code cbc_gc(INTERP); __code (* CODES[])(INTERP) = { cbc_no_op, cbc_no_op, + cbc_gc, cbc_exit, }; +void gc(int * p, INTERP i){ + i->reg_base = (MVMRegister *)p; + return; +} + +__code cbc_gc(INTERP i){ + int test = 3; + gc(&test,i); + goto cbc_next(i); +} + __code cbc_next(INTERP i){ __code (*c)(INTERP); c = CODES[NEXT_OP(i)]; + // c(i); goto c(i); }