summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_vm.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* | 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 ```
* Merge pull request #48793 from vnen/gdscript-fix-temp-type-adjustRémi Verschelde2021-05-171-0/+42
|\ | | | | GDScript: Fix crash caused by uninitialized temp stack slots
| * GDScript: Fix crash caused by uninitialized temp stack slotsGeorge Marques2021-05-171-0/+42
| | | | | | | | | | | | This adds initialization to every typed temporary stack slot at the beginning of the function call instead of emitting instructions, since those might be in a conditional branch and not be called.
* | GDScript: Add support for builtin static method callsGeorge Marques2021-05-161-0/+46
|/
* GDScript: Implement lambdas compilation and runtimeGeorge Marques2021-04-281-2/+36
|
* GDScript: Adjust type of temporaries when neededGeorge Marques2021-04-161-0/+78
|
* Reduce number of addressing modes in GDScript VMGeorge Marques2021-04-081-114/+59
| | | | | | | | | | | | | | There's now only 3 addressing modes: stack, constant, and member. Self, class, and nil are now present respectively in the first 3 stack slots. Global and class constants are moved to local constants when compiling. Named globals is only present on editor to use on tool singletons, so its use now emits a new instruction to copy the global to the stack. This allow us to further optimize the VM later by embedding the addressing modes in the instructions themselves, which is better done with less permutations.
* GDScript: Properly validate return typeGeorge Marques2021-04-051-4/+188
| | | | | | | When the type cannot be validated at compile time, the runtime must do a check to ensure type safety is kept, as the code might be assuming the return type is correct in another place, leading to crashes if the contract is broken.
* Add typed arrays to GDScriptGeorge Marques2021-03-291-4/+84
| | | | | | | | - Use `Array[type]` for type-hints. e.g.: `var array: Array[int] = [1, 2, 3]` - Array literals are typed if their storage is typed (variable asssignment of as argument in function all). Otherwise they are untyped.
* Fixes small typos and grammar correctionAnshul7sp12021-03-121-1/+1
|
* Merge pull request #44005 from RandomShaper/gds_needless_checkRémi Verschelde2021-01-111-5/+1
|\ | | | | Remove useless check in GDScript
| * Remove useless check in GDScriptPedro J. Estébanez2020-12-011-5/+1
| | | | | | | | | | | | The removed check was adding a protection for the case where a `Reference` has not yet got its reference count initialized and a script is called on it. That would cause the object to be released after the call. The removed code was constructing the `Variant` via the `Object` constructor so it didn't deal with the reference count and so the release was prevented. However, `Variant` no longer works that way so that check was useless. Now it's just illegal to run GDScript on a Reference whose reference count has not been initialized.
* | Merge pull request #44604 from lyuma/gdscript_dictionary_crashRémi Verschelde2021-01-111-1/+1
|\ \ | | | | | | GDScript: Fix crash when iterating through empty dictionary.
| * | Fix crash when iterating through empty dictionary.Lyuma2020-12-211-1/+1
| | |
* | | Update copyright statements to 2021Rémi Verschelde2021-01-011-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Happy new year to the wonderful Godot community! 2020 has been a tough year for most of us personally, but a good year for Godot development nonetheless with a huge amount of work done towards Godot 4.0 and great improvements backported to the long-lived 3.2 branch. We've had close to 400 contributors to engine code this year, authoring near 7,000 commit! (And that's only for the `master` branch and for the engine code, there's a lot more when counting docs, demos and other first-party repos.) Here's to a great year 2021 for all Godot users 🎆
* | | Rename empty() to is_empty()Marcel Admiraal2020-12-281-5/+5
|/ /
* | Merge pull request #44275 from vnen/variant-function-arg-pointersRémi Verschelde2020-12-151-6/+6
|\ \ | | | | | | Use pointer parameters in Variant function pointers
| * | Use pointer parameters in Variant function pointersGeorge Marques2020-12-101-6/+6
| |/ | | | | | | | | | | Instead of references. This is needed because those function pointers are used in GDNative which needs to work with plain C, which doesn't support passing parameters by reference.
* | Merge pull request #43890 from vnen/gdscript-builtin-functions-refactorRémi Verschelde2020-12-151-9/+68
|\ \ | |/ |/| GDScript: Refactor builtin functions
| * GDScript: Refactor builtin functionsGeorge Marques2020-11-261-9/+68
| | | | | | | | | | | | | | | | | | | | | | They are now called "utility functions" to avoid confusion with methods of builtin types, and be consistent with the naming in Variant. Core utility functions are now available in GDScript. The ones missing in core are added specifically to GDScript as helpers for convenience. Some functions were remove when there are better ways to do, reducing redundancy and cleaning up the global scope.
* | Fix VariantInternal initialization and setting of objectGeorge Marques2020-11-301-1/+1
|/ | | | | | - Initialize Object pointer to nullptr so it's not used by mistake. - When setting an Object check if it's a reference so refcounting works as intended.
* GDScript: Add faster instruction for validated constructorGeorge Marques2020-11-211-0/+22
| | | | Only for built-in types.
* GDScript: Add typed iterate instructionsGeorge Marques2020-11-211-87/+763
|
* GDScript: Add faster call instructions for builtin methodsGeorge Marques2020-11-211-0/+35
| | | | | Methods from builtin types can be called by using the function pointer when the argument and base types are known at compile time.
* GDScript: Add faster call instructions for native methodsGeorge Marques2020-11-211-49/+406
|