summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_function.h
Commit message (Collapse)AuthorAgeFilesLines
...
* GDScript: Add faster call instructions for native methodsGeorge Marques2020-11-211-0/+43
|
* GDScript: Add speficic set/get instructionsGeorge Marques2020-11-211-2/+26
| | | | | When the base type is known at compile-time, we can get a direct function pointer that is faster than the regular set/get paths.
* GDScript: Add faster operator for known typesGeorge Marques2020-11-211-0/+4
| | | | | It now uses the direct operator function pointer, which increases performance in evaluation.
* GDScript: Gather instructions arguments beforehandGeorge Marques2020-11-211-27/+33
| | | | | | | | | Almost all instructions need variant arguments. With this change they are loaded in an array before each instruction call. This makes the addressing code be localized to less places, improving compilation overhead and binary size by a small margin. This should not affect performance.
* Reorganized core/ directory, it was too fatty alreadyreduz2020-11-071-6/+6
| | | | | | -Removed FuncRef, since Callable makes it obsolete -Removed int_types.h as its obsolete in c++11+ -Changed color names code
* Prevent cyclic reference between script and its membersPedro J. Estébanez2020-09-101-1/+2
|
* Add GDScript disassemblerGeorge Marques2020-09-011-8/+4
|
* Add GDScript code generation interfaceGeorge Marques2020-09-011-0/+1
| | | | Implement the abstraction by targeting the current VM.
* New GDScript tokenizer and parserGeorge Marques2020-07-201-3/+3
| | | | | | | | | | Sometimes to fix something you have to break it first. This get GDScript mostly working with the new tokenizer and parser but a lot of things isn't working yet. It compiles and it's usable, and that should be enough for now. Don't worry: other huge commits will come after this.
* Style: Enforce braces around if blocks and loopsRémi Verschelde2020-05-141-1/+2
| | | | | Using clang-tidy's `readability-braces-around-statements`. https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
* Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocksRémi Verschelde2020-05-141-3/+0
| | | | | | | | | | | | | | Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
* Port member initialization from constructor to declaration (C++11)Rémi Verschelde2020-05-141-8/+8
| | | | | | | | | | Using `clang-tidy`'s `modernize-use-default-member-init` check and manual review of the changes, and some extra manual changes that `clang-tidy` failed to do. Also went manually through all of `core` to find occurrences that `clang-tidy` couldn't handle, especially all initializations done in a constructor without using initializer lists.
* Style: clang-format: Disable AllowShortIfStatementsOnASingleLineRémi Verschelde2020-05-101-1/+2
| | | | | | | Part of #33027, also discussed in #29848. Enforcing the use of brackets even on single line statements would be preferred, but `clang-format` doesn't have this functionality yet.
* Fix object leaks caused by unfulfilled yieldsPedro J. Estébanez2020-05-051-2/+9
| | | | | | | | | | Now the stack saved in a `GDScriptFunctionState` is cleared as soon as the `yield()` operation is known not to be resumed because either the script, the instance or both are deleted. This clears problems like leaked objects by eliminating cases of circular references between `GDScriptFunctionState`s preventing them and the objects they refer to in their saved stacks from being released. As an example, this makes using `SceneTreeTimer` safer. Furthermore, with this change it's now possible to print early warnings about `yield()`s to released script/instances, as now we know they won't be successfully resumed as the condition for that happens. However, this PR doesn't add such messages, to keep the observed behavior the same for the time being. Also, now a backup of the function name in `GDScriptFunctionState` is used, since the script may not be valid by the time the function name is needed for the resume-after-yield error messages.
* Fix leaked objects when game ends with yields in progressPedro J. Estébanez2020-04-291-2/+4
|
* Replace NULL with nullptrlupoDharkael2020-04-021-2/+2
|
* Style: Set clang-format Standard to Cpp11Rémi Verschelde2020-03-171-1/+1
| | | | | | | | | | For us, it practically only changes the fact that `A<A<int>>` is now used instead of the C++03 compatible `A<A<int> >`. Note: clang-format 10+ changed the `Standard` arguments to fully specified `c++11`, `c++14`, etc. versions, but we can't use `c++17` now if we want to preserve compatibility with clang-format 8 and 9. `Cpp11` is still supported as deprecated alias for `Latest`.
* Reworked signal connection system, added support for Callable and Signal ↵Juan Linietsky2020-02-201-3/+3
| | | | objects and made them default.
* GDScript: Remove self static reference and create one on callsGeorge Marques2020-02-191-1/+1
| | | | | | This is needed because of the new changes to Variant. The reference counter is increased by adding it to a Variant, which means no GDScript will be freed (or will be double freed if manually freed somewhere).
* Changed logic and optimized ObjectID in ObjectDB and Variant, removed RefPtr.Juan Linietsky2020-02-151-4/+4
|
* Validate instances of objects before trying to check their type in GDScriptBojidar Marinov2020-01-161-7/+15
| | | | Fixes #27582
* Update copyright statements to 2020Rémi Verschelde2020-01-011-2/+2
| | | | | | | | | | | Happy new year to the wonderful Godot community! We're starting a new decade with a well-established, non-profit, free and open source game engine, and tons of further improvements in the pipeline from hundreds of contributors. Godot will keep getting better, and we're looking forward to all the games that the community will keep developing and releasing with it.
* Revert "Forbid implicit type conversion in GDScript"Rémi Verschelde2019-03-041-2/+6
|
* GDScript: Forbid implicit type conversionGeorge Marques2019-03-031-6/+2
| | | | | Since types are not present in release builds, this could cause issues where a variable does not have the exact defined type.
* Core: Ensure classes match their header filenameRémi Verschelde2019-02-121-1/+1
| | | | | | | | | | | | | | | Also drop some unused files. Renamed: - `core/dvector.h` -> `pool_vector.h` - `core/io/resource_import.h` -> `resource_importer.h` - `core/sort.h` -> `sort_array.h` - `core/string_db.h` -> `string_name.h` Dropped: - `core/allocators.h` - `core/os/shell.h` - `core/variant_construct_string.cpp`
* Fix many asan and ubsan reported issuesHein-Pieter van Braam2019-01-301-2/+9
| | | | | | | | | This allows most demos to run without any ubsan or asan errors. There are still some things in thirdpart/ and some things in AudioServer that needs a look but this fixes a lot of issues. This should help debug less obvious issues, hopefully. This fixes #25217 and fixes #25218
* GDScript: check for underscore prefix when type-checkingGeorge Marques2019-01-151-2/+8
| | | | | | Some classes are represented internally with an underscore prefix, so we need to make sure we match this representation when type-checking, otherwise the check might fail on a valid scenario.
* Update copyright statements to 2019Rémi Verschelde2019-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* Fix crash on signal/resume to dangling targetPedro J. Estébanez2018-11-251-4/+2
|
* Revert "Fix crash on signal/resume to dangling target"Pedro J. Estébanez2018-11-241-4/+6
| | | | This reverts commit 54bdc1e1f6a7fb85a5b193c9b8ecf0dcf06949e6.
* Fix crash on signal/resume to dangling targetPedro J. Estébanez2018-10-171-6/+4
| | | | Fixes #22443.
* Make core/ includes absolute, remove subfolders from include pathRémi Verschelde2018-09-121-7/+7
| | | | | | This allows more consistency in the manner we include core headers, where previously there would be a mix of absolute, relative and include path-dependent includes.
* GDScript: Allow `is` operator to test built-in typesGeorge Marques2018-08-261-0/+1
|
* Add typed instructions to GDScriptGeorge Marques2018-07-201-0/+79
| | | | | | | - Typed assignment (built-in, native, and script). - Cast (built-in conversion; native and script checks). - Check type of functions arguments on call. - Check type of members on set.
* Add static type checks in the parserGeorge Marques2018-07-201-0/+20
| | | | | | | | | | | | - Resolve types for all identifiers. - Error when identifier is not found. - Match return type and error when not returning a value when it should. - Check unreachable code (code after sure return). - Match argument count and types for function calls. - Determine if return type of function call matches the assignment. - Do static type check with match statement when possible. - Use type hints to determine export type. - Check compatibility between type hint and explicit export type.
* Fix memory leak in GDScript during infinnity loops with yieldsYasha Borevich2018-06-281-1/+1
|
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-291-10/+2
|
* Revert "RPCMode refactor, more sync modes"Max Hilbrunner2018-05-291-2/+10
|
* Refactor RPCMode enum and checksFabio Alessandrelli2018-05-261-10/+2
|
* Enable autoload in editorGeorge Marques2018-05-011-1/+9
| | | | | | - Tool scripts will be executed and can be accessed by plugins. - Other script languages can implement add/remove_named_global_constant to make use of this functionality.
* completed-signal is emitted by all GDScriptFunctionStates of a coroutine ↵Lars Kokemohr2018-03-141-0/+1
| | | | now, allowing to yield for completion of a function with more than one yield inside.
* Add missing copyright headers and fix formattingRémi Verschelde2018-01-051-0/+1
| | | | | | Using `misc/scripts/fix_headers.py` on all Godot files. Some missing header guards were added, and the header inclusion order was fixed in the Bullet module.
* Update copyright statements to 2018Rémi Verschelde2018-01-011-2/+2
| | | | Happy new year to the wonderful Godot community!
* GDScript: Refactor "GD" class prefix to "GDScript"Rémi Verschelde2017-11-161-0/+247