Commit graph

14900 commits

Author SHA1 Message Date
Magnus Norddahl
43cfedbd23 - disable jit in 32-bit builds 2019-04-15 14:37:21 +02:00
Magnus Norddahl
18258c6cd5 - fix wrong offsets 2019-04-15 14:37:20 +02:00
Magnus Norddahl
c9a20d56d1 - generate a memset for the allocated stack memory because that's what the VM does
(this really shouldn't be done by the VM either - the compiler backend should clear its registers if it wants them to be zero!)
2019-04-15 14:37:19 +02:00
Magnus Norddahl
8fd2bd1d51 - fix operand size mismatch error 2019-04-15 14:37:17 +02:00
Chronos Ouroboros
104f49e589 Fix the code for MODF_RK in the JIT compiler. 2019-04-15 14:37:16 +02:00
Chronos Ouroboros
c8e56f4dda Fixed the Vector2/3 != operator. 2019-04-15 14:37:14 +02:00
Chronos Ouroboros
c3c100bf9f Added support for CMP_APPROX to EQV_R and moved the code to a template. 2019-04-15 14:37:13 +02:00
Magnus Norddahl
b4db05a7ff - modify exception checks to jump ahead if the exception is to be thrown as it limits static misprediction 2019-04-15 14:37:11 +02:00
Magnus Norddahl
3504f48bfa - fix a typo 2019-04-15 14:37:10 +02:00
Magnus Norddahl
3f952e94cd - fix the throw messages 2019-04-15 14:37:09 +02:00
Christoph Oelckers
74d02811c7 - fixed vector math instructions to use the same order of operations as the VM. 2019-04-15 14:37:07 +02:00
Magnus Norddahl
64387abcce - add vm_jit cvar to control JIT compilation 2019-04-15 14:37:05 +02:00
Magnus Norddahl
87744b22ab - update JIT PARAM handling to match the VM instruction change 2019-04-15 14:37:04 +02:00
Magnus Norddahl
43a6fc7227 - RUNTIME_FUNCTION only exists in 64-bit Windows 2019-04-15 14:37:02 +02:00
Magnus Norddahl
a54dbec73a - fix wrong shift direction 2019-04-15 14:37:01 +02:00
Magnus Norddahl
bd1f529574 - build enough of the unwind opcodes for visual studio's debugger to produce the correct call stack 2019-04-15 14:36:59 +02:00
Magnus Norddahl
ea8725f03b - construct our own runtime as the one provided by asmjit is too primitive 2019-04-15 14:36:58 +02:00
Magnus Norddahl
89bf3f0455 - add more names to asmjit objects 2019-04-15 14:36:56 +02:00
Magnus Norddahl
7e9e823674 - remove the frameX registers as they were just constant offsets to vmframe that could be merged into other constant offsets 2019-04-15 14:36:55 +02:00
Magnus Norddahl
475510c8ea - give the remaining virtual registers names 2019-04-15 14:36:53 +02:00
Magnus Norddahl
68c05a424b - give temp registers names and reuse the FString object for formatting names 2019-04-15 14:36:52 +02:00
Magnus Norddahl
d48738437b - skip RESULT opcodes when outputting assembly 2019-04-15 14:36:51 +02:00
Magnus Norddahl
77850c1ec5 - clean up assembly output slightly by only generating labels for the opcodes jumped to 2019-04-15 14:36:49 +02:00
Magnus Norddahl
316010378d - fix CASTB opcode implementation 2019-04-15 14:36:48 +02:00
Magnus Norddahl
2c89d1e694 - fix missing convert from float to double in LSP and LSP_R opcodes
- fix missing convert from double to float in SSP and SSP_R opcodes
2019-04-15 14:36:46 +02:00
Magnus Norddahl
9b9113d0c4 - fix debug build compile error 2019-04-15 14:36:44 +02:00
Magnus Norddahl
7230974c1e - remove the need to do any VARF_Native runtime checks by making native functions use the same calling convention as the script version 2019-04-15 14:36:43 +02:00
Magnus Norddahl
ae6c7e541c - do script calls directly from asmjit without using a lambda wrapper
- do VARF_Native check at compile time when possible
2019-04-15 14:36:41 +02:00
Magnus Norddahl
37dfbba232 - add -dumpjit command line parameter that dumps the JIT log for all functions to dumpjit.txt
# Conflicts:
#	src/scripting/backend/vmbuilder.cpp
2019-04-15 14:36:39 +02:00
Magnus Norddahl
a60ac7b47d - fix return warning 2019-04-15 14:33:49 +02:00
Magnus Norddahl
e7f0b7a0bd - switch to using setjmp/longjmp for exception handling 2019-04-15 14:33:47 +02:00
Magnus Norddahl
b24ec1f9cc - add disabled code that attempts to load registers directly from function arguments 2019-04-15 14:33:46 +02:00
Magnus Norddahl
04ba3ede16 - add missing include statement 2019-04-15 14:33:44 +02:00
Magnus Norddahl
6db9b1394c - allocate VMFrame on the stack for simple functions with no strings 2019-04-15 14:33:43 +02:00
Magnus Norddahl
84d2de34f0 - remove argument not used anymore 2019-04-15 14:33:41 +02:00
Magnus Norddahl
636a9b9322 - apply asmjit register allocator bugfix
- enable debug builds of asmjit
2019-04-15 14:33:40 +02:00
Magnus Norddahl
f0c059678b - move VM creation into the jitted function. this will allow the jit compiler to skip vm frame creation when possible 2019-04-15 14:33:39 +02:00
Magnus Norddahl
baaed0920a - create ScriptCall function pointer on VMScriptFunction 2019-04-15 14:33:37 +02:00
Magnus Norddahl
03689cf004 - modify the VM calling convention so that the callee sets up its own VM frame 2019-04-15 14:33:35 +02:00
Magnus Norddahl
992c097ad1 - fix wrong registers getting saved when passing parameters by reference 2019-04-15 14:33:34 +02:00
Magnus Norddahl
19ae43be17 - removed CanJit as all opcodes are now implemented
- fix some store bugs
2019-04-15 14:33:32 +02:00
Magnus Norddahl
b3aeb37189 - fix 32 bit compile errors 2019-04-15 14:33:31 +02:00
Magnus Norddahl
e2dcca611c - catch and rethrow c++ exceptions 2019-04-15 14:33:29 +02:00
Magnus Norddahl
22e60d74ad - reuse temp virtual registers 2019-04-15 14:33:28 +02:00
Magnus Norddahl
80cda43370 - workaround bug in asmjit's register allocator for calls where the return register is already allocated in a physical register needed by one of the call arguments 2019-04-15 14:33:26 +02:00
Magnus Norddahl
bb3d0021d6 - switch ToMemAddress to imm_ptr where allowed 2019-04-15 14:33:25 +02:00
Magnus Norddahl
f90019561d - switch from ASMJIT_ARCH_X64 to ASMJIT_ARCH_64BIT when checking if we need to use 64-bit pointers 2019-04-15 14:33:23 +02:00
Magnus Norddahl
e0f0511d29 - create a very basic OP_IJMP implementation 2019-04-15 14:33:22 +02:00
Magnus Norddahl
812a4290b1 - create CreateCall helper to get rid of a lot of the cc.call boilerplate 2019-04-15 14:33:20 +02:00
Magnus Norddahl
ff6317d6f4 - implement OP_TAIL and OP_TAIL_K 2019-04-15 14:33:19 +02:00