![]() | Name | Last modified | Size | Description |
---|---|---|---|---|
![]() | Parent Directory | - | ||
![]() | Android.bp | 2024-12-02 00:53 | 4.0K | |
![]() | CleanSpec.mk | 2024-12-02 00:53 | 4.2K | |
![]() | NOTICE | 2024-12-02 00:53 | 16K | |
![]() | OWNERS | 2024-12-02 00:53 | 85 | |
![]() | README.html | 2024-12-02 00:53 | 14K | |
![]() | README.rst | 2024-12-02 00:53 | 6.9K | |
![]() | bcinfo/ | 2024-12-02 00:53 | - | |
![]() | gdb_plugin/ | 2024-12-02 00:53 | - | |
![]() | include/ | 2024-12-02 00:53 | - | |
![]() | lib/ | 2024-12-02 00:53 | - | |
![]() | libbcc-targets.mk | 2024-12-02 00:53 | 1.5K | |
![]() | tests/ | 2024-12-02 00:53 | - | |
![]() | tools/ | 2024-12-02 00:53 | - | |
libbcc is an LLVM bitcode execution engine that compiles the bitcode to an in-memory executable. libbcc is versatile because:
libbcc provides:
Highlights of libbcc are:
libbcc supports bitcode from various language frontends, such as Renderscript, GLSL (pixelflinger2).
libbcc strives to balance between library size, launch time and steady-state performance:
The size of libbcc is aggressively reduced for mobile devices. We customize and improve upon the default Execution Engine from upstream. Otherwise, libbcc's execution engine can easily become at least 2 times bigger.
To reduce launch time, we support caching of binaries. Just-in-Time compilation are oftentimes Just-too-Late, if the given apps are performance-sensitive. Thus, we implemented AOT to get the best of both worlds: Fast launch time and high steady-state performance.
AOT is also important for projects such as NDK on LLVM with portability enhancement. Launch time reduction after we implemented AOT is signficant:
Apps libbcc without AOT libbcc with AOT launch time in libbcc launch time in libbcc App_1 1218ms 9ms App_2 842ms 4ms Wallpaper: MagicSmoke 182ms 3ms Halo 127ms 3ms Balls 149ms 3ms SceneGraph 146ms 90ms Model 104ms 4ms Fountain 57ms 3ms
AOT also masks the launching time overhead of on-device linking and helps it become reality.
For steady-state performance, we enable VFP3 and aggressive optimizations.
Currently we disable Lazy JITting.
Basic:
Reflection:
Debug:
A cache file (denoted as *.oBCC) for libbcc consists of several sections: header, string pool, dependencies table, relocation table, exported variable list, exported function list, pragma list, function information table, and bcc context. Every section should be aligned to a word size. Here is the brief description of each sections:
For furthur information, you may read bcc_cache.h, CacheReader.cpp, and CacheWriter.cpp for details.
Calls from Execution Environment or from/to within script:
On ARM, the first 4 arguments will go into r0, r1, r2, and r3, in that order. The remaining (if any) will go through stack.
For ext_vec_types such as float2, a set of registers will be used. In the case of float2, a register pair will be used. Specifically, if float2 is the first argument in the function prototype, float2.x will go into r0, and float2.y, r1.
Note: stack will be aligned to the coarsest-grained argument. In the case of float2 above as an argument, parameter stack will be aligned to an 8-byte boundary (if the sizes of other arguments are no greater than 8.)
Calls from/to a separate compilation unit: (E.g., calls to Execution Environment if those runtime library callees are not compiled using LLVM.)
On ARM, we use hardfp. Note that double will be placed in a register pair.