summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_disassembler.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Implement Vector4, Vector4i, Projectionreduz2022-07-231-0/+6
| | | | | | | | | | | | | 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/+8
| | | | | | | | | | | 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.
* GDScript: Allow using self in lambdasGeorge Marques2022-04-241-0/+19
|
* 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/+22
|
* Update copyright statements to 2022Rémi Verschelde2022-01-031-2/+2
| | | | Happy new year to the wonderful Godot community!
* GDScript: Fix loading of interdependent autoloadsGeorge Marques2021-09-011-0/+8
| | | | | | 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.
* Rename Quat to QuaternionMarcel Admiraal2021-06-041-2/+2
|
* Rename Variant TRANSFORM to TRANSFORM3DAaron Franke2021-06-031-1/+1
| | | Also _transform to _transform3d
* Fix typos with codespellRémi Verschelde2021-05-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 ```
* GDScript: Add support for builtin static method callsGeorge Marques2021-05-161-0/+22
|
* GDScript: Implement lambdas compilation and runtimeGeorge Marques2021-04-281-1/+20
|
* GDScript: Adjust type of temporaries when neededGeorge Marques2021-04-161-0/+45
|
* Reduce number of addressing modes in GDScript VMGeorge Marques2021-04-081-23/+19
| | | | | | | | | | | | | | 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.
* Merge pull request #47569 from vnen/gdscript-typed-returnRémi Verschelde2021-04-051-0/+33
|\ | | | | GDScript: Properly validate return type
| * GDScript: Properly validate return typeGeorge Marques2021-04-051-0/+33
| | | | | | | | | | | | | | 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.
* | Style: Apply clang-tidy's `readability-braces-around-statements`Rémi Verschelde2021-04-051-13/+26
|/
* Add typed arrays to GDScriptGeorge Marques2021-03-291-0/+41
| | | | | | | | - 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.
* 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 🎆
* fixes crash in disassemlber for opcode OPCODE_ASSIGN_TYPED_NATIVEJordan Schidlowsky2020-12-151-4/+1
|
* Merge pull request #43890 from vnen/gdscript-builtin-functions-refactorRémi Verschelde2020-12-151-4/+39
|\ | | | | GDScript: Refactor builtin functions
| * GDScript: Refactor builtin functionsGeorge Marques2020-11-261-4/+39
| | | | | | | | | | | | | | | | | | | | | | 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.
* | fixes crash for OPCODE_CAST_TO_NATIVE opcode in gdscript disassemlberJordan Schidlowsky2020-11-251-4/+1
|/
* GDScript: Add faster instruction for validated constructorGeorge Marques2020-11-211-1/+18
| | | | Only for built-in types.
* GDScript: Add typed iterate instructionsGeorge Marques2020-11-211-0/+54
|
* GDScript: Add faster call instructions for builtin methodsGeorge Marques2020-11-211-0/+21
| | | | | 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-0/+106
|
* GDScript: Add speficic set/get instructionsGeorge Marques2020-11-211-4/+67
| | | | | 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/+11
| | | | | It now uses the direct operator function pointer, which increases performance in evaluation.
* GDScript: Gather instructions arguments beforehandGeorge Marques2020-11-211-62/+63
| | | | | | | | | 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.
* GDScript: Split Function code into multiple filesGeorge Marques2020-11-211-0/+540
To improve organization and reduce the size of compilation units.