History of Android virtual machine development

Before Android 2.2 (Dalvik interpreted)

Dalvik as a virtual machine, is responsible for loading dex / odex file and parsed into machine code to the system operation. At this point Dalvik pure interpreted.

 

Android 2.2 (Dalvik JIT)

Dalvik JIT-compiled instant, by Hospot, JIT compiler performs frequent dex / odex compiled and optimized code, compiled Native Code.

 

Disadvantages: need to be recompiled every time you start, more power is running, causing the battery overhead.

 

Android 4.4 (ART AOT / Dalvik)

Introducing ART (Android Runtime) and AOT (Ahead-Of-Time), and at this time Dalvik ART coexist, the user can select both.

 

Android 5.0 (ART AOT)

ART (Android Runtime) completely replace Dalvik, AOT be the only compilation mode.

JIT is compiled (dynamic compilation) at run time, every time to odex be recompiled to run the program. The AOT is statically compiled, the application installation process will dex2oat dex precompiled ELF file, which is equivalent local application.

 

Disadvantages:

After application installation and system upgrades need to be recompiled, time-consuming.

The optimized files take up additional storage space.

 

Android 7.0 (ART AOT/JIT)

Android 7.0 using mixed AOT and JIT compilation mode.

1, dex will not be compiled when the application is installed.

2, when the first operation performed by the parser interprets, after hot function is identified after the JIT compiler generates profile JIT Code Cache file is stored in the hot spot function to record the information.

3, when the phone enters Idle (IDLE) or charge (Charging) status, profile files in the system directory scanning App execution AOT compilation process.

 

The difference between the ART and Dalvik

 

Published 28 original articles · won praise 9 · views 5574

Guess you like

Origin blog.csdn.net/rookiegan/article/details/104896834