Age | Commit message (Collapse) | Author |
|
GDScript: Fix crash caused by uninitialized temp stack slots
|
|
This adds initialization to every typed temporary stack slot at the
beginning of the function call instead of emitting instructions, since
those might be in a conditional branch and not be called.
|
|
|
|
|
|
GDScript: Use special stack space for temporaries to reduce type changes
|
|
|
|
So the stack slots perform less type changes, which is useful for
future optimizations.
|
|
|
|
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.
|
|
GDScript: Properly validate return type
|
|
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.
|
|
Rename Array.invert() to Array.reverse()
|
|
- 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.
|
|
Does the same internally for List and Vector<>, which includes all
PackedArray types.
|
|
Fix error when calling coroutine with await in _ready
|
|
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 🎆
|
|
The code paths for calling async functions seemed to be missing in some
cases, causing a debug break and false positive error.
|
|
|
|
GDScript: Refactor builtin functions
|
|
GDScript default argument override bug fix
|
|
Fix: #41766
|
|
- 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.
|
|
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.
|
|
- 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.
|
|
Only for built-in types.
|
|
|
|
Methods from builtin types can be called by using the function pointer
when the argument and base types are known at compile time.
|
|
|
|
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.
|
|
It now uses the direct operator function pointer, which increases
performance in evaluation.
|
|
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: for loop override stack variable bug fix
|
|
Fix: #42050
|
|
Fix: #41848
|
|
Implement the abstraction by targeting the current VM.
|