diff -r 40746ab0a30b -r ef5492aa8d8b jitcraft/Interpreter.cpp --- a/jitcraft/Interpreter.cpp Sat Jul 14 21:01:52 2012 -0700 +++ b/jitcraft/Interpreter.cpp Sun Jul 15 14:40:11 2012 -0700 @@ -407,11 +407,13 @@ top.sp--; break; -case OP_CALLGLOBAL: +case OP_CALL: { zone->heap().reclaim(); - unsigned index = READ_UINT32(top.pc); - Local newFun(zone, top.fp->code()->module()->getFunction(index)); + + Local newFun(zone, top.sp[-1].fun); + top.sp--; + if (!zone->stack().pushInlineFrame(newFun)) goto error; @@ -690,6 +692,19 @@ break; } +case OP_MODULE: +{ + top.sp++; + top.sp[-1].module = top.fp->code()->module(); + break; +} + +case OP_GETMODULE_FN: +{ + top.sp[-1].fun = top.sp[-1].module->getFunction(READ_UINT32(top.pc)); + break; +} + default: assert(false); return false;