mirror of
https://github.com/godotengine/godot.git
synced 2025-10-24 02:13:36 +00:00
GDScript: Add faster call instructions for builtin methods
Methods from builtin types can be called by using the function pointer when the argument and base types are known at compile time.
This commit is contained in:
parent
d8b22097f2
commit
52ab64db69
7 changed files with 125 additions and 0 deletions
|
|
@ -572,6 +572,27 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|||
DISASSEMBLE_PTRCALL(PACKED_VECTOR3_ARRAY);
|
||||
DISASSEMBLE_PTRCALL(PACKED_COLOR_ARRAY);
|
||||
|
||||
case OPCODE_CALL_BUILTIN_TYPE_VALIDATED: {
|
||||
int argc = _code_ptr[ip + 1 + instr_var_args];
|
||||
|
||||
text += "call-builtin-method validated ";
|
||||
|
||||
text += DADDR(2 + argc) + " = ";
|
||||
|
||||
text += DADDR(1) + ".";
|
||||
text += "<unknown method>";
|
||||
|
||||
text += "(";
|
||||
|
||||
for (int i = 0; i < argc; i++) {
|
||||
if (i > 0)
|
||||
text += ", ";
|
||||
text += DADDR(1 + i);
|
||||
}
|
||||
text += ")";
|
||||
|
||||
incr = 5 + argc;
|
||||
} break;
|
||||
case OPCODE_CALL_BUILT_IN: {
|
||||
text += "call-built-in ";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue