- Introduces two new instruction formats, 45cc and 4rcc. As the name suggests,
these instructions are similar to 35c and 3rc, expect that they encode an
additional constant pool reference in their 4th byte.
- Introduce two new instructions, invoke-polymorphic and
invoke-polymorphic/range - used to implement signature polymorphism.
- Allow instructions to directly reference the proto_id section of the
dex file. This involves the introduction of a new kind of reference
(MethodProtoReference) and has the side effect of cleaning up a fair
amount of special casing in ProtoPool.
- Disable support for ART version based switches (and remove LambdaTest
which depends on it). Experimental lambda support and support for ART
version based switches will be removed in a follow up change.
Bug: 30550796
Test: test-art
Test: ./gradlew build
We now perform the type propagation while analyzing the if-eqz/if-nez
instruction. Additionally, AnalyzedInstruction.setsRegister now has
special case logic to check for this case, so we don't incorrectly
propagate the original type past the if-eqz/if-nez
We should only use the type info from an instance-of/if-eqz combo if we're
going from an interface to a class, or going from a class to a subtype
of that class -- otherwise, we're actually losing information.
In oat files, it's possible that a check-cast is removed based on the
register being provably of the type being cast to, based on the result
of an instance-of check.
Supporting this in general would require more sophisticated static analysis
than is currently done. Instead, this adds a special-case specifically
for the case of an instance-of followed immediately by an if-eqz
This is useful, for example, when comparing the result of deodexing with
the original dex file, to remove the "false" differences caused by the
different potential ways to reference a given virtual method.
Previously smali would reorder implements directives to be
alphabetical in the dex file. In the Java 8 Language the order of
interfaces may affect the order of initializer invocation when using
default methods. Therefore we will preserve this order in
smali/baksmai.
Bug: 24338722
Change-Id: I6851b02a5402c7d4cd4b60af54052c320e48d0bf
Some java compilers don't generate the synthetic accessor methods in the
way that the accessorTest is trying to test. So we build the test dex
file using a known-good compiler and check it in, ensuring the test is
always run using an appropriate dex file.
* Add new -X/--experimental flag to [dis]assemble opcodes not in art yet
* Add new opcodes liberate-variable, box-lambda, unbox-lambda,
capture-variable, create-lambda, invoke-lambda
* Add support for encoding 25x instructions
* Adds LambdaTest to check new opcodes assemble/disassemble properly
TODO: invoke-lambda-range
Change-Id: I5c8bcbfa8b6cb9a13ef2017fce2d1b7fda6e11c3