summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_byte_codegen.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix copyright headers referring to GodotSpartan3222024-10-271-2/+2
|
* Rebrand preambles to RedotDubhghlas McLaughlin2024-10-111-0/+2
| | | | | | | | | | | | | | | | | | | | | | Credits: Co-authored-by: Skogi <skogi.b@gmail.com> Co-authored-by: Spartan322 <Megacake1234@gmail.com> Co-authored-by: swashberry <swashdev@pm.me> Co-authored-by: Christoffer Sundbom <christoffer_karlsson@live.se> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: McDubh <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: Dubhghlas McLaughlin <103212704+mcdubhghlas@users.noreply.github.com> Co-authored-by: radenthefolf <radenthefolf@gmail.com> Co-authored-by: John Knight <80524176+Tekisasu-JohnK@users.noreply.github.com> Co-authored-by: Adam Vondersaar <adam.vondersaar@uphold.com> Co-authored-by: decryptedchaos <nixgod@gmail.com> Co-authored-by: zaftnotameni <122100803+zaftnotameni@users.noreply.github.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: wesam <108880473+wesamdev@users.noreply.github.com> Co-authored-by: Mister Puma <MisterPuma80@gmail.com> Co-authored-by: Aaron Benjamin <lifeartstudios@gmail.com> Co-authored-by: SingleError <isaaconeoneone@gmail.com> Co-authored-by: Bioblaze Payne <BioblazePayne@gmail.com>
* Implement typed dictionariesThaddeus Crews2024-09-041-0/+1
|
* GDScript: Perform validated calls with static methodsGeorge Marques2024-04-251-0/+1
| | | | | | When the types are validated at compile time, this type of call runs faster. It is already used for instance methods, this adds this optimization to native static methods as well.
* GDScript: Fix uninitialized local variables not being resetDanil Alexeev2024-03-301-6/+13
|
* Fix `#if *_ENABLED` inconsistencies, should check if definedRémi Verschelde2024-01-171-1/+1
| | | | Co-authored-by: Caroline Joy Bell <halotroop2288@proton.me>
* GDScript: Replace ptrcalls on MethodBind to validated callsGeorge Marques2023-10-061-8/+1
| | | | | | | | | 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.
* GDScript: Add static typing for `for` loop variableDanil Alexeev2023-08-171-3/+2
|
* GDScript: Fix some bugs with static variables and functionsDanil Alexeev2023-06-161-2/+2
|
* Style: Harmonize header includes in modulesRémi Verschelde2023-06-151-1/+0
| | | | | | | | | | | | | | | | | | | | 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
* Add support for static variables in GDScriptGeorge Marques2023-04-271-0/+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.
* Fix edge cases of object lifetime when signals involvedPedro J. Estébanez2023-04-111-0/+2
|
* Merge pull request #73489 from vonagam/type-check-nodeRémi Verschelde2023-02-201-2/+1
|\ | | | | | | GDScript: Rework type check
| * GDScript: Rework type checkDmitrii Maganov2023-02-171-2/+1
| |
* | Avoid GDScript bookkeeping from referencing objects longer than necessaryPedro J. Estébanez2023-02-171-1/+28
|/
* Merge pull request #70948 from vnen/gdscript-ptr-method-name-in-debugGeorge Marques2023-01-231-1/+19
|\
| * GDScript: Add names for disassembling function pointersGeorge Marques2023-01-231-1/+19
| | | | | | | | | | | | When instructions use function pointers, it's not possible to retrieve their original names in the disassembly. This stores the names in vectors (in debug builds) so they can be shown.
* | GDScript: Remove function of `continue` for match statementGeorge Marques2023-01-221-5/+0
|/ | | | | | The keyword is confusing and rarely is used in the intended way. It is removed now in favor of a future feature (pattern guards) to avoid breaking compatibility later.
* Merge pull request #70987 from vonagam/fix-parameter-conversion-assignGeorge Marques2023-01-121-1/+1
|\
| * GDScript: Fix missing conversion for default argument valuesDmitrii Maganov2023-01-061-1/+1
| |
* | GDScript: Fix temp values being written without proper clearGeorge Marques2023-01-111-1/+2
| | | | | | | | | | | | Temporary values in the stack were not being properly cleared when the return value of calls were discarded, which can cause memory issues especially for reference types like PackedByteArray.
* | GDScript: Don't use the NIL address to hold return value of functionsGeorge Marques2023-01-091-0/+2
|/ | | | | This prevents that the NIL address is filled with another value, which causes problems for some instructions that read from NIL.
* 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".
* Optimizations for GDScript VMJuan Linietsky2023-01-021-2/+7
| | | | | | | * 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.
* [Net] Modularize multiplayer, expose MultiplayerAPI to extensions.Fabio Alessandrelli2022-07-261-1/+1
| | | | | | | | | - RPC configurations are now dictionaries. - Script.get_rpc_methods renamed to Script.get_rpc_config. - Node.rpc[_id] and Callable.rpc now return an Error. - Refactor MultiplayerAPI to allow extension. - New MultiplayerAPI.rpc method with Array argument (for scripts). - Move the default MultiplayerAPI implementation to a module.
* Code quality: Fix header guards consistencyRémi Verschelde2022-07-251-3/+3
| | | | | Adds `header_guards.sh` bash script, used in CI to validate future changes. Can be run locally to fix invalid header guards.
* GDScript: Fix setter being called in chains for shared typesGeorge Marques2022-06-271-0/+2
| | | | | | | | | | | 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.
* Replace most uses of Map by HashMapreduz2022-05-161-21/+21
| | | | | | | | | | | | * 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-1/+1
|
* GDScript: Add support for static method calls in native typesGeorge Marques2022-04-061-0/+1
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* Use range iterators for `Map`Lightning_A2021-09-301-3/+3
|
* Merge pull request #52323 from vnen/gdscript-singleton-interdependence-fixRémi Verschelde2021-09-131-0/+1
|\ | | | | Fix loading of interdependent autoloads
| * GDScript: Fix loading of interdependent autoloadsGeorge Marques2021-09-011-0/+1
| | | | | | | | | | | | 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.
* | [Net] Move multiplayer to core subdir, split RPCManager.Fabio Alessandrelli2021-09-071-1/+1
|/ | | | | | | | | | | Move multiplayer classes to "core/multiplayer" subdir. Move the RPCConfig and enums (TransferMode, RPCMode) to a separate file (multiplayer.h), and bind them to the global namespace. Move the RPC handling code to its own class (RPCManager). Renames "get_rpc_sender_id" to "get_remote_sender_id".
* [Net] Single `rpc` annotation. "sync" no longer part of mode.Fabio Alessandrelli2021-07-201-1/+1
| | | | | | | | | | | | | | | | - Move the "sync" property for RPCs to RPCConfig. - Unify GDScript annotations into a single one: - `@rpc(master)` # default - `@rpc(puppet)` - `@rpc(any)` # former `@remote` - Implement three additional `@rpc` options: - The second parameter is the "sync" option (which also calls the function locally when RPCing). One of "sync", "nosync". - The third parameter is the transfer mode (reliable, unreliable, ordered). - The third parameter is the channel (unused for now).
* GDScript: Use analyzer data to decide assignment conversionGeorge Marques2021-05-261-0/+1
| | | | | | | Since there might be tricky cases in the analyzer (in the case of unsafe lines) which would need to be properly checked again. Instead, this splits the code generator in two functions and use information set by the analyzer to tell which function to use, without a need to re-check.
* GDScript: Add support for builtin static method callsGeorge Marques2021-05-161-0/+1
|
* GDScript: Implement lambdas compilation and runtimeGeorge Marques2021-04-281-0/+15
|
* GDScript: Adjust type of temporaries when neededGeorge Marques2021-04-161-0/+1
|
* GDScript: Pool temporary values by type on the stackGeorge Marques2021-04-141-25/+29
| | | | | So the stack slots perform less type changes, which is useful for future optimizations.
* Reduce number of addressing modes in GDScript VMGeorge Marques2021-04-081-14/+8
| | | | | | | | | | | | | | 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.
* Style: Apply clang-tidy's `readability-braces-around-statements`Rémi Verschelde2021-04-051-10/+20
|
* Add typed arrays to GDScriptGeorge Marques2021-03-291-0/+1
| | | | | | | | - 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.
* Merge pull request #44104 from nekomatata/coroutine-await-fixRémi Verschelde2021-01-111-0/+1
|\ | | | | Fix error when calling coroutine with await in _ready
| * Fix error when calling coroutine with await in _readyPouleyKetchoupp2020-12-171-0/+1
| | | | | | | | | | The code paths for calling async functions seemed to be missing in some cases, causing a debug break and false positive error.
* | 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 🎆
* Merge pull request #43890 from vnen/gdscript-builtin-functions-refactorRémi Verschelde2020-12-151-1/+31
|\ | | | | GDScript: Refactor builtin functions
| * GDScript: Refactor builtin functionsGeorge Marques2020-11-261-1/+31
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #41773 from ThakeeNathees/default-argument-override-buf-fixGeorge Marques2020-12-021-0/+1
|\ \ | | | | | | GDScript default argument override bug fix