Magnus Norddahl
b159b5667a
- fix 8 and 16 bit store
2018-08-18 18:21:52 +02:00
Magnus Norddahl
e557e8fac0
- destroy the jit runtime when all script functions are destroyed
2018-08-18 17:50:47 +02:00
Magnus Norddahl
9d68d43ce7
- disable all unimplemented opcodes in the switch to ensure 'Unknown VM opcode' fatal error is generated if CanJit has a bug
2018-08-18 13:18:52 +02:00
Magnus Norddahl
68b2cd58d8
Fix compile errors on macOS
2018-08-18 12:37:33 +02:00
Jonathan Russell
6a40e092fe
- added remaining int arithmetic opcodes (and fixed float loading offset issue)
2018-08-17 22:06:12 +01:00
Jonathan Russell
758ee5cbfb
- forgot to turn off debug switch in last commit
2018-08-17 19:15:27 +01:00
Jonathan Russell
08c0ac541f
- made absMaskInt const
2018-08-17 19:14:31 +01:00
Jonathan Russell
d137b3c94e
- implemented CMP_APPROX for OP_EQF_*, making ~== work for doubles
2018-08-17 19:08:19 +01:00
Chronos Ouroboros
079391e5ac
Updated CanJit's supported opcodes list.
2018-08-16 21:45:04 +02:00
Chronos Ouroboros
a8ce626708
Pointer addition opcodes must leave NULL pointers as they are.
2018-08-16 21:45:04 +02:00
Chronos Ouroboros
591783087d
Changed binary int ops to use a temporary register, fixed some opcodes.
...
For some reason, binary ops might reuse one of the input registers as the output register.
This is a problem for very obvious reasons.
2018-08-14 20:08:04 -03:00
Jonathan Russell
dc03cb7a80
- made CMP_CHECK checking compile time
2018-08-14 20:50:32 +01:00
Jonathan Russell
740415246e
- added exact floating point comparison opcodes
2018-08-14 18:32:17 +01:00
Jonathan Russell
167693f102
- implemented all integer comparison operators
2018-08-14 15:07:09 +01:00
Jonathan Russell
b30df47499
- adds OP_EQ_R, the first instruction using jumps
2018-08-14 13:02:56 +01:00
Magnus Norddahl
0ced612d2c
- add misc float opcodes
2018-08-14 01:07:30 +02:00
Jonathan Russell
cdb5a9d91e
- added most vector maths opcodes
2018-08-13 21:36:55 +01:00
Chronos Ouroboros
cb28bbc72e
Fix floats and implement some more opcodes.
2018-08-13 13:07:36 -03:00
Magnus Norddahl
83d769f55c
- copy initial register values from the VM frame
2018-08-13 00:15:42 +02:00
Magnus Norddahl
7108fd6228
- implement most of the integer math opcodes
2018-08-12 04:34:57 +02:00
Magnus Norddahl
cbb945d8a7
- embed and use asmjit to JIT ZScript VM functions
2018-08-12 02:11:13 +02:00
alexey.lysiuk
b2697a99f8
- added missing null pointer checks to VM ops
2018-07-16 17:10:47 +03:00
alexey.lysiuk
2ae8d39441
Removed all superfluous #include's
...
Automatically optimized by CLion IDE with manual corrections
2018-04-24 14:30:35 +03:00
alexey.lysiuk
81bc05b7c5
Added support for default values of arguments with uint type
2018-03-07 15:58:06 +02:00
alexey.lysiuk
81ea9fb372
Added runtime check for negative array indices in VM
...
https://forum.zdoom.org/viewtopic.php?t=57886
2017-11-02 18:01:13 +02:00
Christoph Oelckers
daca12600d
- fixed: The ADDA_RK opcode used the wrong constant type for the offset it adds to the pointer.
2017-07-15 09:14:39 +02:00
alexey.lysiuk
279b1e27dc
Made usage of assertions in VM code consistent
...
https://forum.zdoom.org/viewtopic.php?t=56995
2017-06-22 10:36:08 +03:00
Christoph Oelckers
1ed415014e
- fixed: 'self' may never be null for native VM functions so it must always abort if null gets passed.
2017-06-05 08:43:12 +02:00
Christoph Oelckers
b50123ec6b
- avoid function call in VM code.
...
- return after calling ThrowAbortException because this avoids storing some register variables on the stack.
2017-05-30 17:50:56 +02:00
alexey.lysiuk
62bac1d612
Added check for nullptr to CLSS and META instructions of scripting VM
...
https://forum.zdoom.org/viewtopic.php?t=56667
2017-05-30 18:09:51 +03:00
Christoph Oelckers
97b664968e
- removed a few unused VM opcodes.
2017-05-19 10:27:22 +02:00
Christoph Oelckers
57d703236b
- changed Doom source license to GPL in all subdirectories and fixed missing licenses in a few other files.
2017-04-17 12:27:19 +02:00
Christoph Oelckers
6599e2c425
- moved the VM types into their own file and only include it where really needed.
2017-04-13 01:12:04 +02:00
Christoph Oelckers
fc9e304189
- separated class descriptors from VM types.
...
Combining these two groups of data has been the cause of many hard to detect errors because it allowed liberal casting between types that are used for completely different things.
2017-04-12 22:46:49 +02:00
Christoph Oelckers
7a6e70e777
- reenabled the part of OP_THROW that throws a VMAbortException. This part is still needed for a runtime variable access check.
2017-04-11 00:11:36 +02:00
alexey.lysiuk
d5edd3db36
Commented out remains of VM exception handling opcodes
...
This fixes build with GCC/Clang
2017-04-10 22:18:43 +03:00
Christoph Oelckers
040c70714c
- commented out the exception handling opcodes in the VM.
...
They are currently not used and not planned to be used - and they are rather costly by increasing stack size per call quite significantly.
2017-04-10 20:41:55 +02:00
Christoph Oelckers
9ae97502be
- removed the last remnants of the ATAGs.
2017-04-10 17:08:52 +02:00
Christoph Oelckers
60dd58e7d2
- most ATAG stuff is gone, except for the static storage space in the VMFunction.
2017-04-10 16:06:18 +02:00
Christoph Oelckers
5464336035
- removed ATAGs from the function builder.
2017-04-10 15:48:27 +02:00
Christoph Oelckers
e551ef52f8
- removed atag parameter from GetConstantAddress.
2017-04-10 15:39:04 +02:00
Christoph Oelckers
ef77cbd295
- stop using the ATAGs for checking pointer types in asserts.
...
This is an incredibly costly way to do a debug check as it infests the entire VM design from top to bottom. These tags are basically useless for anything else but validating object pointers being passed to native functions (i.e. mismatches between definition and declaration) and that simply does not justify a feature that costs execution time in non-debug builds and added memory overhead everywhere.
Note that this commit does not remove the tags, it only discontinues their use.
2017-04-10 15:18:31 +02:00
Christoph Oelckers
e780cd8297
- seems the wrong version of this got committed...
2017-04-01 12:04:31 +02:00
Christoph Oelckers
41f2f61b94
- minor VM optimization: Precalculate a function's frame size when compiling it instead of doing it each time it gets called.
...
This made up ca. 10% of the 'call' instruction's execution time.
2017-04-01 10:42:47 +02:00
Christoph Oelckers
31ea33bfc4
- rewrote the condition nodes from SBARINFO in ZScript. This compiles but hasn't been tested yet.
2017-03-23 00:25:26 +01:00
Christoph Oelckers
9bd75bcac5
- some conceptual work on statusbar stuff. This looks like a viable approach to build something that can replace SBARINFO.
2017-03-22 19:56:21 +01:00
Christoph Oelckers
4417afd548
- changed VMValue to handle strings by reference.
...
This makes VMValue a real POD type with no hacky overloads and eliminates a lot of destructor code in all places that call a VM function. Due to the way this had to be handled, none of these destructors could be skipped because any value could have been a string.
This required some minor changes in functions that passed a temporary FString into the VM to ensure that the temporary object lives long enough to be handled. The code generator had already been changed to deal with this in a previous commit.
This is easily offset by the code savings and reduced maintenance needs elsewhere.
2017-03-22 01:44:56 +01:00
Christoph Oelckers
9bffe4ee50
- scriptified the main statusbar interface and the Strife status bar.
...
Note that the Strife status bar does not draw the health bars yet. I tried to replace the hacky custom texture with a single fill operation but had to find out that all the coordinate mangling for the status bar is being done deep in the video code. This needs to be fixed before this can be made to work.
Currently this is not usable in mods because they cannot initialize custom status bars yet.
2017-03-22 00:32:52 +01:00
alexey.lysiuk
7aa6a6b0b3
Restored explicit assignment operators for VMValue
...
Unfortunately strings require special handling and so all operators must be available
This partly solves https://mantis.zdoom.org/view.php?id=453 (and https://mantis.zdoom.org/view.php?id=459 too)
2017-03-21 12:14:50 +02:00
Christoph Oelckers
403c5693a9
- cleaned out a large part of unused methods from VMValue.
...
- keep string registers which are being used as function parameters allocated until after the function call returns. This is for allowing to pass strings by reference which would avoid some costly constructor/destructor loops in the call instruction.
2017-03-19 21:25:30 +01:00