History log of /art/oatdump/oatdump.cc
Revision Date Author Comments
c9dbb1df3b5c06ba122cacaf35b17cb53c6be3c6 04-Jun-2016 Mathieu Chartier <mathieuc@google.com> Revert "Revert "Hold dex caches live in class table""

Bug: 29083330

This reverts commit f102faf1bcbdb2149e3e7bf27b1819f621b7894b.

Change-Id: Ibc6d260247b3113beec7d33552061512a36c9ce8
f102faf1bcbdb2149e3e7bf27b1819f621b7894b 04-Jun-2016 Brian Carlstrom <bdc@google.com> Revert "Hold dex caches live in class table"

This reverts commit d6d49e56c2b7b11f474acb80cb02bb1fe9b7861e.

Bug: 29083330
Change-Id: Ie209b27897b8079f2d13fd0837fe5f83a7e61afc
d6d49e56c2b7b11f474acb80cb02bb1fe9b7861e 02-Jun-2016 Mathieu Chartier <mathieuc@google.com> Hold dex caches live in class table

Prevents temporary dex caches being unloaded for the same dex file.
Usually this is OK, but if someone resolved a string in that dex
cache, it could leave stale pointers in BSS. Also it can use extra
memory in linear alloc if we allocate dex cache arrays multiple
times.

Bug: 29083330

(cherry picked from commit f284d448e3edd428b6ade473d0993028638b2064)

Change-Id: Ie1b0b0cf835a998e19227cbb90014011a6cd40c4
a6e95b32d499811bbb37602fc7446a5a0d05b9f8 11-May-2016 Aart Bik <ajcbik@google.com> Fix oatdump crash on arm64/arm code.
Also adds 16 bit literal information.

Rationale:
When "run-away" instructions are disassembled, the literal
addresses may go out of range, causing oatdump to crash.
This CL guards memory access against the full memory range
allocated to assembly instructions and data (it is possible
but not really necessary to refine this a bit). Out of range
arguments are now displayed as (?) to denote the issue, which
is a lot nicer than crashing.

BUG=28670871

(cherry picked from commit d3059e77818a058513ed92557160bdb6d5102b67)

Change-Id: I322bbdf83509e253430c40428a05c0ad16b81354
00bb716039d23e02797a3858fcdb0380a9bb8855 30-Apr-2016 Andreas Gampe <agampe@google.com> ART: Dump more OatDexFile data in oatdump

Add some stats about the enclosed dex file and type table when
dumping an oat file.

Bug: 28251566
Change-Id: I80c14e85d68cd1e3e4c64b7b9d86059d5ac8a6ad
cdca476bf3394ce9d97a369e84e701b427009318 28-Apr-2016 Mathieu Chartier <mathieuc@google.com> Revert "Revert "Write conflict tables in image""

Added test.

Bug: 27906566

This reverts commit 8e2478d23e89a7022c93ddc608dcbba7b29b91e6.

Change-Id: I0894f5f7cd11af29ed9d0345b51f527fc8a41d19
8e2478d23e89a7022c93ddc608dcbba7b29b91e6 27-Apr-2016 Mathieu Chartier <mathieuc@google.com> Revert "Write conflict tables in image"

Some strange issues on angler.

This reverts commit cda9386add68d94697449c6cb08b356747e55c21.

Change-Id: Iba3a8bac6ce40ee16d83163823356951fecb6787
cda9386add68d94697449c6cb08b356747e55c21 14-Apr-2016 Mathieu Chartier <mathieuc@google.com> Write conflict tables in image

Add image sections for runtime methods and conflict tables. This
makes it that we do not need to fake up a length prefixed array
for runtime methods.

Reduces .art private dirty and PSS.

System wide .art PSS goes from 32.5MB to 30.5MB after system boot.

Business card .art private dirty goes from 588K to 504K.

Increases image size by ~100K.

Bug: 27906566

Change-Id: I38cbe3150c3eeb385b8cad7cf93614e3980f4162
adbf93edb12dee174be3c5cad4d65ea97b40ffb5 08-Apr-2016 Vladimir Marko <vmarko@google.com> Oatdump: Smarter StackMap lookup to improve performance.

Shaves off roughly 10% from the oatdump_test time.

Bug: 27824283
Change-Id: I6c2fd3b1db2723871641d43aeb543581d405cfcb
9c0bce46d93ea443cf4bc0163666475c4f928d73 31-Mar-2016 David Srbecky <dsrbecky@google.com> Fix thumb bit in the oatdump symbolizer.

MethodDebugInfo expects code address without the bit set.
Therefore we need to clear it before passing it to the DWARF writer.

(cherry picked from commit a1b4c5f562c67398e14756bd127ed806937ff35a)
Bug: 28017942
Change-Id: I37586b19f2a3fc95107abb6204a34e95a3816936
9d07e3d128ccfa0ef7670feadd424a825e447d1d 31-Mar-2016 Vladimir Marko <vmarko@google.com> Clean up OatQuickMethodHeader after Quick removal.

This reduces the size of the pre-header by 8 bytes, reducing
oat file size and mmapped .text section size. The memory
needed to store a CompiledMethod by dex2oat is also reduced,
for 32-bit dex2oat by 8B and for 64-bit dex2oat by 16B. The
aosp_flounder-userdebug 32-bit and 64-bit boot.oat are each
about 1.1MiB smaller.

Disable the broken StubTest.IMT, b/27991555 .

Change-Id: I05fe45c28c8ffb7a0fa8b1117b969786748b1039
09ed09866da6d8c7448ef297c148bfa577a247c2 12-Feb-2016 David Srbecky <dsrbecky@google.com> Pack stack map entries on bit level to save space.

Use only the minimum number of bits required to store stack map data.
For example, if native_pc needs 5 bits and dex_pc needs 3 bits, they
will share the first byte of the stack map entry.

The header is changed to store bit offsets of the fields rather than
byte sizes. Offsets also make it easier to access later fields without
calculating sum of all previous sizes.

All of the header fields are byte sized or encoded as ULEB128 instead
of the previous fixed size encoding. This shrinks it by about half.

It saves 3.6 MB from non-debuggable boot.oat (AOSP).
It saves 3.1 MB from debuggable boot.oat (AOSP).

It saves 2.8 MB (of 99.4 MB) from /system/framework/arm/ (GOOG).
It saves 1.0 MB (of 27.8 MB) from /system/framework/oat/arm/ (GOOG).

Field loads from stackmaps seem to get around 10% faster.
(based on the time it takes to load all stackmap entries from boot.oat)

Bug: 27640410
Change-Id: I8bf0996b4eb24300c1b0dfc6e9d99fe85d04a1b7
a1b4c5f562c67398e14756bd127ed806937ff35a 31-Mar-2016 David Srbecky <dsrbecky@google.com> Fix thumb bit in the oatdump symbolizer.

MethodDebugInfo expects code address without the bit set.
Therefore we need to clear it before passing it to the DWARF writer.

Change-Id: I37586b19f2a3fc95107abb6204a34e95a3816936
bf9611f821697b14bf9e170f503c3f47613b046b 26-Mar-2016 Andreas Gampe <agampe@google.com> ART: Clean up verifier

Clean up verifier post-Quick.

Change-Id: I0b05e10dd06edd228fe2068c8afffc4b7d7fdffa
796d63050a18f263b93ea34951a61deaecab3422 13-Mar-2016 Nicolas Geoffray <ngeoffray@google.com> Add an ImtConflictTable to better resolve IMT conflicts.

- Attach a ImtConflictTable to conflict runtime ArtMethod.
- Initially 0, a new one will be created at the first hit of
the conflict method.
- If the assembly code does not find a target method in the table,
we will create a new one again, copying the data from the previous
table and adding the new mapping.

Implemented for arm/arm64/x86/x64.

bug:27556801
bug:24769046

Change-Id: Ie74d1c77cf73d451a1142bdc5e3683f9f84bb4e7
0b4cbd0c2a75b47ae09d21e5d73d2b1709cb5b9e 09-Mar-2016 Mathieu Chartier <mathieuc@google.com> Add oatdump support for app images

Example usage on host:
oatdumpd --app-oat=art/plus32.odex --app-image=art/plus32.art
--image=art/oats/system@framework@boot.art --instruction-set=arm

TODO: Add to oatdump test.

Bug: 27408512
Bug: 22858531

(cherry picked from commit bcb6a72569a1401b36a3ad3b6aa4d13e29966cf0)

Change-Id: I9d1aa7eaa16795e5fbabc6974d245849e16b1d03
bcb6a72569a1401b36a3ad3b6aa4d13e29966cf0 09-Mar-2016 Mathieu Chartier <mathieuc@google.com> Add oatdump support for app images

Example usage on host:
oatdumpd --app-oat=art/plus32.odex --app-image=art/plus32.art
--image=art/oats/system@framework@boot.art --instruction-set=arm

TODO: Add to oatdump test.

Bug: 27408512
Bug: 22858531

Change-Id: I320db8b76c780c6eadabcb45ce88f45950741484
5d950769b607b4f76413212db640a32d796911de 07-Mar-2016 David Srbecky <dsrbecky@google.com> Symbolize native debug information for AOTed methods in boot.oat.

The oatdump symbolizer will produce all DWARF information now,
not just the symtab. This allows us to recover almost all native
debug information after the fact, even for non-debuggable oat files.

The main drawback is that non-debuggable oat files do not have
enough stackmaps to provide reasonable line stepping experience.
We might also be missing inlined methods from backtraces.

Change-Id: I73ff6f43a3a0e5a0907af353f74f04e9b0129590
2fdd03c982386e1d13aed9f1b51e1f0eee237971 10-Mar-2016 David Srbecky <dsrbecky@google.com> Add symbolizer option to generate debug information only.

There is no need to copy the .rodata and .text sections since the
consumers can get their data form the original ELF file. We mark
those section as SHT_NOBITS instead, which is the standard way to
create ELF file with separate debug information only.

The new option is called --only-keep-debug and it essentially has
the same effect as --only-keep-debug option for "strip" command.

Change-Id: I4f7488c04bbad86288beeda11c3bf295890e740d
197160d47f34238cb5e7444fa4c2de300db8e2c6 07-Mar-2016 David Srbecky <dsrbecky@google.com> Refactor MethodDebugInfo (input of DWARF writer).

Do not pass CompiledMethod pointer through since it is only available
during AOT compile but not during JIT compile or at runtime. Creating
mock CompiledMethod just pass data is proving increasingly tricky, so
copy the fields that we need to MethodDebugInfo instead.

Change-Id: I820297b41e769fcac488c0ff2d2ea0492bb13ed8
2d8614bf1ba44468c834d9d3d5562466637f63f2 08-Mar-2016 Andreas Gampe <agampe@google.com> ART: Use the right ElfBuilder for oatdump symbolizer

We should not unconditionally output 32-bit ELF files.

Bug: 27293423
Change-Id: Ibbb74a7807b24c46cb23d7b5867936569424e8fe
316a2186b7fa9e03187d45ac0fa320f4dff1f3df 18-Sep-2015 Douglas Leung <douglas.leung@imgtec.com> Add Mips abiflags section to the oatfile.

Once this patch is merged, then the workaround patch:
0acb15ead6a554a6879b29fd90726b9ea8fd98c4
in bionic can be removed.

Change-Id: Ie06a3c4e384a23a77db7d04a2508edbf3a6d3933
5d8112029d0e085c5a0099257daa4c7e29c12310 08-Mar-2016 David Srbecky <dsrbecky@google.com> Propagate InstructionSetFeatures to ElfBuilder.

This is subset of CL171665 and it separates it into two.
It will be needed to generate .MIPS.abiflags ELF section.

Change-Id: I5557e7cb98d0fa1dc57c85cf6161e119c6d50a1a
c03d7b6bcac15ce8f829fee654b91a7e4583769d 02-Mar-2016 David Brazdil <dbrazdil@google.com> oatdump: Add option to print just the header

Sometimes that's all one needs.

Change-Id: I0c442ed32f1662ad0b37dc2fccedd964ed1b1466
944da603cde59a4277f3bbc31d860a90842a1a2a 19-Feb-2016 Vladimir Marko <vmarko@google.com> ART: Allow method references across oat files for multi-image, 2nd attempt.

These were disabled because we didn't have sufficient
information about the multi-image layout when processing
link-time patches in OatWriter. This CL refactors the
ELF file creation so that the information is available.

Also clean up ImageWriter to use oat file indexes instead
of filenames and avoid reopening the oat file to retrieve
the checksum.

Change-Id: Icc7b528deca29da1e473c8f079521a36d6c4892f
45724f9a0cc38dbb3071beb3eeab96499868b49c 17-Feb-2016 Vladimir Marko <vmarko@google.com> Revert "Allow method references across oat files for multi-image."

Breaks Quick tests.

This reverts commit 6065402316da2b51eed5fc34cffbd991766bd408.

Change-Id: I8a5469ba7cea5f46b85cb489b3e0ef06ed548f03
6065402316da2b51eed5fc34cffbd991766bd408 16-Feb-2016 Vladimir Marko <vmarko@google.com> Allow method references across oat files for multi-image.

These were disabled because we didn't have sufficient
information about the multi-image layout when processing
link-time patches in OatWriter. This CL refactors the
ELF file creation so that the information is available.

Change-Id: I6f2e8dc8572d143c72cc2693bb0ba4fd76f889ab
9e49ab114a367203256f11545c42162a419ee880 28-Jan-2016 Tamas Berghammer <tberghammer@google.com> Add a comment to oatdump for 0 size symbols

The symbolizer inside oatdump generates 0 size symbols for the
trampoline symbols. Add a comment explaining why we emitting them with
0 size.

Change-Id: I16ed87554681ce57aafc26517a1e674647b5f9ac
ace0dc1dd5480ad458e622085e51583653853fb9 20-Jan-2016 Andreas Gampe <agampe@google.com> ART: Add option to ensure deterministic compilation

To ensure reliable stable generation of a boot image, add a flag
for forced determinism, trading compile time for a deterministic
output.

We have to run certain passes in the compiler-driver single-threaded.
It is also necessary to try to make the heap layout deterministic.
Switch to nonconcurrent GC, use the free-list implementation for LOS,
and try to allocate the main space at a known location. This is best
effort at the moment.

To allow the compiler phase to be parallelized, const-strings need
to be created beforehand.

The identity hashcode seed needs to be pinned.

Besides the Dex object we also need to null the DexFile pointer in
dex caches.

For classes, we need to remove the clinit thread ID.

Fix oatdump alignment padding accounting.

Bug: 26687569
Change-Id: Ia82120e8f715bb3691d861817b12778ac677355a
8f75c455ab41abe709e6e801cf360dbe079d5ffa 26-Jan-2016 Tamas Berghammer <tberghammer@google.com> Emit symbol names for trampoline symbols in oatdump

Modify the symbolizer functionality of oatdump to emit symbols for
the trampolines in the begining of each oat file.

Change-Id: I083c160ff54784f904743f87bcc18881e6ce0603
4a26f17b055cadc949c3e9fdfa637fe5656339d9 26-Jan-2016 Mathieu Chartier <mathieuc@google.com> Remove GetImageRoots read barrier for image relocation

Fixes CC assertion that failed if an app image was loaded when the GC
was running.

Bug: 26786304
Change-Id: I47bea7b4b947332b57be2e2db604c2c25d92b7e2
5b1c2ca30dad519be285f0a1e839c23cc4e3a51d 25-Jan-2016 David Srbecky <dsrbecky@google.com> Revert "Revert "Add option to generate compressed backtrace info.""

This reverts commit 8546cc9aeb05e866e1fb6a9e4130d53ea330baa8.

Change-Id: I676fdf9af27fa3b16fa8921778ff8832ab8c437d
8546cc9aeb05e866e1fb6a9e4130d53ea330baa8 25-Jan-2016 David Srbecky <dsrbecky@google.com> Revert "Add option to generate compressed backtrace info."

This reverts commit 5fdcc3c931b70204fd8c491afa66f57f8428490f.

Change-Id: I9c1f5aad6933a46af6717e3a90a51f76111f9c8a
5fdcc3c931b70204fd8c491afa66f57f8428490f 19-Jan-2016 David Srbecky <dsrbecky@google.com> Add option to generate compressed backtrace info.

Add flag --generate-mini-debug-info which generates
LZMA compressed .symtab and .debug_frame, which are
sufficient to print java backtraces in libunwind.

If enabled, it increases the size of boot.oat by about 3.5%.

Change-Id: Ic3c2ef7704c05fa328720c6781ca2a9b8e3935a3
4b07a6e518a42eac43f5746e646e90a7865beb83 15-Jan-2016 Jeff Hao <jeffhao@google.com> Add oat location to oatdump.

Change-Id: Idc0da67e04048a00c4ce4b524103be0925f66e71
966878d987cec1940fdfa8633fc79f8112320821 14-Jan-2016 Mathieu Chartier <mathieuc@google.com> Revert "Create parent class loader for dex2oat"

Bug: 22858531

This reverts commit d37d364c27e74a7b49970a8c970482e273aa7b1a.

Change-Id: Id71a6f3bb9a29c04a5c13210633674e05d798114
dcdc85bbd569f0ee66c331b4219c19304a616214 04-Dec-2015 Jeff Hao <jeffhao@google.com> Dex2oat support for multiple oat file and image file outputs.

Multiple changes to dex2oat and the runtime to support a --multi-image
option. This generates a separate oat file and image file output for
each dex file input.

Change-Id: Ie1d6f0b8afa8aed5790065b8c2eb177990c60129
9865bde5d822f56c4732214c2005dfcaa41f94cf 21-Dec-2015 Mathieu Chartier <mathieuc@google.com> Rename NullHandle to ScopedNullHandle

This makes it clearer that is invalid to do things like:
Handle<T> h = ScopedNullHandle<T>();

Bug: 26233305
Change-Id: I6d8f54eae01ec2e901cb7043afa853ea77db79fe
131980fc9aeb2b4d03480443e0fb494c76ce03a2 03-Dec-2015 Vladimir Marko <vmarko@google.com> Add ElfWriter::GetStream().

This will be used for writing the OatHeader which is
currently oddly written through the .text stream.

Also move the error delaying output stream out of the
ElfBuilder<> to its own file and move all output stream
files to compiler/linker/.

Change-Id: I00db4e33ed80ac4757ec459946c7b5ae014a3a2e
208a5cb383dd9dcd3461f89b74af5df67dc8d794 03-Dec-2015 Mathieu Chartier <mathieuc@google.com> Store class tables in the image

Reduces how long it takes to load an application image.

N5 boot.art size
Before: 8007680
After: 8122368

Also reduces boot time by how long AddImageClassesToClassTable
used to take (~20ms).

Changed class hashes to be uint32_t to fix cross compilation. We need
serialized hash tables to be valid with different pointer sizes.

Bug: 22858531

Change-Id: I463fc83f499ff75f509e80c253a55b9116ee5b89
10c13565474de2786aad7c2e79757ea250747a15 25-Nov-2015 Vladimir Marko <vmarko@google.com> Refactor oat file writing to give Dex2Oat more control.

This is the first step towards writing dex files to oat file
and mapping them from there for the actual AOT compilation.

Change-Id: Icb0d27487eaf6ba3a66c157e695f9bdc5bb9cf9a
d37d364c27e74a7b49970a8c970482e273aa7b1a 20-Nov-2015 Mathieu Chartier <mathieuc@google.com> Create parent class loader for dex2oat

This means we also put the class loader in the app image so that it
can be used for verifying the dex file order.

Bug: 22858531
Change-Id: I30761b59421c8a24cffd62b469134b25d2929e2e
04302dbb106d590ff72c0dfecda23d85b6565059 12-Nov-2015 Hiroshi Yamauchi <yamauchi@google.com> Fix class unloading with the CC collector.

Avoid unnecessarily decoding dex cache and class loader weak roots,
which would trigger read barriers.

Re-enable 141-class-unload with the CC collector.

Bug: 12687968
Bug: 24468364
Change-Id: Ib4c19f25000873cab0e06047040442d135285745
073b16c8429d302d5413e8ffc488b03b8f770780 10-Nov-2015 Mathieu Chartier <mathieuc@google.com> Image space cleanup for app images

Removed Heap::GetImageSpace, added Heap::GetBootImageSpace.

Generalized some logic in the class linker for image spaces.

Bug: 22858531

Change-Id: Ib3e12bb061a247e232d3dc93b0d6b35eb3a34d25
6d8c8f0344a706df651567387ede683ab3ec1b5f 26-Oct-2015 David Srbecky <dsrbecky@google.com> Rewrite ElfBuilder to make streaming directly to file easier.

The previous design required knowing all the sections and their
sizes before even the first byte of the file was written.

The new design allows sections to be written one by one without
any knowledge of later sections. Furthermore, as soon as
section is started, its virtual memory address is known,
which removes the need for the various patching passes.

The new ElfBuilder essentially tries to be a thin wrapper
around OutputStream which keeps track where the various
sections start/end and then writes their ELF headers.

Change-Id: I817e7f3b41882e4e4b9b442cfe56e4ef2e26babd
524e7ea8cd17bad17bd9f3e0ccbb19ad0d4d9c02 16-Oct-2015 Nicolas Geoffray <ngeoffray@google.com> Remove ArtCode.

- Instead use OatQuickMethodHeader.
- Various cleanups now that we don't have all those
ArtMethod -> ArtCode -> OatQuickMethodHeader indirections.

As a consequence of this cleanup, exception handling got a bit
faster.

ParserCombinators benchmark (exception intensive) on x64: (lower is better)
Before:
ParserCombinators(RunTime): 1062500.0 us.
After:
ParserCombinators(RunTime): 833000.0 us.

Change-Id: Idac917b6f1b0dc254ad68fb3781cd61bccadb0f3
d57d454a11ac6f49eaa397ec14d6231e3a2727b7 14-Oct-2015 Mathieu Chartier <mathieuc@google.com> Allocate dex cache arrays in their class loader's linear alloc

Fixes memory leak for class unloading where the dex cache arrays
used to be in the runtime linear alloc which never got freed.

TODO: Some of the callers like the compiler just use the runtime
linear alloc. We could clean this up if we want to have class
unloading during compilation for some reason.

Added regression test.

Bug: 22720414

Change-Id: Ia50333a06a339efbdaedb5ad94b7a1ae841124ec
6bc4374e3fa00e3ee5e832e1761c43e0b8a71558 12-Oct-2015 Nicolas Geoffray <ngeoffray@google.com> Add an abstraction over a compiled code.

That's just step 1, moving code-related functions of ArtMethod to
another class. That class is only a wrapper on an ArtMethod, but will
be changed to be a wrapper around compiled code.

Change-Id: I6f35fc06d37220558dff61691e51ae20066b0dd6
f9c6fc610b27887f832e453a0da1789187293408 07-Oct-2015 Mathieu Chartier <mathieuc@google.com> Add OatFileManager

Takes over a large amount of functionality from the class linker.

Changed OatFile to loading the same OatFile multiple times. This is
required for unloading OatFiles and moving dex caches to BSS since
these require a different OatFile for each dex cache and class
loader.

Bug: 22720414

Change-Id: I0321096723a294dc72949f21e66da82727b512fc
4f55e22630d99ca0edd9e951e5ee96b57bb9b980 04-Sep-2015 Mathieu Chartier <mathieuc@google.com> Add and use ScopedSuspendAll

Usage replaces most SuspendAll and ResumeAll calls.

Change-Id: I355683a5365876242cea85a656dcb58455f7a294
f1d666e1b48f8070ef1177fce156c08827f08eb8 04-Sep-2015 Mathieu Chartier <mathieuc@google.com> Add ScopedThreadSuspension

Fixes the TransitionFromRunnableToSuspended and
TransitionFromSuspendedToRunnable pattern that was prone to errors.

Change-Id: Ie6ae9c0357c83b4fc4899d05dfa0975553170267
05792b98980741111b4d0a24d68cff2a8e070a3a 03-Aug-2015 Vladimir Marko <vmarko@google.com> ART: Move DexCache arrays to native.

This CL has a companion CL in libcore/
https://android-review.googlesource.com/162985

Change-Id: Icbc9e20ad1b565e603195b12714762bb446515fa
673ed3d8aedc5462a47ded827c99f35d46525457 28-Aug-2015 Mathieu Chartier <mathieuc@google.com> Revert "Revert "Change dex caches to be weak roots""

This reverts commit 81a9087f0df0518c39405b7d18ba5858a6d8b77b.

Boot.oat creation time goes from 4.7s to 4.9s on host due to extra
locking. Will try to improve this in another CL.

Bug: 23602225
Bug: 22720414

Change-Id: I7e25b75cfb63faa196c7b0f60e46cce50bf12021
81a9087f0df0518c39405b7d18ba5858a6d8b77b 28-Aug-2015 Brian Carlstrom <bdc@google.com> Revert "Change dex caches to be weak roots"

This reverts commit 3ae6b1d42523bb2a0ddb5edff1aaf05b592f28f4.
ac8f4397f6978484fad6769526e9e3b3f7e7bd19 27-Aug-2015 Mathieu Chartier <mathieuc@google.com> Keep dex files live for duration of oatdump

Not keeping the dex file live caused a dex cache with a pointer to a
stale dex file resulting in oatdump failing. This is required to
remove the dex file location test that causes the class loader 068
test to fail.

Change-Id: I5d532862ab998482c0d16d7a63c6bdc3752f031a
3ae6b1d42523bb2a0ddb5edff1aaf05b592f28f4 14-Aug-2015 Mathieu Chartier <mathieuc@google.com> Change dex caches to be weak roots

Changed dex caches to be weak roots. This is necessary for class
unloading since the resolved types arrays would keep classes live
when they should be unloaded. Currently the dex caches still don't
get freed due to the class loader roots.

Also deleted some unused functionality in image writer.

Bug: 22720414
Change-Id: If22cb3cad7e3baabc8158a77d7f20799faf4c341
14632857428b7e37761e6e811c19021715a400f8 17-Aug-2015 Vladimir Marko <vmarko@google.com> ART: Rename ArtMethod's size and alignment methods.

Remove the historical prefix "Object" to avoid confusion
with Java objects.

Change-Id: Ib36422c9a24878d8d4bd757977d99cbf66b3d567
cf36d493124d8048efa0bd6f67d817ce3cd6b725 12-Aug-2015 Vladimir Marko <vmarko@google.com> ART: Compress LengthPrefixedArray on 32-bit targets.

Previously, the LengthPrefixedArray<ArtMethod> on 32-bit
targets contained a 64-bit length field followed by the
ArtMethod elements with size only a multiple of 4, not 8.
Consequently, an odd-length array broke the alignment for
the following array which would have the 64-bit length
placed at an unaligned address.

To fix that, we make the length field 32-bit and explicitly
pass the alignment information to the LengthPrefixedArray.
This also makes the 32-bit boot image a bit smaller.
On Nexus 5, AOSP, ToT, the field section is 11528B smaller
and the method section is 21036B smaller. 64-bit targets
should see the same savings for the field section but no
difference for the methods section.

Change-Id: I3e03e7b94129025c8a1c117c27645a34dec516d2
3887c468d731420e929e6ad3acf190d5431e94fc 12-Aug-2015 Roland Levillain <rpl@google.com> Remove unnecessary `explicit` qualifiers on constructors.

Change-Id: Id12e392ad50f66a6e2251a68662b7959315dc567
54d220eb9cc51215d75b9e0fe921b94bebbb3fd6 31-Jul-2015 Mathieu Chartier <mathieuc@google.com> Move ArtFields and ArtMethods to be a length prefixed array

Fixes race conditions between changing method and fields arrays
being seen in the wrong order by the GC.

Bug: 22832610
Change-Id: Ia21d6698f73ba207a6392c3d6b9be2658933073f
b1d8c314b55bb2df2b2bb72a3daaf5db65b7ebc7 04-Aug-2015 Igor Murashkin <iam@google.com> Revert "cleanup: Replace pointers with out-parameters and fix-up formatting"

This reverts commit a315f5c546b796f55f4872bb6efc15eb858d9639.

--

Revert "runtime: cleanup class_linker out-parameters and formatting"

This reverts commit bc1d78daa463572c5a770cdca858a3b51d8e1b7b.

--

Revert "base: replace raw pointers for out-parameters with safer out<T>"

This reverts commit fb326cffc679cab8eb873b9e44795706f023cb3c.
a315f5c546b796f55f4872bb6efc15eb858d9639 01-Aug-2015 Igor Murashkin <iam@google.com> cleanup: Replace pointers with out-parameters and fix-up formatting

Cleans all of oat_file.h/.cc, parsed_options.h./cc, runtime.h/.cc

Other files are touched only incidentally to use outof(x) instead of &x.

Change-Id: I0bb15111149d53bb21aac2199ef33bd35333b0ca
90443477f9a0061581c420775ce3b7eeae7468bc 17-Jul-2015 Mathieu Chartier <mathieuc@google.com> Move to newer clang annotations

Also enable -Wthread-safety-negative.

Changes:
Switch to capabilities and negative capabilities.

Future work:
Use capabilities to implement uninterruptible annotations to work
with AssertNoThreadSuspension.

Bug: 20072211

Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
7617abdb402fd0419daa3eefb2ad059ccbb8b6db 11-Jul-2015 Igor Murashkin <iam@google.com> runtime: Add -Xverify:softfail and ART_TEST_INTERPRETER_ACCESS_CHECKS

Use ART_TEST_INTERPRETER_ACCESS_CHECKS=true to run all the tests through
the interpreter with access checks enabled. The normal interpreter tests
do not currently enable access checks, which means that a large part of
the interpreter codebase is untested.

The verifier will force every class into a soft fail mode if
-Xverify:softfail is used, thereby ensuring that if used along with the
interpreter (-Xint) that the interpret is always in access checks mode.

This is used alongside with --compile-filter=verify-at-runtime to
prevent the AOT compiler from putting down any code.

Change-Id: I35a10ed8c43d76fa96133cf01fdad497da387200
0a5cd12a30e1b02833bdd94f11b74ecf4835ecb3 16-Jul-2015 Nicolas Geoffray <ngeoffray@google.com> Make oatdump see the new vmap table generated by dextodex.

Change-Id: I48f3fb7320e39c864f8fbc478f970b18358408ec
8f1e08af6172781f91a17fce0a5a4183a9f70aa9 26-Jun-2015 Vladimir Marko <vmarko@google.com> ART: Don't nest indenters in oatdump.

Reduces the time taken by the oatdump_test by ~12s (15%)
on host and ~55s (9%) on N5.

Change-Id: I99bb16ff5f3640389815f1fe54379ca64eac071b
6fcaf3f7b5c4fca67b506c4a4233e8373be6d48e 08-Jul-2015 Nicolas Geoffray <ngeoffray@google.com> Fix oatdump after ArtMethod change.

ArtMethod is now word aligned, and not necessarily 8 byte aligned.

Change-Id: I8bd6b2f156d7f2ab191d6f2675b013713bbf258d
6d7f1796f3afafaaae4bf71088f92184adcff858 02-Jul-2015 Roland Levillain <rpl@google.com> Make oatdump work with .art files and code generated by Optimizing.

When inspecting an .art file with oatdump (using `--image'),
do not try to compute size stats about the vmap table if the
method has been compiled with Optimizing.

Change-Id: I1204b53c91ac8bf98665ed357d8509a4a01a52f9
eb7b7399dbdb5e471b8ae00a567bf4f19edd3907 19-Jun-2015 Alexandre Rames <alexandre.rames@linaro.org> Opt compiler: Add disassembly to the '.cfg' output.

This is automatically added to the '.cfg' output when using the usual
`--dump-cfg` option.

Change-Id: I864bfc3a8299c042e72e451cc7730ad8271e4deb
d39645e22b8db1767cf64dc1200a9e4b2f939ed2 10-Jun-2015 Mathieu Chartier <mathieuc@google.com> Move image intern table into image

Previously we recreated this intern table during runtime startup.
This added 50-100ms of boot time.

Fixed bug where we didn't copy over hashcodes into the image.

Deleted some stale code.

(cherry picked from commit fac3a390a247fe33d4873773d742aad4cc100118)

Bug: 20727525
Bug: 19569780
Change-Id: I08959e9aa2a73cedb52f393033e2ffea3a26e76b
fac3a390a247fe33d4873773d742aad4cc100118 10-Jun-2015 Mathieu Chartier <mathieuc@google.com> Move image intern table into image

Previously we recreated this intern table during runtime startup.
This added 50-100ms of boot time.

Fixed bug where we didn't copy over hashcodes into the image.

Deleted some stale code.

Bug: 20727525
Bug: 19569780
Change-Id: I08959e9aa2a73cedb52f393033e2ffea3a26e76b
f677ebfd832c9c614fea5e6735725fec2f7a3f2a 29-May-2015 David Brazdil <dbrazdil@google.com> Cache stack map encoding

Operations on CodeInfo and StackMap objects repeatedly read encoding
information from the MemoryRegion. Since these are 3-bit-loads of
values that never change, caching them can measurably reduce compile
times.

According to benchmarks, this patch saves 1-3% on armv7, 2-4% on x86,
and 0-1% on x64.

Change-Id: I46b197513601325d8bab562cc80100c00ec28a3b
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
f2650d1f957b158496de8016bc43fb575e81d6bc 28-May-2015 Roland Levillain <rpl@google.com> Show stack maps and Dex register maps in oatdump's assembly code.

Stack maps and Dex register maps are not longer displayed
in CodeInfo sections, unless `--dump:code_info_stack_maps'
is passed to oatdump.

Change-Id: Id82adb406d7e56cda27df8e5a8bd328a88b9ee11
0396ed7d3ad30778cb4af19e7086bea0deace9b9 27-May-2015 Roland Levillain <rpl@google.com> Improve art::CodeInfo dumping.

- Refactor existing dumping code into a set of new routines.
- Use art::Indenter to properly indent in the output.
- Add an additional argument to art::CodeInfo::Dump to
enable or disable the dumping of stack maps and Dex
register maps.

Change-Id: I52814095ff465522302d5d69d416726369ca5258
c93098060708b7a24c937b420a071cf6bdcf33f7 26-May-2015 Mathieu Chartier <mathieuc@google.com> Add oatdump test

(cherry picked from commit 19510f02b011e545665f6219e6144c8e47aed5f0)

Bug: 18000316

Change-Id: Ic22d63dc64a9b7a492b5e6bfbd4c75f30c35dfd5
19510f02b011e545665f6219e6144c8e47aed5f0 26-May-2015 Mathieu Chartier <mathieuc@google.com> Add oatdump test

Bug: 18000316

Change-Id: Ic22d63dc64a9b7a492b5e6bfbd4c75f30c35dfd5
df2bb1f36c0d755f0bdb2b1562e52669f3de4a09 05-May-2015 Andreas Gampe <agampe@google.com> ART: Fix double-free in oatdump

The ImageDumper doesn't own the OatDumperOptions.

Bug: 20818721
Change-Id: Iea11ada8fb6418b226d39b33c252a834c42e655e
bc90fd09e09a845ae6ea0d84ad67560575a94142 22-Apr-2015 David Srbecky <dsrbecky@google.com> Major refactoring of ElfBuilder.

Simplify ElfBuilder by removing duplicated or redundant code.
Many of the repeated code patterns were replaced by just
looping over the list of all sections.

Methods Init() and Write() have been merged into one.
The split between those was rather arbitrary, but it was there
for a reason. It allowed creation of raw sections between
the calls which may have depended on layout decisions done in
Init(), but not in Write() (e.g. knowing of offset of .text).

This has been replaced by more generic solution.
All sections are asked about their size first and complete
file layout is calculated. Then the sections are asked to
write their content (potentially using the layout information).

This should be pure refactoring CL - the compiler should
produce bit for bit identical output as before.

Change-Id: I281d13d469801bd8288b36b360d200d98a3e92d7
0c5bbc11a6af7b4f83b3929bc99de690635095c0 28-Apr-2015 David Srbecky <dsrbecky@google.com> Minor refactoring of ElfBuilder.

* Nest section builder classes within the main builder
class to reduce verbosity caused by templates.
* Move .eh_frame and .eh_frame_hdr section headers earlier
so that the section headers are sorted by file offset.
* Do not emit PT_NULL header if .eh_frame_hdr is missing.

None of these changes should have any material impact.
This CL just prepares ground for the following CL.

Change-Id: I56f9825892adb01d413a18ca10cb5c805cb8cd78
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
533c207f9d2da6d913c4b10f6f757fe9d6367b10 22-Apr-2015 David Srbecky <dsrbecky@google.com> Simplify template parameters of Elf classes.

The ELF specification defines several types which differ between
32-bit ELF and 64-bit ELF. We used to template all ELF-related
methods on all of those types which was very verbose.

This CL wraps all the types as typedefs in ElfTypes32 and ElfTypes64.
One of those wrappers is then used as the template parameter.

Change-Id: I65247c2c79d92a7c4799e988cf3e4a1b10eb4788
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
daaf3265806eb2eadb2e03302bd68022fab5ca28 24-Mar-2015 Mathieu Chartier <mathieuc@google.com> Add AccessibleObject and Field to mirror

Main motivation is to remove all the functionality / field access on
java side to ArtField. Also comes with some reflection speedups /
slowdowns.

Summary results:
getDeclaredField/getField are slower mostly due to JNI overhead.
However, there is a large speedup in getInt, setInt,
GetInstanceField, and GetStaticField.

Before timings (N5 --compiler-filter=everything):

benchmark ns linear runtime
Class_getDeclaredField 782.86 ===
Class_getField 832.77 ===
Field_getInt 160.17 =
Field_setInt 195.88 =
GetInstanceField 3214.38 ==============
GetStaticField 6809.49 ==============================

After:
Class_getDeclaredField 1068.15 ============
Class_getField 1180.00 ==============
Field_getInt 121.85 =
Field_setInt 139.98 =
GetInstanceField 1986.15 =======================
GetStaticField 2523.63 ==============================

Bug: 19264997

Change-Id: Ic0d0fc1b56b95cd6d60f8e76f19caeaa23045c77
81c6f8db12b203878a7d72444ead2bc7cf5c47ad 26-Mar-2015 Andreas Gampe <agampe@google.com> ART: PathClassLoader for compiler

Use an actual PathClassLoader when compiling apps, instead of a
side structure and cutout.

This CL sets up a minimal object 'cluster' that recreates the Java
side of a regular ClassLoader such that the Class-Linker will
recognize it and use the internal native fast-path.

This CL removes the now unnecessary compile-time-classpath and
replaces it with a single 'compiling-the-boot-image' flag in the
compiler callbacks.

Note: This functionality is *only* intended for the compiler, as
the objects have not been completely initialized.

Bug: 19781184

Change-Id: I7f36af12dd7852d21281110a25c119e8c0669c1d
e5fed03772144595c0904faf3d6974cc55214c8c 18-Mar-2015 Richard Uhler <ruhler@google.com> Support relative encoded dex locations in oat files.

Now when opening an oat file, the caller can pass an absolute dex
location used to resolve the absolute path for any relative
encoded dex locations in the oat file.

Bug: 19550105
Change-Id: I6e9559afe4d86ac12cf0b90176b5ea696a83d0e7
004c230b4cfc856690c61faabc41864061813c88 20-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Compress the StackMaps.

First step towards the compression of the StackMap (not
the DexRegisterMap). Next step will be to just use what is
needed (instead of byte -> word).

Change-Id: I4f81b2d05bf5cc508585e16fbbed1bafbc850e2e
bf9fc581e8870faddbd320a935f9a627da724c48 14-Mar-2015 Mathieu Chartier <mathieuc@google.com> Add more info to who called SuspendAll

Helps diagnose related jank.

Change-Id: I38191cdda723c6f0355d0197c494a3dff2b6653c
fead4e4f397455aa31905b2982d4d861126ab89d 13-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> [optimizing] Don't record None locations in the stack maps.

- moved environment recording from code generator to stack map stream
- added creation/loading factory methods for the DexRegisterMap (hides
internal details)
- added new tests

Change-Id: Ic8b6d044f0d8255c6759c19a41df332ef37876fe
15b9d5274399736ac09705f0507df24fac4f00c1 12-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> API change in StackVisitor::GetVReg*.

- Remove GetVReg() and SetVReg() that were expecting to always succeed.
- Change Quick-only methods to take a FromQuickCode suffix.
- Change deopt to use dead values when GetVReg does not succeed:
the optimizing compiler will not have a location for uninitialized
Dex registers and potentially dead registers.

Change-Id: Ida05773a97aff8aa69e0caf42ea961f80f854b77
a2d8ec6876325e89e5d82f5dbeca59f96ced3ec1 12-Mar-2015 Roland Levillain <rpl@google.com> Compress the Dex register maps built by the optimizing compiler.

- Replace the current list-based (fixed-size) Dex register
encoding in stack maps emitted by the optimizing compiler
with another list-based variable-size Dex register
encoding compressing short locations on 1 byte (3 bits for
the location kind, 5 bits for the value); other (large)
values remain encoded on 5 bytes.
- In addition, use slot offsets instead of byte offsets to
encode the location of Dex registers placed in stack
slots at small offsets, as it enables more values to use
the short (1-byte wide) encoding instead of the large
(5-byte wide) one.
- Rename art::DexRegisterMap::LocationKind as
art::DexRegisterLocation::Kind, turn it into a
strongly-typed enum based on a uint8_t, and extend it to
support new kinds (kInStackLargeOffset and
kConstantLargeValue).
- Move art::DexRegisterEntry from
compiler/optimizing/stack_map_stream.h to
runtime/stack_map.h and rename it as
art::DexRegisterLocation.
- Adjust art::StackMapStream,
art::CodeGenerator::RecordPcInfo,
art::CheckReferenceMapVisitor::CheckOptimizedMethod,
art::StackVisitor::GetVRegFromOptimizedCode, and
art::StackVisitor::SetVRegFromOptimizedCode.
- Implement unaligned memory accesses in art::MemoryRegion.
- Use them to manipulate data in Dex register maps.
- Adjust oatdump to support the new Dex register encoding.
- Update compiler/optimizing/stack_map_test.cc.

Change-Id: Icefaa2e2b36b3c80bb1b882fe7ea2f77ba85c505
5c42c29b89286e5efa4a4613132b09051ce5945b 25-Feb-2015 Vladimir Marko <vmarko@google.com> Add support for .bss section in oat files.

Change-Id: I779b80b8139d9afdc28373f8c68edff5df7726ce
32f500daa2c04b1efe946c12c90502736e47d5fc 23-Feb-2015 Anestis Bechtsoudis <anestis@census-labs.com> ART: oatdump enhancements

New features list includes:
- Class filter option to limit classes search space
- Method filter is applied only against the method
name, instead of the entire signature. Can be
combined with class filter for maximum efficiency.
- Bulk dump of class and method names list only.
Can be combined with filters to limit results.
- Export embedded dex files from input oat files
to filesystem (symlinks not supported as utils
functions are utilized for os & fs operations).
- addr2instr option to locate the in-range method
implementation and limit disassemble dumps. Input
relative addr is added to oat executable offset to
calculate the search offset. If method has been
successfully located, code is dumped and program
aborts further analysis of the input file. Methods
located before the target address just print their
signature, although skip all disassemble and other
info. Calculated search offset is also printed as
part of the initial header info.
- Little-endian dex instructions bytecode is printed
in the same line before the instruction string.

Some minor re-orders have been also taken place for
more targeted results.

Change-Id: I3116ee3c99c258718f46faea8ea4295da6ae2bf7
Signed-off-by: Anestis Bechtsoudis <anestis@census-labs.com>
442b46a087c389a91a0b51547ac9205058432364 18-Feb-2015 Roland Levillain <rpl@google.com> Display optimizing compiler's CodeInfo objects in oatdump.

A few elements are not displayed yet (stack mask, inline info) though.

Change-Id: I5e51a801c580169abc5d1ef43ad581aadc110754
fbef44de596d298dc6430f482dffc933a046dd28 23-Dec-2014 Richard Uhler <ruhler@google.com> Use unique_ptr to track ownership of dex files.

Bug: 18809837
Change-Id: Ie571eae8fc19ee9207390cff5c7e2a38071b126a
c24f3990db5845691016b935df3d9382b6762f0f 18-Dec-2014 Andreas Gampe <agampe@google.com> ART: Fix oatdump

Refactor and modify cmdline.h to allow oatdump to run without a
Runtime.

Bug: 18789891
Change-Id: I1d7a1585e3672d04e58dbac9a4d4bd835c1c9143
3774335b08076117d6950cd472cdd59a167470b5 13-Nov-2014 Igor Murashkin <iam@google.com> Add a new imgdiag tool to diff boot.art/core.art against a process

Analyze the dirty memory pages of a running process per-object,
this allows is to to fine-tune the dirty object binning algorithm in
image writer.

Also:
* Factor out oatdump command line parsing code into cmdline.h
* Factor out common build rules for building variations of binaries
* Add a gtest for imgdiag

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

Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
08f1f50d6c2e8f247b8f5f19711d75a792851c7a 03-Dec-2014 Ian Rogers <irogers@google.com> Remove FieldHelper.

Change-Id: I2d74e2d5b3c35a691c95339de0db9361847fca11
957ca1cd025104fccb0b08928f955f9bdb4ab91c 22-Nov-2014 Mathieu Chartier <mathieuc@google.com> Delete ArtMethod gc_map_ field

Moved the gc_map field from OatMethod to OatQuickMethodHeader.
Deleted the ArtMethod gc_map_ field.

Bug: 17643507

Change-Id: Ifa0470c3e4c2f8a319744464d94c6838b76b3d48

(cherry picked from commit 807140048f82a2b87ee5bcf337f23b6a3d1d5269)
c6fc909c6b42b4c365b1e7f86639ee4b360249fa 22-Nov-2014 Mathieu Chartier <mathieuc@google.com> Delete ArtMethod gc_map_ field

Moved the gc_map field from OatMethod to OatQuickMethodHeader.
Deleted the ArtMethod gc_map_ field.

Bug: 17643507

Change-Id: Ifa0470c3e4c2f8a319744464d94c6838b76b3d48
a7dd0386f35c0ba4aef3f5b16bc84c6f4e2fc702 21-Nov-2014 Mathieu Chartier <mathieuc@google.com> Fix oatdump to use OatHeader pointer size

Bug: 18473190
Change-Id: If505b4f62105899f4f1257d3bccda3e6eb0dcd7c

(cherry picked from commit c934e483ceabbd589422beea1fa35f5182ecfa99)
c934e483ceabbd589422beea1fa35f5182ecfa99 21-Nov-2014 Mathieu Chartier <mathieuc@google.com> Fix oatdump to use OatHeader pointer size

Bug: 18473190
Change-Id: If505b4f62105899f4f1257d3bccda3e6eb0dcd7c
4303ba97313458491e038d78efa041d41cf7bb43 06-Nov-2014 Andreas Gampe <agampe@google.com> ART: Track Flush & Close in FdFile

Implement a check that aborts when a file hasn't been explicitly
flushed and closed when it is destructed.

Add WARN_UNUSED to FdFile methods.

Update dex2oat, patchoat, scoped_flock and some gtests to pass with
this.

(cherry picked from commit 9433ec60b325b708b9fa87e699ab4a6565741494)

Change-Id: I9ab03b1653e69f44cc98946dc89d764c3e045dd4
d582fa4ea62083a7598dded5b82dc2198b3daac7 06-Nov-2014 Ian Rogers <irogers@google.com> Instruction set features for ARM64, MIPS and X86.

Also, refactor how feature strings are handled so they are additive or
subtractive.
Make MIPS have features for FPU 32-bit and MIPS v2. Use in the quick compiler
rather than #ifdefs that wouldn't have worked in cross-compilation.
Add SIMD features for x86/x86-64 proposed in:
https://android-review.googlesource.com/#/c/112370/

Bug: 18056890

Change-Id: Ic88ff84a714926bd277beb74a430c5c7d5ed7666
3fcd22051f5ac12f0825204b534912af38f02c61 12-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Add a --method-filter option to oatdump.

I intend to use oatdump for testing generated code, and
being able to filter on a method name will make the
testing more reliable.

Change-Id: Iaf7fef7228d9d8a901bd9b98452d244d42ca497e
48447025389cd67605041a28d4ded1528381bc4e 22-Oct-2014 Igor Murashkin <iam@google.com> ART: Add support for patching and loading OAT files compiled with PIC

* Images (.art) compiled with pic now have a new field added.
* isDexOptNeeded will now skip patch-ing for apps compiled PIC
* First-boot patching now only copies boot.art, boot.oat is linked

As a result, all system preopted dex files (with --compile-pic) no
longer take up any space in /data/dalvik-cache/<isa>.

(cherry-picked from AOSP master
46774767fcf7780d1455e755729198648d08742e)

Conflicts (from aosp master):
compiler/image_test.cc
compiler/image_writer.cc
compiler/image_writer.h
compiler/oat_test.cc
dex2oat/dex2oat.cc
oatdump/oatdump.cc
runtime/elf_file.cc
runtime/elf_file.h
runtime/elf_file_impl.h
runtime/oat_file.cc
runtime/oat_file.h

Bug: 18035729

(cherry picked from commit 90ca5c0301651101de0e363842e5d08ae65233f7)

Change-Id: I8d99f95cc3d1fa221fc530ebb1fcc4b3263c183d
e7c9a8c2b8481aafbc6af4ce6229bd361ba24742 07-Nov-2014 Mathieu Chartier <mathieuc@google.com> Add hash map, reduce excessive hashing

Changed the class def index to use a HashMap instead of unordered_map
so that we can use FindWithHash to reduce how often we need to compute
hashes.

Fixed a bug in ClassLinker::UpdateClass where we didn't properly
handle classes with the same descriptor but different class loaders.
Introduced by previous CL.

Before (fb launch):
1.74% art::ComputeModifiedUtf8Hash(char const*)

After:
0.95% art::ComputeModifiedUtf8Hash(char const*)

Bug: 18054905
Bug: 16828525

Change-Id: Iba2ee37c9837289e0ea187800ba4af322225a994

(cherry picked from commit 564ff985184737977aa26c485d0c1a413e530705)
564ff985184737977aa26c485d0c1a413e530705 07-Nov-2014 Mathieu Chartier <mathieuc@google.com> Add hash map, reduce excessive hashing

Changed the class def index to use a HashMap instead of unordered_map
so that we can use FindWithHash to reduce how often we need to compute
hashes.

Fixed a bug in ClassLinker::UpdateClass where we didn't properly
handle classes with the same descriptor but different class loaders.
Introduced by previous CL.

Before (fb launch):
1.74% art::ComputeModifiedUtf8Hash(char const*)

After:
0.95% art::ComputeModifiedUtf8Hash(char const*)

Bug: 18054905
Bug: 16828525

Change-Id: Iba2ee37c9837289e0ea187800ba4af322225a994
277ccbd200ea43590dfc06a93ae184a765327ad0 04-Nov-2014 Andreas Gampe <agampe@google.com> ART: More warnings

Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general,
and -Wunused-but-set-parameter for GCC builds.

Change-Id: I81bbdd762213444673c65d85edae594a523836e5
6a3c1fcb4ba42ad4d5d142c17a3712a6ddd3866f 31-Oct-2014 Ian Rogers <irogers@google.com> Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.

Fix associated errors about unused paramenters and implict sign conversions.
For sign conversion this was largely in the area of enums, so add ostream
operators for the effected enums and fix tools/generate-operator-out.py.
Tidy arena allocation code and arena allocated data types, rather than fixing
new and delete operators.
Remove dead code.

Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
90ca5c0301651101de0e363842e5d08ae65233f7 22-Oct-2014 Igor Murashkin <iam@google.com> ART: Add support for patching and loading OAT files compiled with PIC

* Images (.art) compiled with pic now have a new field added.
* isDexOptNeeded will now skip patch-ing for apps compiled PIC
* First-boot patching now only copies boot.art, boot.oat is linked

As a result, all system preopted dex files (with --compile-pic) no
longer take up any space in /data/dalvik-cache/<isa>.

(cherry-picked from AOSP master
46774767fcf7780d1455e755729198648d08742e)

Conflicts (from aosp master):
compiler/image_test.cc
compiler/image_writer.cc
compiler/image_writer.h
compiler/oat_test.cc
dex2oat/dex2oat.cc
oatdump/oatdump.cc
runtime/elf_file.cc
runtime/elf_file.h
runtime/elf_file_impl.h
runtime/oat_file.cc
runtime/oat_file.h

Bug: 18035729
Change-Id: Ie1acad81a0fd8b2f24e1f3f07a06e6fdb548be62
a37d925d405be9f589ac282869a997e73414d859 27-Oct-2014 Alexandre Rames <alexandre.rames@arm.com> Improvements to the ARM64 disassembler.

This contains three changes:
- Use register aliases in the disassembly.
- When loading from a literal pool, show what is being loaded.
- Disassemble using absolute addresses on ARM64.
This ensures that addresses disassembled are coherent with instruction
location addresses shown.

Examples of disassembled instructions before and after the changes:

Before:
movz w17, #0x471f
ldr d9, pc+736 (addr 0x72690d50)

After:
movz wip1, #0x471f
ldr d9, pc+736 (addr 0x72690d50) (-745.133)

Change-Id: I72fdc160fac26f74126921834f17a581c26fd5d8
46774767fcf7780d1455e755729198648d08742e 22-Oct-2014 Igor Murashkin <iam@google.com> ART: Add support for patching and loading OAT files compiled with PIC

* Images (.art) compiled with pic now have a new field added.
* isDexOptNeeded will now skip patch-ing for apps compiled PIC
* First-boot patching now only copies boot.art, boot.oat is linked

As a result, all system preopted dex files (with --compile-pic) no
longer take up any space in /data/dalvik-cache/<isa>.

Bug: 18035729
Change-Id: Ie1acad81a0fd8b2f24e1f3f07a06e6fdb548be62
2d2621a1463d2f3f03fa73503fa42e43657cdcfc 24-Oct-2014 Mathieu Chartier <mathieuc@google.com> Optimize method linking

Added more inlining, removed imt array allocation and replaced it
with a handle scope. Removed some un-necessary handle scopes.

Added logic to base interface method tables from the superclass so
that we dont need to reconstruct for every interface (large win).

Facebook launch Dalvik KK MR2:
TotalTime: 3165
TotalTime: 3652
TotalTime: 3143
TotalTime: 3298
TotalTime: 3212
TotalTime: 3211

Facebook launch TOT before:
WaitTime: 3702
WaitTime: 3616
WaitTime: 3616
WaitTime: 3687
WaitTime: 3742
WaitTime: 3767

After optimizations:
WaitTime: 2903
WaitTime: 2953
WaitTime: 2918
WaitTime: 2940
WaitTime: 2879
WaitTime: 2792

LinkInterfaceMethods no longer one of the hottest methods, new list:
4.73% art::ClassLinker::LinkVirtualMethods(art::Thread*, art::Handle<art::mirror::Class>)
3.07% art::DexFile::FindClassDef(char const*) const
2.94% art::mirror::Class::FindDeclaredStaticField(art::mirror::DexCache const*, unsigned int)
2.90% art::DexFile::FindStringId(char const*) const

Bug: 18054905
Bug: 16828525

(cherry picked from commit 1fb463e42cf1d67595cff66d19c0f99e3046f4c4)

Change-Id: I27cc70178fd3655fbe5a3178887fcba189d21321
1fb463e42cf1d67595cff66d19c0f99e3046f4c4 24-Oct-2014 Mathieu Chartier <mathieuc@google.com> Optimize method linking

Added more inlining, removed imt array allocation and replaced it
with a handle scope. Removed some un-necessary handle scopes.

Added logic to base interface method tables from the superclass so
that we dont need to reconstruct for every interface (large win).

Facebook launch Dalvik KK MR2:
TotalTime: 3165
TotalTime: 3652
TotalTime: 3143
TotalTime: 3298
TotalTime: 3212
TotalTime: 3211

Facebook launch TOT before:
WaitTime: 3702
WaitTime: 3616
WaitTime: 3616
WaitTime: 3687
WaitTime: 3742
WaitTime: 3767

After optimizations:
WaitTime: 2903
WaitTime: 2953
WaitTime: 2918
WaitTime: 2940
WaitTime: 2879
WaitTime: 2792

LinkInterfaceMethods no longer one of the hottest methods, new list:
4.73% art::ClassLinker::LinkVirtualMethods(art::Thread*, art::Handle<art::mirror::Class>)
3.07% art::DexFile::FindClassDef(char const*) const
2.94% art::mirror::Class::FindDeclaredStaticField(art::mirror::DexCache const*, unsigned int)
2.90% art::DexFile::FindStringId(char const*) const

Bug: 18054905
Bug: 16828525

Change-Id: I27cc70178fd3655fbe5a3178887fcba189d21321
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
b8acbcc7cbca78f79d345239ae627dbfb412d412 15-Oct-2014 Mathieu Chartier <mathieuc@google.com> Fix oatdump for no image

Added MemMap::Init if we dont initialize the runtime.

(cherry picked from commit d424d0856927a5d771644b0ef18cb48ef8c04817)
Bug: 18000219

Change-Id: Ice068edea04708551b3fb8b75eae4e97758a18f9
edfc4ca2c8e1de6a1d42700cc0bc41d5b243ea04 15-Oct-2014 Mathieu Chartier <mathieuc@google.com> Fix oatdump for no image

Added MemMap::Init if we dont initialize the runtime.

(cherry picked from commit d424d0856927a5d771644b0ef18cb48ef8c04817)
Bug: 18000219

Change-Id: Ice068edea04708551b3fb8b75eae4e97758a18f9
d424d0856927a5d771644b0ef18cb48ef8c04817 15-Oct-2014 Mathieu Chartier <mathieuc@google.com> Fix oatdump for no image

Added MemMap::Init if we dont initialize the runtime.

Bug: 18000219
Change-Id: I1bd715e18838919c0773db5fa25623348326baa6
13735955f39b3b304c37d2b2840663c131262c18 08-Oct-2014 Ian Rogers <irogers@google.com> stdint types all the way!

Change-Id: I4e4ef3a2002fc59ebd9097087f150eaf3f2a7e08
0279ebb3efd653e6bb255470c99d26949c7bcd95 09-Oct-2014 Ian Rogers <irogers@google.com> Tidy ELF builder.

Don't do "if (ptr)". Use const. Use DISALLOW_COPY_AND_ASSIGN. Avoid public
member variables.
Move ValueObject to base and use in ELF builder.
Tidy VectorOutputStream to not use non-const reference arguments.

Change-Id: I2c727c3fc61769c3726de7cfb68b2d6eb4477e53
f4da675bbc4615c5f854c81964cac9dd1153baea 01-Aug-2014 Vladimir Marko <vmarko@google.com> Implement method calls using relative BL on ARM.

Store the linker patches with each CompiledMethod instead of
keeping them in CompilerDriver. Reorganize oat file creation
to apply the patches as we're writing the method code. Add
framework for platform-specific relative call patches in the
OatWriter. Implement relative call patches for ARM.

Change-Id: Ie2effb3d92b61ac8f356140eba09dc37d62290f8
00b25f33737b281938347cca535beb77de6e8cd5 18-Sep-2014 Andreas Gampe <agampe@google.com> ART: Allow oatdump to verify oat file

Bring up a runtime for oatdump of an oat file if the boot image
option is given. This allows to use the verifier on any oat file.

Some refactoring.

Change-Id: Ifa895f22b648c7064fb0837fb36a0118422a3462
0036cd492ab19668c4efe0975654b7d11d1d8998 18-Sep-2014 Brian Carlstrom <bdc@google.com> Remove MethodVerifier whitespace diff from aosp/master

(cherry picked from commit 6e5251e154cf7e1ce0965f62146467c91a69f811)

Change-Id: I821eee8cfacfbb9b7cc8fa972faa58e9ad47f58e
6e5251e154cf7e1ce0965f62146467c91a69f811 18-Sep-2014 Brian Carlstrom <bdc@google.com> Remove MethodVerifier whitespace diff from aosp/master

Change-Id: Iaec0afe71ed05e44850ed22d4849b464e423c218
20d3eae6bd65bea5206e57acab8145956e36ab08 17-Sep-2014 Nicolas Geoffray <ngeoffray@google.com> Update comment about disabling vmap dump.

Change-Id: If5d09b0d5cb9a8039b0037e6eedaae6785b1ded2
2cbaccb67e22c0b313a9785bfc65bcb4b25d0676 15-Sep-2014 Brian Carlstrom <bdc@google.com> Avoid printing absolute addresses in oatdump

- Added printing of OatClass offsets.
- Added printing of OatMethod offsets.
- Added bounds checks for code size size, code size, mapping table, gc map, vmap table.
- Added sanity check of 100k for code size.
- Added partial disassembly of questionable code.
- Added --no-disassemble to disable disassembly.
- Added --no-dump:vmap to disable vmap dumping.
- Reordered OatMethod info to be in file order.

Bug: 15567083

(cherry picked from commit 34fa79ece5b3a1940d412cd94dbdcc4225aae72f)

Change-Id: I2c368f3b81af53b735149a866f3e491c9ac33fb8
34fa79ece5b3a1940d412cd94dbdcc4225aae72f 15-Sep-2014 Brian Carlstrom <bdc@google.com> Avoid printing absolute addresses in oatdump

- Added printing of OatClass offsets.
- Added printing of OatMethod offsets.
- Added bounds checks for code size size, code size, mapping table, gc map, vmap table.
- Added sanity check of 100k for code size.
- Added partial disassembly of questionable code.
- Added --no-disassemble to disable disassembly.
- Added --no-dump:vmap to disable vmap dumping.
- Reordered OatMethod info to be in file order.

Bug: 15567083
Change-Id: Id86a21e06d4a28f29f16fd018cba7e55c57f849a
2ed8deff799448e094fa7a7cb9cf3b718820f4c6 28-Aug-2014 Andreas Gampe <agampe@google.com> ART: Allow quickening in the boot image

Update the class linker to accept class status from the boot image
in compiler mode. Update compiler driver to allow quickening for
boot image classes. Update method verifier to accept quickened
instructions in compiler mode when we just want to dump. Update
oatdump to the new verifier API.

Bug: 17316928

(cherry picked from commit 35439baf287b291b67ee406308e17fc6194facbf)

Change-Id: I9ef1bfd78b0d93625b89b3d662131d7d6e5f2903
5182932cf6704b53e957f7b4be021fe505a55e22 26-Aug-2014 Andreas Gampe <agampe@google.com> ART: Change access flag behavior in verifier

Note: this moves the miranda modifier to the upper 16 bit.

Bug: 16161620

(cherry picked from commit 7fc8f90b7160e879143be5cfd6ea3df866398884)

Change-Id: I2f591d53b7d1559171e70aaaf22225d94b4882f5
35439baf287b291b67ee406308e17fc6194facbf 28-Aug-2014 Andreas Gampe <agampe@google.com> ART: Allow quickening in the boot image

Update the class linker to accept class status from the boot image
in compiler mode. Update compiler driver to allow quickening for
boot image classes. Update method verifier to accept quickened
instructions in compiler mode when we just want to dump. Update
oatdump to the new verifier API.

Bug: 17316928
Change-Id: I9ef1bfd78b0d93625b89b3d662131d7d6e5f2903
7b078e8c04f3e1451dbdd18543c8b9692b5b067e 10-Sep-2014 Ian Rogers <irogers@google.com> Compile time performance improvements focusing on interpret-only.

Reduce virtual method dispatch in the method verifier and make more code
inline-able.
Add a StringPiece with const char* equality operator to avoid redundant
StringPieces and strlens.
Remove back link from register line to verifier and pass as argument to reduce
size of RegisterLine.
Remove instruction length from instruction flags and compute from the
instruction, again to reduce size.
Add suspend checks to resolve and verify to allow for more easy monitor
inflation and reduce contention on Locks::thread_list_suspend_thread_lock_.
Change ThrowEarlierClassFailure to throw pre-allocated exception.
Avoid calls to Thread::Current() by passing self.
Template specialize IsValidClassName.
Make ANR reporting with SIGQUIT run using checkpoints rather than suspending
all threads. This makes the stack/lock analysis less lock error prone.
Extra Barrier assertions and condition variable time out is now returned as a
boolean both from Barrier and ConditionVariable::Wait.

2 threaded host x86-64 interpret-only numbers from 341 samples:
Before change: Avg 176.137ms 99% CI 3.468ms to 1060.770ms
After change: Avg 139.163% 99% CI 3.027ms to 838.257ms
Reduction in average compile time after change is 20.9%.
Slow-down without change is 26.5%.

Bug: 17471626 - Fix bug where RegTypeCache::JavaLangObject/String/Class/Throwable
could return unresolved type when class loading is disabled.
Bug: 17398101

Change-Id: Id59ce3cc520701c6ecf612f7152498107bc40684
7fc8f90b7160e879143be5cfd6ea3df866398884 26-Aug-2014 Andreas Gampe <agampe@google.com> ART: Change access flag behavior in verifier

Note: this moves the miranda modifier to the upper 16 bit.

Bug: 16161620
Change-Id: I2f591d53b7d1559171e70aaaf22225d94b4882f5
3946844c34ad965515f677084b07d663d70ad1b8 02-Sep-2014 Nicolas Geoffray <ngeoffray@google.com> Runtime support for the new stack maps for the opt compiler.

Now most of the methods supported by the compiler can be optimized,
instead of using the baseline.

Change-Id: I80ab36a34913fa4e7dd576c7bf55af63594dc1fa
54fc26c7350beb782d042ba61cb06284b3a367e4 05-Sep-2014 Andreas Gampe <agampe@google.com> ART: Refactor elf_writer_quick, add symbolizer

Refactors some classes in elf_writer_quick.h to elf_builder.h to
be more friendly for re-use. Use this in oatdump to add a symtab
to an oat file.

Bug: 17187621, 17322125
Change-Id: I2333291334fd98bd09cc5717fb83cb18efe3a029
faf9f0d53573025dc5ae5ff6c4412396030cf1da 30-Aug-2014 Razvan A Lupusoru <razvan.a.lupusoru@intel.com> ART: Allow oatdump to print vr stack locations

For both debugging and performance analysis, it is necessary to understand
stack layout. This patch adds capability to oatdump to print out the offsets
of the locals, ins, method*, and out VRs.

Change-Id: I73512f59e4fd2d2b12725a6c76d602182c46ff78
Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
cc2f2393e69a9b1425bad1a89f41aaaf8c38f9e2 30-Aug-2014 Ian Rogers <irogers@google.com> Reduce and speed-up class def searches.

Use the class linker for descriptor lookups from the compile driver so that
dex caches are populated.
Reduce the scope of functions for scanning class paths to just the class
linker where they are performed.
If we see more than a threshold number of find class def misses on a dex file
lazily compute an index, so that future lookups are constant time (part of the
collection code is taken from
https://android-review.googlesource.com/#/c/103865/3). Note that we take a lazy
approach so that we don't serialize on loading dex files, this avoids the
reason the index was removed in 8b2c0b9abc3f520495f4387ea040132ba85cae69.
Remove an implicit and unnecessary std::string creation for PrintableString.

Single threaded interpret-only dex2oat performance is improved by roughly 10%.

Bug: 16853450

Change-Id: Icf72df76b0a4328f2a24075e81f4ff267b9401f4
(cherry picked from commit 68b56858367e29461ae290fd797443a1ef6d8005)
68b56858367e29461ae290fd797443a1ef6d8005 30-Aug-2014 Ian Rogers <irogers@google.com> Reduce and speed-up class def searches.

Use the class linker for descriptor lookups from the compile driver so that
dex caches are populated.
Reduce the scope of functions for scanning class paths to just the class
linker where they are performed.
If we see more than a threshold number of find class def misses on a dex file
lazily compute an index, so that future lookups are constant time (part of the
collection code is taken from
https://android-review.googlesource.com/#/c/103865/3). Note that we take a lazy
approach so that we don't serialize on loading dex files, this avoids the
reason the index was removed in 8b2c0b9abc3f520495f4387ea040132ba85cae69.
Remove an implicit and unnecessary std::string creation for PrintableString.

Single threaded interpret-only dex2oat performance is improved by roughly 10%.

Bug: 16853450

Change-Id: Icf72df76b0a4328f2a24075e81f4ff267b9401f4
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
bf99f77dda749e2b653e8c45259b1fb56e7bb012 24-Aug-2014 Mathieu Chartier <mathieuc@google.com> Clean up Handle usage.

Prefer using ConstHandle instead of Handle as function arguments
since you can't assign new references to ConstHandle which helps
prevent bugs.

Changed NullHandle to be a ConstHandle so that you can never modify
it to be a non null reference.

Change-Id: I81cb979f6f8d5b49e5614966a2caf28c3701dd4f
dc3761719fb5e2d1ced5708e3c73b965f9ef0c73 22-Aug-2014 Hiroshi Yamauchi <yamauchi@google.com> Handlerize MethodVerifier::mirror_method_.

The method (mirror_method_) wasn't handlerized across some
allocation/GC points such as the ResolveType() call in
ScanTryCatchBlocks() and the GetReturnType() calls in
CodeFlowVerifyInstruction().

Bug: 12687968
Change-Id: I95323de14459eb5a7c4abfcf44f882f86d59be64
cb6b0f31ede2275e79e6199ec391147585a37a2a 12-Aug-2014 Ian Rogers <irogers@google.com> Avoid use of std::string where we have const char*.

Removing the ClassHelper caused std::string creation for all calls to
Class::GetDescriptor and a significant performance regression. Make the
std::string an out argument so the caller can maintain it and its life time
while allowing GetDescriptor to return the common const char* case.

Don't generate GC maps when compilation is disabled.

Remove other uses of std::string that are occuring on critical paths.
Use the cheaper SkipClass in CompileMethod in CompilerDriver.
Specialize the utf8 as utf16 comparison code for the common shorter byte
encoding.
Force a bit of inlining, remove some UNLIKELYs (they are prone to pessimizing
code), add some LIKELYs.

x86-64 host 1-thread interpret-only of 57 apks:
Before: 29.539s
After: 23.467s

Regular compile:
Before: 1m35.347s
After: 1m20.056s

Bug: 16853450
Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad

Conflicts:
runtime/utils.cc
1ff3c98775a4577cf053dba9a0c2d5c21c07b298 12-Aug-2014 Ian Rogers <irogers@google.com> Avoid use of std::string where we have const char*.

Removing the ClassHelper caused std::string creation for all calls to
Class::GetDescriptor and a significant performance regression. Make the
std::string an out argument so the caller can maintain it and its life time
while allowing GetDescriptor to return the common const char* case.

Don't generate GC maps when compilation is disabled.

Remove other uses of std::string that are occuring on critical paths.
Use the cheaper SkipClass in CompileMethod in CompilerDriver.
Specialize the utf8 as utf16 comparison code for the common shorter byte
encoding.
Force a bit of inlining, remove some UNLIKELYs (they are prone to pessimizing
code), add some LIKELYs.

x86-64 host 1-thread interpret-only of 57 apks:
Before: 29.539s
After: 23.467s

Regular compile:
Before: 1m35.347s
After: 1m20.056s

Bug: 16853450
Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad
a59dd80f9f48cb750d329d4d4af2d99d72b484d1 03-Jul-2014 Alex Light <allight@google.com> Runtime can now be set to require relocation

Add a pair of runtime flags -Xrelocate and -Xnorelocate that can force
the runtime to require that all files that are run are relocated, to
prevent attacks based on the known art base address.

Add support for running patchoat on oat files compiled without an image.

Change run-test to have new --prebuild and --relocate flags.

Bug: 15358152

Change-Id: I91166c62dd1ab80e5cbcb7883a2cd0d56afca32d
22d5e735f403c57525fe868304c7123f0ce66399 16-Jul-2014 Ian Rogers <irogers@google.com> Remove object_utils.h.

Break into object_lock, field_helper and method_helper.
Clean up header files following this.
Also tidy some of the Handle code in response to compiler errors when resolving
the changes in this CL.

Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
e63db27db913f1a88e2095a1ee8239b2bb9124e8 16-Jul-2014 Ian Rogers <irogers@google.com> Break apart header files.

Create libart-gtest for common runtime and compiler gtest routines.
Rename CompilerCallbacksImpl that is quick compiler specific.
Rename trace clock source constants to not use the overloaded profiler term.

Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933
22f8e5c82d12951be38cd893426e13bee33fd69d 09-Jul-2014 Andreas Gampe <agampe@google.com> Revert "Revert "ART: Key-Value Store in Oat header""

This reverts commit 452bee5da9811f62123978e142bd67b385e9ff82.

Heap-allocate a couple of objects in dex2oat to avoid large frame
size.

Includes fixes originally in 100596 and 100605.

Change-Id: Id51a44198c973c91f0a3f87b9d992a5dc110c6f8
98d1cc8033251c93786e2fa8c59a2e555a9493be 16-May-2014 Mingyao Yang <mingyao@google.com> Improve performance of invokevirtual/invokeinterface with embedded imt/vtable

Add an embedded version of imt/vtable into class object. Both tables start at
fixed offset within class object so method/entry point can be loaded directly
from class object for invokeinterface/invokevirtual.

Bug: 8142917
Change-Id: I4240d58cfbe9250107c95c0708c036854c455968
c87d27b25994da8670d82a8f7bad6327b693bfff 27-Jun-2014 Andreas Gampe <agampe@google.com> ART: Key-Value Store in Oat header

Allows the storage of string-string pairs in the oat header. The
first significant use of this is storing the implicit-check flags,
so that an oat file can be rejected if it doesn't agree with the
current runtime.

Bump the oat version as the header structure changes.

Change-Id: I15a1c16886e6b8fa7b881c918c19c1efa5c7c00f
452bee5da9811f62123978e142bd67b385e9ff82 09-Jul-2014 Nicolas Geoffray <ngeoffray@google.com> Revert "ART: Key-Value Store in Oat header"

Broke arm64 build.

This reverts commit c87d27b25994da8670d82a8f7bad6327b693bfff.

Change-Id: I4c2ade295d2b5aa77fc3ad810e0e859629a5bf09
bfd9a4378eacaf2dc2bbe05ad48c5164fc93c9fe 22-May-2014 Mathieu Chartier <mathieuc@google.com> Change MethodHelper to use a Handle.

Added ConstHandle to help prevent errors where you modify the value
stored in the handle of the caller. Also fixed compaction bugs
related to not knowing MethodHelper::GetReturnType can resolve types.
This bug was present in interpreter RETURN_OBJECT.

Bug: 13077697

Change-Id: I71f964d4d810ab4debda1a09bc968af8f3c874a3
61c5ebc6aee2cac1c363de6fbdac25ada1697fdb 06-Jun-2014 Mathieu Chartier <mathieuc@google.com> Change FieldHelper to use a handle.

Fixed compaction bugs related to FieldHelper::GetType in:
artSet32InstanceFromCode
SetFieldValueImpl
CheckReceiver
Field_set
interpreter::DoFieldPut
MethodVerifier::VerifyISGet
MethodVerifier::VerifyISPut
MethodVerifier::VerifyIGetQuick

Bug: 13077697

Change-Id: I7de9ded2893b5568d43e4daa86fd135bf5508b72
a8b41aaa08283390606e6515d178ca3cc4c6ca41 05-Jun-2014 Andreas Gampe <agampe@google.com> ART: Allocate ostreams on the heap in Oatdump::DumpOatMethod

The stack frame size for this method is above our limits. Allocate
ostreams on the heap instead of on the stack.

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

Merge ART from AOSP to lmp-preview-dev.

Change-Id: I0f578733a4b8756fd780d4a052ad69b746f687a9
0cd81352a7c06e381951cea1b104fd73516f4341 23-May-2014 Mathieu Chartier <mathieuc@google.com> Revert "Revert "Fix an outstanding compaction bug in interpreter.""

Fixed the generic trampoline to not use ToJObject when unnecessary.

Bug: 15167269

This reverts commit 3bdb873122964da7937eb070cbcf2ef638a8e459.

Change-Id: I0525d0e0f3afb753c770e1572070a0fa22b02271
46960fe5dcc1be07b39a55114338423a73554449 23-May-2014 Ian Rogers <irogers@google.com> Make the specification of when we need precise constants more precise.

Means that oatdump output showing values for deoptimization actually reflects
what we see at runtime.
Also, doesn't do precise in the case of determining methods and fields for the
quickened case, which may be an occasional performance win.

Change-Id: I62c7fb244f7996ba9d52e7a7ce75c046b663fa17
3bdb873122964da7937eb070cbcf2ef638a8e459 23-May-2014 Mathieu Chartier <mathieuc@google.com> Revert "Fix an outstanding compaction bug in interpreter."

This reverts commit e09ae0920be57760fb390b6944bce420fa0b5582.

Change-Id: I48036306130d5ccfec683d0dc3e9a642a02ee9c1
0f5baa079eea76758aee32d7f87cb175deab8308 22-May-2014 Brian Carlstrom <bdc@google.com> Update dump-oat-* and oatdump for new image file layout

Bug: 11997009
Change-Id: I30c356f3ea62b1850d17b5c6bf4af4080a466858
e09ae0920be57760fb390b6944bce420fa0b5582 15-May-2014 Mathieu Chartier <mathieuc@google.com> Fix an outstanding compaction bug in interpreter.

Fixed a bug in DoFieldPut where the FieldHelper GetType could cause
thread suspension which would result in a stale obj.

Added more handles in the class linker to facilitate moving fiels
and methods in the future.

Removed un-necessarly passing handle references since these are value
types and don't need to be passed by reference.

Added a special NullHandle type which allows null handles without a
handle scope.

Change-Id: I1b51723920a2e4f4f8b2907066f578a3e879fd5b
700a402244a1a423da4f3ba8032459f4b65fa18f 20-May-2014 Ian Rogers <irogers@google.com> Now we have a proper C++ library, use std::unique_ptr.

Also remove the Android.libcxx.mk and other bits of stlport compatibility
mechanics.

Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
f832284dd847ff077577bb5712225430bbbb3b67 16-May-2014 Mathieu Chartier <mathieuc@google.com> Delete ClassHelper and fix compaction bug in GetDirectInterface

Cleanup helps to prevent compaction bugs. Fixed a fairly serious
compaction error caused by calling ClassHelper::GetDirectInterface
without handling the case where it causes thread suspension due to
ResolveType.

Bug: 8981901

Change-Id: I82b3bb6dd48d21eb6ece7aae0733c4a23c2bc408
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
b9beb2e2efb6a204a69ca660d478b45f851e8f09 10-May-2014 Ian Rogers <irogers@google.com> Place ISA into boot image name.

Depends upon:
https://android-review.googlesource.com/94078

Change-Id: I22c18b03b2c0db7a3f792920064e7710363b58b4
42fcd9838a87abaf7a2ef86853a5287f86dbe391 22-Apr-2014 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "64bit changes to the stack walker for the Quick ABI.""

This reverts commit 8d5ead52a92675c258113d3dfa71bf8fceba5d9f.

Change-Id: I6b4774a9bd180de33551975e106322ba1192e6ab
8a630577ed2d9e9571c3434c505e5de223b23c07 09-Apr-2014 Vladimir Marko <vmarko@google.com> Move mapping table and vmap table offsets to OatMethodHeader.

This change has a libcore/ companion CL
"Remove ArtMethod's quick fields mapping table and vmap table."
https://android-review.googlesource.com/91254

Bug: 11767815
Change-Id: I46ce2067e1ecd915da3890606498e31ffc332813
bbd695c71e0bf518f582e84524e1cdeb3de3896c 16-Apr-2014 Mathieu Chartier <mathieuc@google.com> Replace ObjectSet with LargeObjectBitmap.

Speeds up large object marking since large objects no longer required
a lock. Changed the GCs to use the heap bitmap for marking objects
which aren't in the fast path. This eliminates the need for a
MarkLargeObject function.

Maps before (10 GC iterations):
Mean partial time: 180ms
Mean sticky time: 151ms

Maps after:
Mean partial time: 161ms
Mean sticky time: 101ms

Note: the GC durations are long due to recent ergonomic changes and
because the fast bulk free hasn't yet been enabled. Over 50% of the
GC time is spent in RosAllocSpace::FreeList.

Bug: 13571028

Change-Id: Id8f94718aeaa13052672ccbae1e8edf77d653f62
d3c5bebcb52a67cb06e7ab303eaf45f230c08b60 11-Apr-2014 Vladimir Marko <vmarko@google.com> Avoid allocating OatFile::OatClass on the heap.

Avoid allocating a BitVector for OatFile::OatClass::bitmap_
with kOatClassSomeCompiled methods. That makes the OatClass
copy-constructible as it doesn't own any memory. We use that
in OatFile::OatDexFile::GetOatClass() to return the result
by value thus avoiding one or two heap allocations per call.

Change-Id: Ic7098109028a5b49e39ef626f877de86e732ed18
c0a1b18ac71ec0ff3ec0cca3cc8db9eb74e50690 05-Mar-2014 Brian Carlstrom <bdc@google.com> Reuse NoopCompilerCallbacks in oatdump

Change-Id: Icb4d3941196c1a236f0184fe4d0b7f5838bc13bd
2ec6520d57479d393bffa05defa1479b25ca8382 04-Mar-2014 Brian Carlstrom <bdc@google.com> Support compiler filters for boot classpath

image_writer.cc
Remove assumption that all methods in the boot classpath are compiled

oat_writer.cc
Don't skip writing ArtMethod::quick_code_offset_ for methods that need resolution, leave that to ImageWriter

dex2oat.cc
Allow dex2dex compilation of image dex files by making the in memory pages writable in all cases, not just app case.

oatdump.cc
dump new OatHeader fields
use ImageSpace.GetImageFilename, not command line image filename, since location may be in dalvik-cache
remove inaccurate check about non-null GC map

quick_trampoline_entrypoints.cc
add and improve some DCHECKS that were useful while debugging

class_linker.cc
image_space.cc
fix double facepalm

parsed_options.cc
fix zygote logging to not skip values to two part options like -classpath <foo>

runtime.cc
wireup parsed compiler options to runtime

Change-Id: Iad314df0b80623c0663d61713d5098297ab9ac87
9583fbcf597eff6d0b3c5359b8e8d5f70ed82c40 28-Feb-2014 Nicolas Geoffray <ngeoffray@google.com> Remove oat file location in the image.

The oat file is now always in the same directory, and has the
same name as the image file. Only difference is the extension.

This also removes the need for host-prefix.

Change-Id: I16d1f7aeb1d58372d41921694664e9c321afc1ad
c22c59ef8513b4cbbfd25073d1afbf58196b522a 25-Feb-2014 Mathieu Chartier <mathieuc@google.com> Remove started runtime check in RevokeAllThreadLocalAllocationStacks

This check occasionally caused some thread local allocation stacks
to incorrectly not get revoked when multiple threads were allocating
without a started runtime. This showed up in image_test with
compaction enabled when we were initializing classes in the compiler
driver.

Change-Id: I7f28d072feea333c2503e35265ba25c51a6308fe
404f59f4125ec9935ad8cffac56ab99d6320b17b 24-Feb-2014 Dave Allison <dallison@google.com> Adds 2 new option args to oatdump:

--dump:raw_mapping_table
--dump:raw_gc_map
Change-Id: Ic4af5ae5714329da616240abbe64b137ed67d221
90d706849a09590f150748ff97256ef718aca441 21-Feb-2014 Hiroshi Yamauchi <yamauchi@google.com> Fix oatdumpd.

Bug: 13063529
Change-Id: I777cd7621ed522b8ab84c5bb1a9d2e5583817a08
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
5115473c81ec855a5646a5f755afb26aa7f2b1e9 02-Jan-2014 Vladimir Marko <vmarko@google.com> Fix oatdump "compilercallbacks" option for runtime.

The "compilercallbacks" runtime option replaced "compiler"
in I708ca13227c809e07917ff3879a89722017e83a9 .

Fix a comment in codegen_util.cc .

Change-Id: I2c5ebd56dd96f0ee8e62b602bfe45357565471ff
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
fa82427c68b09f4aedbee319dc71579afbfc66f5 06-Nov-2013 Ian Rogers <irogers@google.com> Fix oatdump and valgrind.

Bug: 11531382
Move allocation instrumentation out of runtime into instrumentation. Don't
attempt to suspend threads in unstarted runtimes.
Make indentation support sputc returning eof, on which it will sync and try
again. A further failure likely means the disk is full.
Move the dump-oat output directory to be art as now there's too much output to
fit all the dump-oat data in our standard /tmp.

Change-Id: I8ea848ace318552c180e2efa46570288ff1ca62c
7020278bce98a0735dc6abcbd33bdf1ed2634f1d 23-Oct-2013 Dave Allison <dallison@google.com> Support hardware divide instruction

Bug: 11299025

Uses sdiv for division and a combo of sdiv, mul and sub for modulus.
Only does this on processors that are capable of the sdiv instruction, as determined
by the build system.

Also provides a command line arg --instruction-set-features= to allow cross compilation.
Makefile adds the --instruction-set-features= arg to build-time dex2oat runs and defaults
it to something obtained from the target architecture.

Provides a GetInstructionSetFeatures() function on CompilerDriver that can be
queried for various features. The only feature supported right now is hasDivideInstruction().

Also adds a few more instructions to the ARM disassembler

b/11535253 is an addition to this CL to be done later.

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

Change-Id: Idf7fe85e1293453a8ad862ff2380dcd5db4e3a39
ba150c37d582eeeb8c11ba5245edc281cf31793c 28-Aug-2013 Brian Carlstrom <bdc@google.com> Omit OatMethodOffsets for classes without compiled code

Change-Id: If0d290f4aebc778ff12d8fed017c270ad2ac3220
8d31bbd3d6536de12bc20e3d29cfe03fe848f9da 13-Oct-2013 Ian Rogers <irogers@google.com> Throw IOException at source of failing to open a dex file.

Before is:
java.lang.ClassNotFoundException: Didn't find class "GCBench" on path: DexPathList[[zip file "/disk2/dalvik-dev/out/host/linux-x86/framework/GCBench.jar"],nativeLibraryDirectories=[/disk2/dalvik-dev/out/host/linux-x86/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
Suppressed: java.lang.ClassNotFoundException: GCBench
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 1 more
Caused by: java.lang.NoClassDefFoundError: Class "LGCBench;" not found
... 5 more
And after is:
java.lang.ClassNotFoundException: Didn't find class "GCBench" on path: DexPathList[[zip file "/disk2/dalvik-dev/out/host/linux-x86/framework/GCBench.jar"],nativeLibraryDirectories=[/disk2/dalvik-dev/out/host/linux-x86/lib]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:511)
at java.lang.ClassLoader.loadClass(ClassLoader.java:469)
Suppressed: java.io.IOException: Zip archive '/disk2/dalvik-dev/out/host/linux-x86/framework/GCBench.jar' doesn't contain classes.dex
at dalvik.system.DexFile.openDexFile(Native Method)
at dalvik.system.DexFile.<init>(DexFile.java:80)
at dalvik.system.DexFile.<init>(DexFile.java:59)
at dalvik.system.DexPathList.loadDexFile(DexPathList.java:268)
at dalvik.system.DexPathList.makeDexElements(DexPathList.java:235)
at dalvik.system.DexPathList.<init>(DexPathList.java:113)
at dalvik.system.BaseDexClassLoader.<init>(BaseDexClassLoader.java:48)
at dalvik.system.PathClassLoader.<init>(PathClassLoader.java:38)
at java.lang.ClassLoader.createSystemClassLoader(ClassLoader.java:128)
at java.lang.ClassLoader.access$000(ClassLoader.java:65)
at java.lang.ClassLoader$SystemClassLoader.<clinit>(ClassLoader.java:81)
at java.lang.ClassLoader.getSystemClassLoader(ClassLoader.java:137)
Suppressed: java.lang.ClassNotFoundException: GCBench
at java.lang.Class.classForName(Native Method)
at java.lang.BootClassLoader.findClass(ClassLoader.java:781)
at java.lang.BootClassLoader.loadClass(ClassLoader.java:841)
at java.lang.ClassLoader.loadClass(ClassLoader.java:504)
... 1 more
Caused by: java.lang.NoClassDefFoundError: Class "LGCBench;" not found
... 5 more

Also, move dex file verifier messages out of logs.
In the process the ClassLinker::dex_lock_ needed tidying to cover a smaller
scope. Bug 11301553.

Change-Id: I80058652e11e7ea63457cc01a0cb48afe1c15543
8e3fb14615f20677da8421ada131b5f2fcd8eb56 10-Oct-2013 Brian Carlstrom <bdc@google.com> Revert "Add Jack modifier."

This reverts commit 6ffd0967027c092a62d7100ca42ceded369c8ca1.

Change-Id: Ia69241a5100e8f740379e2ed944279de4daaf9ed
6f277751ec5bfc0d7469b2cc7f7134e9032593f1 01-Oct-2013 Brian Carlstrom <bdc@google.com> Make oatdump support image file generated on device

Bug: 11012947
Change-Id: Ic7bce4cbf1c00e219c2d312e85b27b980b1396f2
fc0e94bed3f88ed7e50854fd8dfaf5dcb345250f 24-Sep-2013 Ian Rogers <irogers@google.com> StringPiece clean up.

Profile guided clean up.
Try to avoid creating StringPieces with the contents of a dex file where
the length is known.
Try to avoid RegTypeCache::FromDescriptor when there's a class available.
Make ConstantType::ConstantValue inlinable.
Saving of about 50ms from a 2 threaded ThinkFree compile on host.

Change-Id: I47a12c3c76f46e2c9805be1c3a3e3870fe1f5d85
ee39a10e45a6a0880e8b829525c40d6055818560 19-Sep-2013 Ian Rogers <irogers@google.com> Use class def index from java.lang.Class.

Bug: 10244719
This removes the computation of the dex file index, when necessary this is
computed by searching the dex file. Its only necessary in
dalvik.system.DexFile.defineClassNative and DexFile::FindInClassPath, the
latter not showing up significantly in profiling with this change.

(cherry-picked from 8b2c0b9abc3f520495f4387ea040132ba85cae69)
Change-Id: I20c73a3b17d86286428ab0fd21bc13f51f36c85c
8b2c0b9abc3f520495f4387ea040132ba85cae69 19-Sep-2013 Ian Rogers <irogers@google.com> Use class def index from java.lang.Class.

Bug: 10244719
Depends on:
https://googleplex-android-review.git.corp.google.com/362363
This removes the computation of the dex file index, when necessary this is
computed by searching the dex file. Its only necessary in
dalvik.system.DexFile.defineClassNative and DexFile::FindInClassPath, the
latter not showing up significantly in profiling with this change.

Change-Id: I20c73a3b17d86286428ab0fd21bc13f51f36c85c
32327098e300ab66671b891a18bf669576fc896a 30-Aug-2013 Mathieu Chartier <mathieuc@google.com> Fix oatdump to take bitmap bytes into its accounting.

Bug: 10567842

Change-Id: I14d921343bc54598a83cfcf8d7185dca702c2739
31e8925781c2302f1d1a9b39e216ba415bfe0d7e 28-Aug-2013 Mathieu Chartier <mathieuc@google.com> Write out image bitmap inside of image file.

We now create the image bitmap when we generate the image. The image
bitmap is written after the image inside of the image file. This
speeds up dex2oat by making walking the image during heap creation
unnecessary. This should also help memory pressure by enabling the
image bitmap to be swappable.

Bug: 10432288

Change-Id: Idebf459ed15edbb41a7d9b9b353934155bce2f19
4b8c13ee44c4c959d7b8de9adff7ce6df48c31d0 24-Aug-2013 Brian Carlstrom <bdc@google.com> Fix sort order to make register promotion stable

Also some minor oatdump fixes

Change-Id: I5679835bf684b98d130b77ecf00bda5f6547d383
02e25119b15a6f619f17db99f5d05124a5807ff3 15-Aug-2013 Mathieu Chartier <mathieuc@google.com> Fix up TODO: c++0x, update cpplint.

Needed to update cpplint to handle const auto.

Fixed a few cpplint errors that were being missed before.

Replaced most of the TODO c++0x with ranged based loops. Loops which
do not have a descriptive container name have a concrete type instead
of auto.

Change-Id: Id7cc0f27030f56057c544e94277300b3f298c9c5
414af10d719603fb4d8d972f5a022c17957b44e1 13-Aug-2013 Brian Carlstrom <bdc@google.com> Add flock(2)ing on dex-cache files to prevent races

Bug: 9071417
Change-Id: I1ee9ff281867f90fba7a8ed8bbf06b33ac29d511
7571e8b761ebc2c923525e12ea9fcf07e62cb33e 13-Aug-2013 Brian Carlstrom <bdc@google.com> Add flock(2)ing on dex-cache files to prevent races

Bug: 9071417
Change-Id: I1ee9ff281867f90fba7a8ed8bbf06b33ac29d511
ea46f950e7a51585db293cd7f047de190a482414 30-Jul-2013 Brian Carlstrom <bdc@google.com> Refactor java.lang.reflect implementation

Cherry-picked from commit ed41d5c44299ec5d44b8514f6e17f802f48094d1.

Move to ArtMethod/Field instead of AbstractMethod/Field and have
java.lang.reflect APIs delegate to ArtMethod/ArtField.

Bug: 10014286.

Change-Id: Iafc1d8c5b62562c9af8fb9fd8c5e1d61270536e7
08bf1967611965b65ffd5de1aa603b60e7b2d6a8 12-Aug-2013 Dragos Sbirlea <dragoss@google.com> Work on SMALL_ART and PORTABLE working at the same time.

Change-Id: Iddedf63b6f9d908717a4d30f963e9b81a9604d49
96faf5b363d922ae91cf25404dee0e87c740c7c5 10-Aug-2013 Ian Rogers <irogers@google.com> Uleb128 compression of vmap and mapping table.

Bug 9437697.

Change-Id: I30bcb97d12cd8b46d3b2cdcbdd358f08fbb9947a
(cherry picked from commit 1809a72a66d245ae598582d658b93a24ac3bf01e)
1809a72a66d245ae598582d658b93a24ac3bf01e 10-Aug-2013 Ian Rogers <irogers@google.com> Uleb128 compression of vmap and mapping table.

Bug 9437697.

Change-Id: I30bcb97d12cd8b46d3b2cdcbdd358f08fbb9947a
7934ac288acfb2552bb0b06ec1f61e5820d924a4 26-Jul-2013 Brian Carlstrom <bdc@google.com> Fix cpplint whitespace/comments issues

Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
6c87180aef7d3127c0f25fcbc76e71f4a4f2b9fa 17-Jul-2013 Brian Carlstrom <bdc@google.com> Fix oatdump to work after selinux OatFile installd change

Change-Id: I993eceef726fca37fd4c79bc0872fb28899ae2f6
f1d3455064792ac1c486a4a9c24279a37b4af473 13-Jul-2013 Brian Carlstrom <bdc@google.com> Do not mark pages executable unnecessarily to play nice with selinux

Change-Id: Ief4a5da38ac7c2cf7bf6f7a640cb63c5e8ed03bd
7940e44f4517de5e2634a7e07d58d0fb26160513 12-Jul-2013 Brian Carlstrom <bdc@google.com> Create separate Android.mk for main build targets

The runtime, compiler, dex2oat, and oatdump now are in seperate trees
to prevent dependency creep. They can now be individually built
without rebuilding the rest of the art projects. dalvikvm and jdwpspy
were already this way. Builds in the art directory should behave as
before, building everything including tests.

Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81