R8 Optimization: Null Data Flow Analysis (Part 2)

1 · Jake Wharton · Jan. 15, 2019, midnight
Note: This post is part of a series on D8 and R8, Android’s new dexer and optimizer, respectively. For an intro to D8 read “Android’s Java 8 support”. For an intro to R8 read “R8 Optimization: Staticization”. Part 1 of this post demonstrated R8’s ability to eliminate null checks after method inlining. This was accomplished by virtue of nullability information being present in R8’s (and D8’s) intermediate representation (IR). When the arguments flowing into a method were always non-null or alwa...