Logo
Explore Help
Register Sign In
Miko/LSL-PyOptimizer
1
0
Fork 0
You've already forked LSL-PyOptimizer
Code Issues Pull Requests Actions Packages Projects Releases Wiki Activity
Files
7dcd7aa31523d3c9e90aacdfd7b87dcf7f9cb4ff
LSL-PyOptimizer/unit_tests/coverage.suite/jump-opt.lsl

13 lines
202 B
Plaintext
Raw Normal View History

Perform redundant jump elimination in lastpass This is a first try at redundant jump removal (jumps that target the very next instruction). It's too basic in several ways. - The statement is replaced by a ';' instead of removed. - If the jump was the only statement in an if, when the if becomes empty, it's not folded. - Jumps that are last in the 'then' branch of if+else are not visible. This would need either to track multiple last statements, or to have some means to anticipate what the next statement is at every statement. A Control Flow Graph would help a lot. - When a label is immediately followed by a jump, all jumps to that label should target the destination of that jump if it's in scope. Added to TODO. - It misses some optimizations when not expanding WHILE and FOR into IF/JUMP. Moving everything to an earlier stage would help with some of these, especially with ';' and 'if' folding. Unconditionally expanding WHILE and FOR would also help.
2019-01-06 22:32:19 +01:00
default{state_entry(){
if (llGetLinkNumber()) jump x1;
if (llGetLinkNumber()) jump x1; else jump x3;
llOwnerSay("ok");
@x1;
jump x2;
@x3;
llOwnerSay("blergh");
@x2;
}}
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.25.3 Page: 55ms Template: 2ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API