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:
@@ -331,8 +331,13 @@ class GDScriptByteCodeGenerator : public GDScriptCodeGenerator {
|
||||
return -1; // Unreachable.
|
||||
}
|
||||
|
||||
void append(GDScriptFunction::Opcode p_code, int p_argument_count) {
|
||||
opcodes.push_back((p_code & GDScriptFunction::INSTR_MASK) | (p_argument_count << GDScriptFunction::INSTR_BITS));
|
||||
void append_opcode(GDScriptFunction::Opcode p_code) {
|
||||
opcodes.push_back(p_code);
|
||||
}
|
||||
|
||||
void append_opcode_and_argcount(GDScriptFunction::Opcode p_code, int p_argument_count) {
|
||||
opcodes.push_back(p_code);
|
||||
opcodes.push_back(p_argument_count);
|
||||
instr_args_max = MAX(instr_args_max, p_argument_count);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user