What does OAT mean?

2019-02-01 22:33发布

问题:

We know that Dalvik uses APK, DEX, and ODEX files. And we know this abbreviation means via AOSP source or Developers site.

(like this - https://source.android.com/devices/tech/dalvik/dex-format.html)

  • DEX means Dalvik EXcutable file.
  • ODEX means Optimized Dalvik EXcutable file.
  • APK means Android PacKage.

ART (Android RunTime) uses OAT and ART, but they do not explain the meaning anywhere.

Does anyone know the meaning of these shortened words?

回答1:

It’s Of Ahead Time, a silly reordering of Ahead Of Time. We went with that because then we say that process of converting .dex files to .oat files would be called quakerizing and that would be really funny.



回答2:

OAT is a file format produced by compiling a DEX file with ahead-of-time compilation (AOT).

Before AOT came to Android, dexopt was used to optimize DEX to ODEX (optimized DEX) which contains the optimized bytecode.

With AOT, dex2oat is used to optimize and compile DEX into an OAT file which may contain machine code in the ELF format.

Reference: https://stackoverflow.com/a/26263071/2872712



回答3:

Some searching found this page, which says:

The OAT file extension is associated with applications developed for Google Android operating system that is used on various portable devices. The *.oat file stores native C++ code of application designed for new Android RunTime (ART) available in Android 4.4 and higher.

Android RunTime is successor of Dalvik process virtual machine used by older versions of Android.



回答4:

Even those file formats are available for a while, there is still no off doc with an explanation about meaning (at least I didn't find). So for myself, I figured out the next meaning:

.art - stands for AndroidRunTime (here on page 12 it's pointed that the format is proprietary, and used by "only one file" in ART, so that's why I think in this way)

.oat - found at least three explanation where the best imho is "Optimized Android file Type" (and the idea came from here).

Other possible variants of .oat I had is: "Optimized Application file Type" or just easy AOT->OAT (as .oat produced from ahead-of-time compilation process).



回答5:

As dexopt produces ODEX - Optimized Dalvik EXecutable, which contains the optimized bytecode, dex2oat produces OAT, and my guess that it should stand for Optimized Ahead of Time.



回答6:

Reading some comparison between ART and Dalvik, i found that AOT refers to Ahead Of Time, you can read more about it Here