Jake Wharton explores how Android's D8 dexer works around vendor-specific and version-specific VM bugs when converting Java bytecode to Dalvik bytecode. Three concrete bugs are examined: the unused `not-int` instruction that some vendor JITs never implemented (causing crashes when D8 started using it), a vendor JIT crash triggered by a non-zero check immediately after a less-than-zero check on `cmp-long` results (found in OkHttp/Okio), and an Android 6.0 ART AOT compiler memory exhaustion bug triggered by heavily recursive methods. D8 automatically applies workarounds for these bugs based on the app's minimum API level, switching to more efficient bytecodes once the buggy Android versions are no longer supported.

13m read timeFrom jakewharton.com
Post cover image
Table of contents
Not A NotLong CompareRecursion