History log of /art/runtime/arch/arm64/quick_entrypoints_arm64.S
Revision Date Author Comments
e7d876adcfc1977800264ab7540aa488c1568b48 28-Jun-2015 Mathieu Chartier <mathieuc@google.com> ART: Fix CFI annotation for art_quick_aput_obj

Fix the CFI state after an early return.

Bug: 22014525

(cherry picked from commit 2738639bcd30b908d825725169b7497ed047debb)

Change-Id: I56b9ba8cf8c47d70a642f064e59c7e04a476dd2f
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
27a4a9d2a488dd57cd00d9108d10defde04141a2 05-May-2015 Sebastien Hertz <shertz@google.com> Fix instrumentation exit stub for arm64

Fixes bad offset to restore register x21.

Bug: 20798393

(cherry picked from commit a538effb3f848bfec232c55f167b9f35b416948f)

Change-Id: I030d848ab0f46043e86f53abae204463f0aaccbe
a538effb3f848bfec232c55f167b9f35b416948f 05-May-2015 Sebastien Hertz <shertz@google.com> Fix instrumentation exit stub for arm64

Fixes bad offset to restore register x21.

Bug: 20798393
Change-Id: I030d848ab0f46043e86f53abae204463f0aaccbe
848f70a3d73833fc1bf3032a9ff6812e429661d9 15-Jan-2014 Jeff Hao <jeffhao@google.com> Replace String CharArray with internal uint16_t array.

Summary of high level changes:
- Adds compiler inliner support to identify string init methods
- Adds compiler support (quick & optimizing) with new invoke code path
that calls method off the thread pointer
- Adds thread entrypoints for all string init methods
- Adds map to verifier to log when receiver of string init has been
copied to other registers. used by compiler and interpreter

Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
5ea536aa4a6414db01beaf6f8bd8cb9adc5cfc92 20-Apr-2015 Vladimir Marko <vmarko@google.com> Remove ArtMethod* parameter from dex cache entry points.

Load the ArtMethod* using an optimized stack walk instead.
This reduces the size of the generated code.

Three of the entry points are called only from a slow-path
and the fourth (InitializeTypeAndVerifyAccess) is rare and
already slow enough that the one or two extra loads
(depending on whether we already have the ArtMethod* in a
register) are insignificant. And as we're starting to use
PC-relative addressing of the dex cache arrays (already
done by Quick for the boot image), having the ArtMethod* in
a register becomes less likely anyway.

Change-Id: Ib19b9d204e355e13bf386662a8b158178bf8ad28
2cebb24bfc3247d3e9be138a3350106737455918 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Replace NULL with nullptr

Also fixed some lines that were too long, and a few other minor
details.

Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
69a503050fb8a7b3a79b2cd2cdc2d8fbc594575d 14-Apr-2015 Zheng Xu <zheng.xu@arm.com> ARM64: Remove suspend register.

It also clean up build/remove frame used by JNI compiler and generates
stp/ldp instead of str/ldr. Also x19 has been unblocked in both quick and
optimizing compiler.

Change-Id: Idbeac0942265f493266b2ef9b7a65bb4054f0e2d
bb87e0f1a52de656bc77cb01cb887e51a0e5198b 03-Apr-2015 Mathieu Chartier <mathieuc@google.com> Refactor and improve GC root handling

Changed GcRoot to use compressed references. Changed root visiting to
use virtual functions instead of function pointers. Changed root visting
interface to be an array of roots instead of a single root at a time.
Added buffered root marking helper to avoid dispatch overhead.

Root marking seems a bit faster on EvaluateAndApplyChanges due to batch
marking. Pause times unaffected.

Mips64 is untested but might work, maybe.

Before:
MarkConcurrentRoots: Sum: 67.678ms 99% C.I. 2us-664.999us Avg: 161.138us Max: 671us

After:
MarkConcurrentRoots: Sum: 54.806ms 99% C.I. 2us-499.986us Avg: 136.333us Max: 602us

Bug: 19264997

Change-Id: I0a71ebb5928f205b9b3f7945b25db6489d5657ca
e15ea086439b41a805d164d2beb07b4ba96aaa97 10-Feb-2015 Hiroshi Yamauchi <yamauchi@google.com> Reserve bits in the lock word for read barriers.

This prepares for the CC collector to use the standard object header
model by storing the read barrier state in the lock word.

Bug: 19355854
Bug: 12687968
Change-Id: Ia7585662dd2cebf0479a3e74f734afe5059fb70f
126d65952a03b3e44d5021208673c01920a982a4 03-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Fix generic JNI stubs to not discard the Java native frame.

Change-Id: Ic856b442fdde5ce91673fc5856eb0dfc84c75d28
1cc7dbabd03e0a6c09d68161417a21bd6f9df371 18-Dec-2014 Andreas Gampe <agampe@google.com> ART: Reorder entrypoint argument order

Shuffle the ArtMethod* referrer backwards for easier removal.

Clean up ARM & MIPS assembly code.

Change some macros to make future changes easier.

Change-Id: Ie2862b68bd6e519438e83eecd9e1611df51d7945
4808846b2a8647a448aaa05d561a4f60b190196b 12-Dec-2014 Nicolas Geoffray <ngeoffray@google.com> Save all registers in native to Java stubs.

This will make things more friendly when experimenting with the
number of callee saves in optimizing.

Change-Id: Iefd9a2da329a420eb69fc2fa9e91c06bbda30cdb
2d7210188805292e463be4bcf7a133b654d7e0ea 10-Nov-2014 Mathieu Chartier <mathieuc@google.com> Change 64 bit ArtMethod fields to be pointer sized

Changed the 64 bit entrypoint and gc map fields in ArtMethod to be
pointer sized. This saves a large amount of memory on 32 bit systems.
Reduces ArtMethod size by 16 bytes on 32 bit.

Total number of ArtMethod on low memory mako: 169957
Image size: 49203 methods -> 787248 image size reduction.
Zygote space size: 1070 methods -> 17120 size reduction.
App methods: ~120k -> 2 MB savings.

Savings per app on low memory mako: 125K+ per app
(less active apps -> more image methods per app).

Savings depend on how often the shared methods are on dirty pages vs
shared.

TODO in another CL, delete gc map field from ArtMethod since we
should be able to get it from the Oat method header.

Bug: 17643507

Change-Id: Ie9508f05907a9f693882d4d32a564460bf273ee8

(cherry picked from commit e832e64a7e82d7f72aedbd7d798fb929d458ee8f)
e832e64a7e82d7f72aedbd7d798fb929d458ee8f 10-Nov-2014 Mathieu Chartier <mathieuc@google.com> Change 64 bit ArtMethod fields to be pointer sized

Changed the 64 bit entrypoint and gc map fields in ArtMethod to be
pointer sized. This saves a large amount of memory on 32 bit systems.
Reduces ArtMethod size by 16 bytes on 32 bit.

Total number of ArtMethod on low memory mako: 169957
Image size: 49203 methods -> 787248 image size reduction.
Zygote space size: 1070 methods -> 17120 size reduction.
App methods: ~120k -> 2 MB savings.

Savings per app on low memory mako: 125K+ per app
(less active apps -> more image methods per app).

Savings depend on how often the shared methods are on dirty pages vs
shared.

TODO in another CL, delete gc map field from ArtMethod since we
should be able to get it from the Oat method header.

Bug: 17643507

Change-Id: Ie9508f05907a9f693882d4d32a564460bf273ee8
0ff20d50fcf120b798cabf8cebd77d54850e6cd5 22-Oct-2014 Stephen Kyle <stephen.kyle@arm.com> Fix arm64 bug introduced by refactoring.

- Commit 1d8cdbc5202378 made changes to the parameters for
artSet64InstanceFromCode, but did not change THREE_ARG_DOWNCALL
to THREE_ARG_REF_DOWNCALL for arm64.

Change-Id: If256b0bd32dbd1c95f61e0afcb35975bb09a8b97
Signed-off-by: Stephen Kyle <stephen.kyle@arm.com>
1d8cdbc5202378a5f1a4b3a1fba610675ed4dcd5 23-Sep-2014 Ian Rogers <irogers@google.com> Refactor quick entrypoints

Remove FinishCalleeSaveFrameSetup.
Assembly routines write down anchor into TLS as well as placing runtime
method in callee save frame.
Simplify artSet64InstanceFromCode by not computing the referrer from the
stack in the C++ code.
Move assembly offset tests next to constant declaration and tidy arch_test.

Change-Id: Iededeebc05e54a1e2bb7bb3572b8ba012cffa1c8
677cd61ad05d993c4d3b22656675874f06d6aabc 15-Oct-2014 Ian Rogers <irogers@google.com> Make ART compile with GCC -O0 again.

Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on
architecture.
Add to instruction_set_test to warn when InstructionSetFeatures don't agree
with ones from system properties, AT_HWCAP and /proc/cpuinfo.
Clean-up class linker entry point logic to not return entry points but to
test whether the passed code is the particular entrypoint. This works around
image trampolines that replicate entrypoints.
Bug: 17993736

(cherry picked from commit 6f3dbbadf4ce66982eb3d400e0a74cb73eb034f3)

Change-Id: I3e7595f437db4828072589d475a5453b7f31003e
6f3dbbadf4ce66982eb3d400e0a74cb73eb034f3 15-Oct-2014 Ian Rogers <irogers@google.com> Make ART compile with GCC -O0 again.

Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on
architecture.
Add to instruction_set_test to warn when InstructionSetFeatures don't agree
with ones from system properties, AT_HWCAP and /proc/cpuinfo.
Clean-up class linker entry point logic to not return entry points but to
test whether the passed code is the particular entrypoint. This works around
image trampolines that replicate entrypoints.
Bug: 17993736

Change-Id: I5f4b49e88c3b02a79f9bee04f83395146ed7be23
ec1694ddb034c4b86da59e9ba989ac1d8af2845c 09-Oct-2014 Ian Rogers <irogers@google.com> Fix ARM64 build.

Change-Id: Ia0044523473d7a93ef3f0eed8e6c28602e767c17
3b37073e52f3b8a2a9e16bc9a019ef2607a97245 09-Oct-2014 Vladimir Marko <vmarko@google.com> Fix arm64 build: move macro usage after definition.

The build was broken by
https://android-review.googlesource.com/110341

Change-Id: I137b4bc694af15465bf0db3ffe337950064d2a53
832336b3c9eb892045a8de1bb12c9361112ca3c5 09-Oct-2014 Ian Rogers <irogers@google.com> Don't copy fill array data to quick literal pool.

Currently quick copies the fill array data from the dex file to the literal
pool. It then has to go through hoops to pass this PC relative address down
to out-of-line code. Instead, pass the offset of the table to the out-of-line
code and use the CodeItem data associated with the ArtMethod. This reduces
the size of oat code while greatly simplifying it.
Unify the FillArrayData implementation in quick, portable and the interpreters.

Change-Id: I9c6971cf46285fbf197856627368c0185fdc98ca
37f05ef45e0393de812d51261dc293240c17294d 17-Jul-2014 Fred Shih <ffred@google.com> Reduced memory usage of primitive fields smaller than 4-bytes

Reduced memory used by byte and boolean fields from 4 bytes down to a
single byte and shorts and chars down to two bytes. Fields are now
arranged as Reference followed by decreasing component sizes, with
fields shuffled forward as needed.

Bug: 8135266
Change-Id: I65eaf31ed27e5bd5ba0c7d4606454b720b074752
29b3841ad8c1c18ee7ddd2d8cab85806b3d62eaa 13-Aug-2014 Andreas Gampe <agampe@google.com> ART: Set default visibility to protected

Set default visibility of symbols to protected. This allows the
linker to optimize internal calls and helps avoid plt calls.

Make almost all assembly stubs hidden, as -fvisibility does not
seem to apply to them. Change the assembly tests accordingly. Also
allows to clean up previous hacks to avoid plt calls.

Bug: 16974467

(cherry picked from commit 235e77bd9f19e4faefda109be40f8744f3a66f40)

Change-Id: I9030dcf6116251f434f94a2b08e56e12085af652
b038ba66a166fb264ca121632f447712e0973b5b 14-Aug-2014 Dave Allison <dallison@google.com> Revert "Revert "Reduce stack usage for overflow checks""

Fixes stack protection issue.
Fixes mac build issue.

This reverts commit 83b1940e6482b9d8feba5c492507735686650ea5.

Change-Id: I7ba17252882b23a740bcda2ea94aacf398255406
4cf00ba324f5f6884059796a6ba41937f32e1844 14-Aug-2014 Dave Allison <dallison@google.com> Revert "Reduce stack usage for overflow checks"

This reverts commit 63c051a540e6dfc806f656b88ac3a63e99395429.

Change-Id: I282a048994fcd130fe73842b16c21680053c592f
03c9785a8a6d712775cf406c4371d0227c44148f 14-Aug-2014 Dave Allison <dallison@google.com> Revert "Revert "Reduce stack usage for overflow checks""

Fixes stack protection issue.
Fixes mac build issue.

This reverts commit 83b1940e6482b9d8feba5c492507735686650ea5.

Change-Id: I7ba17252882b23a740bcda2ea94aacf398255406
83b1940e6482b9d8feba5c492507735686650ea5 14-Aug-2014 Dave Allison <dallison@google.com> Revert "Reduce stack usage for overflow checks"

This reverts commit 63c051a540e6dfc806f656b88ac3a63e99395429.

Change-Id: I282a048994fcd130fe73842b16c21680053c592f
235e77bd9f19e4faefda109be40f8744f3a66f40 13-Aug-2014 Andreas Gampe <agampe@google.com> ART: Set default visibility to protected

Set default visibility of symbols to protected. This allows the
linker to optimize internal calls and helps avoid plt calls.

Make almost all assembly stubs hidden, as -fvisibility does not
seem to apply to them. Change the assembly tests accordingly. Also
allows to clean up previous hacks to avoid plt calls.

Bug: 16974467
Change-Id: I9030dcf6116251f434f94a2b08e56e12085af652
63c051a540e6dfc806f656b88ac3a63e99395429 26-Jul-2014 Dave Allison <dallison@google.com> Reduce stack usage for overflow checks

This reduces the stack space reserved for overflow checks to 12K, split
into an 8K gap and a 4K protected region. GC needs over 8K when running
in a stack overflow situation.

Also prevents signal runaway by detecting a signal inside code that
resulted from a signal handler invokation. And adds a max signal count to
the SignalTest to prevent it running forever.

Also reduces the number of iterations for the InterfaceTest as this was
taking (almost) forever with the --trace option on run-test.

Bug: 15435566

Change-Id: Id4fd46f22d52d42a9eb431ca07948673e8fda694

Conflicts:
compiler/optimizing/code_generator_x86_64.cc
runtime/arch/x86/fault_handler_x86.cc
runtime/arch/x86_64/quick_entrypoints_x86_64.S
648d7112609dd19c38131b3e71c37bcbbd19d11e 26-Jul-2014 Dave Allison <dallison@google.com> Reduce stack usage for overflow checks

This reduces the stack space reserved for overflow checks to 12K, split
into an 8K gap and a 4K protected region. GC needs over 8K when running
in a stack overflow situation.

Also prevents signal runaway by detecting a signal inside code that
resulted from a signal handler invokation. And adds a max signal count to
the SignalTest to prevent it running forever.

Also reduces the number of iterations for the InterfaceTest as this was
taking (almost) forever with the --trace option on run-test.

Bug: 15435566

Change-Id: Id4fd46f22d52d42a9eb431ca07948673e8fda694
d74824bdd01b2a76b310e1275a1114d39833a708 12-Aug-2014 Zheng Xu <zheng.xu@arm.com> AArch64: Fix art_quick_string_compareto.

Though __memcmp16() is implemented in the same module as the caller, it
is still possible that the toolchain would put __memcmp16() into plt. In
that case, IP registers can be trashed when loading the function address.
Use x14/x15 to replace IP0/IP1.

Bug: 16974467

(cherry picked from commit 62ddb328860e907eb76ccd3abed63ba75438fea8)

Change-Id: I40e39d075860bc78624ce6ef8b4f8e33e57fc58c
62ddb328860e907eb76ccd3abed63ba75438fea8 12-Aug-2014 Zheng Xu <zheng.xu@arm.com> AArch64: Fix art_quick_string_compareto.

Though __memcmp16() is implemented in the same module as the caller, it
is still possible that the toolchain would put __memcmp16() into plt. In
that case, IP registers can be trashed when loading the function address.
Use x14/x15 to replace IP0/IP1.

Bug: 16974467
Change-Id: Ica7294b9bf90342031efa5fd51a86a6fcab5852b
7204c04dd86ae8ce05690e38737b2abf017a0a69 11-Jun-2014 Stuart Monteith <stuart.monteith@arm.com> AArch64: Implicit StackOverflow/NPE/Suspend checks.

This implements implicit stack overflow checks and null pointer exceptions
for AArch64. Suspend checks are implemented but not switched on yet.

Bug: 16256184
Change-Id: I2eb076f2c0c9d94793d5a898fea49cf409b4eb66
Signed-off-by: Stuart Monteith <stuart.monteith@arm.com>
d5c78f44dc53ef9fda47a95ad3e9799be850c2b2 11-Jun-2014 Stuart Monteith <stuart.monteith@arm.com> AArch64: Implicit StackOverflow/NPE/Suspend checks.

This implements implicit stack overflow checks and null pointer exceptions
for AArch64. Suspend checks are implemented but not switched on yet.

Change-Id: I2eb076f2c0c9d94793d5a898fea49cf409b4eb66
Signed-off-by: Stuart Monteith <stuart.monteith@arm.com>
b551fdcda9eb128c80de37c4fb978968bec6d4b3 25-Jul-2014 Zheng Xu <zheng.xu@arm.com> AArch64: Clean up CalleeSaveMethod frame and the use of temp registers.

CalleeSaveMethod frame size changes :
SaveAll : 368 -> 176
RefOnly : 176 -> 96
RefsAndArgs : 304 -> 224

JNI register spill size changes :
160 -> 88

In the transition assembly, use registers following the rules:
1. x0-x7 as temp/argument registers.
2. IP0, IP1 as scratch registers.
3. After correct type of callee-save-frame has been setup, all registers
are scratch-able(probably except xSELF and xSUSPEND).
4. When restore callee-save-frame, IP0 and IP1 should be untouched.
5. From C to managed code, we assume all callee save register in AAPCS
will be restored by managed code except x19(SUSPEND).

In quick compiler:
1. Use IP0, IP1 as scratch register.
2. Use IP1 as hidden argument register(IP0 will be scratched by
trampoline.)

Change-Id: I05ed9d418b01b9e87218a7608536f57e7a286e4c
ab088118d33caafb00815ab72ac0fd7374169f64 14-Jul-2014 Hiroshi Yamauchi <yamauchi@google.com> Add read barriers for the roots in Runtime.

Bug: 12687968
Change-Id: If26518a8251702cfe4d5cd7d1f50e80e342704cf
c200a4abeca91e19969f5b35543f17f812ba32b9 17-Jun-2014 Andreas Gampe <agampe@google.com> ART: Rework Generic JNI, add ARM version

Refactors and optimizes Generic JNI. This version uses TwoWordReturn
to avoid writing to / loading from the bottom of the alloca.

Change-Id: I3287007c976f79c9fd32d3b3a43f2d1371bf4cd3
86797a791d692f81def5c1b5f0918992c49ed122 19-Jun-2014 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Add memcmp16() for Arm64; ensure xSELF not clobbered

This patch modifies memcmp() to memcmp16(). Please note that this
implementation of memcmp16() is based on the bionic's memcmp().

However, to reflect a recent specification change, the file has been
modified to respect the new String.compareTo() behavior.

A test for memcmp16() has been added. The string_compareto test in
stub_test has been changed to invoke __memcmp16 in assembly stubs.

Add artIsAssignableFromCode to the list of native downcalls to
store and reload x18. Remove CheckSuspendFromCode, as it is unused.

Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Change-Id: Ie0b5425ecfb62906d29a5d02e84c7e07ffb34a11
70f8d4b107e1f87c23df51efa360b3f4e90bce91 19-Jun-2014 Sebastien Hertz <shertz@google.com> Fix art_quick_instrumentation_exit for ARM64

Stores the integer result in x0 into the stack. Also avoids clobbering integer
result in x0 by setting it to xSELF after copying it to x2 when calling the
artInstrumentationMethodExitFromCode function.

Bug: 15690361
Change-Id: I9fb873cf32f194779f299607dda8a7316a99c528
0210d11658becc2bf02fe79788c87276a857d0e9 16-Jun-2014 Zheng Xu <zheng.xu@arm.com> AArch64: Add transition assembly to wrapper native functions.

There is slight difference between managed code ABI and AAPCS. We
can make managed code ABI to be the same with AAPCS. But considering
that, we might introduce more differences later for performance. It
is better to have a wrapper to deal with the differences.

Change-Id: I46ced072e9e3a83f713d2bf86fa478fc6144ee81
6aac355810d83babbd834df07cf1a38f44ad11c2 09-Jun-2014 Andreas Gampe <agampe@google.com> ART: Add initialize_type stubs for ARM64; indexof test

Add down-call stubs for ARM64. Add a test for indexof in stub_test.

Change-Id: I7bc045e29e4ca11ded5b318c47544edc1266afdb
4d0589c90971e19c25894414ae7da579269e1fe2 11-Jun-2014 Andreas Gampe <agampe@google.com> ART: Move __memcmp16 from Bionic to ART

Handle __memcmp16 / MemCmp16 in ART. Import assembly implementations
for arm and mips from Bionic. Use a generic C version for all other
platforms.

Removes the memcmp16 quick entrypoint, as it is never used. Bump
the oat version and update thread.cc and checks to reflect the
structural change.

Change-Id: I54a5a1da2a0a43ef271c8aeda0bf2276b8b11ac6
169489b4f4be8c5dd880ba6f152948324d22ff79 11-Jun-2014 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Add support for inlined methods

This patch adds support for Arm64 inlined methods.

Change-Id: Ic6aeed6d2d32f65cd1e63cf482f83cdcf958798a
41c507a9dae44b8329a857da3d9810fab2e9ddc6 15-May-2014 Alexei Zavjalov <alexei.zavjalov@intel.com> ART: Generalize code to find PC for artInvokeInterfaceTrampoline

This allows to determine target method when the interface method has
no dex index, now also for X86-64 and ARM64.

Add constexpr functions to callee_save_frame.h to have compile-time
sizes of callee-save frames. Add a test that ensures they agree
with computations by the corresponding ArtMethod methods.

Move some instruction-set functions into the header file to allow
inlining them. Move arch-specific pointer sizes and alignment sizes
out of globals.h to instruction_set.h to reduce dependencies.

Change-Id: I2997592c7dd1f4dd2bd497522c64bd235ae615a6
Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
d58342caa97108ba413bad467c285c0377f138f5 05-Jun-2014 Andreas Gampe <agampe@google.com> ART: Add instrumentation stubs for ARM64 and X86-64

Adds instrumentation stubs necessary for debugger support.

Refactors MethodAndCode to a top-level TwoWordReturn. A function
having a return type of TwoWordReturn will return its two-word
content, either 2x32b or 2x64b, in two registers according to
the architecture's ABI.

Bug: 15443938
Change-Id: Id7e1fbd4ad8eb6f29e23d48903c76f77b28d981a
d1e9167713e485d9264e856b68ffb568f22f1dc9 03-Jun-2014 Andreas Gampe <agampe@google.com> ART: Fix an error in proxy_invoke stub on ARM64

Make sure that d0 is filled with the right value, as the return
from C code is always in x0.

Bug: 15386201
Change-Id: I6c048b3d92272d769f1de3bdc9ce30733b9e1935
ffddfdf6fec0b9d98a692e27242eecb15af5ead2 03-Jun-2014 Tim Murray <timmurray@google.com> DO NOT MERGE

Merge ART from AOSP to lmp-preview-dev.

Change-Id: I0f578733a4b8756fd780d4a052ad69b746f687a9
cf4035a4c41ccfcc3e89a0cee25f5218a11b0705 29-May-2014 Andreas Gampe <agampe@google.com> ART: Use StackReference in Quick Stack Frame

The method reference at the bottom of a quick frame is a stack
reference and not a native pointer. This is important for 64b
architectures, where the notions do not coincide.

Change key methods to have StackReference<mirror::ArtMethod>*
parameter instead of mirror::ArtMethod**. Make changes to
invoke stubs for 64b archs, change the frame setup for JNI code
(both generic JNI and compilers), tie up loose ends.

Tested on x86 and x86-64 with host tests. On x86-64, tests succeed
with jni compiler activated. x86-64 QCG was not tested.

Tested on ARM32 with device tests.

Fix ARM64 not saving x19 (used for wSUSPEND) on upcalls.

Tested on ARM64 in interpreter-only + generic-jni mode.

Fix ARM64 JNI Compiler to work with the CL.

Tested on ARM64 in interpreter-only + jni compiler.

Change-Id: I77931a0cbadd04d163b3eb8d6f6a6f8740578f13
48241e786121e1c4c050d9cfad3d22de270a3e75 23-May-2014 Zheng Xu <zheng.xu@arm.com> AArch64: Add suspend check in managed code.

TODO: Remove x19 in the frame in runtime, generic jni, compiled jni.

Change-Id: Ibdc292c9e7adb3a5d3eff353c22f60ffc101f549
ed65c5e982705defdb597d94d1aa3f2997239c9b 22-May-2014 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Enable LONG_* and INT_* opcodes.

This patch fixes some of the issues with LONG and INT opcodes. The patch
has been tested and passes all the dalvik tests except for 018 and 107.

Change-Id: Idd1923ed935ee8236ab0c7e5fa969eaefeea8708
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
51f763506c7bb34420242e88e1631550f94d6417 21-May-2014 Andreas Gampe <agampe@google.com> ART: Add INVOKE_TRAMPOLINE and imt_conflict stub to 64b architectures

"Generalize" the return type notion of the interface helpers.

Includes a simple test for imt_conflict. The other interface
trampolines are as of yet untested.

Change-Id: I30fc75f5103766d57628ff22bcbac7c7f81037e3
6cf80102b5f308f2a5326869343ea0d19109a7fb 19-May-2014 Andreas Gampe <agampe@google.com> ART: Fix ARM64 long-jump context caller-save smashes

In aarch64, d8-d15 are callee-saved. We smashed exactly the wrong
registers.

Add code to stub_test that checks whether the callee-saved fp
registers are preserved on ARM64. There are no callee-saved registers
for x86, so the invoke methods are not extended for those architectures.

Fix a minor type in callee-save frame setup for ARM64.

Bug: 14160872
Change-Id: I080fce6eda7d560b4efb610f0e9454f3471fa4f9
675967d981a3d17aaedf4ca6e07cc3a76e066921 15-May-2014 Andreas Gampe <agampe@google.com> ART: Fix comments for dmb

Update the comments to mention correct barrier type.

Bug: 14680557
Change-Id: I26df43078c189cf16cc65e99b851981cbd063017
421c53742610c053543f8c84e04d5e0c5185d68c 14-May-2014 Mathieu Chartier <mathieuc@google.com> Address comments from HandleScope change.

For:
https://android-review.googlesource.com/#/c/93793

Change-Id: I020d22a1508bf4f1770e6806d70e4fbb9a0fa0ab
eb8167a4f4d27fce0530f6724ab8032610cd146b 08-May-2014 Mathieu Chartier <mathieuc@google.com> Add Handle/HandleScope and delete SirtRef.

Delete SirtRef and replaced it with Handle. Handles are value types
which wrap around StackReference*.

Renamed StackIndirectReferenceTable to HandleScope.

Added a scoped handle wrapper which wraps around an Object** and
restores it in its destructor.

Renamed Handle::get -> Get.

Bug: 8473721

Change-Id: Idbfebd4f35af629f0f43931b7c5184b334822c7a
4fc046e78efbc98541388cdda986b5d8a2b951ad 07-May-2014 Andreas Gampe <agampe@google.com> ART: Add lock and unlock stubs for ARM64, fix for X86-64

Basic translation of ARM stubs using dmb memory barrier.

Fix placement of dmb in unlock_object of ARM and ARM64.

Update lock and unlock tests in stub_test to force fat locks.

Fix X86-64 unlock stub.

Change-Id: Ie2e4328d9631e06843115888644e75fde8b319ee
dfd891a61a1642b3c0d532e0cec73255cf4b9afb 30-Apr-2014 Matteo Franchin <matteo.franchin@arm.com> AArch64: Fixing and adding arm64 trampolines.

Fixed art_quick_resolution_trampoline for Arm64.
Also added art_quick_initialize_static_storage and
art_quick_resolve_string.

Change-Id: I8a03ed8dd4e23e26e9974209e1da939361125e0c
63206f3038d3d6e1cb24166726613808a4b0ad8c 07-May-2014 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Fix the usage of Thread Register for arm64

This patch cleans-up the usage of x18 as TR for Arm64. As described in
the Arm64 Procedure Call Standard, the recommended usage for x18 is to
carry inter-procedural state (i.e. ART thread information).

However, since x18 is a temporary register there is no guarantee that on
calls to external functions x18 is preserved. Thus on JNI calls we need
to save and restore x18 before coming back to managed runtime. For the
JNI compiler trampoline we move x18 (temporary register - caller saved)
to x19 (ETR, callee saved) before calling into native code, and
restore it on the way back.

Change-Id: If24091018d640027a497517a9238bf4a80d013aa
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
6e4e59c674f4d58421512dbcfc57a99e27b6b5c8 06-May-2014 Andreas Gampe <agampe@google.com> ART: ARM64 field entrypoints

Add Quick field entrypoints for ARM64.

Add tests to stub_test. Make inline assembly more robust to compiler
choices for registers on ARM.

Change-Id: I199edfad5dd9b73c6f6fc8a572ff4e0e0c04921d
266340d30a2ed52a4ea0ff64492d6aac857a3e24 02-May-2014 Andreas Gampe <agampe@google.com> ART: ARM64 art_quick_string_compareto

A simple implementation of the assembly stub for ARM64.

Make the string_compareto test in stub_test more interesting by
having strings with offsets in their backing arrays.

Change-Id: Ibc3a1bdb70e3764baa6b8e793987166c67b6fb39
f4e910badbaa5aa48efbf697715f4815f0ebc7e4 30-Apr-2014 Andreas Gampe <agampe@google.com> Implement art_quick_aput_object stubs for X86-64 and ARM64

Implement the aput_object stubs for 64b architectures and enable
their testing in stub_test.

Fix missing @PLT for x86.

Add automatic _local labels in function definitions in x86-64 so we
can make local jumps (instead of PLT hoops).

Change-Id: I614b88fd5966acd8a564b87c47d4c50ee605320c
00c1e6d5fa6c2c20f25c38591b9780114bf7ddbf 26-Apr-2014 Andreas Gampe <agampe@google.com> Add ARM64 & X86_64 Assembly, plus tests

This adds assembly code or removes UNTESTED annotation from
TWO_ARG_DOWNCALLand THREE_ARG_DOWNCALL macros and supporting code,
generating working allocation stubs.

Some object and array allocation tests are added to the stub_test.

Change-Id: I5e93b7543c1e6dbd33b0d4cf564c7cbd963e74ef
5c1e4352614d61fed6868567e58b96682828cb4d 22-Apr-2014 Andreas Gampe <agampe@google.com> Add "arch_test" gtest for assembly stub constants, add some ARM64 assembly code

Add a test that (1) checks all callee-save method frame sizes for
all architectures, (2) checks thread offsets for the runtime
architecture and (3) checks callee-save method offsets for the
runtime architecture.

The "asm_support_XXX.h" files now only contain definitions that are
common between all architectures. Architecture-specific definitions
(i.e., special registers names) have been pushed into the corresponding
.S file. This change was required to be able to undefine definitions
in the test, so that multiple tests can be written in one file.

Test (1) above is in a sense two-stage. The arch_test gtest compares
constants (if it finds them) against the frame size as reported by
the ArtMethods created by the Runtime. This works for all architectures
as we can provide the instruction-set to CreateCalleeSaveMethod. The
second stage of the "test" are preprocessor tests with "#error" in the
case that the constants are not the expected value.

Optimally I'd like to change that to an actual runtime test exercising
the assembly code, which would also allow to check whether the right
registers are stored.

Also added missing assembly code for ARM64 for the callee-save macros.

Also fix X86_64 compilation for Clang 3.5.

Change-Id: I018e6433dffd3d31ba3bfcd75661653f4c7b6552
525cde2dd7cc7ad4212765ad3975cf260a934d3e 23-Apr-2014 Andreas Gampe <agampe@google.com> Add a GTest for Assembly Stubs, Add some ARM64 and X86-64 Stubs

This GTest adds some runtime testing for the stubs that does not
rely on the compiler. This should allow to add or update the stubs
and do testing, especially on architectures without working compiler.

This test is a bit dangerous: if it doesn't know how to handle an
architecture, it will only log a warning. This is so that testing
does not break at the moment. The warning is forced to stdout, too,
so that it is always visible.

Add art_quick_check_cast to ARM64 and X86-64. Add art_quick_memcpy
to X86-64. The latter should be removed in a good compiler, as it is
practically only overhead. Add minor CFI information in ARM.

Change-Id: Ia9c6d0f4035eb1527c12b5f6067dece59e25528d
75b9113b2b0a5807043af2a669a93d1579af8e2c 09-Apr-2014 Serban Constantinescu <serban.constantinescu@arm.com> AArch64: Jni compiler fixes

This patch fixes some of the issues with the ARM64 assembler and JNI
compiler.

The JNI compiler is not enabled by default, yet. To enable, change
line 1884 in compiler/driver/compiler_driver.cc, removing kArm64 from
the GenericJNI list.

The compiler passes all tests in jni_compiler_test.

Also change the common_compiler_test instruction-set-features logic.
We allow tests when the build-time features are a subset of the
runtime features.

Dex2oat cross-compiling is now working. A 32b version of dex2oat should
be able to compile correctly.

Change-Id: I51d1c24f2c75d4397a11c54724a8b277ff3b3df8
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
03906cffb1a59931c1c871ac3a0ffb1c4476bbb4 07-Apr-2014 Andreas Gampe <agampe@google.com> Fix ARM64 invoke stubs, correct CFI directives

The stubs do not advance over the arguments array when they cannot
place the parameter in a register. Fixed.

Changed the frame code for the invoke stubs so that CFI is easier
to apply. Also defined two macros to unite the parts that are
identical between static and dynamic invoke. With moving one statement
and accepting 12B increased (dead) code size one could almost fully
unite the implementations.

Corrected CFI directives for the CALLEE_SAVE macros.

Change-Id: Idf593fc46f0b6e1eb579010d0cdcf9c1a71730b1
e62a07eac9ba2bef01f373832dd810a2cee9f348 26-Mar-2014 Andreas Gampe <agampe@google.com> Last patch for running tests on ARM64

This allows all run-tests to succeed with the interpreter+GenJNI
setup.

Change-Id: I45734e7e57340439369a613ef4329e3be2c0c4c9
c6ee54e9a9fd67d24c63bd802ef2fe540a4f86a5 25-Mar-2014 Andreas Gampe <agampe@google.com> Trampoline and assembly fixes for ARM64

Trampolines need a jump, not a call. Expose br in the ARM64
assembler to allow this.

The resolution trampoline is called with the Quick ABI, and will
continue to a Quick ABI function. Then the method pointer must be
in x0.

Change-Id: I4e383b59d6c40a659d324a7faef3fadf0c890178
9de65ff3a9c49b91d80be292020f012f3d0a24ef 22-Mar-2014 Andreas Gampe <agampe@google.com> Fixes to mem_map wraparound and ARM64 quick_invoke assembly

There are only 6 free GPRs for passing in a non-static invoke. This
corrupted one register for long-signature methods.

The wrap-around did not actually wrap around correctly.

Change-Id: I62658dadeb83bb22960b9455e211d26ffaa20f6f
b95a5345ae4217b70ca36f0cced92f68dda7caf5 12-Mar-2014 Stuart Monteith <stuart.monteith@arm.com> AArch64: Add arm64 runtime support.

Adds support for arm64 to ART. Assembler stubs are sufficient for
down calls into interpreter. JNI compiler and generics are not finished.

Basic Generic JNI functionality.

Change-Id: I4a07c79d1e037b9f5746673480e32cf456867b82