summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_byte_codegen.h
Commit message (Collapse)AuthorAgeFilesLines
* 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
| * | GDScript default argument override bug fixThakee Nathees2020-11-281-0/+1
| | | | | | | | | | | | Fix: #41766
* | | GDScript: Improve handling of operatorsGeorge Marques2020-11-261-1/+2
| |/ |/| | | | | | | | | | | | | - Use the new functions in Variant to determine the validity and resulting type of operators. - Split the operator function in codegen between binary and unary, since the unary ones have now a special requirement of having the second argument to be the NIL type when requesting info.
* | GDScript: Fix mishandling of stack pointersGeorge Marques2020-11-251-4/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace the for loop temporaries by locals. They cause conflicts with the stack when being popped, while locals are properly handled in the scope. - Change the interface for the codegen so the for loop list doesn't live through the whole block if it's a temporary. - Keep track of the actual amount of local variables in the stack. Using the size of the map is misleading in cases where multiple locals have the same name (which is allowed when there's no shadowing). - Added a few debug checks for temporaries, to avoid them being wrongly manipulated in the future. They should not live more than a line of code. - Rearrange some of compiler code to make sure the temporaries don't live across blocks.
* | GDScript: Add faster instruction for validated constructorGeorge Marques2020-11-211-0/+14
| | | | | | | | Only for built-in types.
* | GDScript: Add faster call instructions for builtin methodsGeorge Marques2020-11-211-0/+15
| | | | | | | | | | 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-2/+22
| |
* | GDScript: Add speficic set/get instructionsGeorge Marques2020-11-211-0/+78
| | | | | | | | | | 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-3/+16
| | | | | | | | | | It now uses the direct operator function pointer, which increases performance in evaluation.
* | GDScript: Gather instructions arguments beforehandGeorge Marques2020-11-211-8/+10
|/ | | | | | | | | 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.
* Add GDScript code generation interfaceGeorge Marques2020-09-011-0/+277
Implement the abstraction by targeting the current VM.