OSDN Git Service

Try to substitute constructor chains for IPUTs.
authorVladimir Marko <vmarko@google.com>
Thu, 4 Feb 2016 19:46:56 +0000 (19:46 +0000)
committerVladimir Marko <vmarko@google.com>
Tue, 9 Feb 2016 19:57:41 +0000 (19:57 +0000)
commit354efa6cdf558b2331e8fec539893fa51763806e
treeb2d91993fc46011d1eeb416d411bf16fb4d25c20
parent519281001dabe9060e2bfefc2382570bab26c96a
Try to substitute constructor chains for IPUTs.

Match a constructor chain where each constructor either
forwards some or all of its arguments to the next (i.e.
superclass constructor or a constructor in the same class)
and may pass extra zeros (of any type, including null),
followed by any number of IPUTs on "this", storing either
arguments or zeros, until we reach the contructor of
java.lang.Object.

When collecting IPUTs from the constructor chain, remove
any IPUTs that store the same field as an IPUT that comes
later. This is safe in this case even if those IPUTs store
volatile fields because the uninitialized object reference
wasn't allowed to escape yet. Also remove any IPUTs that
store zero values as the allocated object is already zero
initialized.

Change-Id: If93022310bf04fe38ee741665ac4a65d4c2bb25f
15 files changed:
compiler/dex/quick/dex_file_method_inliner.cc
compiler/optimizing/inliner.cc
compiler/optimizing/inliner.h
compiler/optimizing/intrinsics.cc
runtime/dex_instruction_utils.h
runtime/quick/inline_method_analyser.cc
runtime/quick/inline_method_analyser.h
test/569-checker-pattern-replacement/src-multidex/Base.java [new file with mode: 0644]
test/569-checker-pattern-replacement/src-multidex/BaseWithFinalField.java [new file with mode: 0644]
test/569-checker-pattern-replacement/src-multidex/Derived.java [new file with mode: 0644]
test/569-checker-pattern-replacement/src-multidex/DerivedInSecondDex.java [new file with mode: 0644]
test/569-checker-pattern-replacement/src-multidex/DerivedWithFinalField.java [new file with mode: 0644]
test/569-checker-pattern-replacement/src/BaseInMainDex.java [new file with mode: 0644]
test/569-checker-pattern-replacement/src/Main.java
test/Android.run-test.mk