History log of /art/runtime/arch/x86/quick_entrypoints_x86.S
Revision Date Author Comments
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
fabe91e0d558936ac26b98d2b4ee1af08f58831d 26-Aug-2014 Dave Allison <dallison@google.com> Handle nested signals

This allows for signals to be raised inside the ART signal handler.
This can occur when the JavaStackTraceHandler attempts to generate
a stack trace and something goes wrong.

It also fixes an issue where the fault manager was not being
correctly shut down inside the signal chaining code. In this
case the signal handler was not restored to the original.

Bug: 17006816
Bug: 17133266
Change-Id: I9c25bf4f6921e6a107aefbdf47d2c0db9f41508f
ebee8de725d5fa83483642786b19ea453d865762 13-Aug-2014 Nicolas Geoffray <ngeoffray@google.com> Fix bugs in the x86 and arm versions of generic JNI.

Also fix the run script of 116-nodex2oat to use the non-prebuild
script for target.

Bug: 17000769

(cherry-picked from commit 54accbca0b549b1b1ad3ef09655dad438bc1e104)

Change-Id: I439fcd710fb8bb408f3288ff8fb34fef23890adb
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
ab9a0dbf3b63d517da5278b8298e6cd316e09f68 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
83b1940e6482b9d8feba5c492507735686650ea5 14-Aug-2014 Dave Allison <dallison@google.com> Revert "Reduce stack usage for overflow checks"

This reverts commit 63c051a540e6dfc806f656b88ac3a63e99395429.

Change-Id: I282a048994fcd130fe73842b16c21680053c592f
a0b530dd5e76662156b40c8a84ebb446b6332598 10-Aug-2014 Dan Albert <danalbert@google.com> Fix the Mac build.

Apparently Mac uses a different assembler directive for .hidden.

Change-Id: Ic2adb6bef82e376c3e5f4a29258a85a0dac00cd5
6a763f149f0c6f705cab8fb1984aa6f9198b2841 10-Aug-2014 Dan Albert <danalbert@google.com> Proper fix after -Bsymbolic change.

Marking the offending symbols as hidden allows the linker to resolve
them at build time.

Bug: 16853291
Change-Id: I1480c1520c23f81e42831a66737bba7bdf3433c2
35e1e6ad4b50f1adbe9f93fe467766f042491896 30-Jul-2014 Tong Shen <endlessroad@google.com> 1. Fix CFI for quick compiled code in x86 & x86_64;
2. Emit CFI in .eh_frame instead of .debug_frame.

With CFI, we can correctly unwind past quick generated code.
Now gdb should unwind to main() for both x86 & x86_64 host-side ART.

Note that it does not work with relocation yet.

Testing:
1. art/test/run-test --host --gdb [--64] --no-relocate 005
2. In gdb, run 'b art_quick_invoke_stub', then 'r', then 'c' a few times
3. In gdb, run 'bt'. You should see stack frames down to main()

Change-Id: I5350d4097dc3d360a60cb17c94f1d02b99bc58bb
f5881ed68a05b371e7578966470ff3801b180578 23-Jul-2014 Andreas Gampe <agampe@google.com> ART: Fix x86_64 instrumentation_exit, also movsd -> movq

Change movd/movsd to movq.

Bug: 16386215

(cherry picked from commit fea29016a79f39ac12a4ba4ebdcbc86800c03427)

Change-Id: Icca71ca2aeeb2917aff46043051d6046f04395d4
2c240f7972dc4e6c7cbfb5d4ddcae64720230109 23-Jul-2014 Jeff Hao <jeffhao@google.com> Fix x86 instrumentation exit entrypoint and trace size limit.

The x86 instruction movd only copies a 32-bit value when used with a
memory location. movsd properly copies 64-bits.

Bug: 16386215

(cherry picked from commit cf2e7b0621dfe7fcacd56555dffabab65d1130e7)

Change-Id: I102db8aaa5e8a6b3a88f01e545d1bb51b4f3d5d4
fea29016a79f39ac12a4ba4ebdcbc86800c03427 23-Jul-2014 Andreas Gampe <agampe@google.com> ART: Fix x86_64 instrumentation_exit, also movsd -> movq

Change movd/movsd to movq.

Bug: 16386215
Change-Id: Icca71ca2aeeb2917aff46043051d6046f04395d4
cf2e7b0621dfe7fcacd56555dffabab65d1130e7 23-Jul-2014 Jeff Hao <jeffhao@google.com> Fix x86 instrumentation exit entrypoint and trace size limit.

The x86 instruction movd only copies a 32-bit value when used with a
memory location. movsd properly copies 64-bits.

Bug: 16386215

Change-Id: Ia59b2c2af72ce5202c7b62413687aedb48cfd25e
147eb41b53729ec8d5c188d1cac90964a51afb8a 11-Jul-2014 Dave Allison <dallison@google.com> Revert "Revert "Revert "Revert "Add implicit null and stack checks for x86""""

This reverts commit 0025a86411145eb7cd4971f9234fc21c7b4aced1.

Bug: 16256184
Change-Id: Ie0760a0c293aa3b62e2885398a8c512b7a946a73

Conflicts:
compiler/dex/quick/arm64/target_arm64.cc
compiler/image_test.cc
runtime/fault_handler.cc
69dfe51b684dd9d510dbcb63295fe180f998efde 11-Jul-2014 Dave Allison <dallison@google.com> Revert "Revert "Revert "Revert "Add implicit null and stack checks for x86""""

This reverts commit 0025a86411145eb7cd4971f9234fc21c7b4aced1.

Bug: 16256184
Change-Id: Ie0760a0c293aa3b62e2885398a8c512b7a946a73
7fb36ded9cd5b1d254b63b3091f35c1e6471b90e 10-Jul-2014 Dave Allison <dallison@google.com> Revert "Revert "Add implicit null and stack checks for x86""

Fixes x86_64 cross compile issue. Removes command line options
and property to set implicit checks - this is hard coded now.

This reverts commit 3d14eb620716e92c21c4d2c2d11a95be53319791.

Change-Id: I5404473b5aaf1a9c68b7181f5952cb174d93a90d
0025a86411145eb7cd4971f9234fc21c7b4aced1 11-Jul-2014 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Revert "Add implicit null and stack checks for x86"""

Broke the build.

This reverts commit 7fb36ded9cd5b1d254b63b3091f35c1e6471b90e.

Change-Id: I9df0e7446ff0913a0e1276a558b2ccf6c8f4c949
34e826ccc80dc1cf7c4c045de6b7f8360d504ccf 29-May-2014 Dave Allison <dallison@google.com> Add implicit null and stack checks for x86

This adds compiler and runtime changes for x86
implicit checks. 32 bit only.

Both host and target are supported.
By default, on the host, the implicit checks are null pointer and
stack overflow. Suspend is implemented but not switched on.

Change-Id: I88a609e98d6bf32f283eaa4e6ec8bbf8dc1df78a
3d14eb620716e92c21c4d2c2d11a95be53319791 10-Jul-2014 Dave Allison <dallison@google.com> Revert "Add implicit null and stack checks for x86"

It breaks cross compilation with x86_64.

This reverts commit 34e826ccc80dc1cf7c4c045de6b7f8360d504ccf.

Change-Id: I34ba07821fc0a022fda33a7ae21850957bbec5e7
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
7ac7e32fb84b6a933181d31694d8a2d81ddca6d6 28-Jun-2014 Elliott Hughes <enh@google.com> Fix the x86 textrel and remove -Wl,--no-fatal-warnings.

Bug: 11358761
Change-Id: I825cecce121a9011f74c5fdf77d1fbecd30adbc7
bd3682eada753de52975ae2b4a712bd87dc139a6 11-Jun-2014 Alexei Zavjalov <alexei.zavjalov@intel.com> ART: Implement rem_double/rem_float for x86/x86-64

This adds inlined version of the rem_double/rem_float bytecodes
for x86/x86-64 platforms. This patch also removes unnecessary
fmod and fmodf stubs from runtime.

Change-Id: I2311aa2adf08d6614527e0da070e3b6ce2343a20
Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
e3d5581266301e6a672af6233220037abf52fea1 11-Jun-2014 Ian Rogers <irogers@google.com> Fix host Mac build.

Ptr - ptr is an int not size_t on the Mac.
Fix use of assembly literal macro.
Remove forgotten about WITH_HOST_DALVIK.

Change-Id: I64db1927b2c6a145b6a96ffcc33d704914bba1bb
c5f17732d8144491c642776b6b48c85dfadf4b52 06-Jun-2014 Ian Rogers <irogers@google.com> Remove deprecated WITH_HOST_DALVIK.

Bug: 13751317
Fix the Mac build:
- disable x86 selector removal that causes OS/X 10.9 kernel panics,
- madvise don't need does zero memory on the Mac, factor into MemMap
routine,
- switch to the elf.h in elfutils to avoid Linux kernel dependencies,
- we can't rely on exclusive_owner_ being available from other pthread
libraries so maintain our own when futexes aren't available (we
can't rely on the OS/X 10.8 hack any more),
- fix symbol naming in assembly code,
- work around C library differences,
- disable backtrace in DumpNativeStack to avoid a broken libbacktrace
dependency,
- disable main thread signal handling logic,
- align the stack in stub_test,
- use $(HOST_SHLIB_SUFFIX) rather than .so in host make file variables.

Not all host tests are passing on the Mac with this change. dex2oat
works as does running HelloWorld.
Change-Id: I5a232aedfb2028524d49daa6397a8e60f3ee40d3
779f8c951c0fbe36d4b213113a99541132947bb7 10-Jun-2014 Andreas Gampe <agampe@google.com> ART: Generic JNI for x86

Add the generic JNI trampoline for x86. Small cleanup in the C code.

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

Merge ART from AOSP to lmp-preview-dev.

Change-Id: I0f578733a4b8756fd780d4a052ad69b746f687a9
8792ae10c0c2ed20c743806522eceeaf0e016e19 22-May-2014 Serguei Katkov <serguei.i.katkov@intel.com> x86: art_quick_instrumentation_entry should not use offset address

art_quick_instrumentation_entry uses offset of the address
instead of full adress but this address is used in ret instruction
which does not expect it.

Change-Id: I9e576037d7adf14a7e9fa8f6d4aba4ee540fcc14
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
1d4d7bdafd0c3d4df7bf8e907b08db9669db7023 23-May-2014 Alexei Zavjalov <alexei.zavjalov@intel.com> ART: refactor x86/x86-64 entrypoints

This patch:

- removes unused stubs in x86/64 runtimes (art_quick_l2d, art_quick_l2f
and art_quick_idivmod)
- replaces art_quick_fmod, art_quick_fmodf and art_quick_is_assignable
entrypoints in x86-64 to the direct calls
- removes art_quick_indexof stub in x86-64

Change-Id: I6141c5c73b0b449fa3b866068b101e0be211b93e
Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
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
47d00c0a893b13b69e4bac1836e10cc3e1812d41 17-Apr-2014 Ian Rogers <irogers@google.com> Add untested x86-64 downcall and exception assembly.

Change-Id: Ic555f9f5af8c3a2110a92e55772ff6c0128e5c19
e78d4e1a7066d2bc60d265eb27e78b336df941dd 07-Apr-2014 Serguei Katkov <serguei.i.katkov@intel.com> art_quick_unlock_object uses comparison incorrectly

art_quick_unlock_object incrrectly checks the thin lock condition.
The patch fixes this issue.

Change-Id: I9e2fcf89c9e9cb34aca72ed001672fd83cd53377
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
8ef84afbaeb433adaed98a11902502dd733e5222 03-Apr-2014 Serguei Katkov <serguei.i.katkov@intel.com> art_quick_lock_object uses registers incorrectly

x86 implementation of art_quick_lock_object uses registers
incorrectly in the case of .Lalready_thin. eax points to object
while it is used as holding the lock word.

The patch fixes this.

Change-Id: Iacf1a40c6570fae78a5504ca3b2f1218631f7a8f
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
bf6b92a158053c98b15f4393abb3b86344ec9a20 06-Mar-2014 Andreas Gampe <agampe@google.com> Generic JNI implementation for x86_64

Starting implementation for generic JNI on x86_64. Frames are of
large static size (>4K) right now, should be compacted later. Passes
the whole of jni_compiler_test.

Change-Id: I88ac3e13a534afe7568d62a1ef97cb766e8260e4
2da882315a61072664f7ce3c212307342e907207 27-Feb-2014 Andreas Gampe <agampe@google.com> Initial changes towards Generic JNI option

Some initial changes that lead to an UNIMPLEMENTED. Works
by not compiling for JNI right now and tracking native methods
which have neither quick nor portable code. Uses new trampoline.

Change-Id: I5448654044eb2717752fd7359f4ef8bd5c17be6e
4554bfdc2859712a763a12e35a4176914fc7c994 26-Feb-2014 Alexei Zavjalov <alexei.zavjalov@intel.com> Incorrect result of compareTo between empty and non-empty strings

Current implementation of the Strings.compareTo() handles the case when
empty string compares to non-empty string in the wrong way.

This patch adds handler for such cases.

Change-Id: I35cc2cfd5141551d6da65748c44b59e64a3f8117
Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
8016a12a5f9c2ea70b52e353a0169ba836ee9402 22-Feb-2014 Ian Rogers <irogers@google.com> Make X86 assembly labels local.

Avoids the symbols being part of the symbol file and confusing tools like gdb.

Change-Id: I4c40b0d42964e6b2e3fa135320e603b5b41ea0e1
4028a6c83a339036864999fdfd2855b012a9f1a7 20-Feb-2014 Mark Mendell <mark.p.mendell@intel.com> Inline x86 String.indexOf

Take advantage of the presence of a constant search char or start index
to tune the generated code.

Change-Id: I0adcf184fb91b899a95aa4d8ef044a14deb51d88
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
0177e53ea521ad58b70c305700dab32f1ac773b7 12-Feb-2014 Ian Rogers <irogers@google.com> Work in the direction of hard float quick ABIs.

Pass a shorty to ArtMethod::Invoke so that register setup can use it.
Document x86-64 ABI.
Add extra debug output for one JNI native method registration fails, namely a
dump of the Class and its dex file's location.
Add hack to get testing of OatMethod's without GC maps working in 64bit.

Change-Id: Ic06b68e18eac33637df2caf5e7e775ff95ae70f3
ef7d42fca18c16fbaf103822ad16f23246e2905d 06-Jan-2014 Ian Rogers <irogers@google.com> Object model changes to support 64bit.

Modify mirror objects so that references between them use an ObjectReference
value type rather than an Object* so that functionality to compress larger
references can be captured in the ObjectRefererence implementation.
ObjectReferences are 32bit and all other aspects of object layout remain as
they are currently.

Expand fields in objects holding pointers so they can hold 64bit pointers. Its
expected the size of these will come down by improving where we hold compiler
meta-data.
Stub out x86_64 architecture specific runtime implementation.
Modify OutputStream so that reads and writes are of unsigned quantities.
Make the use of portable or quick code more explicit.
Templatize AtomicInteger to support more than just int32_t as a type.
Add missing, and fix issues relating to, missing annotalysis information on the
mutator lock.
Refactor and share implementations for array copy between System and uses
elsewhere in the runtime.
Fix numerous 64bit build issues.

Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
bb8f0ab736b61db8f543e433859272e83f96ee9b 28-Jan-2014 Hiroshi Yamauchi <yamauchi@google.com> Embed array class pointers at array allocation sites.

Following https://android-review.googlesource.com/#/c/79302, embed
array class pointers at array allocation sites in the compiled code.

Change-Id: I67a1292466dfbb7f48e746e5060e992dd93525c5
be1ca55db3362f5b100c4c65da5342fd299520bb 15-Jan-2014 Hiroshi Yamauchi <yamauchi@google.com> Use direct class pointers at allocation sites in the compiled code.

- Rather than looking up a class from its type ID (and checking if
it's resolved/initialized, resolving/initializing if not), use
direct class pointers, if possible (boot-code-to-boot-class pointers
and app-code-to-boot-class pointers.)
- This results in a 1-2% speedup in Ritz MemAllocTest on Nexus 4.
- Embedding the object size (along with class pointers) caused a 1-2%
slowdown in MemAllocTest and isn't implemented in this change.
- TODO: do the same for array allocations.
- TODO: when/if an application gets its own image, implement
app-code-to-app-class pointers.
- Fix a -XX:gc bug.
cf. https://android-review.googlesource.com/79460/
- Add /tmp/android-data/dalvik-cache to the list of locations to
remove oat files in clean-oat-host.
cf. https://android-review.googlesource.com/79550
- Add back a dropped UNLIKELY in FindMethodFromCode().
cf. https://android-review.googlesource.com/74205

Bug: 9986565
Change-Id: I590b96bd21f7a7472f88e36752e675547559a5b1
b10a57da80cd8e53582c9b13aba5014dc1e69929 22-Jan-2014 Mark Mendell <mark.p.mendell@intel.com> Fix non-PLT text relocation introduced by CL 79466

One 'PLT_SYMBOL' was missed. Breaks target tests again.

Change-Id: I67cb4c1b54f889a9935dab4a87da52ae412efb17
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
3f2d031f639b3b9dd4adbf9e70d23de931a9801d 21-Jan-2014 Mark Mendell <mark.p.mendell@intel.com> Use macros to remove CFI information for MAC OS/X

Place allocation macros inline for x86 as the macros aren't/can't
go through the Linux/OSX normalizing macro wrappers.
Switch to clang for OS/X host build thereby enabling -std=gnu++11
and -Wthread-safety. Remove the -Wstrict-aliasing numeric option
as 3 is the default warning level and warning levels aren't
supported by clang's command line.

This builds as far as gtests which fail due to assumptions they
would only ever compile on non-GCC with RTTI.

Change-Id: Id0d83578e9b93b0f6aea5e9b8ddf2815f0dcd8aa
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
a9abe872ad5ad6128d6f3fb018b6447962303ecc 10-Jan-2014 Mark Mendell <mark.p.mendell@intel.com> Make x86 runtime PIC

The existing code in runtime/arch/x86 doesn't use PIC code to call
routines, and this causes a message that libart{,d}.so having text
relocations to be genartion. That message, in turn, messes up running
the art-target tests.

Change-Id: I7fe5dbb8eed458a0f7bd3713566ee38a5db8e904
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
da0a4dbede243c5ac473db88d44ba6139e7dd87e 03-Jan-2014 Ian Rogers <irogers@google.com> Remove extraneous CFI from x86 entrypoints to fix backtrace.

PUSH/POP are macros that already handle cfi save/restore.

Change-Id: I95765e7c4d66acfa2f115ebb343fbab4eca33c08
7410f29b4dae223befac036ea567d7f33351dad1 24-Nov-2013 Mathieu Chartier <mathieuc@google.com> Fix dumpsys meminfo <pid>.

Added a case for BumpPointerSpaces. Confirmed working non-debug.
Should also work in debug builds.

Bug: 11830794
Change-Id: I12053ff16eec403dcd4a780e13095e3212a77132
cbb2d20bea2861f244da2e2318d8c088300a3710 15-Nov-2013 Mathieu Chartier <mathieuc@google.com> Refactor allocation entrypoints.

Adds support for switching entrypoints during runtime. Enables
addition of new allocators with out requiring significant copy
paste. Slight speedup on ritzperf probably due to more inlining.

TODO: Ensuring that the entire allocation path is inlined so
that the switch statement in the allocation code is optimized
out.

Rosalloc measurements:
4583
4453
4439
4434
4751

After change:
4184
4287
4131
4335
4097

Change-Id: I1352a3cbcdf6dae93921582726324d91312df5c9
590fee9e8972f872301c2d16a575d579ee564bee 13-Sep-2013 Mathieu Chartier <mathieuc@google.com> Compacting collector.

The compacting collector is currently similar to semispace. It works by
copying objects back and forth between two bump pointer spaces. There
are types of objects which are "non-movable" due to current runtime
limitations. These are Classes, Methods, and Fields.

Bump pointer spaces are a new type of continuous alloc space which have
no lock in the allocation code path. When you allocate from these it uses
atomic operations to increase an index. Traversing the objects in the bump
pointer space relies on Object::SizeOf matching the allocated size exactly.

Runtime changes:
JNI::GetArrayElements returns copies objects if you attempt to get the
backing data of a movable array. For GetArrayElementsCritical, we return
direct backing storage for any types of arrays, but temporarily disable
the GC until the critical region is completed.

Added a new runtime call called VisitObjects, this is used in place of
the old pattern which was flushing the allocation stack and walking
the bitmaps.

Changed image writer to be compaction safe and use object monitor word
for forwarding addresses.

Added a bunch of added SIRTs to ClassLinker, MethodLinker, etc..

TODO: Enable switching allocators, compacting on background, etc..

Bug: 8981901

Change-Id: I3c886fd322a6eef2b99388d19a765042ec26ab99
bbb32c277b800a8ee378c16a3645ab6d4d19aef1 06-Nov-2013 Dave Allison <dallison@google.com> Add .cfi_restore for assembly functions

Bug: 11256318

This adds .cfi_restore directives to the assembly language functions
for ARM, MIPS and x86.

Change-Id: Ic5a80e190aa6cf2d2fcfaecec14de03221ff386b
ad2541a59c00c2c69e8973088891a2b5257c9780 25-Oct-2013 Mathieu Chartier <mathieuc@google.com> Fix object identity hash.

The object identity hash is now stored in the monitor word after
being computed. Hashes are computed by a pseudo random number
generator.

When we write the image, we eagerly compute object hashes to
prevent pages getting dirtied.

Bug: 8981901

Change-Id: Ic8edacbacb0afc7055fd740a52444929f88ed564
88474b416eb257078e590bf9bc7957cee604a186 24-Oct-2013 Jeff Hao <jeffhao@google.com> Implement Interface Method Tables (IMT).

Change-Id: Idf7fe85e1293453a8ad862ff2380dcd5db4e3a39
1984152ac92aad244ae15184d12f9ceade686b7b 22-Oct-2013 Mathieu Chartier <mathieuc@google.com> Add missing callee save restore to quick entrypoints.

Added callee save restoration to art_quick_proxy_invoke_handler,
art_quick_resolution_trampoline, art_quick_to_interpreter_bridge.

Bug: 8981901

Change-Id: Iaa5bf862834b49cc48bce4f4ffa34a6797024e6d
2a6c7b7c21adcd4493542604305585b852ccf554 16-Oct-2013 Mathieu Chartier <mathieuc@google.com> Restore callee save registers.

The callee saves weren't all being restored as an optimiation, but
this breaks compaction if register promotion is enabled. The reason
for this is that these registers may contain references which the
GC will update.

Change-Id: I810f56b4ed1f92c632155e30c0838269cb95f3c5
a9a8254c920ce8e22210abfc16c9842ce0aea28f 04-Oct-2013 Ian Rogers <irogers@google.com> Improve quick codegen for aput-object.

1) don't type check known null.
2) if we know types in verify don't check at runtime.
3) if we're runtime checking then move all the code out-of-line.

Also, don't set up a callee-save frame for check-cast, do an instance-of test
then throw an exception if that fails.
Tidy quick entry point of Ldivmod to Lmod which it is on x86 and mips.
Fix monitor-enter/exit NPE for MIPS.
Fix benign bug in mirror::Class::CannotBeAssignedFromOtherTypes, a byte[]
cannot be assigned to from other types.

Change-Id: I9cb3859ec70cca71ed79331ec8df5bec969d6745
d9c4fc94fa618617f94e1de9af5f034549100753 02-Oct-2013 Ian Rogers <irogers@google.com> Inflate contended lock word by suspending owner.

Bug 6961405.
Don't inflate monitors for Notify and NotifyAll.
Tidy lock word, handle recursive lock case alongside unlocked case and move
assembly out of line (except for ARM quick). Also handle null in out-of-line
assembly as the test is quick and the enter/exit code is already a safepoint.
To gain ownership of a monitor on behalf of another thread, monitor contenders
must not hold the monitor_lock_, so they wait on a condition variable.
Reduce size of per mutex contention log.
Be consistent in calling thin lock thread ids just thread ids.
Fix potential thread death races caused by the use of FindThreadByThreadId,
make it invariant that returned threads are either self or suspended now.

Code size reduction on ARM boot.oat 0.2%.
Old nexus 7 speedup 0.25%, new nexus 7 speedup 1.4%, nexus 10 speedup 2.24%,
nexus 4 speedup 2.09% on DeltaBlue.

Change-Id: Id52558b914f160d9c8578fdd7fc8199a9598576a
3b4c18933c24b8a33f38573c2ebcdb9aa16efeb5 13-Sep-2013 Hiroshi Yamauchi <yamauchi@google.com> Split the allocation path into 'instrumented' and 'uninstrumented'
ones.

The instrumented path is equivalent to the existing allocation path
that checks for three instrumentation mechanisms (the debugger
allocation tracking, the runtime allocation stats collection, and
valgrind) for every allocation. The uinstrumented path does not
perform these checks. We use the uninstrumented path by default and
enable the instrumented path only when any of the three mechanisms is
enabled. The uninstrumented version of Heap::AllocObject() is inlined.

This change improves the Ritz MemAllocTest by ~4% on Nexus 4 and ~3%
on Host/x86.

Bug: 9986565
Change-Id: I3e68dfff6789d77bbdcea98457b694e1b5fcef5f
468532ea115657709bc32ee498e701a4c71762d4 05-Aug-2013 Ian Rogers <irogers@google.com> Entry point clean up.

Create set of entry points needed for image methods to avoid fix-up at load time:
- interpreter - bridge to interpreter, bridge to compiled code
- jni - dlsym lookup
- quick - resolution and bridge to interpreter
- portable - resolution and bridge to interpreter

Fix JNI work around to use JNI work around argument rewriting code that'd been
accidentally disabled.
Remove abstact method error stub, use interpreter bridge instead.
Consolidate trampoline (previously stub) generation in generic helper.
Simplify trampolines to jump directly into assembly code, keeps stack crawlable.
Dex: replace use of int with ThreadOffset for values that are thread offsets.
Tidy entry point routines between interpreter, jni, quick and portable.

Change-Id: I52a7c2bbb1b7e0ff8a3c3100b774212309d0828e
(cherry picked from commit 848871b4d8481229c32e0d048a9856e5a9a17ef9)
848871b4d8481229c32e0d048a9856e5a9a17ef9 05-Aug-2013 Ian Rogers <irogers@google.com> Entry point clean up.

Create set of entry points needed for image methods to avoid fix-up at load time:
- interpreter - bridge to interpreter, bridge to compiled code
- jni - dlsym lookup
- quick - resolution and bridge to interpreter
- portable - resolution and bridge to interpreter

Fix JNI work around to use JNI work around argument rewriting code that'd been
accidentally disabled.
Remove abstact method error stub, use interpreter bridge instead.
Consolidate trampoline (previously stub) generation in generic helper.
Simplify trampolines to jump directly into assembly code, keeps stack crawlable.
Dex: replace use of int with ThreadOffset for values that are thread offsets.
Tidy entry point routines between interpreter, jni, quick and portable.

Change-Id: I52a7c2bbb1b7e0ff8a3c3100b774212309d0828e
834b394ee759ed31c5371d8093d7cd8cd90014a8 31-Jul-2013 Brian Carlstrom <bdc@google.com> Merge remote-tracking branch 'goog/dalvik-dev' into merge-art-to-dalvik-dev

Change-Id: I323e9e8c29c3e39d50d9aba93121b26266c52a46
7655f29fabc0a12765de828914a18314382e5a35 29-Jul-2013 Ian Rogers <irogers@google.com> Portable refactorings.

Separate quick from portable entrypoints.
Move architectural dependencies into arch.

Change-Id: I9adbc0a9782e2959fdc3308215f01e3107632b7c
166db04e259ca51838c311891598664deeed85ad 26-Jul-2013 Ian Rogers <irogers@google.com> Move assembler out of runtime into compiler/utils.

Other directory layout bits of clean up. There is still work to separate quick
and portable in some files (e.g. argument visitor, proxy..).

Change-Id: If8fecffda8ba5c4c47a035f0c622c538c6b58351