History log of /art/compiler/optimizing/sharpening.cc
Revision Date Author Comments
f25cc730ff70f085daf527f69a02fdee69aee16b 16-Mar-2017 Vladimir Marko <vmarko@google.com> Deterministic DexCache in heap images.

Preload each slot in dex cache arrays with the candidate
entry with the lowest index.

Also fix a discrepancy where we used to keep an ArtField*
in the DexCache if we kept the declaring class rather than
based on the class referenced in the corresponding FieldId.
This can result in accessing a field through a FieldId with
an unresolved class as demonstrated by the regression test.

Test: 159-app-image-fields
Test: testrunner.py --host
Bug: 30627598
Change-Id: I34735047cb064ff462cd9859e86a61ddf8615ecd
c52f3034b06c03632e937aff07d46c2bdcadfef5 02-Mar-2017 Richard Uhler <ruhler@google.com> Remove --include-patch-information option from dex2oat.

Because we no longer support running patchoat on npic oat files, which
means the included patch information is unused .

Bug: 33192586
Test: m test-art-host

Change-Id: I9e100c4e47dc24d91cd74226c84025e961d30f67
c4aa82c5b0aa921c51eaf6f6bbaff36501ea2cee 06-Mar-2017 Nicolas Geoffray <ngeoffray@google.com> Invoke typed arraycopy for primitive arrays.

Apps will always call the Object version of arraycopy. When
we can infer the types of the passed arrays, replace the method
being called to be the typed System.arraycopy one.

10% improvement on ExoPlayerBench.

Test: 641-checker-arraycopy
bug: 7103825
Change-Id: I872d7a6e163a4614510ef04ae582eb90ec48b5fa
fa4333dcb481e564f54726b4e6f8153612df835e 14-Feb-2017 Andreas Gampe <agampe@google.com> ART: Add operator == and != with nullptr to Handle

Get it in line with ObjPtr and prettify our code.

Test: m
Change-Id: I1322e2a9bc7a85d7f2441034a19bf4d807b81a0e
83c8e27a292e6e002fb3b3def75cf6d8653378e8 31-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Code refactoring around sharpening HLoadClass.

Even if the class is not accessible through the dex cache, we
can access it by other means (eg boot class, jit table). So rewrite
static field access instruction builder to not bail out if a class
cannot be accessed through the dex cache.

bug:34966607

test: test-art-host test-art-target
Change-Id: I88e4e09951a002b480eb8f271726b56f981291bd
1ebe4fe1a6cb0835197ee3a848d554b79ca9d367 30-Jan-2017 Alex Light <allight@google.com> Fix creating self-recursive obsolete methods.

We were using recursive loading of the current art method which was
making us miss obsolete methods in some cases.

We could also end up checking the wrong method when walking the stack.

We also add tests for recursive obsolete methods in general.

Bug: 34815470

Test: mma -j40 test-art-host
Test: ART_TEST_JIT=true mma -j40 test-art-host
Change-Id: I522fd4cac4e3f9d35d03b128bad6d6971cfe6c4a
5247c08fb186a5a2ac02226827cf6b994f41a681 13-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Put the resolved class in HLoadClass.

To avoid repeated lookups in sharpening/rtp/inlining.

Test: test-art-host test-art-target
Change-Id: I08d0da36a4bb061cdaa490ea2af3a3217a875bbe
1998cd02603197f2acdc0734397a6d48b2f59b80 13-Jan-2017 Vladimir Marko <vmarko@google.com> Implement HLoadClass/kBssEntry for boot image.

Test: m test-art-host
Test: m test-art-host with CC
Test: m test-art-target on Nexus 9
Test: Nexus 9 boots.
Test: Build aosp_mips64-eng
Bug: 30627598
Change-Id: I168f24dedd5fb54a1e4215ecafb947ffb0dc3280
6bec91c7d4670905cd67440991ec76fd54d0f000 09-Jan-2017 Vladimir Marko <vmarko@google.com> Store resolved types for AOT code in .bss.

Test: m test-art-host
Test: m test-art-target on Nexus 9.
Test: Nexus 9 boots.
Test: Build aosp_mips64-eng.
Bug: 30627598
Bug: 34193123
Change-Id: I8ec60a98eb488cb46ae3ea56341f5709dad4f623
4155998a2f5c7a252a6611e3926943e931ea280a 06-Jan-2017 Vladimir Marko <vmarko@google.com> Make runtime call on main for HLoadClass/kDexCacheViaMethod.

Remove dependency of the compiled code on types dex cache
array in preparation for changing to a hash-based array.

Test: m test-art-host
Test: m test-art-target on Nexus 9
Bug: 30627598
Change-Id: I3c426ed762c12eb9eb4bb61ea9a23a0659abf0a2
48886c2ee655a16224870fee52dc8721a52babcf 06-Jan-2017 Vladimir Marko <vmarko@google.com> Remove HLoadClass::LoadKind::kDexCachePcRelative.

Test: m test-art-host
Test: m test-art-target-run-test-552-checker-sharpening
Bug: 30627598
Change-Id: Ic809b0f3a8ed0bd4dc7ab67aa64866f9cdff9bdb
f0acfe7a812a332122011832074142718c278dae 09-Jan-2017 Nicolas Geoffray <ngeoffray@google.com> Keep resolved String in HLoadString.

For the following reasons:
- Avoids needing to do a lookup again in CodeGenerator::EmitJitRoots.
- Fixes races where we the string was GC'ed before CodeGenerator::EmitJitRoots.
- Makes it possible to do GVN on the same string but defined in different
dex files.

Test: test-art-host, test-art-target
Change-Id: If2b5d3079f7555427b1b96ab04546b3373fcf921
4d1be4920fefe2c1f7cb40357842c6587cdcc50e 06-Jan-2017 Vladimir Marko <vmarko@google.com> Remove the IsInDexCache flag from HLoadString.

This flag was obsolete and always false.

Test: m test-art-host
Change-Id: Iabefc068908ff4f994b63e7e18a2a27c25a0919e
c1a42cf3873be202c8c0ca3c4e67500b470ab075 18-Dec-2016 Nicolas Geoffray <ngeoffray@google.com> Remove soon to be obsolete call kinds for direct calls.

And remove CompilerDriver::GetCodeAndMethodForDirectCall in
preparation of removing non-PIC prebuild and non-PIC on-device
boot image compilation.

Test: test-art-host test-art-target
bug:33192586
Change-Id: Ic48e3e8b9d7605dd0e66f31d458a182198ba9578
568763405f6eb7cb78fd39272569e30fe21be85e 16-Dec-2016 Nicolas Geoffray <ngeoffray@google.com> Sharpen HLoadClass from inliner.

Also cleanup HLoadClass constructor.

Test: ART_TEST_JIT=true m test-art-host-run-test

Change-Id: I8f803b05fb8a7267d1421ca9c032e624f27efed3
9b1583e7d799a3bb3c0036abb8a0b9fcbfad360a 13-Dec-2016 Nicolas Geoffray <ngeoffray@google.com> Support GVN for HLoadClass::LoadKind::kJitTableAddress.

Fixes performance regressions seen in eg Dhrystone.

Also add comment on why a class may not be found when sharpening.

Test: manual Dhrystone run, performance recovers
Test: ART_TEST_JIT=true test-art-host-run-test-jit
Change-Id: I8e879f1c390f83e8bc930f343beb7b4a41c2f190
22384aeab988df7fa5ccdc48a668589c5f602c39 12-Dec-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Add kJitTableAddress for HLoadClass.""

This reverts commit d2d5262c8370309e1f2a009f00aafc24f1cf00a0.

Change-Id: I6149d5c7d5df0b0fc5cb646a802a2eea8d01ac08
d2d5262c8370309e1f2a009f00aafc24f1cf00a0 12-Dec-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Add kJitTableAddress for HLoadClass."

One test failure after merge.

This reverts commit 5b12f7973636bfea29da3956a9baa7a6bbe2b666.

Change-Id: I120c49e53274471fc1c82a10d52e99c83f5f85cc
5b12f7973636bfea29da3956a9baa7a6bbe2b666 09-Dec-2016 Nicolas Geoffray <ngeoffray@google.com> Add kJitTableAddress for HLoadClass.

This new kind loads classes from the root table associated with
JIT compiled code.

Also remove kDexCacheAddress, which is replaced by kJitTableAddress.

test: ART_TEST_JIT=true test-art-host-jit test-art-target-jit
Change-Id: Ia23029688d1a60c178bf2ffa7463927c5d5de4d0
8a0128a5ca0784f6d2b4ca27907e8967a74bc4c5 28-Nov-2016 Andreas Gampe <agampe@google.com> ART: Add dex::StringIndex

Add abstraction for uint32_t string index.

Test: m test-art-host
Change-Id: I917c2881702fe3df112c713f06980f2278ced7ed
a5b09a67034e57a6e10231dd4bd92f4cb50b824c 18-Nov-2016 Andreas Gampe <agampe@google.com> ART: Add dex::TypeIndex

Add abstraction for uint16_t type index.

Test: m test-art-host
Change-Id: I47708741c7c579cbbe59ab723c1e31c5fe71f83a
132d8363bf8cb043d910836672192ec8c36649b6 16-Nov-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Revert "Revert "JIT root tables.""""

Test: 626-set-resolved-string, test-art-host, test-art-target
Test: run-libcore-tests.sh
Test: phone boots and runs

This reverts commit 3395fbc20bcd20948bec8958db91b304c17cacd8.

Change-Id: I104b73d093e3eb6a271d564cfdb9ab09c1c8cf24
3395fbc20bcd20948bec8958db91b304c17cacd8 14-Nov-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Revert "JIT root tables."""

libcore failures:
dalvikvm32 F 11-14 03:04:06 14870 14870 jit_code_cache.cc:310] Check failed: new_string != nullptr

This reverts commit 75afcdd3503a8a8518e5b23d21b6e73306ce39ce.

Change-Id: I5a6b6b48aa79a763d1ff1ba4d85d63811254787d
75afcdd3503a8a8518e5b23d21b6e73306ce39ce 10-Nov-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "JIT root tables.""

Also contains Revert "Support kJitTableAddress in x86/arm/arm64."

This reverts commit 4acd03638fcdb4e5d1666f8eec7eb3bf6d6be035.
This reverts commit 997d1217830c0a18b70faeabd53c04700a87d7d9.

Test: ART_USE_READ_BARRIER=true/false test-art-host test-art-target

Change-Id: I77cb1e9bf8f1b4c58b72d3cf5ca31ced2aaa1ea3
4acd03638fcdb4e5d1666f8eec7eb3bf6d6be035 09-Nov-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "JIT root tables."

May be the offender for jit-gcstress failure of 902.

This reverts commit ac3ebc3150760425ed00abd56da48f9a6e0666bc.

Change-Id: I9ea6c9236fd1729fed7d1868dd8a111172932308
54d6a207341ad45cb5eceed71a344073ed6d4e31 09-Nov-2016 Vladimir Marko <vmarko@google.com> Fix 552-checker-sharpening for PIC test.

And remove obsolete HLoadString::LoadKind::kDexCacheAddress.

Test: m ART_TEST_PIC_TEST=true test-art-host
Change-Id: I3e7a1a98c2c7eba5ea10954d7efcf743a807c300
ac3ebc3150760425ed00abd56da48f9a6e0666bc 05-Oct-2016 Nicolas Geoffray <ngeoffray@google.com> JIT root tables.

Implement root tables for the JIT. Each JIT compiled method
gets a table allocated before the stack maps.

The table gets visited through Runtime::SweepSystemWeaks.

Implement String roots for x86_64 as an example.

Test: test-art-host test-art-target

Change-Id: Id3d5bc67479e08b52dd4b253e970201203a0f0d2
1bc4b178590fa204265363a0207f1388e8bd6d15 24-Oct-2016 Vladimir Marko <vmarko@google.com> Revert "Disable kBssEntry LoadString sharpening."

Fix .bss GC root walking by registering the oat file
with the class loader's class table.

Also fix potentially outdated ObjPtr<> use in debug build.

This reverts commit b55fdbb30b3bc4e334c241153b98c0a6ea4a4a2b.

Test: m test-art-host
Bug: 32124939
Change-Id: I0b7e3b93cb53c7b22408aa10a04eaf5582c69ee8
1ceb37c75544c5285fb87f27e1d9fa7261ced60c 30-Aug-2016 Mathieu Chartier <mathieuc@google.com> Remove unnecessary load class for new instance

Remove the load class for new instance if the load class has only one
use and can not throw. Previously many were not removed due to
MarkInDexCache nulling out the environment of the HLoadClass and
causing CanMoveClinitCheck to fail.

Also keep track of initialized HLoadClass and always remove clinit
checks for these.

Added checker regression test.

Code size savings: ARM64 CC boot.oat: 47896936 -> 47642488 (-0.53%)
Savings from IsInitialized optimization: 65984 bytes

Performance unmeasured, probably faster due to removing unnecessary
work.

Test: test-art-host with CC baker

Bug: 29516974

Change-Id: I43358762ffb380ebe7e6518d0d440a5e1cc03b61
0cab20cf5e2f19491296c832998b51dd3d9eb0a0 21-Oct-2016 Vladimir Marko <vmarko@google.com> Disable kBssEntry LoadString sharpening.

We seem to fail to visit the BSS GC roots sometimes.

Bug: 32124939
Test: m test-art-host
Change-Id: I4724ced649042cbeb170cac9e8da8c5db168c8fc
(cherry picked from commit b55fdbb30b3bc4e334c241153b98c0a6ea4a4a2b)
b55fdbb30b3bc4e334c241153b98c0a6ea4a4a2b 21-Oct-2016 Vladimir Marko <vmarko@google.com> Disable kBssEntry LoadString sharpening.

We seem to fail to visit the BSS GC roots sometimes.

Bug: 32124939
Test: m test-art-host
Change-Id: I4724ced649042cbeb170cac9e8da8c5db168c8fc
aad75c6d5bfab2dc8e30fc99fafe8cd2dc8b74d8 03-Oct-2016 Vladimir Marko <vmarko@google.com> Revert "Revert "Store resolved Strings for AOT code in .bss.""

Fixed oat_test to keep dex files alive. Fixed mips build.
Rewritten the .bss GC root visiting and added write barrier
to the artResolveStringFromCode().

Test: build aosp_mips-eng
Test: m ART_DEFAULT_GC_TYPE=SS test-art-target-host-gtest-oat_test
Test: Run ART test suite on host and Nexus 9.
Bug: 20323084
Bug: 30627598

This reverts commit 5f926055cb88089d8ca27243f35a9dfd89d981f0.

Change-Id: I07fa2278d82b8eb64964c9a4b66cb93726ccda6b
5f926055cb88089d8ca27243f35a9dfd89d981f0 30-Sep-2016 Vladimir Marko <vmarko@google.com> Revert "Store resolved Strings for AOT code in .bss."

There are some issues with oat_test64 on host and aosp_mips-eng.

Also reverts "compiler_driver: Fix build."

Bug: 20323084
Bug: 30627598

This reverts commit 63dccbbefef3014c99c22748d18befcc7bcb3b41.
This reverts commit 04a44135ace10123f059373691594ae0f270a8a4.

Change-Id: I568ba3e58cf103987fdd63c8a21521010a9f27c4
0795f23920ee9aabf28e45c63cd592dcccf00216 28-Sep-2016 Mathieu Chartier <mathieuc@google.com> Clean up ScopedThreadStateChange to use ObjPtr

Also fixed inclusion of -inl.h files in .h files by adding
scoped_object_access-inl.h and scoped_fast_natvie_object_access-inl.h

Changed AddLocalReference / Decode to use ObjPtr.

Changed libartbenchmark to be debug to avoid linkage errors.

Bug: 31113334

Test: test-art-host

Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
63dccbbefef3014c99c22748d18befcc7bcb3b41 21-Sep-2016 Vladimir Marko <vmarko@google.com> Store resolved Strings for AOT code in .bss.

And do some related refactorings.

Bug: 20323084
Bug: 30627598
Test: Run ART test suite including gcstress on host and Nexus 9.
Test: Run ART test suite including gcstress with baker CC on host and Nexus 9.
Test: Build aosp_mips64-eng.
Change-Id: I1b12c1570fee8e5da490b47f231050142afcbd1e
5e4e11e171f90d9a3ea178fc8e72aac909de55d5 22-Sep-2016 Nicolas Geoffray <ngeoffray@google.com> Clean-up sharpening and compiler driver.

Remove dependency on compiler driver for sharpening
and dex2dex (the methods called on the compiler driver were
doing unnecessary work), and remove the now unused methods
in compiler driver.

Also remove test that is now invalid, as sharpening always
succeeds.

test: m test-art-host m test-art-target
Change-Id: I54e91c6839bd5b0b86182f2f43ba5d2c112ef908
4a4a601e8a99d0a711720c8a0d9878b26498fb4c 16-Sep-2016 Mathieu Chartier <mathieuc@google.com> Improve sharpening for read barrier image HLoadClass

Handle MarkInBoot image for LoadKind::kReferrersClass. This reduces
read barriers for the boot image if the referring class is in
the boot image.

Only really helps CC case, TODO avoid doing the work for non CC?

ARM64 CC baker boot.oat: 48006064 -> 47916736

Bug: 29516974

Test: test-art-host CC baker

Change-Id: Ibfa0cf0a3b888ad0e53c2d95a38e330b79e7443c
95026871a4745b417b9b776966f26666d1c1f737 09-Sep-2016 Vladimir Marko <vmarko@google.com> Revert "Revert "Re-enable boot image string sharpening.""

The reason for the revert was a transaction bug fixed by
https://android-review.googlesource.com/271008

Bug: 20323084
Bug: 31239436

This reverts commit f508c565b13585a766719b87a00e3c2a4200abe0.

Change-Id: I2f5995b55ccbf58b888db3f0ab64d6186e400a92
31b12e32073f458950e96d0d1b44e48508cf67e4 03-Sep-2016 Mathieu Chartier <mathieuc@google.com> Avoid read barrier for image HLoadClass

Concurrent copying baker:

X86_64 core-optimizing-pic.oat: 28583112 -> 27906824 (2.4% smaller)

Around 0.4% of 2.4% is from re-enabling kBootImageLinkTimeAddress,
kBootImageLinkTimePcRelative, and kBootImageAddress.

N6P boot.oat 32: 73042140 -> 71891956 (1.57% smaller)
N6P boot.oat 64: 83831608 -> 82531456 (1.55% smaller)

EAAC: 1252 -> 1245 (32 samples)

Bug: 29516974

Test: test-art-host CC baker, N6P booting

Change-Id: I9a196cf0157058836981c43c93872e9f0c4919aa
3a21e386fa55a8b86dffa5250985b263fcfd2155 02-Sep-2016 Vladimir Marko <vmarko@google.com> Clean up some includes.

Remove some unnecessary includes from header files, replace
others with forward references and add includes to source
files as needed. Reduce dependency on stack.h by pulling
StackReference<> out to its own file.

Test: m test-art-host
Change-Id: I0fb182145e328870cbd918b0ef6ae2950223c1b2
f508c565b13585a766719b87a00e3c2a4200abe0 01-Sep-2016 Vladimir Marko <vmarko@google.com> Revert "Re-enable boot image string sharpening."

The boot image may not contain the target String.

Bug: 20323084
Bug: 31239436

This reverts commit 9ed010e43c729a801089307c55f20f6d4df8271c.

Change-Id: Id299619ff9866bacd5098f76836355878a478042
9ed010e43c729a801089307c55f20f6d4df8271c 30-Aug-2016 Vladimir Marko <vmarko@google.com> Re-enable boot image string sharpening.

Test: Run ART test suite with ART_TEST_PIC_IMAGE=true on host and Nexus 9.
Bug: 20323084
Change-Id: Ifc10e4b6f5078f599711bd84be0cec53494af3af
5a5d0faab643eb07ba33d91d47484878c1450b44 19-Aug-2016 Christina Wadsworth <cwadsworth@google.com> ART: Fixing build breakage (sharpening DCHECK).

Change-Id: I7ba19808dde0712739a278075da57f724166a233
bf44e0e5281de91f2e38a9378b94ef8c50ad9b23 18-Aug-2016 Christina Wadsworth <cwadsworth@google.com> ART: Implement a fixed size string dex cache

Previously, the string dex cache was dex_file->NumStringIds() size, and
@ruhler found that only ~1% of that cache was ever getting filled. Since
many of these string dex caches were previously 100,000+ indices in
length, we're wasting a few hundred KB per app by storing null pointers.
The intent of this project was to reduce the space the string dex cache
is using, while not regressing on time that much. This is the first of a
few CLs, which implements the new fixed size array and disables the
compiled code so it always goes slow path. In four other CLs, I
implemented a "medium path" that regresses from the previous "fast path"
only a bit in assembly in the entrypoints. @vmarko will introduce new
compiled code in the future so that we ultimately won't be regressing on
time at all. Overall, space savings have been confirmed as on the order
of 100 KB per application.

A 4-5% slow down in art-opt on Golem, and no noticeable slow down in the
interpreter. The opt slow down should be diminished once the new
compiled code is introduced.

Test: m test-art-host

Bug: 20323084

Change-Id: Ic654a1fb9c1ae127dde59290bf36a23edb55ca8e
542451cc546779f5c67840e105c51205a1b0a8fd 26-Jul-2016 Andreas Gampe <agampe@google.com> ART: Convert pointer size to enum

Move away from size_t to dedicated enum (class).

Bug: 30373134
Bug: 30419309
Test: m test-art-host
Change-Id: Id453c330f1065012e7d4f9fc24ac477cc9bb9269
dbb7f5bef10138ade0fb202da1d61f562b2df649 30-Mar-2016 Vladimir Marko <vmarko@google.com> Improve HLoadClass code generation.

For classes in the boot image, use either direct pointers
or PC-relative addresses. For other classes, use PC-relative
access to the dex cache arrays for AOT and direct address of
the type's dex cache slot for JIT.

For aosp_flounder-userdebug:
- 32-bit boot.oat: -252KiB (-0.3%)
- 64-bit boot.oat: -412KiB (-0.4%)
- 32-bit dalvik cache total: -392KiB (-0.4%)
- 64-bit dalvik-cache total: -2312KiB (-1.0%)
(contains more files than the 32-bit dalvik cache)
For aosp_flounder-userdebug forced to compile PIC:
- 32-bit boot.oat: -124KiB (-0.2%)
- 64-bit boot.oat: -420KiB (-0.5%)
- 32-bit dalvik cache total: -136KiB (-0.1%)
- 64-bit dalvik-cache total: -1136KiB (-0.5%)
(contains more files than the 32-bit dalvik cache)

Bug: 27950288
Change-Id: I4da991a4b7e53c63c92558b97923d18092acf139
ffc87076dda9878cb2cc098149bae441d38b9268 20-Apr-2016 Calin Juravle <calin@google.com> Split profile recording from jit compilation

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

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

Bug: 27916886

(cherry picked from commit e5de54cfab5f14ba0b8ff25d8d60901c7021943f)

Change-Id: I68afc181d71447895fb12346c1806e99bcab1de2
e5de54cfab5f14ba0b8ff25d8d60901c7021943f 20-Apr-2016 Calin Juravle <calin@google.com> Split profile recording from jit compilation

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

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

Bug: 27916886
Change-Id: I6e4768dc5d58f2f85f947b276b4244aa11ce3fca
db8e62dca9232634daecb548bd51f3186004535c 30-Mar-2016 Vladimir Marko <vmarko@google.com> Optimizing: Clean up after const-string sharpening.

Do not look up the String for JIT, just check if it's in the
dex cache. Strings on hot paths should already be resolved
and we don't want to unnecessarily increase JIT compile time
to have a chance of improving a cold path.

Also, change the enum LinkerPatchType to be an inner enum
class of LinkerPatch and clean up casts between pointers and
uint64_t.

Change-Id: Ia6e0513af1a84ce94a3b30edac0c592157d374ec
cac5a7e871f1f346b317894359ad06fa7bd67fba 22-Feb-2016 Vladimir Marko <vmarko@google.com> Optimizing: Improve const-string code generation.

For strings in the boot image, use either direct pointers
or pc-relative addresses. For other strings, use PC-relative
access to the dex cache arrays for AOT and direct address of
the string's dex cache slot for JIT.

For aosp_flounder-userdebug:
- 32-bit boot.oat: -692KiB (-0.9%)
- 64-bit boot.oat: -948KiB (-1.1%)
- 32-bit dalvik cache total: -900KiB (-0.9%)
- 64-bit dalvik cache total: -3672KiB (-1.5%)
(contains more files than the 32-bit dalvik cache)
For aosp_flounder-userdebug forced to compile PIC:
- 32-bit boot.oat: -380KiB (-0.5%)
- 64-bit boot.oat: -928KiB (-1.0%)
- 32-bit dalvik cache total: -468KiB (-0.4%)
- 64-bit dalvik cache total: -1928KiB (-0.8%)
(contains more files than the 32-bit dalvik cache)

Bug: 26884697
Change-Id: Iec7266ce67e6fedc107be78fab2e742a8dab2696
e523423a053af5cb55837f07ceae9ff2fd581712 02-Dec-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Don't use the compiler driver for method resolution.""

This reverts commit c88ef3a10c474045a3476a02ae75d07ddd3230b7.

Change-Id: I0ed88a48b313a8d28bc39fae40631123aadb13ef
c88ef3a10c474045a3476a02ae75d07ddd3230b7 01-Dec-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Don't use the compiler driver for method resolution."

Fails 425 in debuggable mode.

This reverts commit 4db0bf9c4db6a09716c3388b7d2f88d534470339.

Change-Id: I346df8f75674564fc4fb241c60f23e250fc7f0a7
4db0bf9c4db6a09716c3388b7d2f88d534470339 23-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Don't use the compiler driver for method resolution.

The compiler driver makes assumptions that don't hold for
the optimizing compiler, and will for example always go to
slow path for an invoke-super when there's no verified method.

Also fix GenerateInvokeVirtual in the presence of intrinsics.

Next change will address some of the TODOs in sharpening.cc.

Change-Id: I2b0e543ee9b9bebcadb2d26de29e850c59ad58b9
d1eaf0dc9abc42dbcbbd9c4b98bf930ae5f394f3 29-Oct-2015 Vladimir Marko <vmarko@google.com> Keep list of dex files for oat file in CompilerDriver.

Use this list to improve invoke-static/-direct dispatch for
intra-oat calls.

Also fix a latent ArmBaseRelativePatcher::ReserveSpaceEnd()
bug exposed by a buggy early version of this CL: when we
have unresolved patches at the end of all code, we need to
emit a final thunk. Though the OatWriter will try to patch
the unresolved call to a trampoline at the beginning of the
oat file, that trampoline may be too far and the relative
patcher doesn't know about it anyway, so it needs to assume
that a thunk is needed.

This reduces the overall size of oat files present in dalvik
cache on Nexus 9 after first boot by over 1MiB, AOSP ToT,
aosp_flounder-userdebug build.

Change-Id: I98604b70cb17377eed057c1c23971865cf344e43
dc151b2346bb8a4fdeed0c06e54c2fca21d59b5d 15-Oct-2015 Vladimir Marko <vmarko@google.com> Optimizing: Determine invoke-static/-direct dispatch early.

Determine the dispatch type of invoke-static/-direct in a
special pass right after the type inference. This allows the
inliner to pass the "needs dex cache" check and inline more.
It also allows the code generator to avoid requesting a
register location for the ArtMethod* for kDexCachePcRelative
and direct methods.

The supported dispatch check handles also situations that
the CompilerDriver currently doesn't allow. The cleanup of
the CompilerDriver and required changes to Quick will come
in a separate change.

Change-Id: I3f8e903a119949e95871d8ab0a995f4731a13a07