Commit graph

14988 commits

Author SHA1 Message Date
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
Magnus Norddahl
be6637dd17 - use the ParamOpcodes array for finding the OP_PARAM's used by a call 2019-04-15 14:33:17 +02:00
Magnus Norddahl
f1f2dca792 - implement string version of OP_CAST 2019-04-15 14:33:16 +02:00
Magnus Norddahl
0cf5f3704b - implement string part of OP_CASTB 2019-04-15 14:33:14 +02:00
Magnus Norddahl
097de74510 - implement OP_LFP 2019-04-15 14:33:13 +02:00
Magnus Norddahl
7f996b5334 - read the parameters and registers directly off the stack 2019-04-15 14:33:11 +02:00
Jonathan Russell
ff421eda63 - changed a bunch of manual address additions in string opcodes to leas 2019-04-15 14:33:10 +02:00
Magnus Norddahl
b6521467f3 - more load fixes 2019-04-15 14:33:08 +02:00
Magnus Norddahl
e28389ad12 - fix truncated load addresses due to a bug in asmjit
- change ToMemAddress to use uint64_t
2019-04-15 14:33:06 +02:00
Magnus Norddahl
db0c516693 - avoid certain x86::ptr overloads as the last argument is not always an offset 2019-04-15 14:33:05 +02:00
Jonathan Russell
0da351bfea - fixed typo in last commit 2019-04-15 14:33:03 +02:00
Jonathan Russell
2dd2344e80 - implemented SS_R, LCS_R, and LKS_R 2019-04-15 14:33:02 +02:00
Magnus Norddahl
fb7df75011 - fix bug in LKF_R 2019-04-15 14:33:00 +02:00