mirror of
https://github.com/godotengine/godot.git
synced 2025-10-25 02:43:29 +00:00
GDScript: Add speficic set/get instructions
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.
This commit is contained in:
parent
1ad5c926dc
commit
5aeb390cd7
5 changed files with 476 additions and 13 deletions
|
|
@ -167,8 +167,8 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|||
|
||||
incr += 4;
|
||||
} break;
|
||||
case OPCODE_SET: {
|
||||
text += "set ";
|
||||
case OPCODE_SET_KEYED: {
|
||||
text += "set keyed ";
|
||||
text += DADDR(1);
|
||||
text += "[";
|
||||
text += DADDR(2);
|
||||
|
|
@ -177,8 +177,28 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|||
|
||||
incr += 4;
|
||||
} break;
|
||||
case OPCODE_GET: {
|
||||
text += "get ";
|
||||
case OPCODE_SET_KEYED_VALIDATED: {
|
||||
text += "set keyed validated ";
|
||||
text += DADDR(1);
|
||||
text += "[";
|
||||
text += DADDR(2);
|
||||
text += "] = ";
|
||||
text += DADDR(3);
|
||||
|
||||
incr += 5;
|
||||
} break;
|
||||
case OPCODE_SET_INDEXED_VALIDATED: {
|
||||
text += "set indexed validated ";
|
||||
text += DADDR(1);
|
||||
text += "[";
|
||||
text += DADDR(2);
|
||||
text += "] = ";
|
||||
text += DADDR(3);
|
||||
|
||||
incr += 5;
|
||||
} break;
|
||||
case OPCODE_GET_KEYED: {
|
||||
text += "get keyed ";
|
||||
text += DADDR(3);
|
||||
text += " = ";
|
||||
text += DADDR(1);
|
||||
|
|
@ -188,6 +208,28 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|||
|
||||
incr += 4;
|
||||
} break;
|
||||
case OPCODE_GET_KEYED_VALIDATED: {
|
||||
text += "get keyed validated ";
|
||||
text += DADDR(3);
|
||||
text += " = ";
|
||||
text += DADDR(1);
|
||||
text += "[";
|
||||
text += DADDR(2);
|
||||
text += "]";
|
||||
|
||||
incr += 5;
|
||||
} break;
|
||||
case OPCODE_GET_INDEXED_VALIDATED: {
|
||||
text += "get indexed validated ";
|
||||
text += DADDR(3);
|
||||
text += " = ";
|
||||
text += DADDR(1);
|
||||
text += "[";
|
||||
text += DADDR(2);
|
||||
text += "]";
|
||||
|
||||
incr += 5;
|
||||
} break;
|
||||
case OPCODE_SET_NAMED: {
|
||||
text += "set_named ";
|
||||
text += DADDR(1);
|
||||
|
|
@ -198,6 +240,16 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|||
|
||||
incr += 4;
|
||||
} break;
|
||||
case OPCODE_SET_NAMED_VALIDATED: {
|
||||
text += "set_named validated ";
|
||||
text += DADDR(1);
|
||||
text += "[\"";
|
||||
text += "<unknown name>";
|
||||
text += "\"] = ";
|
||||
text += DADDR(2);
|
||||
|
||||
incr += 4;
|
||||
} break;
|
||||
case OPCODE_GET_NAMED: {
|
||||
text += "get_named ";
|
||||
text += DADDR(2);
|
||||
|
|
@ -209,6 +261,17 @@ void GDScriptFunction::disassemble(const Vector<String> &p_code_lines) const {
|
|||
|
||||
incr += 4;
|
||||
} break;
|
||||
case OPCODE_GET_NAMED_VALIDATED: {
|
||||
text += "get_named validated ";
|
||||
text += DADDR(2);
|
||||
text += " = ";
|
||||
text += DADDR(1);
|
||||
text += "[\"";
|
||||
text += "<unknown name>";
|
||||
text += "\"]";
|
||||
|
||||
incr += 4;
|
||||
} break;
|
||||
case OPCODE_SET_MEMBER: {
|
||||
text += "set_member ";
|
||||
text += "[\"";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue