Christoph Oelckers
80c6505eee
- fixed initialization of default parameters in dynamically created function calls like in the MENUDEF parser
2018-11-23 09:34:38 +01:00
Magnus Norddahl
6f397854d0
- inline VBTL opcode
...
- remove old META and CLSS implementations
2018-11-23 05:37:26 +01:00
Magnus Norddahl
9ef7212f54
- add return type to CreateFuncSignature
2018-11-23 05:20:12 +01:00
Magnus Norddahl
be4b217608
- fix typo
2018-11-23 04:50:01 +01:00
Magnus Norddahl
3ba6290419
- add support in the jit compiler to do direct native calls using the x64 calling convention
2018-11-23 04:47:18 +01:00
Christoph Oelckers
a9ec819557
- 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.
2018-11-18 19:31:13 +01:00
Christoph Oelckers
a981737855
- generate register type info for the parameter lists of all functions.
...
Currently used for loading parameters into registers.
For checking parameters of native functions some more work is needed to get the info to the function. Currently it doesn't receive the function descriptor.
2018-11-18 17:10:55 +01:00
Magnus Norddahl
1ef772d017
- add missing CheckVMFrame call
2018-11-18 14:02:39 +01:00
Magnus Norddahl
a8a9ec98f3
- only allocate stack space for vmframe and call returns when we need them
2018-11-18 13:49:19 +01:00
Magnus Norddahl
748dbec77a
- improve dumpjit output slightly
2018-11-18 13:14:41 +01:00
Magnus Norddahl
e778f05b12
- don't emit VMValue.Type information when we know the receiver isn't going to read it anyway
2018-11-18 12:59:53 +01:00
Magnus Norddahl
486b7e0f3c
- delay emitting PARAM and VTBL instructions until CALL/CALL_K
2018-11-18 12:38:55 +01:00
alexey.lysiuk
4624c6e6a3
- use custom offsetof() macro
...
src/scripting/vm/jit_call.cpp:164:38: warning: offset of on non-standard-layout type 'VMScriptFunction' [-Winvalid-offsetof]
src/scripting/vm/jit_load.cpp:87:50: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof]
src/scripting/vm/jit_load.cpp:96:50: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof]
src/scripting/vm/jit_load.cpp:257:53: warning: offset of on non-standard-layout type 'DObject' [-Winvalid-offsetof]
2018-11-18 12:48:50 +02:00
Christoph Oelckers
629d329f22
- removed OP_TAIL.
...
The amount of support code for this minor optimization was quite large and this stood in the way of streamlining the VM's calling convention, so it was preferable to remove it before moving on.
2018-11-18 07:43:03 +01:00
Magnus Norddahl
7e0dacdb1d
- disabled code that shows how a thunk function and native setup would look like
2018-11-17 16:26:54 +01:00
Christoph Oelckers
89cec539fa
- fixed IJMP code generation for the JIT compiler.
...
With a proper count value available this can be done properly. The only relevant targets are the jumps immediately succeeding the IJMP instructions, nothing else.
2018-11-17 13:39:14 +01:00
Christoph Oelckers
fcb5684607
- do not use instructions from too recent instruction set extensions.
...
andn is part of BMI1 which was introduced in 2012, which is far too recent to be used unchecked.
2018-11-17 13:10:18 +01:00
Magnus Norddahl
68afc419af
- inline ReadBarrier, GetClass and GetClassMeta
2018-11-17 10:54:16 +01:00
Christoph Oelckers
94ed30e782
- removed the default parameter handling from all native script functions because it is no longer needed.
2018-11-17 10:03:40 +01:00
Magnus Norddahl
f99bba48dc
- stop using lambda functions for CreateCall because MSVC lambas use a different calling convention and "converts" them to the right one by generating a thunk function
2018-11-17 05:12:47 +01:00
Magnus Norddahl
f082a8af98
- removed the SetupSimpleFrameMissingArgs logic as the number of args are now guaranteed
2018-11-17 00:49:22 +01:00
Magnus Norddahl
8ec85cb0ee
- add warning text when falling back to the VM
2018-11-17 00:36:40 +01:00
Magnus Norddahl
ea26bf6b2f
- make functions using too many registers (more than 200) fall back to the VM
2018-11-17 00:04:15 +01:00
Christoph Oelckers
97573a0452
- implemented VMCallWithDefaults and used it for all calls with variable arguments.
...
This isn't used for the 3 action function calls because it requires an array allocation which would be a bit too costly for something as frequently called as action functions.
They will need a different approach.
2018-11-16 19:18:33 +01:00
Christoph Oelckers
6d7710165c
- fixed last commit.
2018-11-16 18:50:34 +01:00
Christoph Oelckers
c24da62cdd
- marked all places where an incomplete parameter list may be passed to the VM by a native call by redirecting VMCall to an intermediate VMCallWithDefaults. This function must later fill in the missing arguments from the default.
2018-11-16 18:41:27 +01:00
Magnus Norddahl
ac28f0d34f
- remove unused argument
2018-11-16 01:33:41 +01:00
Magnus Norddahl
34b037c9db
- avoid calling VMFillParams for simple stack frames
...
- split Setup into more functions
2018-11-16 01:13:25 +01:00
Magnus Norddahl
6c31d2e965
- add dword store to memset code
2018-11-15 23:04:11 +01:00
Magnus Norddahl
00d41432d8
- disable jit in 32-bit builds
2018-11-15 22:47:44 +01:00
Magnus Norddahl
5ef2175c38
- fix wrong offsets
2018-11-15 22:40:12 +01:00
Magnus Norddahl
0394dc56b7
- 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!)
2018-11-15 22:33:13 +01:00
Magnus Norddahl
f3e0db913c
- fix operand size mismatch error
2018-11-15 22:07:27 +01:00
Chronos Ouroboros
96b8f12a30
Fix the code for MODF_RK in the JIT compiler.
2018-11-14 21:05:24 -02:00
Chronos Ouroboros
566eb58000
Fixed the Vector2/3 != operator.
2018-11-14 20:01:13 +01:00
Chronos Ouroboros
5375a99cf6
Added support for CMP_APPROX to EQV_R and moved the code to a template.
2018-11-14 10:29:48 -02:00
Magnus Norddahl
e6023c55a8
- modify exception checks to jump ahead if the exception is to be thrown as it limits static misprediction
2018-11-10 22:48:20 +01:00
Magnus Norddahl
a7ef178284
- fix a typo
2018-11-10 19:56:54 +01:00
Magnus Norddahl
173fe94736
- fix the throw messages
2018-11-10 19:52:41 +01:00
Christoph Oelckers
3c5609537a
- fixed vector math instructions to use the same order of operations as the VM.
2018-11-09 22:36:08 +01:00
Magnus Norddahl
534606f4ce
- add vm_jit cvar to control JIT compilation
2018-11-01 21:39:30 +01:00
Magnus Norddahl
295fc7d7f7
Revert "- the build tests are using some ancient dino 7.1 Windows SDK where UnwindInfoAddress isn't part of the struct yet."
...
This reverts commit 20516e1c0b
.
2018-10-17 08:54:41 +02:00
Magnus Norddahl
20516e1c0b
- the build tests are using some ancient dino 7.1 Windows SDK where UnwindInfoAddress isn't part of the struct yet.
2018-10-15 03:06:40 +02:00
Magnus Norddahl
1f0add9067
- update JIT PARAM handling to match the VM instruction change
2018-10-14 23:13:30 +02:00
Magnus Norddahl
70f18f87b9
Merge remote-tracking branch 'origin/master' into asmjit
2018-10-14 22:55:57 +02:00
Magnus Norddahl
1a2e5b12d0
- RUNTIME_FUNCTION only exists in 64-bit Windows
2018-10-14 22:54:30 +02:00
Christoph Oelckers
dd719f0f14
- extended the register limit for 'param'.
...
The instruction one free instruction byte so it's now using that to extend its argument's register range to 65535.
For param this is needed because it passes strings by reference and creating an implicit temporary copy for string constants does not work here.
2018-10-14 09:13:26 +02:00
Magnus Norddahl
cd211da2d8
- fix wrong shift direction
2018-10-14 08:53:18 +02:00
Magnus Norddahl
a3f6950a4f
- build enough of the unwind opcodes for visual studio's debugger to produce the correct call stack
2018-10-14 08:27:27 +02:00
Magnus Norddahl
cf9bae67a8
- construct our own runtime as the one provided by asmjit is too primitive
2018-10-14 00:46:54 +02:00