Reorder the method types.

Seems to slightly improve perf.
This commit is contained in:
Bob Nystrom
2013-12-12 07:39:27 -08:00
parent 4ba5c38bbf
commit 8e71660ce6
2 changed files with 13 additions and 13 deletions
+9 -9
View File
@@ -673,15 +673,6 @@ Value interpret(WrenVM* vm, Value function)
Method* method = &classObj->methods[symbol];
switch (method->type)
{
case METHOD_NONE:
printf("Receiver ");
wrenPrintValue(receiver);
printf(" does not implement method \"%s\".\n",
vm->methods.names[symbol]);
// TODO(bob): Throw an exception or halt the fiber or something.
exit(1);
break;
case METHOD_PRIMITIVE:
{
Value* args = &fiber->stack[fiber->stackSize - numArgs];
@@ -724,6 +715,15 @@ Value interpret(WrenVM* vm, Value function)
LOAD_FRAME();
break;
}
case METHOD_NONE:
printf("Receiver ");
wrenPrintValue(receiver);
printf(" does not implement method \"%s\".\n",
vm->methods.names[symbol]);
// TODO(bob): Throw an exception or halt the fiber or something.
exit(1);
break;
}
DISPATCH();
}