Age | Commit message (Collapse) | Author |
|
Removes dependency on art/libdexfile and uses equivalent definitions
from the dexter/slicer library.
Bug: 133140750
Bug: 142948359
Test: m
Test: atest dex-builder-test \
view-compiler-tests \
android.view.cts.PrecompiledLayoutTest
Change-Id: I49562ac4867254ecde287b828f76d23cb5132dd0
|
|
The code was previously pretty messy and hard to follow. This reworks some
things to make it more manageable. Among the changes:
* Pull out fragments of code into their own method, so the high level steps are
more apparent in methods like DexViewBuilder::Start.
* Pull frequently used types into global constants in dex_layout_compiler.cc.
* Rework register handling to track liveness so a strict stack discipline is no
longer needed.
Change-Id: Idb4b41f88c96a1ac4efb2c7b9bed05c2de0da999
|
|
Bug: 111895153
Change-Id: I5fa2936501c79e30a66f3863b76229ec83433928
|
|
Bug: 111895153
Change-Id: I12b38fa520790debec545d7d1f6b3522a65ce03b
|
|
This allows us to generate code that can read static fields in a class. Once we
include several other field operations, we will be able to generate more
specialized inflation code in the view compiler.
Bug: 111895153
Change-Id: Ia11195b1cea6d5a3ddbc60d972922586a062c853
|
|
Bug: 123880763
Test: build with WITH_TIDY=1 DEFAULT_GLOBAL_TIDY_CHECKS=*,-readability-*,
-google-readability-*,-google-runtime-references,-cppcoreguidelines-*,
-modernize-*,-llvm-*,-bugprone-narrowing-conversions,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,-hicpp-*,-fuchsia-*
Change-Id: Ibf80f951ae2369a55570770febe8a1c4422181e1
|
|
This was causing the viewcompiler to crash on deeper layout hierarchies.
We fix this by reserving several scratch registers. When an invoke instruction
uses registers that don't fit in a 4-bit field, we move all of these values into
the scratch registers and use an invoke/range instruction instead. The scratch
registers are all above the highest allocated register, so they are guaranteed
not to clobber meaningful values.
Supporting more registers for invoke also required supporting
register-to-register moves, which some how we'd gotten by without so far.
Finally, to make viewcompiler fail more loudly when things go wrong, many
DCHECKs have been changed to CHECKs.
Bug: 123517491
Test: atest
Change-Id: I9eb7c9bcf1fc7d713e664b331804bdcddafc95a4
|
|
Bug: 111895153
Test: atest
Change-Id: I767e56713fab6beaa6970e58c4fc4d3560cc1304
|
|
This CL adds the ability to generate code that calls static and virtual methods
which return objects, as well as the not-equal-to-zero comparison operator.
Bug: 111895153
Change-Id: I4ae9b3cb2edc6540671112b73c02bf6380d23051
|
|
This change corrals most of the bit shifting and ORing needed to encode Dex
instructions into EncodeXXX functions that follow the naming scheme at
https://source.android.com/devices/tech/dalvik/instruction-formats. Overall, it
makes the code easier to follow and probably even less error prone because we
only have to make the format right in one place.
Bug: 111895153
Change-Id: I902ec3c8bca6b5dc4ad900503af7aef58d4bbf5f
|
|
This change also includes support for calling methods with more that one
argument. In fact, we can go up to four.
Bug: 111895153
Change-Id: I49472171cefcf57cdfce2ac4d41646ed4df29074
|
|
Bug: 111895153
Change-Id: If6bdd9a280f6feed175be4da57733f3442e6dd14
|
|
This CL adds support for the if-eqz instruction. It should be easy to add
additional comparisons as needed.
This also introduces a new kind of Value called a Label. Labels may be created
any time and then must be bound to a location in code at some point. References
to labels are tracked, and when a label is bound all references are patched to
refer to the concrete address.
Bug: 111895153
Change-Id: I15424aec75425004f0f1f4bbc6e760bac3a6c7de
|
|
The Dex builder can now generate calls to methods (although not in all forms
yet). To help do this, we add a new virtual Instruction and Value class. This is
needed to generate code with values that are not known until the entire method
has been generated. In particular, we can now refer to function parameters.
The test method now accepts a String and returns the the length of the string.
Bug: 111895153
Change-Id: I11d52b083ae51d8151fccb1a65e45d40ff05fd81
|
|
This is planned to ship on device, so by convention the view_compiler should not
be in a tools directory.
Change-Id: I0eb03812d77ec38edc3908725acb40bacb345ecd
|