History log of /art/runtime/interpreter/mterp/arm/bincmp.S
Revision Date Author Comments
1d011d9306fd4ff57d72411775d415a86f5ed398 04-Apr-2016 Bill Buzbee <buzbee@google.com> Revert "Revert "Revert "Revert "ART: Improve JitProfile perf in arm/arm64 mterp""""

Bug: 28081559

This reverts commit 961ea9fe42edcc2c57469bf451d1ca421da5cd59.

Change-Id: I98a5bb8112646706ae7bd73bf6393cb956466be3
961ea9fe42edcc2c57469bf451d1ca421da5cd59 01-Apr-2016 Hiroshi Yamauchi <yamauchi@google.com> Revert "Revert "Revert "ART: Improve JitProfile perf in arm/arm64 mterp"""

This reverts commit 4a8ac9cee4312ac910fabf31c64d28d4c8362836.

570-checker-osr intermittently failing.

Bug: 27939339
d6190dcdfb1f247ff0bf8268dacf413c93b58cf5 31-Mar-2016 Calin Juravle <calin@google.com> Revert "Revert "Revert "ART: Improve JitProfile perf in arm/arm64 mterp"""

This reverts commit 4a8ac9cee4312ac910fabf31c64d28d4c8362836.

Bug: 27939339
4a8ac9cee4312ac910fabf31c64d28d4c8362836 25-Mar-2016 Bill Buzbee <buzbee@google.com> Revert "Revert "ART: Improve JitProfile perf in arm/arm64 mterp""

Ready for review.

This reverts commit 6aef867f4d1a98a12bcdd65e9bf2ff894f0f2d7e.

Change-Id: I5d53ed2bedc7e429ce7d3cdf80b6696a9628740e
6aef867f4d1a98a12bcdd65e9bf2ff894f0f2d7e 25-Mar-2016 Calin Juravle <calin@google.com> Revert "ART: Improve JitProfile perf in arm/arm64 mterp"

This reverts commit c1d6b341eed646e5adafc6c4fd4e3748f0292368.
c1d6b341eed646e5adafc6c4fd4e3748f0292368 02-Mar-2016 buzbee <buzbee@google.com> ART: Improve JitProfile perf in arm/arm64 mterp

ART currently requires two profiling-related things from the
interpreters: hotness updates and OSR switch checks. The hotness
updates previously used the existing instrumentation framework - which
is flexible, but quite heavyweight. For most things, the
instrumentation framework overhead is acceptable, but because we do a
hotness update on every backwards branch the overhead is unacceptable.
Prior to this CL, branch profiling dominates interpreter cost.

Here, we bypass the instrumentation framework for hotness updates
and deliver a significant performance improvement. Running
interpreter-only (dalvikvm -Xint) on a Nexus 6, we see the logic
subtest of Caffeinemark improving from 2600 to 9200, and the
overall score going from 1979 to over 3000. Compared to the
C++ switch interpreter, we see a 6x improvement on the branchy logic
subtest and a 2.6x improvement overall.

Compared with the previous mterp which did not have support for
jit profiling, we see a few (1% to 5%) performance loss on the
standard command-line benchmarks. I consider this acceptable
(we could create an alternate non-profiling mterp which would
have no penalty, but I don't consider this overhead big enough to
justify that).

Change-Id: I50b5b8c5ed8ebda3c8b4e65d27ba7393c3feae04
f1dcaccfac4a9e022ea49752a774552b2f791489 24-Feb-2016 buzbee <buzbee@google.com> ART: Profile all branches for on-stack replacement

Change the switch, goto and mterp interpreters to profile
not-taken as well as taken branches. This allows for on-stack
replacement when the cfg has been rearranged such that the loop
header was originally the fallthrough of a Dalvik byte-code branch.

Note that this increases the already-heavy cost of branch profiling.
Measuring on a Nexus 6 using a very branchy benchmark (logic subtest
from Caffeinemark), we see:

No profiling Taken only Taken & not-taken
mterp 9728 3434 2384
C++ goto 3914 2422 2037
C++ switch 2986 2411 2112

As measured, the cost of branch profiling is dominating execution
time. This will be addressed in follow-up CLs.

Change-Id: Ibc858f317398dd991ed8e4f3c3d72bd4c9a60594
fd522f9039befff986701ff05054ffdd1be1dd33 11-Feb-2016 Bill Buzbee <buzbee@google.com> Revert "Revert "Revert "Revert "ART: Enable Jit Profiling in Mterp for arm/arm64""""

This reverts commit 5d03317a834efdf3b5240c401f1bc2ceac7a2f25.

We need to catch all possible cases in which new instrumentation appears
or the debugger is attached, and then switch to the reference interpreter
if necessary. We may, in a future CL, use the alt-mterp mechanism to accompish
this (as did Dalvik).

Only enables Arm64 for now. Once it survives extended testing, will enable
arm and update x86.

Updated OSR handling to match other interpreters.

Change-Id: I076f1d752d6f59899876bab26b18e2221cd92f69
5d03317a834efdf3b5240c401f1bc2ceac7a2f25 11-Feb-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Revert "ART: Enable Jit Profiling in Mterp for arm/arm64"""

Unfortunately, run-test interpreter on arm32 are still timing out, and the following jdwp tests on armv8 are failing:

org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testBreakpoint_BeforeException (no test history available)
org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testFieldAccess (no test history available)
org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testFieldModification (no test history available)
org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testMethodExit (no test history available)
org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testMethodExitWithReturnValue (no test history available)
org.apache.harmony.jpda.tests.jdwp.Events.FieldAccessTest#testFieldAccessEvent (no test history available)
org.apache.harmony.jpda.tests.jdwp.Events.FieldModification002Test#testFieldModifyEvent (no test history available)
org.apache.harmony.jpda.tests.jdwp.Events.FieldModificationTest#testFieldModifyEvent (no test history available)
org.apache.harmony.jpda.tests.jdwp.Events.MethodExitWithReturnValueTest#testMethodExitWithReturnValueException (no test history available)

This reverts commit 9687f244bdb5dd0b4d9dd804a7c8c7b4a911d364.

Change-Id: Iadac4902ab8d7eb574cc4abeba5f93388d59dcb4
9687f244bdb5dd0b4d9dd804a7c8c7b4a911d364 05-Feb-2016 Bill Buzbee <buzbee@google.com> Revert "Revert "ART: Enable Jit Profiling in Mterp for arm/arm64""

Fixes: missing sign extension in iget template
Call to wrong branch profiling helper in arm/goto_16 and arm/goto_32
Missing export PCs
Reworks: Branch handlers to reduce cost of branch profiling.

Re-enables Jit profiling for both Arm and Arm64.

Performance note:
Branch profiling is relatively expensive, though the real
cost will depend on branch frequency. Taking a very
branch intensive benchmark, CaffeineMark's logic test, we
see the following scores (higher is better):

Mterp (profiling off) 6187
Mterp (profiling on) 4305

Switch (profiling off) 3931
Switch (profiling on) 2032

This reverts commit 95717f0010e7a9445450f4d39babfaf3a83e29b5.

Change-Id: Ia2ef8b54ce95bfa86178b89c43f8a703316b2944
95717f0010e7a9445450f4d39babfaf3a83e29b5 05-Feb-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "ART: Enable Jit Profiling in Mterp for arm/arm64"

Not super happy to revert this, but unfortunately, too many problems when testing:

arm: tests timeout when running run-tests with the interpreter.

arm64 failures:
test-art-target-run-test-ndebug-prebuild-jit-relocate-ntrace-cms-checkjni-image-npictest-ndebuggable-003-omnibus-opcodes64
test-art-target-run-test-ndebug-prebuild-jit-relocate-ntrace-cms-checkjni-image-npictest-ndebuggable-005-annotations64
test-art-target-run-test-ndebug-prebuild-jit-relocate-ntrace-cms-checkjni-image-npictest-ndebuggable-064-field-access64
test-art-target-run-test-ndebug-prebuild-jit-relocate-ntrace-cms-checkjni-image-npictest-ndebuggable-406-fields64

org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testBreakpoint_BeforeException
org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testFieldAccess
org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testFieldModification
org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testMethodExit
org.apache.harmony.jpda.tests.jdwp.Events.EventWithExceptionTest#testMethodExitWithReturnValue
org.apache.harmony.jpda.tests.jdwp.Events.FieldAccessTest#testFieldAccessEvent
org.apache.harmony.jpda.tests.jdwp.Events.FieldModification002Test#testFieldModifyEvent
org.apache.harmony.jpda.tests.jdwp.Events.FieldModificationTest#testFieldModifyEvent
org.apache.harmony.jpda.tests.jdwp.Events.MethodExitWithReturnValueTest#testMethodExitWithReturnValueException

This reverts commit a0a16105423459287497a98129dcba2828ccd7f0.

Change-Id: I8ff0512265ed0a422be67e7410998ad02639509c
a0a16105423459287497a98129dcba2828ccd7f0 04-Feb-2016 buzbee <buzbee@google.com> ART: Enable Jit Profiling in Mterp for arm/arm64

Adds the hooks for branch profiling to arm and arm64. The
other Jit profiling modes are handled in common code.

Stubbed out support for on-stack replacement.

Change-Id: Ic298a81139108c3d7f1325b59d97e14a9de08de6
1452bee8f06b9f76a333ddf4760e4beaa82f8099 06-Mar-2015 buzbee <buzbee@google.com> Fast Art interpreter

Add a Dalvik-style fast interpreter to Art.
Three primary deficiencies in the existing Art interpreter
will be addressed:

1. Structural inefficiencies (primarily the bloated
fetch/decode/execute overhead of the C++ interpreter
implementation).
2. Stack memory wastage. Each managed-language invoke
adds a full copy of the interpreter's compiler-generated
locals on the shared stack. We're at the mercy of
the compiler now in how much memory is wasted here. An
assembly based interpreter can manage memory usage more
effectively.
3. Shadow frame model, which not only spends twice the memory
to store the Dalvik virtual registers, but causes vreg stores
to happen twice.

This CL mostly deals with #1 (but does provide some stack memory
savings). Subsequent CLs will address the other issues.

Current status:
Passes all run-tests.
Phone boots interpret-only.
2.5x faster than Clang-compiled Art goto interpreter on fetch/decode/execute
microbenchmark, 5x faster than gcc-compiled goto interpreter.
1.6x faster than Clang goto on Caffeinemark overall
2.0x faster than Clang switch on Caffeinemark overall
68% of Dalvik interpreter performance on Caffeinemark (still much slower,
primarily because of poor invoke performance and lack of execute-inline)
Still nearly an order of magnitude slower than Dalvik on invokes
(but slightly better than Art Clang goto interpreter.
Importantly, saves ~200 bytes of stack memory per invoke (but still
wastes ~400 relative to Dalvik).

What's needed:
Remove the (large quantity of) bring-up hackery in place.
Integrate into the build mechanism. I'm still using the old Dalvik manual
build step to generate assembly code from the stub files.
Remove the suspend check hack. For bring-up purposes, I'm using an explicit
suspend check (like the other Art interpreters). However, we should be
doing a Dalvik style suspend check via the table base switch mechanism.
This should be done during the alternative interpreter activation.
General cleanup.
Add CFI info.
Update the new target bring-up README documentation.
Add other targets.

In later CLs:
Consolidate mterp handlers for expensive operations (such as new-instance) with
the code used by the switch interpreter. No need to duplicate the code for
heavyweight operations (but will need some refactoring to align).
Tuning - some fast paths needs to be moved down to the assembly handlers,
rather than being dealt with in the out-of-line code.
JIT profiling. Currently, the fast interpreter is used only in the fast
case - no instrumentation, no transactions and no access checks. We
will want to implement fast + JIT-profiling as the alternate fast
interpreter. All other cases can still fall back to the reference
interpreter.
Improve invoke performance. We're nearly an order of magnitude slower than
Dalvik here. Some of that is unavoidable, but I suspect we can do
better.
Add support for our other targets.

Change-Id: I43e25dc3d786fb87245705ac74a87274ad34fedc