Make CallFrame and Method use Obj* for functions.

There's no point in packing it in a Value since it will always
be an ObjFn or ObjClosure. Leaving it an Obj* is a bit faster.

Also fixed a bug where it was freeing the closure's flexible
array of upvalues.
This commit is contained in:
Bob Nystrom
2013-12-25 16:12:07 -08:00
parent ba0f39a5e0
commit 8c4a58a0a3
5 changed files with 45 additions and 49 deletions
+1 -1
View File
@@ -275,7 +275,7 @@ Value findGlobal(WrenVM* vm, const char* name);
// Pushes [function] onto [fiber]'s callstack and invokes it. Expects [numArgs]
// arguments (including the receiver) to be on the top of the stack already.
// [function] can be an `ObjFn` or `ObjClosure`.
void wrenCallFunction(ObjFiber* fiber, Value function, int numArgs);
void wrenCallFunction(ObjFiber* fiber, Obj* function, int numArgs);
// Mark [obj] as a GC root so that it doesn't get collected. Initializes
// [pinned], which must be then passed to [unpinObj].