You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Optimizations for GDScript VM
* 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.
This commit is contained in:
@@ -405,6 +405,7 @@ public:
|
||||
ADDR_TYPE_STACK = 0,
|
||||
ADDR_TYPE_CONSTANT = 1,
|
||||
ADDR_TYPE_MEMBER = 2,
|
||||
ADDR_TYPE_MAX = 3,
|
||||
};
|
||||
|
||||
enum FixedAddresses {
|
||||
@@ -416,12 +417,6 @@ public:
|
||||
ADDR_NIL = ADDR_STACK_NIL | (ADDR_TYPE_STACK << ADDR_BITS),
|
||||
};
|
||||
|
||||
enum Instruction {
|
||||
INSTR_BITS = 20,
|
||||
INSTR_MASK = ((1 << INSTR_BITS) - 1),
|
||||
INSTR_ARGS_MASK = ~INSTR_MASK,
|
||||
};
|
||||
|
||||
struct StackDebug {
|
||||
int line;
|
||||
int pos;
|
||||
@@ -514,7 +509,6 @@ private:
|
||||
|
||||
Variant _get_default_variant_for_data_type(const GDScriptDataType &p_data_type);
|
||||
|
||||
_FORCE_INLINE_ Variant *_get_variant(int p_address, GDScriptInstance *p_instance, Variant *p_stack, String &r_error) const;
|
||||
_FORCE_INLINE_ String _get_call_error(const Callable::CallError &p_err, const String &p_where, const Variant **argptrs) const;
|
||||
|
||||
friend class GDScriptLanguage;
|
||||
|
||||
Reference in New Issue
Block a user