jitcraft/Interpreter.cpp
changeset 73 ef5492aa8d8b
parent 72 40746ab0a30b
child 74 80e29e23eb4e
     1.1 --- a/jitcraft/Interpreter.cpp	Sat Jul 14 21:01:52 2012 -0700
     1.2 +++ b/jitcraft/Interpreter.cpp	Sun Jul 15 14:40:11 2012 -0700
     1.3 @@ -407,11 +407,13 @@
     1.4      top.sp--;
     1.5      break;
     1.6  
     1.7 -case OP_CALLGLOBAL:
     1.8 +case OP_CALL:
     1.9  {
    1.10      zone->heap().reclaim();
    1.11 -    unsigned index = READ_UINT32(top.pc);
    1.12 -    Local<Function> newFun(zone, top.fp->code()->module()->getFunction(index));
    1.13 +
    1.14 +    Local<Function> newFun(zone, top.sp[-1].fun);
    1.15 +    top.sp--;
    1.16 +
    1.17      if (!zone->stack().pushInlineFrame(newFun))
    1.18          goto error;
    1.19  
    1.20 @@ -690,6 +692,19 @@
    1.21      break;
    1.22  }
    1.23  
    1.24 +case OP_MODULE:
    1.25 +{
    1.26 +    top.sp++;
    1.27 +    top.sp[-1].module = top.fp->code()->module();
    1.28 +    break;
    1.29 +}
    1.30 +
    1.31 +case OP_GETMODULE_FN:
    1.32 +{
    1.33 +    top.sp[-1].fun = top.sp[-1].module->getFunction(READ_UINT32(top.pc));
    1.34 +    break;
    1.35 +}
    1.36 +
    1.37  default:
    1.38      assert(false);
    1.39      return false;