| 795 | } |
| 796 | |
| 797 | void GDScriptByteCodeGenerator::write_set(const Address &p_target, const Address &p_index, const Address &p_source) { |
| 798 | if (HAS_BUILTIN_TYPE(p_target)) { |
| 799 | if (IS_BUILTIN_TYPE(p_index, Variant::INT) && Variant::get_member_validated_indexed_setter(p_target.type.builtin_type) && |
| 800 | IS_BUILTIN_TYPE(p_source, Variant::get_indexed_element_type(p_target.type.builtin_type))) { |
| 801 | // Use indexed setter instead. |
| 802 | Variant::ValidatedIndexedSetter setter = Variant::get_member_validated_indexed_setter(p_target.type.builtin_type); |
| 803 | append_opcode(GDScriptFunction::OPCODE_SET_INDEXED_VALIDATED); |
| 804 | append(p_target); |
| 805 | append(p_index); |
| 806 | append(p_source); |
| 807 | append(setter); |
| 808 | return; |
| 809 | } else if (Variant::get_member_validated_keyed_setter(p_target.type.builtin_type)) { |
| 810 | Variant::ValidatedKeyedSetter setter = Variant::get_member_validated_keyed_setter(p_target.type.builtin_type); |
| 811 | append_opcode(GDScriptFunction::OPCODE_SET_KEYED_VALIDATED); |
| 812 | append(p_target); |
| 813 | append(p_index); |
| 814 | append(p_source); |
| 815 | append(setter); |
| 816 | return; |
| 817 | } |
| 818 | } |
| 819 | |
| 820 | append_opcode(GDScriptFunction::OPCODE_SET_KEYED); |
| 821 | append(p_target); |
| 822 | append(p_index); |
| 823 | append(p_source); |
| 824 | } |
| 825 | |
| 826 | void GDScriptByteCodeGenerator::write_get(const Address &p_target, const Address &p_index, const Address &p_source) { |
| 827 | if (HAS_BUILTIN_TYPE(p_source)) { |