mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
GDScript: Add faster instruction for validated constructor
Only for built-in types.
This commit is contained in:
parent
e0dca3c6b6
commit
5518e2a68e
5 changed files with 112 additions and 3 deletions
|
@ -384,7 +384,7 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|||
} break;
|
||||
case OPCODE_CONSTRUCT: {
|
||||
Variant::Type t = Variant::Type(_code_ptr[ip + 3 + instr_var_args]);
|
||||
int argc = _code_ptr[ip + 2 + instr_var_args];
|
||||
int argc = _code_ptr[ip + 1 + instr_var_args];
|
||||
|
||||
text += "construct ";
|
||||
text += DADDR(1 + argc);
|
||||
|
@ -400,6 +400,23 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|||
|
||||
incr = 3 + instr_var_args;
|
||||
} break;
|
||||
case OPCODE_CONSTRUCT_VALIDATED: {
|
||||
int argc = _code_ptr[ip + 1 + instr_var_args];
|
||||
|
||||
text += "construct validated ";
|
||||
text += DADDR(1 + argc);
|
||||
text += " = ";
|
||||
|
||||
text += "<unkown type>(";
|
||||
for (int i = 0; i < argc; i++) {
|
||||
if (i > 0)
|
||||
text += ", ";
|
||||
text += DADDR(i + 1);
|
||||
}
|
||||
text += ")";
|
||||
|
||||
incr = 3 + instr_var_args;
|
||||
} break;
|
||||
case OPCODE_CONSTRUCT_ARRAY: {
|
||||
int argc = _code_ptr[ip + 1 + instr_var_args];
|
||||
text += " make_array ";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue