by Graf Zahl » Tue May 30, 2017 6:18 am
No. I guess adding a NULL check for those would be ok. Natively that's 2 machine instructions, but when doing it in script code it really gets expensive.
That said, I think something needs to be done about 'bound' instructions for dynamic arrays. That's way too inefficient right now. Maybe dedicated array access instructions that do all the multiplication and checking as part of a single instruction? Only problem: It'd require approx. 20 opcodes but it's something that could really count as currently such an access can end up 8 VM instructions.
No. I guess adding a NULL check for those would be ok. Natively that's 2 machine instructions, but when doing it in script code it really gets expensive.
That said, I think something needs to be done about 'bound' instructions for dynamic arrays. That's way too inefficient right now. Maybe dedicated array access instructions that do all the multiplication and checking as part of a single instruction? Only problem: It'd require approx. 20 opcodes but it's something that could really count as currently such an access can end up 8 VM instructions.