summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_vm.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* Merge pull request #53135 from briansemrau/fix-ref-leakRémi Verschelde2022-06-281-1/+1
|\
| * GDScript Don't double-reference Refs returned from native functionBrian Semrau2021-09-281-1/+1
| |
* | Merge pull request #62468 from V-Sekai/core-const-expressionsRémi Verschelde2022-06-281-0/+2
|\ \ | | | | | | Add a const call mode to Object, Variant and Script.
| * | Add a const call mode to Object, Variant and Script.K. S. Ernest (iFire) Lee2022-06-271-0/+2
| | | | | | | | | | | | | | | | | | | | | For this to work safely (user not call queue_free or something in the expression), a const call mode was added to Object and Variant (and optionally Script). This mode ensures only const functions can be called, making it safe to use from the editor. Co-Authored-By: reduz <reduzio@gmail.com>
* | | GDScript: Fix setter being called in chains for shared typesGeorge Marques2022-06-271-0/+16
|/ / | | | | | | | | | | | | | | | | | | | | When a type is shared (i.e. passed by reference) it doesn't need to be called in a setter chain (e.g. `a.b.c = 0`) since it will be updated in place. This commit adds an instruction that jumps when the value is shared so it can be used to skip those cases and avoid redundant calls of setters. It also solves issues when assigning to sub-properties of read-only properties.
* | Do not reset return value in release buildBlack Cat2022-06-221-1/+1
| |
* | GDScript: Fix stack overflow when using multiple `await`George Marques2022-05-271-9/+12
| |
* | Merge pull request #61003 from vnen/gdscript-await-stack-fixRémi Verschelde2022-05-161-29/+26
|\ \
| * | GDScript: Fix stack manipulation for `await`George Marques2022-05-131-29/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The stack now contains three special addresses that should no be copied to the state, since it contains references that creates cycles. They can be recreated when the function is resumed. This commit also removes the clearing of stack from the GDScriptFunctionState destructor, since it should be cleared when the function exits. The state stack should only be cleared manually if the instance is freed before the state resumes (which is already being done). Otherwise this would destruct the stack twice, causing crashes.
* | | Replace most uses of Map by HashMapreduz2022-05-161-2/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | * Map is unnecessary and inefficient in almost every case. * Replaced by the new HashMap. * Renamed Map to RBMap and Set to RBSet for cases that still make sense (order matters) but use is discouraged. There were very few cases where replacing by HashMap was undesired because keeping the key order was intended. I tried to keep those (as RBMap) as much as possible, but might have missed some. Review appreciated!
* | GDScript: Allow using self in lambdasGeorge Marques2022-04-241-0/+36
| |
* | GDScript: Rename OPCODE_TYPE_ADJUST_TRANSFORM to have a 3D suffixAaron Franke2022-04-071-2/+2
| |
* | GDScript: Add support for static method calls in native typesGeorge Marques2022-04-061-3/+49
| |
* | Remove VARIANT_ARG* macrosreduz2022-03-091-8/+8
| | | | | | | | | | | | | | | | * Very old macros from the time Godot was created. * Limited arguments to 5 (then later changed to 8) in many places. * They were replaced by C++11 Variadic Templates. * Renamed methods that take argument pointers to have a "p" suffix. This was used in some places and not in others, so made it standard. * Also added a dereference check for Variant*. Helped catch a couple of bugs.
* | Return a correctly typed variant in case of a function error to prevent hard ↵SaracenOne2022-02-171-4/+35
| | | | | | | | crashes
* | Rename Variant::is_ref() to is_ref_counted()Pedro J. Estébanez2022-01-201-2/+2
| |
* | Merge pull request #56409 from ↵Rémi Verschelde2022-01-101-1/+6
|\ \ | | | | | | | | | cdemirer/fix-unexpected-copying-when-parameter-is-typed
| * | Fix unexpected Packed Array copying when parameter is typedcdemirer2022-01-021-1/+6
| | |
* | | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
|/ / | | | | | | Happy new year to the wonderful Godot community!
* | Replace String comparisons with "", String() to is_empty()Nathan Franke2021-12-091-10/+10
| | | | | | | | | | | | Also: - Adds two stress tests to test_string.h - Changes to .empty() on std::strings
* | Remove hash symbol in front of opcode error messages in GDScriptHugo Locurcio2021-11-091-1/+1
| | | | | | | | | | | | The hash symbol creates spurious issue references on GitHub if the message is posted outside a code block, which means some issues have a lot more references than originally intended.
* | clang-format: Disable alignment of operands, too unreliableRémi Verschelde2021-10-281-6/+6
| | | | | | | | | | | | | | | | | | Sets `AlignOperands` to `DontAlign`. `clang-format` developers seem to mostly care about space-based indentation and every other version of clang-format breaks the bad mismatch of tabs and spaces that it seems to use for operand alignment. So it's better without, so that it respects our two-tabs `ContinuationIndentWidth`.
* | Merge pull request #52940 from groud/toast_notificationRémi Verschelde2021-10-191-1/+1
|\ \
| * | Implement toast notifications in the editorGilles Roudière2021-10-141-1/+1
| | |
* | | GDScript: Properly return value with await on non-coroutineGeorge Marques2021-10-141-1/+3
|/ / | | | | | | | | If the keyword `await` is used without a coroutine, it should still return the value synchronally.
* | GDScript: Fix method ptrcall on releaseGeorge Marques2021-10-071-0/+1
| |
* | Use range iterators for `Map`Lightning_A2021-09-301-2/+2
| |
* | Fix check for freed object during castPedro J. Estébanez2021-09-271-3/+3
| |
* | Fix inverted error messages about null objectPedro J. Estébanez2021-09-271-2/+2
|/
* Remove binds from Signal.connectkobewi2021-09-241-1/+1
|
* Merge pull request #51094 from RandomShaper/error_cast_freed_objectRémi Verschelde2021-09-141-0/+15
|\ | | | | Complain if casting a freed object in a debug session
| * Complain if casting a freed object in a debug sessionPedro J. Estébanez2021-09-141-0/+15
| | | | | | | | The idea is to give the user a chance to realize a mistake that will cause a crash in a release build (or with no debugger attached).
* | GDScript: Fix loading of interdependent autoloadsGeorge Marques2021-09-011-0/+13
| | | | | | | | | | | | Move the autoload resolution to runtime by loading it into the stack with an extra instruction. This allows an autoload to use another autoload singleton independent of load order.
* | Fix initialization of objects in VariantInternalGeorge Marques2021-08-191-1/+1
|/
* Fix "super" call when having at least one argumentJulien Nguyen2021-06-131-4/+4
|
* Rename Quat to QuaternionMarcel Admiraal2021-06-041-6/+6
|
* Rename Variant TRANSFORM to TRANSFORM3DAaron Franke2021-06-031-3/+3
| | | Also _transform to _transform3d
* Rename Transform to Transform3D in coreAaron Franke2021-06-031-2/+2
|
* Fix typos with codespellRémi Verschelde2021-05-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using codespell 2.0.0. Method: ``` $ cat > ../godot-word-whitelist.txt << EOF ang curvelinear dof doubleclick fave findn GIRD leapyear lod merchantibility nd numer ois ony que seeked synching te uint unselect webp EOF $ codespell -w -q 3 -I ../godot-word-whitelist.txt --skip="./thirdparty,*.po" $ git diff // undo unwanted changes ```