August 19, 2015 [Issue 14931] switch doesn't work with any pointers | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14931 --- Comment #8 from yebblies <yebblies@gmail.com> --- (In reply to ZombineDev from comment #7) > Is it possible to generate a jump table with placeholders and fill them at link time? How can you choose which entry goes where in the jump table if you don't know the pointer values? -- |
August 19, 2015 [Issue 14931] switch doesn't work with any pointers | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14931 Walter Bright <bugzilla@digitalmars.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@digitalmars.com --- Comment #9 from Walter Bright <bugzilla@digitalmars.com> --- The only thing you can do is have two tables. The first is a table of pointer values, upon which a binary search is done to convert the switch expression into an integer. Then use the integer to index into the second table of jump addresses. Of course, you can do this manually in conventional D anyway, and get just as good results. -- |
August 19, 2015 [Issue 14931] switch doesn't work with any pointers | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14931 --- Comment #10 from yebblies <yebblies@gmail.com> --- (In reply to Walter Bright from comment #9) > The only thing you can do is have two tables. The first is a table of pointer values, upon which a binary search is done to convert the switch expression into an integer. Then use the integer to index into the second table of jump addresses. > > Of course, you can do this manually in conventional D anyway, and get just as good results. Wouldn't you need to sort the pointer list at runtime? -- |
August 19, 2015 [Issue 14931] switch doesn't work with any pointers | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14931 --- Comment #11 from Sobirari Muhomori <dfj1esp02@sneakemail.com> --- (In reply to Andrei Alexandrescu from comment #3) > Yah, accept it and subject it to the usual assumptions and optimizations that go for equivalent integral-based switch statements. If you go for equivalence, enum-based switch will be faster, because it's not equivalent to runtime switch. -- |
August 19, 2015 [Issue 14931] switch doesn't work with any pointers | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14931 --- Comment #12 from ZombineDev <petar.p.kirov@gmail.com> --- (In reply to yebblies from comment #8) > How can you choose which entry goes where in the jump table if you don't know the pointer values? I'm not familiar with what advanced linker options are available for us, so I don't know if it's possible. -- |
August 20, 2015 [Issue 14931] switch doesn't work with any pointers | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14931 --- Comment #13 from yebblies <yebblies@gmail.com> --- (In reply to ZombineDev from comment #12) > (In reply to yebblies from comment #8) > > How can you choose which entry goes where in the jump table if you don't know the pointer values? > > I'm not familiar with what advanced linker options are available for us, so I don't know if it's possible. Pretty much no options. -- |
December 17, 2022 [Issue 14931] switch doesn't work with any pointers | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14931 Iain Buclaw <ibuclaw@gdcproject.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P1 |P4 -- |
December 13 [Issue 14931] switch doesn't work with any pointers | ||||
---|---|---|---|---|
| ||||
https://issues.dlang.org/show_bug.cgi?id=14931 --- Comment #14 from dlangBugzillaToGithub <robert.schadek@posteo.de> --- THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/17720 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB -- |
Copyright © 1999-2021 by the D Language Foundation