Simplify the foreign call preamble a bit.

We don't need to store the number of arguments since we can calculate
it from the start and top of the stack.
This commit is contained in:
Bob Nystrom
2015-12-15 17:10:02 -08:00
parent 01e8f9053e
commit 55beda3ea9
3 changed files with 47 additions and 50 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ void metaCompile(WrenVM* vm)
// Return the result. We can't use the public API for this since we have a
// bare ObjFn.
*vm->foreignCallSlot = OBJ_VAL(fn);
vm->foreignCallSlot = NULL;
*vm->foreignStackStart = OBJ_VAL(fn);
vm->foreignStackStart = NULL;
}
static WrenForeignMethodFn bindMetaForeignMethods(WrenVM* vm,