History log of /art/runtime/quick/inline_method_analyser.cc
Revision Date Author Comments
e5de54cfab5f14ba0b8ff25d8d60901c7021943f 20-Apr-2016 Calin Juravle <calin@google.com> Split profile recording from jit compilation

We still use ProfileInfo objects to record profile information. That
gives us the flexibility to add the inline caches in the future and the
convenience of the already implemented GC.

If UseJIT is false and SaveProfilingInfo true, we will only record the
ProfileInfo and never launch compilation tasks.

Bug: 27916886
Change-Id: I6e4768dc5d58f2f85f947b276b4244aa11ce3fca
141de8c4cf18923b4ee773a455102734ca9e4407 23-Mar-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "ART: Weaken DCHECK"

Change that triggered this got reverted. This "fix" needs more investigation.

This reverts commit 1ee29d3dd3fbbf5df7821b70f45c49275c878e63.

Change-Id: Iee9e88f0e993edc0c7212e36d48ded1d31209156
1ee29d3dd3fbbf5df7821b70f45c49275c878e63 23-Mar-2016 Andreas Gampe <agampe@google.com> ART: Weaken DCHECK

Returns may be either plain or quickened.

Change-Id: Iee343c02fe3e02512c0ed60508525495a7cd5efb
8b3f835f0cca5db53a727d1d77fc6c2430d53d51 09-Mar-2016 Vladimir Marko <vmarko@google.com> ART: Write bit fields together in ComputeSpecialAccessorInfo().

Avoid function calls between storing individual bit fields
to allow the compiler (gcc/clang) to merge those writes
together. Valgrind then marks the memory as "defined" while
individual bit field writes would leave it "undefined" and
later trigger the valgrind error:
Conditional jump or move depends on uninitialised value(s)
on DCHECK()s using the bit fields.

Bug: 27552451
Change-Id: If6de5cbe231f99da0f974a0fc9a36c14e3dc071e
f8b3b8bc37fb04d8ae113ae6bfcf4de2f5a700d4 04-Feb-2016 Vladimir Marko <vmarko@google.com> 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.

(cherry picked from commit 354efa6cdf558b2331e8fec539893fa51763806e)

Change-Id: I691e3b82e550e7a3272ce6a81647c7fcd02c01b1
354efa6cdf558b2331e8fec539893fa51763806e 04-Feb-2016 Vladimir Marko <vmarko@google.com> 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
65dd69e876bf57a9eb3dc07b44bbfdebce8b9a67 02-Feb-2016 Vladimir Marko <vmarko@google.com> ART: Fix bad manual rename of local variable.

Follow up to
https://android-review.googlesource.com/198621 .

Bug: 26929002
Change-Id: I11c5000d7b7bfaa866d45603c8c21d4ab8599a0e
9f35ccd3880e2d4d03dce7d7edb4307fadddf62b 02-Feb-2016 Vladimir Marko <vmarko@google.com> ART: Fix bad manual rename of local variable.

Follow up to
https://android-review.googlesource.com/198621 .

Bug: 26929002
Change-Id: I11c5000d7b7bfaa866d45603c8c21d4ab8599a0e
be10e8e99a78caae01fb65769218800d465144ae 22-Jan-2016 Vladimir Marko <vmarko@google.com> Optimizing: Try pattern substitution when we cannot inline.

Change-Id: I7c01f4494bac8498accc0f087044ec509fee4c98
bd425facc6c86c15f64a3ff09d72e6e626a3f48c 27-Oct-2015 Nicolas Geoffray <ngeoffray@google.com> Remove stalled DCHECK.

Change-Id: I446f3f6b6da6a3f2c883f794b2e6ffb379a89c95
3d21bdf8894e780d349c481e5c9e29fe1556051c 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997

(cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33)

Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d

Fix some ArtMethod related bugs

Added root visiting for runtime methods, not currently required
since the GcRoots in these methods are null.

Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes
--trace run-tests 005, 044.

Fixed optimizing compiler bug where we used a normal stack location
instead of double on ARM64, this fixes the debuggable tests.

TODO: Fix JDWP tests.

Bug: 19264997

Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3

ART: Fix casts for 64-bit pointers on 32-bit compiler.

Bug: 19264997
Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457

Fix JDWP tests after ArtMethod change

Fixes Throwable::GetStackDepth for exception event detection after
internal stack trace representation change.

Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of
proxy method.

Bug: 19264997
Change-Id: I363e293796848c3ec491c963813f62d868da44d2

Fix accidental IMT and root marking regression

Was always using the conflict trampoline. Also included fix for
regression in GC time caused by extra roots. Most of the regression
was IMT.

Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to
detached thread.

EvaluateAndApplyChanges:
From ~2500 -> ~1980
GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots

Bug: 19264997
Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0

Fix bogus image test assert

Previously we were comparing the size of the non moving space to
size of the image file.

Now we properly compare the size of the image space against the size
of the image file.

Bug: 19264997
Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a

[MIPS64] Fix art_quick_invoke_stub argument offsets.

ArtMethod reference's size got bigger, so we need to move other args
and leave enough space for ArtMethod* and 'this' pointer.

This fixes mips64 boot.

Bug: 19264997
Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
e401d146407d61eeb99f8d6176b2ac13c4df1e33 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997
Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
f7083ed806da454ba6a50ddef34799559f863fd4 06-May-2015 Vladimir Marko <vmarko@google.com> Quick: Inline synthetic accessors generated by jack.

While javac names synthetic accessors "access$nnn", jack
names them "-getN", "-putN" and "-wrapN". For simplicity,
treat all methods starting with "-" as synthetic accessors.

Bug: 20873367

(cherry picked from commit d5f1005da7599f149b1332402c9791ef2acb8c42)

Change-Id: Ifcc77fc3c5dd44797a48632c8e16416fbc273a93
d5f1005da7599f149b1332402c9791ef2acb8c42 06-May-2015 Vladimir Marko <vmarko@google.com> Quick: Inline synthetic accessors generated by jack.

While javac names synthetic accessors "access$nnn", jack
names them "-getN", "-putN" and "-wrapN". For simplicity,
treat all methods starting with "-" as synthetic accessors.

Bug: 20873367
Change-Id: I67990a6c2ef1d25dafe460ef70143a113bb5b7da
3481ba2c4e4f3aa80d8c6d50a9f85dacb56b508b 13-Apr-2015 Vladimir Marko <vmarko@google.com> ART: Clean up includes.

Reduce dependencies to improve incremental build times.
Break up circular dependency involving class_linker-inl.h.

Change-Id: I4be742c5c2b5cd9855beea86630fd68aab76b0db
c785344b87221f5e4e6473e5b762e4e61fe65dcf 27-Mar-2015 Mathieu Chartier <mathieuc@google.com> Move ArtField to native

Add linear alloc. Moved ArtField to be native object. Changed image
writer to put ArtFields after the mirror section.

Savings:
2MB on low ram devices
4MB on normal devices

Total PSS measurements before (normal N5, 95s after shell start):
Image size: 7729152 bytes
23112 kB: .NonMoving
23212 kB: .NonMoving
22868 kB: .NonMoving
23072 kB: .NonMoving
22836 kB: .NonMoving
19618 kB: .Zygote
19850 kB: .Zygote
19623 kB: .Zygote
19924 kB: .Zygote
19612 kB: .Zygote
Avg: 42745.4 kB

After:
Image size: 7462912 bytes
17440 kB: .NonMoving
16776 kB: .NonMoving
16804 kB: .NonMoving
17812 kB: .NonMoving
16820 kB: .NonMoving
18788 kB: .Zygote
18856 kB: .Zygote
19064 kB: .Zygote
18841 kB: .Zygote
18629 kB: .Zygote
3499 kB: .LinearAlloc
3408 kB: .LinearAlloc
3424 kB: .LinearAlloc
3600 kB: .LinearAlloc
3436 kB: .LinearAlloc
Avg: 39439.4 kB

No reflection performance changes.

Bug: 19264997
Bug: 17643507

Change-Id: I10c73a37913332080aeb978c7c94713bdfe4fe1c
e5f13e57ff8fa36342beb33830b3ec5942a61cca 24-Feb-2015 Mathieu Chartier <mathieuc@google.com> Revert "Revert "Add JIT""

Added missing EntryPointToCodePointer.

This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399.

Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
a5ca888d715cd0c6c421313211caa1928be3e399 24-Feb-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Add JIT"

Sorry, run-test crashes on target:
0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000'
10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000
10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c
10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0
10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010
10-05 12:15:51.633 I/DEBUG (27995):

Bug: 17950037
This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4.

Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
2535abe7d1fcdd0e6aca782b1f1932a703ed50a4 17-Feb-2015 Mathieu Chartier <mathieuc@google.com> Add JIT

Currently disabled by default unless -Xjit is passed in.

The proposed JIT is a method JIT which works by utilizing interpreter
instrumentation to request compilation of hot methods async during
runtime.

JIT options:
-Xjit / -Xnojit
-Xjitcodecachesize:N
-Xjitthreshold:integervalue

The JIT has a shared copy of a compiler driver which is accessed
by worker threads to compile individual methods.

Added JIT code cache and data cache, currently sized at 2 MB
capacity by default. Most apps will only fill a small fraction of
this cache however.

Added support to the compiler for compiling interpreter quickened
byte codes.

Added test target ART_TEST_JIT=TRUE and --jit for run-test.

TODO:
Clean up code cache.
Delete compiled methods after they are added to code cache.
Add more optimizations related to runtime checks e.g. direct pointers
for invokes.
Add method recompilation.
Move instrumentation to DexFile to improve performance and reduce
memory usage.

Bug: 17950037

Change-Id: Ifa5b2684a2d5059ec5a5210733900aafa3c51bca
956af0f0cb05422e38c1d22cbef309d16b8a1a12 11-Dec-2014 Elliott Hughes <enh@google.com> Remove portable.

Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
575e78c41ece0dec969d31f46be563d4eb7ae43b 04-Nov-2014 Andreas Gampe <agampe@google.com> ART: Replace COMPILE_ASSERT with static_assert (runtime)

Replace all occurrences of COMPILE_ASSERT in the runtime tree.

Change-Id: I01e420899c760094fb342cc6cb9e692dd670a0b2
29a2648821ea4d0b5d3aecb9f835822fdfe6faa1 03-May-2014 Ian Rogers <irogers@google.com> Move DecodedInstruction into MIR.

Change-Id: I188dc7fef4f4033361c78daf2015b869242191c6
c8f60a69a9f2420fc1ecafec612a667be8dcd547 02-Apr-2014 Vladimir Marko <vmarko@google.com> Inlining synthetic accessors.

Bug: 11549140
Change-Id: I0d6a38c51887f55563414c240ac42ee64bdb5426
e1fced1d1805caec04b6e97d2b01a4977c6785c6 04-Apr-2014 Vladimir Marko <vmarko@google.com> Inlining setters that return one of their arguments.

Useful for builder classes and synthetic setters. The latter
are not inlined yet since they are static methods, i.e. they
don't use "this" as the object for IPUT.

Change-Id: I3d34156c3629b837a0a95ccc34a8aae3f4a636d5
73ed718e7b08d17fd2e4af9bceb5e74ac46db676 05-Apr-2014 Mathieu Chartier <mathieuc@google.com> Revert "Inlining setters that return one of their arguments."

Bug: 13817614

This reverts commit 8e40c3e662d852da87b6bcfe79355f96ab9e91c7.

Change-Id: Ia7ed2d933514781150b2e0b9855244e383c60187
389e11db6ef350b806f7a3f0d7b7df23b0ab6e0c 05-Apr-2014 Mathieu Chartier <mathieuc@google.com> Revert "Inlining synthetic accessors."

This reverts commit 505ebb0e7b42e7facc8354515b06333ee8b84b10.
505ebb0e7b42e7facc8354515b06333ee8b84b10 02-Apr-2014 Vladimir Marko <vmarko@google.com> Inlining synthetic accessors.

Bug: 11549140
Change-Id: Ie0034a6840b1beaa3df92f26bf9d315119c81e34
8e40c3e662d852da87b6bcfe79355f96ab9e91c7 04-Apr-2014 Vladimir Marko <vmarko@google.com> Inlining setters that return one of their arguments.

Useful for builder classes and synthetic setters. The latter
are not inlined yet since they are static methods, i.e. they
don't use "this" as the object for IPUT.

Change-Id: I946cf570195be83ecec5fb32851bcaefad45f8a5
2c87c4d999bccdff6cc60bf6af4871cca6e2c893 21-Mar-2014 Sebastien Hertz <shertz@google.com> Support inlining detection from debugger.

In the context of the compiler, every method and field should be resolved. The
InlineMethodAnalyser uses that property so we don't inline unresolved methods
or methods accessing unresolved fields. In the context of the debugger, this is
not true. We may install a breakpoint in a method that's never been resolved
yet for instance.

This CL weaks that property so we can detect getter/setter methods can be
inlined even if they're not resolved yet. To differentiate both contexts, we
pass a null inline method pointer to InlineMethodAnalyser::AnalyseIGetMethod.

Bug: 12187616
Change-Id: I247f315b9abd6b065d5a7ec4116de15a6cce7649
e3e0260c23d8999b9433715ac7ee5296ee2fd633 12-Mar-2014 Vladimir Marko <vmarko@google.com> Move inline method detection to runtime.

The debugger needs this for selective deoptimization.

Change-Id: I8100000449b56e619288fb05d41ea6f02b53b334