Commit graph

2303 commits

Author SHA1 Message Date
eabc727bb7 V8 optimizations 2023-05-19 00:17:41 +02:00
a57c7a5e5b V8 heap object statistics 2023-05-19 00:17:41 +02:00
6466d39c05 V8 memory leak fixes 2023-05-19 00:17:41 +02:00
cd11066aa5 Added script value and script value proxy counters 2023-05-19 00:17:41 +02:00
42704ea4bc Work on fixing V8 memory leaks, memory leak test 2023-05-19 00:17:40 +02:00
56c3bad002 V8 memory usage statistics 2023-05-19 00:17:40 +02:00
fdd8cb290c Optimized getEntityProperties 2023-05-19 00:17:40 +02:00
c18fd9092e Fixed assert on ScriptValueV8Wrapper::construct 2023-05-19 00:17:40 +02:00
8b9cd84df7 vec3ToScriptValue optimizations 2023-05-19 00:17:40 +02:00
43939290b2 Revert "vec3FromScriptValue replacement attempt"
This reverts commit 584e4be0082c07c62b6ad1f17d4258878ce3223c.
2023-05-19 00:17:40 +02:00
dba0925a1c vec3FromScriptValue replacement attempt 2023-05-19 00:17:40 +02:00
ec3e87da5c Added ScriptValue::getPropertyNames 2023-05-19 00:17:40 +02:00
e114d86871 Optimization of conversion of vec3 to/from script value 2023-05-19 00:17:40 +02:00
4062d80445 Added hash maps for faster property search on V8 callbacks 2023-05-19 00:17:40 +02:00
2a2cf3898b Work on porting laser pointers to local entities, removal of LaserPointer JS API 2023-05-19 00:17:40 +02:00
589ca2a399 Converted overlay getProperty calls to Entities.getEntityProperties 2023-05-19 00:17:40 +02:00
6c1fd88fb1 Fixed crash with asset scripting crash 2023-05-19 00:17:40 +02:00
e14ae4a96a Partial fix for asset scripting crash 2023-05-19 00:17:40 +02:00
e75c671a70 Fixed crash with Cameras app 2023-05-19 00:17:39 +02:00
b52fe9a7d5 Fixed crash on starting in VR mode with V8 2023-05-19 00:17:39 +02:00
819ebc9e49 Fixed events on V8 2023-05-19 00:17:39 +02:00
f241ede316 Initial fixes for building on Windows 2023-05-19 00:17:39 +02:00
Dale Glass
4d8a20aed7 Use logging categories everywhere in the base scripting engine code 2023-05-19 00:17:39 +02:00
Dale Glass
0fc2ab870a Add V8 logging category
Rename logging category to overte
Make all V8 code use logging categories
2023-05-19 00:17:39 +02:00
41760ee3ac Changed variable in ScriptObjectV8Proxy because it has to be stored as aligned pointer 2023-05-19 00:17:39 +02:00
Dale Glass
6ac2596293 Capture exceptions that happen in signals in ScriptEngine, add test 2023-05-19 00:17:39 +02:00
Dale Glass
acd19f7c40 Review fix: add flag to choose whether to abort script on exception 2023-05-19 00:17:39 +02:00
Dale Glass
aec756b0b9 Register metatypes, fixes warnings
Remove executeOnScriptThread from Script JS API -- seems unused, is marked deprecated, and for some reason
registration didn't resolve the warnings.
2023-05-19 00:17:39 +02:00
Dale Glass
8f82750f2a Initial implementation of raiseException and test 2023-05-19 00:17:39 +02:00
Dale Glass
cd02b22bd7 Don't crash in uncaughtException() if there isn't an exception 2023-05-19 00:17:39 +02:00
Dale Glass
cb0c62024d Throw the right exception class, and add the thrown value to it 2023-05-19 00:17:39 +02:00
Dale Glass
bb74c2ecc9 Allow accessing engine exceptions from ScriptManager 2023-05-19 00:17:39 +02:00
Dale Glass
de02da5fda Register more metatypes -- more work needed 2023-05-19 00:17:39 +02:00
Dale Glass
b1e2a94d71 Deduplicate QDebug output 2023-05-19 00:17:39 +02:00
Dale Glass
8d6270392d Make ScriptEngine a QObject instead of the derived class
Fix signal -- only needs to be in ScriptEngine
2023-05-19 00:17:39 +02:00
Dale Glass
67e7a7375a Further exception work on V8
* Get rid of maybeEmitUncaughtException
* Mostly get rid of makeError
* Introduce exception hierarchy, change exceptions to shared_ptr
* Simplify exception throwing code
2023-05-19 00:17:39 +02:00
Dale Glass
c0e62c5cc2 Initial exception handling
Make exception handling use the new ScriptException class.
Add exception signal
Throw exceptions in script evaluation
Remove references to ScriptManager from ScriptEngine
2023-05-19 00:17:39 +02:00
2bcd1106d1 Fixed ScriptObjectV8Proxy access after delete 2023-05-19 00:17:39 +02:00
27554da415 Addeed V8 getters/setters to ScriptVariantV8Proxy, fixed animation scripting 2023-05-19 00:17:39 +02:00
4e91765a3f Reverted change that broke AnimationObjec scripting interface 2023-05-19 00:17:38 +02:00
cae1e1195d V8 QObject pointer handling changes 2023-05-19 00:17:38 +02:00
5e5003ff03 Fixed crash on standing up from sit script 2023-05-19 00:17:38 +02:00
8e718262bd Fixed object containing UniquePersistent 2023-05-19 00:17:38 +02:00
acc658ee80 Fixed deadlock in Create App 2023-05-19 00:17:38 +02:00
ae7d229d0e Fix copyright headers 2023-05-19 00:17:38 +02:00
Dale Glass
02a0e33e95 Add NETWORKLESS_TEST_SCRIPT type to NetworkManager.
This is a slightly hacky way to make ScriptManager work without any
networking, and minimize the number of dependencies needed to run
a test.
2023-05-19 00:17:38 +02:00
12f239b18c Fix V8 memory leak and persistend handle problems 2023-05-19 00:17:38 +02:00
Dale Glass
84fd17cb66 Review fixes 2023-05-19 00:17:38 +02:00
Dale Glass
0f46fb9b4d Add a ScriptManagerScriptingInterface.cpp, will be useful later. 2023-05-19 00:17:38 +02:00
Dale Glass
a13723990e More Doxygen for ScriptEngine 2023-05-19 00:17:38 +02:00
Dale Glass
36cba56325 A bit more documentation 2023-05-19 00:17:38 +02:00
Dale Glass
4d70155e59 Create ScriptManagerScriptingInterface to move off the scripting API into its own class
Add a lot of documentation
2023-05-19 00:17:38 +02:00
Dale Glass
e35aa8046d Add more Doxygen docs
Doesn't work right in ScriptManager, looks like a conflict with JSDoc
2023-05-19 00:17:38 +02:00
887ebd5365 Removed deadlock in signal proxy disconnect again 2023-05-19 00:17:38 +02:00
d25e5491eb Fixed V8 crash with Create App 2023-05-19 00:17:38 +02:00
b554fc70ea Added script timers performance debugging 2023-05-19 00:17:38 +02:00
faf9b75487 Added signal time and call count debugging 2023-05-19 00:17:38 +02:00
1ad1aee11f Minor scripting-related fixes 2023-05-19 00:17:38 +02:00
5cf32a968c V8 fixes 2023-05-19 00:17:37 +02:00
f65e72c8f2 Listing objects and their properties on API debugger now works 2023-05-19 00:17:37 +02:00
37cc62d082 Fix problem with sit script 2023-05-19 00:17:37 +02:00
5809576577 Fixed Create App 2023-05-19 00:17:37 +02:00
c3417b807c Increased thread safety in V8 2023-05-19 00:17:37 +02:00
57a2dccc6a V8 bugfixes 2023-05-19 00:17:37 +02:00
89f29ce5ca Safer demarshal functions with no void pointers 2023-05-19 00:17:37 +02:00
acbec55b70 Further work on V8 2023-05-19 00:17:37 +02:00
b786ffccd5 Added more debug info to crash with signals 2023-05-19 00:17:37 +02:00
3e692a60b4 V8 fixes 2023-05-19 00:17:37 +02:00
3a5b927979 Functions connected to signals now use context that was active during connecting 2023-05-19 00:17:37 +02:00
044cd506a6 Script engine thread safety improvements 2023-05-19 00:17:37 +02:00
6bd8a8d503 V8 threading safetyu improvements 2023-05-19 00:17:37 +02:00
5099e68b56 V8 fixes, including calls and signals 2023-05-19 00:17:37 +02:00
a7b1fdcae6 Fixed convertJSObjectToVariant 2023-05-19 00:17:37 +02:00
539c2812c3 Fixed Window.location 2023-05-19 00:17:37 +02:00
66a87def43 Fixed script array to QVariant conversion 2023-05-19 00:17:37 +02:00
cb4dc4c7e8 Fixed location JS API 2023-05-19 00:17:37 +02:00
4f4c8931a9 V8 fixes, incl. enum API objects fix 2023-05-19 00:17:37 +02:00
de91769e2f Fixed some V8 crashes 2023-05-19 00:17:37 +02:00
3f1a7605a5 Fixed build warnings 2023-05-19 00:17:37 +02:00
1550049b0c Fixed script value iterator and connect functionality 2023-05-19 00:17:37 +02:00
e786fd4864 Fixed Script.require 2023-05-19 00:17:37 +02:00
386242d9c7 Fixed adding properties to methods 2023-05-19 00:17:37 +02:00
076349a488 Re-enabled script module cache creation 2023-05-19 00:17:37 +02:00
Dale Glass
2960cc0284 Add missing override 2023-05-19 00:17:36 +02:00
Dale Glass
ac7ebe2888 Add hasProperty for checking whether a property exists 2023-05-19 00:17:36 +02:00
5f2c13da52 Added debug function to list object members 2023-05-19 00:17:36 +02:00
ed968e1ebd Further work on evaluateInClosure 2023-05-19 00:17:36 +02:00
70d4a43009 Fixed evaluateInClosure and other V8 stuff 2023-05-19 00:17:36 +02:00
cc20ced1ca Some V8 debuging messages 2023-05-19 00:17:36 +02:00
da458ccef9 Fixed getting current script name 2023-05-19 00:17:36 +02:00
6301d23c48 Fixed object deletion event, temporarily disabled watchdog log commands to make reading logs easier 2023-05-19 00:17:36 +02:00
0d454eb6e8 V8 fixes, including making debug console work 2023-05-19 00:17:36 +02:00
97137c7b13 More fixes for V8 2023-05-19 00:17:36 +02:00
2f9f78fb87 Fixed setting properties of ScriptObjectV8Proxy 2023-05-19 00:17:36 +02:00
0b8958204f Fixed vector math, added simple test for it 2023-05-19 00:17:36 +02:00
e680b5dc72 Fixed method calls 2023-05-19 00:17:36 +02:00
Dale Glass
640cee0360 Reduce V8 stack size to 256K. Otherwise the interface can be crashed with a stack overflow in a script. 2023-05-19 00:17:36 +02:00
be3d1713a8 Fixed C++ function calls for V8 2023-05-19 00:17:36 +02:00
abfcbb7588 Added V8 Locker for moving script engine to a new thread 2023-05-19 00:17:36 +02:00
827ddf5958 Added simple compile test function 2023-05-19 00:17:36 +02:00