tag:blogger.com,1999:blog-1072233363145751245.post3329448099664348902..comments2023-09-27T05:13:26.741-04:00Comments on Lula's Chronicles: Be careful, Kotlin includes dead code in generated bytecode.Unknownnoreply@blogger.comBlogger4125tag:blogger.com,1999:blog-1072233363145751245.post-7897964816787967922021-08-18T08:31:21.502-04:002021-08-18T08:31:21.502-04:00Excellent Blog, I like your blog and It is very in...Excellent Blog, I like your blog and It is very informative. Thank you<br /><a href="https://skillsion.com/kotlin-android-developer-training/" rel="nofollow">kotlin online course</a><br /><a href="https://skillsion.com/kotlin-android-developer-training/" rel="nofollow">Learn kotlin online</a><br /><br />hemahttps://www.blogger.com/profile/10039791811487845150noreply@blogger.comtag:blogger.com,1999:blog-1072233363145751245.post-8275874758041902052016-09-18T17:37:12.854-04:002016-09-18T17:37:12.854-04:00Hello. Thank you for an interesting research.
In f...Hello. Thank you for an interesting research.<br />In fact, kotlinc removes code inside `if (false)` (inline functions' bodies getting removed too).<br />But kotlinc does not remove code inside of `if (CONST_WITH_FALSE_VALUE)`.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-1072233363145751245.post-88194215574627011172016-07-04T02:49:45.233-04:002016-07-04T02:49:45.233-04:00Hi DireBunny,
you are right they are not useless ...Hi DireBunny,<br /><br />you are right they are not useless due to the way the bytecode is generated. I just wanted to mark is not needed to do it in that way.<br /><br />Thanks for your comment ;)<br />Tomasiohttps://www.blogger.com/profile/12188622048326483594noreply@blogger.comtag:blogger.com,1999:blog-1072233363145751245.post-14053391710915275742016-07-03T10:50:48.475-04:002016-07-03T10:50:48.475-04:00ASTORE 0 / ALOAD 0 in the example you provide are ...ASTORE 0 / ALOAD 0 in the example you provide are not "useless".<br />Otherwise you'll not see corresponding arguments of the inline function in the debugger.<br />Mature JVM implementations can optimize such simple things.Dmitry N. Petrovhttps://www.blogger.com/profile/13829860206555234202noreply@blogger.com