connglli / blog-notes

My personal notes ✍️
MIT License
32 stars 2 forks source link

ART Tests `/art/tests` #122

Open connglli opened 3 years ago

connglli commented 3 years ago

/art/tests

/art/test.py

libarttest

libarttest is an advanced library that is used by ART's test. This library defines advanced JNI methods that can operate ART's behavior like ensuring a method is JIT compiled before running (ensureJITCompiled()), ensuring all methods are deoptimized (deoptimizeAll()). These methods are separatedly defined in different tests and aggregated as a single libarttest library. For these methods, please check the libarttest target defined in /art/test's blueprint Android.bp.

Interesting methods include:

libarttest is always the first argument to all tests' main method. Hence, any test can run System.loadLibrary(args[0]) to load the library.

References