mirror of
https://github.com/wren-lang/wren.git
synced 2026-01-12 14:48:40 +01:00
Get vm compiling as C++.
This commit is contained in:
@ -32,7 +32,7 @@ WrenVM* wrenNewVM(WrenConfiguration* configuration)
|
||||
reallocate = configuration->reallocateFn;
|
||||
}
|
||||
|
||||
WrenVM* vm = reallocate(NULL, 0, sizeof(WrenVM));
|
||||
WrenVM* vm = (WrenVM*)reallocate(NULL, 0, sizeof(WrenVM));
|
||||
|
||||
vm->reallocate = reallocate;
|
||||
|
||||
@ -520,13 +520,13 @@ static bool runInterpreter(WrenVM* vm)
|
||||
}
|
||||
#else
|
||||
|
||||
#define DISPATCH() goto *dispatchTable[instruction = READ_BYTE()];
|
||||
#define DISPATCH() goto *dispatchTable[instruction = (Code)READ_BYTE()];
|
||||
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#define INTERPRET_LOOP for (;;) switch (instruction = READ_BYTE())
|
||||
#define INTERPRET_LOOP for (;;) switch (instruction = (Code)READ_BYTE())
|
||||
#define CASE_CODE(name) case CODE_##name
|
||||
#define DISPATCH() break
|
||||
|
||||
|
||||
@ -51,6 +51,9 @@ typedef enum
|
||||
CODE_LOAD_LOCAL_7,
|
||||
CODE_LOAD_LOCAL_8,
|
||||
|
||||
// Note: The compiler assumes the following _STORE instructions always
|
||||
// immediately follow their corresponding _LOAD ones.
|
||||
|
||||
// Pushes the value in local slot [arg].
|
||||
CODE_LOAD_LOCAL,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user