Commit graph

15628 commits

Author SHA1 Message Date
Christoph Oelckers
34a1c8e545 - delete JIT data when shutting down. 2018-11-25 23:33:14 +01:00
Magnus Norddahl
c164b3c3b0 - fix: float constants got their move instructions inserted after the call instruction 2018-11-25 22:26:38 +01:00
Christoph Oelckers
9475bfe4f1 - declare builtins as static. 2018-11-25 21:47:28 +01:00
Christoph Oelckers
176da5de68 - added a direct native variant for A_PlaySound because this function is relatively easy to test. 2018-11-25 18:41:27 +01:00
Magnus Norddahl
61b91f9814 - fix macro expansion error on gcc and clang 2018-11-25 18:37:26 +01:00
Christoph Oelckers
2b960aa28f - finished adding direct native functions to vmthunks.cpp. 2018-11-25 16:12:15 +01:00
Christoph Oelckers
03364a8c3e - all sector exports done. 2018-11-25 15:14:48 +01:00
Christoph Oelckers
8e8ee732f4 - another batch of direct native functions. 2018-11-25 14:19:19 +01:00
Christoph Oelckers
6628b34f4a - continued work on adding direct native support. 2018-11-25 13:35:32 +01:00
Christoph Oelckers
dc16c1d44e - moved VM thunks from p_sectors.cpp to a separate file and started adding direct native implementations.
For a few larger functions I took them out of sector_t and made them global functions to avoid creating more unnecessary stubs.
2018-11-25 11:34:50 +01:00
Christoph Oelckers
a501a22b28 - define the built-in functions defined in codegen.cpp through the regular interface instead uf just hacking them into the symbol table with incompletely set up data.
- added direct native variants to these builtins and fixed problems with builtin processing.
2018-11-25 11:41:29 +01:00
Christoph Oelckers
b267252a09 - fixed: Since out types cannot be marked as such in a function prototype (as it'd cause parameter mismatches in the resolving pass) it is necessary to check the argflags as well when determining the register type. 2018-11-24 09:34:53 +01:00
Magnus Norddahl
31ed1da4e5 Merge remote-tracking branch 'origin/master' into asmjit 2018-11-23 22:57:11 +01:00
Marisa Kirisame
ee91cf77e4 expose defaultbloodcolor to ZScript. 2018-11-23 22:15:15 +01:00
alexey.lysiuk
dc6ba6bd52 - fixed compilation of POSIX targets
src/doomerrors.h:74:14: error: exception specification of overriding function is more lax than base version
src/posix/sdl/i_main.cpp:272:28: error: 'class std::exception' has no member named 'GetMessage'
2018-11-23 15:14:15 +02:00
Magnus Norddahl
4e2cc1f144 - fix missing include statement 2018-11-23 12:13:53 +01:00
Magnus Norddahl
ac62088690 - fix wrong attribute count passed to SetFormat
- fix missing include statement
2018-11-23 12:09:36 +01:00
Magnus Norddahl
e02367dd09 - use std::runtime_error instead as the constructor on std::exception is a MSVC extension 2018-11-23 12:06:44 +01:00
Christoph Oelckers
ce46f5165a Merge branch 'master' into asmjit 2018-11-23 11:12:52 +01:00
Christoph Oelckers
bced30d1e3 - made CDoomError inherit from std::exception so that the main catch block can also deal with exceptions thrown by the STL.
- Also do not ignore empty exception messages as irrelevant. The only irrelevant exception type is CNoRunExit.
2018-11-23 10:18:52 +01:00
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
Magnus Norddahl
d4e630c127 - fix a rendering glitch when changing resolution 2018-11-23 03:00:11 +01:00
Magnus Norddahl
3e9f531b5f - add NUMA awareness to drawer threads 2018-11-22 14:48:09 +01:00
Rachael Alexanderson
4859c3d301 - fix inverted logic of Intel check 2018-11-22 02:02:37 -05:00
Magnus Norddahl
b4aa4bf0ac - only use shader cache on Intel 2018-11-22 05:31:10 +01:00
Magnus Norddahl
48fd91227c - fix compile error 2018-11-21 10:46:13 +01:00
Magnus Norddahl
dd42557e69 - implement a shader cache 2018-11-20 23:12:20 +01:00
Magnus Norddahl
96df21e3dc - fix typo 2018-11-20 13:54:18 +01:00
Magnus Norddahl
216191c86d - interpolate the normal for models 2018-11-20 13:41:27 +01:00
Christoph Oelckers
a5ee673c91 - exported ADecal to ZScript as a non-native class.
Its one function is still native but this was by far the easiest of the remaining actor classes to export.
2018-11-19 17:54:38 +01:00
Christoph Oelckers
e90ed0a01c removed the quite redundant GetStateForButtonName function
Since it forwards directly to FindState and has no script bindings there is no need to keep it, it'd only complicate the full scriptification of the weapon class if it stuck around.
2018-11-19 18:26:23 +01:00
Christoph Oelckers
ad04001135 - fixed some issues with the bodyque and moved this variable into FLevelLocals
* it was never saved in savegames, leaving the state of dead bodies undefined
* it shouldn't be subjected to pointer substitution because all it contains is old dead bodies, not live ones.
2018-11-19 18:13:23 +01:00
Christoph Oelckers
02de10f657 - cleaned up the PointerSubstitution code
Since the only thing it gets used for is swapping out PlayerPawns it can safely skip all global variables that never point to a live player, which allowed to remove quite a bit of code here that stood in the way of scriptifying more content
2018-11-19 17:05:00 +01:00
Christoph Oelckers
108874f379 - fixed the reginfo checks for the Draw... functions.
They need to be offset by the same amount as the arguments so that the values are properly matched.
2018-11-18 21:18:15 +01:00
Christoph Oelckers
8bc2d50ad2 Merge branch 'master' into asmjit
# Conflicts:
#	src/p_actionfunctions.cpp
2018-11-18 21:08:16 +01:00
Christoph Oelckers
426ee2b78e - fixed: Ceiling render hack segments were inserted into the floor list and incorrectly rendered. 2018-11-18 20:03:06 +01:00
Christoph Oelckers
3aef8418d9 - fixed the type checks for object arrays.
Null pointers must be allowed and non-object pointers which are not null must be explicitly checked for because the code could crash on them when performing a static_cast on an incorrect type.
2018-11-18 19:48:09 +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
Major Cooke
a8d4d45e89 P_Thing_Raise fixes & cleanup
- Transfer flags directly into the function and process inside instead of the action functions
- Pass in raiser for all function calls
2018-11-18 15:28:05 +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