- moved the type infomation entirely out of VMValue.

For the varargs functions that used the Type field to validate their parameters, now a hidden additional argument is passed which contains a byte array with the type info for the current call's arguments. Since this is static per call location it can be better prepared once when the code is being compiled instead of being put in a runtime created array for each invocation. Everything else uses the per-function instance of the same data.

The only thing that still needed the type field with a VMValue is the defaults array, so this uses a different struct type now to store its data.
This commit is contained in:
Christoph Oelckers 2018-11-18 19:31:13 +01:00
commit a9ec819557
18 changed files with 265 additions and 164 deletions

View file

@ -62,7 +62,6 @@
#include "g_levellocals.h"
#include "vm.h"
FString FStringFormat(VM_ARGS); // extern from thingdef_data.cpp
#include "gi.h"
@ -1294,7 +1293,9 @@ DEFINE_ACTION_FUNCTION(_Console, HideConsole)
DEFINE_ACTION_FUNCTION(_Console, Printf)
{
PARAM_PROLOGUE;
FString s = FStringFormat(param, numparam, ret, numret);
PARAM_VA_POINTER(va_reginfo) // Get the hidden type information array
FString s = FStringFormat(VM_ARGS_NAMES);
Printf("%s\n", s.GetChars());
return 0;
}