summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_byte_codegen.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit godotengine/godot@d09d82d433b03bb3773fd2a8cc8d6ccc2f8739ceSpartan3222024-11-261-2/+19
|\
| * Fix crash when division by zero/modulo by zero happen on vectorsChaosus2024-11-211-2/+19
| |
* | 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/+84
|
* Add PackedVector4Array Variant typeK. S. Ernest (iFire) Lee2024-05-031-0/+8
| | | | | Co-authored-by: A Thousand Ships <96648715+AThousandShips@users.noreply.github.com> Co-authored-by: Rémi Verschelde <rverschelde@gmail.com>
* GDScript: Perform validated calls with static methodsGeorge Marques2024-04-251-13/+39
| | | | | | 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-25/+61
|
* set has_type false if it is BUILTIN but Variant::NILemre0altan2024-02-111-1/+1
|
* Change container_element_type to vector containerThaddeus Crews2023-12-051-10/+10
|
* GDScript: Replace ptrcalls on MethodBind to validated callsGeorge Marques2023-10-061-59/+18
| | | | | | | | | 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: Fix `get_*_list()` methods return incorrect infoDanil Alexeev2023-09-041-3/+0
|
* GDScript: Add static typing for `for` loop variableDanil Alexeev2023-08-171-8/+17
|
* GDScript: Optimize operators by assuming the typesGeorge Marques2023-07-281-1/+13
| | | | | | | | | | | 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.
* GDScript: Fix some bugs with static variables and functionsDanil Alexeev2023-06-161-0/+14
|
* Style: Harmonize header includes in modulesRémi Verschelde2023-06-151-1/+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
* Fix edge cases of object lifetime when signals involvedPedro J. Estébanez2023-04-111-1/+20
|
* GDScript: Don't use pool for reference typesGeorge Marques2023-04-111-51/+47
| | | | | Since they need to be properly initialized and finalized to adjust the reference counter.
* GDScript: Don't use validated call for vararg methodsGeorge Marques2023-02-241-2/+2
| | | | | Since they may have runtime type validation, we cannot use the validated call.
* GDScript: Avoid validated division operation to test for zeroGeorge Marques2023-02-211-1/+2
| | | | | | The validated operations for integer division and modulo do not check for division by zero. This avoids validated operation in these cases to make sure the check is performed and avoid crashing the engine.
* Merge pull request #73489 from vonagam/type-check-nodeRémi Verschelde2023-02-201-12/+38
|\ | | | | | | GDScript: Rework type check
| * GDScript: Rework type checkDmitrii Maganov2023-02-171-12/+38
| |
* | Avoid GDScript bookkeeping from referencing objects longer than necessaryPedro J. Estébanez2023-02-171-30/+73
|/
* GDScript: Fix issues with typed arraysDmitrii Maganov2023-01-311-21/+13
|
* Merge pull request #70948 from vnen/gdscript-ptr-method-name-in-debugGeorge Marques2023-01-231-2/+37
|\
| * GDScript: Add names for disassembling function pointersGeorge Marques2023-01-231-2/+37
| | | | | | | | | | | | 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-28/+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-2/+6
|\
| * GDScript: Fix missing conversion for default argument valuesDmitrii Maganov2023-01-061-2/+6
| |
* | GDScript: Fix temp values being written without proper clearGeorge Marques2023-01-111-60/+40
| | | | | | | | | | | | 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-21/+31
|/ | | | | 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-137/+137
| | | | | | | * 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: Fix subclass script path issuesrune-scape2022-12-011-1/+1
|
* Merge pull request #63049 from Faless/mp/4.x_as_moduleRémi Verschelde2022-07-281-1/+1
|\
| * [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.
* | Merge pull request #63325 from EIRTeam/typed_array_fixRémi Verschelde2022-07-271-1/+1
|\ \ | |/ |/|
| * Fix typed array returns returning the incorrect contained typeÁlex Román Núñez2022-07-221-1/+1
| | | | | | | | Fixes #59485 and #60218
* | Implement Vector4, Vector4i, Projectionreduz2022-07-231-0/+12
|/ | | | | | | | | | | | | 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.
* GDScript: Fix setter being called in chains for shared typesGeorge Marques2022-06-271-0/+12
| | | | | | | | | | | 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.
* Add a new HashMap implementationreduz2022-05-121-4/+2
| | | | | | | | | | | | | | | | | Adds a new, cleaned up, HashMap implementation. * Uses Robin Hood Hashing (https://en.wikipedia.org/wiki/Hash_table#Robin_Hood_hashing). * Keeps elements in a double linked list for simpler, ordered, iteration. * Allows keeping iterators for later use in removal (Unlike Map<>, it does not do much for performance vs keeping the key, but helps replace old code). * Uses a more modern C++ iterator API, deprecates the old one. * Supports custom allocator (in case there is a wish to use a paged one). This class aims to unify all the associative template usage and replace it by this one: * Map<> (whereas key order does not matter, which is 99% of cases) * HashMap<> * OrderedHashMap<> * OAHashMap<>
* GDScript: Allow using self in lambdasGeorge Marques2022-04-241-2/+2
|
* GDScript: Rename OPCODE_TYPE_ADJUST_TRANSFORM to have a 3D suffixAaron Franke2022-04-071-1/+1
|
* GDScript: Add support for static method calls in native typesGeorge Marques2022-04-061-0/+18
|
* Merge pull request #55616 from cdemirer/masterRémi Verschelde2022-01-171-0/+1
|\ | | | | Fix nested ternary-if codegen
| * Fix nested ternary-if codegen (#55582)cdemirer2021-12-041-0/+1
| |
* | Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
|/ | | | Happy new year to the wonderful Godot community!
* Only emit typed member setters if safe to do soDavid Sichma2021-10-081-2/+4
| | | | | Instructions are now only emitted if input type matches expected type. Otherwise usual setter fallback.
* Use range iterators for `Map`Lightning_A2021-09-301-28/+28
|
* Merge pull request #52323 from vnen/gdscript-singleton-interdependence-fixRémi Verschelde2021-09-131-0/+6
|\ | | | | Fix loading of interdependent autoloads