summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_vm.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Promote CowData to 64 bitsJuan Linietsky2024-01-191-1/+1
| | | | Fixes a lot of bugs, please help me fill the list.
* Merge pull request #82639 from golfinq/gdscript-improve-indexing-errorRémi Verschelde2024-01-041-17/+28
|\ | | | | | | GDScript: Improve error messages for invalid indexing
| * GDScript: Improve error messages for invalid indexingRémi Verschelde2023-10-021-17/+28
| | | | | | | | | | | | | | | | | | These errors are very common when using an invalid property name or calling on an object of the wrong type, and the previous message was a bit cryptic for users. Co-authored-by: Rémi Verschelde <rverschelde@gmail.com> Co-authored-by: golfinq <golfinqz@gmail.com>
* | Fix missing time for some script functions in profilermsreis2023-12-191-52/+58
| | | | | | | | | | | | | | | | | | Fixes the issue by adding a mechanism by which the functions that were previously disappearing can be profiled too. This is optional with an editor setting, since collecting more information naturally slows the engine further while profiling. Fixes #23715, #40251, #29049
* | Change container_element_type to vector containerThaddeus Crews2023-12-051-2/+2
| |
* | GDScript: Don't optimize division and modulo on debugGeorge Marques2023-10-181-0/+8
| | | | | | | | | | Since the validated operators don't have checks for division by zero, use the regular evaluator in debug which has those checks.
* | GDScript: Fix incorrect error message for utility functionsDanil Alexeev2023-10-161-8/+7
| |
* | GDScript: Replace ptrcalls on MethodBind to validated callsGeorge Marques2023-10-061-315/+157
| | | | | | | | | | | | | | | | | | This improves the performance of typed calls to engine methods when the argument types are exact. Using validated calls delegate more of the work the core instead of doing argument unpacking in the VM. It also does not need different instructions for each return type, simplifying the code.
* | Fix expected argument count for `Callable` call errorsDanil Alexeev2023-09-291-1/+0
|/
* Merge pull request #81200 from RandomShaper/gd_vm_msvcRémi Verschelde2023-09-251-0/+6
|\ | | | | | | Optimize GDScript VM codegen for MSVC
| * Optimize GDScript VM codegen for MSVCPedro J. Estébanez2023-09-251-0/+6
| |
* | GDScript: Fix some lambda bugsDanil Alexeev2023-09-141-4/+5
| |
* | GDScript: Fix `get_*_list()` methods return incorrect infoDanil Alexeev2023-09-041-4/+4
|/
* Merge pull request #79990 from vnen/gdscript-assume-op-typesYuri Sizov2023-08-011-15/+59
|\ | | | | | | GDScript: Optimize operators by assuming the types
| * GDScript: Optimize operators by assuming the typesGeorge Marques2023-07-281-15/+59
| | | | | | | | | | | | | | | | | | | | | | This assumes that operators are called usually with the same type of operands as the first time. So it stores the types of the first run and if matched it uses an optimized path by calling the validated operator function directly. Otherwise it uses the regular untyped evaluator. With this change, if operators do use the same type they run quite faster. OTOH, if the types mismatch it takes longer to run than they would with the previous code.
* | Support threads in the script debuggerJuan Linietsky2023-07-261-9/+11
|/ | | | | | | | | | * This implementation adds threads on the side of the client (script debugger). * Some functions of the debugger are optimized. * The profile is also now thread safe using atomics. * The editor can switch between multiple threads when debugging. This PR adds threaded support for the script language debugger. Every thread has its own thread local data and it will connect to the debugger using multiple thread IDs. This means that, now, the editor can receive multiple threads entering debug mode at the same time.
* GDScript: Fix `_get_script_name()` function collision for SCU buildDanil Alexeev2023-06-201-16/+5
|
* GDScript: Fix some bugs with static variables and functionsDanil Alexeev2023-06-161-5/+43
|
* Style: Harmonize header includes in modulesRémi Verschelde2023-06-151-2/+2
| | | | | | | | | | | | | | | | | | | | This applies our existing style guide, and adds a new rule to that style guide for modular components such as platform ports and modules: Includes from the platform port or module ("local" includes) should be listed first in their own block using relative paths, before Godot's "core" includes which use "absolute" (project folder relative) paths, and finally thirdparty includes. Includes in `#ifdef`s come after their relevant section, i.e. the overall structure is: - Local includes * Conditional local includes - Core includes * Conditional core includes - Thirdparty includes * Conditional thirdparty includes
* Merge pull request #75732 from vonagam/fix-duplicate-conditionRémi Verschelde2023-04-281-3/+3
|\ | | | | | | GDScript: Fix unnecessary duplication of pointed out lines
| * GDScript: Fix unnecessary duplication of pointed out linesDmitrii Maganov2023-04-061-3/+3
| |
* | Add support for static variables in GDScriptGeorge Marques2023-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | Which allows editable data associated with a particular class instead of the instance. Scripts with static variables are kept in memory indefinitely unless the `@static_unload` annotation is used or the `static_unload()` method is called on the GDScript. If the custom function `_static_init()` exists it will be called when the class is loaded, after the static variables are set.
* | GDScript: Don't fail when freed object is returnGeorge Marques2023-04-261-4/+0
| | | | | | | | | | This is check is a bit too eager. The user should be able to handle the return value even if it's a freed object.
* | Fix wrong file on function call errorsodaJar2023-04-241-3/+4
|/
* Added check for null objects in gdscript typed assign.ocean (they/them)2023-02-211-18/+20
|
* Merge pull request #73489 from vonagam/type-check-nodeRémi Verschelde2023-02-201-64/+70
|\ | | | | | | GDScript: Rework type check
| * GDScript: Rework type checkDmitrii Maganov2023-02-171-64/+70
| |
* | Merge pull request #73501 from anvilfolk/oopsiedaisyYuri Sizov2023-02-181-19/+13
|\ \ | |/ |/| Fix inability to assign null regression
| * Fix inability to assign null regressionocean (they/them)2023-02-171-19/+13
| | | | | | | | Co-authored-by: Dmitry Maganov <vonagam@gmail.com>
* | Merge pull request #72867 from vnen/gdscript-limit-call-depthYuri Sizov2023-02-171-0/+32
|\ \ | |/ |/| GDScript: Add limit to call depth
| * GDScript: Add limit to call depthGeorge Marques2023-02-071-0/+32
| | | | | | | | | | | | | | | | | | | | | | The hard limit is set at 2048 depth which seems sensible between legitimate recursive calls while still avoiding a crash because of a stack overflow in most of the cases. Note that it is still possible to reach the stack limit and get an overflow before reaching a call depth. This is intended as a half-way measure to stop crashing in most cases, since there's no reliable nor portable way to check the amount of stack memory left.
* | Fix crash by freed object assign to typed variableocean (they/them)2023-02-161-6/+27
| |
* | Improve GDScript error for method call on null/previously freed instancepkowal2023-02-121-8/+11
| | | | | | | | Fixes #53878.
* | Merge pull request #72654 from RandomShaper/ptrcall_ret_raw_objRémi Verschelde2023-02-111-1/+7
|\ \ | | | | | | | | | Avoid losing references to objects in the native-scripting boundary
| * | Avoid losing references to objects in the native-scripting boundaryPedro J. Estébanez2023-02-031-1/+7
| |/
* / Fix null message in assert()kobewi2023-02-081-1/+4
|/
* GDScript: Improve usability of setter chainsGeorge Marques2023-02-021-6/+23
| | | | | | | | | - Consider PackedArrays non-shared since they are copied on C++/script boundaries. - Add error messages in the analyzer when assigning to read-only properties. - Add specific error message at runtime when assignment fails because the property is read-only.
* GDScript: Fix issues with typed arraysDmitrii Maganov2023-01-311-41/+46
|
* One Copyright Update to rule them allRémi Verschelde2023-01-051-29/+29
| | | | | | | | | | | | | | | | | | | | As many open source projects have started doing it, we're removing the current year from the copyright notice, so that we don't need to bump it every year. It seems like only the first year of publication is technically relevant for copyright notices, and even that seems to be something that many companies stopped listing altogether (in a version controlled codebase, the commits are a much better source of date of publication than a hardcoded copyright statement). We also now list Godot Engine contributors first as we're collectively the current maintainers of the project, and we clarify that the "exclusive" copyright of the co-founders covers the timespan before opensourcing (their further contributions are included as part of Godot Engine contributors). Also fixed "cf." Frenchism - it's meant as "refer to / see".
* Merge pull request #70838 from reduz/gdscript-vm-optimizationRémi Verschelde2023-01-051-209/+232
|\ | | | | | | Optimizations for GDScript VM
| * Optimizations for GDScript VMJuan Linietsky2023-01-021-209/+232
| | | | | | | | | | | | | | * Removed instruction argument count and instruction prefetching. This is now done on the fly. Reduces jumps. * OPCODE_DISPATCH now goes directly to the next instruction, like in Godot 3.x. I have nothing I can use to test performance, so if anyone wants to lend a hand and compare with master (both on debug and release), it would be very welcome.
* | GDScript: Error when assigning return value of void functionGeorge Marques2022-12-301-0/+20
|/ | | | | This also makes built-in method calls empty the return value when the method is void, to avoid keeping returning a garbage value in such case.
* GDScript: Fix subclass script path issuesrune-scape2022-12-011-1/+1
|
* Fix MSVC warnings, rename shadowed variables, fix uninitialized values, ↵bruvzg2022-10-071-1/+1
| | | | change warnings=all to use /W4.
* Rename CONNECT_ONESHOT TO CONNECT_ONE_SHOTMicky2022-09-061-2/+2
| | | | For consistency. Every other exposed `one_shot` is spaced out like this.
* Remove Signal connect bindsJuan Linietsky2022-07-291-1/+1
| | | | | Remove the optional argument p_binds from `Object::connect` since it was deprecated by Callable.bind(). Changed all uses of it to Callable.bind()
* Merge pull request #63560 from V-Sekai/named_global_crashfixRémi Verschelde2022-07-281-0/+1
|\
| * Prevent hard crash in GDScriptVM when a named global can not be found.SaracenOne2022-07-271-0/+1
| |
* | Implement Vector4, Vector4i, Projectionreduz2022-07-231-0/+18
|/ | | | | | | | | | | | | Implement built-in classes Vector4, Vector4i and Projection. * Two versions of Vector4 (float and integer). * A Projection class, which is a 4x4 matrix specialized in projection types. These types have been requested for a long time, but given they were very corner case they were not added before. Because in Godot 4, reimplementing parts of the rendering engine is now possible, access to these types (heavily used by the rendering code) becomes a necessity. **Q**: Why Projection and not Matrix4? **A**: Godot does not use Matrix2, Matrix3, Matrix4x3, etc. naming convention because, within the engine, these types always have a *purpose*. As such, Godot names them: Transform2D, Transform3D or Basis. In this case, this 4x4 matrix is _always_ used as a _Projection_, hence the naming.
* Remove outdated code pathkobewi2022-07-101-5/+1
|