History log of /art/compiler/optimizing/builder.cc
Revision Date Author Comments
b7248b9f1a6d62a30f0cefc12de63c216b5d46e2 07-Apr-2016 Mathieu Chartier <mathieuc@google.com> Store precice set of which constructors require barriers

Fixes bugs where things in the boot image might not have been
calculated even though resolved_clases was true. This only occured
for app and test compiles though.

Fixes test 476-checker-ctor-memory-barrier which was failing due to
inlining something in the boot class path and getting a unexpected
barrier since the barrier defaults to enabled.

No measurable increase in RAM usage.

(cherry picked from commit c4ae916def97b9e1ef6df35c8fabb3921a0e380c)

Bug: 28005874

Change-Id: I4a417819aa129c95f4a83c38df1a66eb77824ea9
dee58d6bb6d567fcd0c4f39d8d690c3acaf0e432 07-Apr-2016 David Brazdil <dbrazdil@google.com> Revert "Revert "Refactor HGraphBuilder and SsaBuilder to remove HLocals""

This patch merges the instruction-building phases from HGraphBuilder
and SsaBuilder into a single HInstructionBuilder class. As a result,
it is not necessary to generate HLocal, HLoadLocal and HStoreLocal
instructions any more, as the builder produces SSA form directly.

Saves 5-15% of arena-allocated memory (see bug for more data):
GMS 20.46MB => 19.26MB (-5.86%)
Maps 24.12MB => 21.47MB (-10.98%)
YouTube 28.60MB => 26.01MB (-9.05%)

This CL fixed an issue with parsing quickened instructions.

Bug: 27894376
Bug: 27998571
Bug: 27995065

Change-Id: I20dbe1bf2d0fe296377478db98cb86cba695e694
60328910cad396589474f8513391ba733d19390b 04-Apr-2016 David Brazdil <dbrazdil@google.com> Revert "Refactor HGraphBuilder and SsaBuilder to remove HLocals"

Bug: 27995065
This reverts commit e3ff7b293be2a6791fe9d135d660c0cffe4bd73f.

Change-Id: I5363c7ce18f47fd422c15eed5423a345a57249d8
e3ff7b293be2a6791fe9d135d660c0cffe4bd73f 02-Mar-2016 David Brazdil <dbrazdil@google.com> Refactor HGraphBuilder and SsaBuilder to remove HLocals

This patch merges the instruction-building phases from HGraphBuilder
and SsaBuilder into a single HInstructionBuilder class. As a result,
it is not necessary to generate HLocal, HLoadLocal and HStoreLocal
instructions any more, as the builder produces SSA form directly.

Saves 5-15% of arena-allocated memory (see bug for more data):
GMS 20.46MB => 19.26MB (-5.86%)
Maps 24.12MB => 21.47MB (-10.98%)
YouTube 28.60MB => 26.01MB (-9.05%)

Bug: 27894376
Change-Id: Iefe28d40600c169c5d306fd2c77034ae19476d90
86ea7eeabe30c98bbe1651a51d03cb89776724e7 16-Feb-2016 David Brazdil <dbrazdil@google.com> Build dominator tree before generating HInstructions

Second CL in the series of merging HGraphBuilder and SsaBuilder. This
patch refactors the builders so that dominator tree can be built
before any HInstructions are generated. This puts the SsaBuilder
removal of HLoadLocals/HStoreLocals straight after HGraphBuilder's
HInstruction generation phase. Next CL will therefore be able to
merge them.

This patch also adds util classes for iterating bytecode and switch
tables which allowed to simplify the code.

Bug: 27894376
Change-Id: Ic425d298b2e6e7980481ed697230b1a0b7904526
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
7bcfcb80a31f57a84d754e00bca8698829365208 23-Mar-2016 Andreas Gampe <agampe@google.com> Revert "Revert "Use compiler filter to determine oat file status.""

This reverts commit 845e5064580bd37ad5014f7aa0d078be7265464d.

Add an option to change what OatFileManager considers up-to-date.
In our tests we're allowed to write to the dalvik-cache, so it
cannot be kSpeed.

(cherry picked from commit 29d38e77c553c6cf71fc4dafe2d22b4e3f814872)

Bug: 27689078
Change-Id: I6274188610f31dcd9d086fc080b2be93afae5a6b
d96a246e5b103bfc167acaa6315bd8abca9de493 23-Mar-2016 Vladimir Marko <vmarko@google.com> Optimizing: Do not insert suspend checks on back-edges.

Rely on HGraph::SimplifyLoop() to insert suspend checks.

CodeGenerator's CheckLoopEntriesCanBeUsedForOsr() checks the
dex pcs of suspend checks against branch targets to verify
that we always have an appropriate point for OSR transition.
However, the HSuspendChecks that were added by HGraphBuilder
to support the recently removed "baseline" interfered with
this in a specific case, namely an infinite loop where the
back-branch jumps to a nop. In that case, the HSuspendCheck
added by HGraphBuilder had a dex pc different from the block
and the branch target but its presence would stop the
HGraph::SimplifyLoop() from adding a new HSuspendCheck with
the correct dex pc.

Bug: 27623547
Change-Id: I83566a260210bc05aea0c44509a39bb490aa7003
29d38e77c553c6cf71fc4dafe2d22b4e3f814872 23-Mar-2016 Andreas Gampe <agampe@google.com> Revert "Revert "Use compiler filter to determine oat file status.""

This reverts commit 845e5064580bd37ad5014f7aa0d078be7265464d.

Add an option to change what OatFileManager considers up-to-date.
In our tests we're allowed to write to the dalvik-cache, so it
cannot be kSpeed.

Bug: 27689078
Change-Id: I0c578705a9921114ed1fb00d360cc7448addc93a
845e5064580bd37ad5014f7aa0d078be7265464d 23-Mar-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Use compiler filter to determine oat file status."

Bots are red. Tentative reverting as this is likely the offender.

Bug: 27689078

This reverts commit a62d2f04a6ecf804f8a78e722a6ca8ccb2dfa931.

Change-Id: I3ec6947a5a4be878ff81f26f17dc36a209734e2a
a62d2f04a6ecf804f8a78e722a6ca8ccb2dfa931 18-Mar-2016 Richard Uhler <ruhler@google.com> Use compiler filter to determine oat file status.

Record the compiler filter in the oat header. Use that to determine
when the oat file is up-to-date with respect to a target compiler
filter level.

New xxx-profile filter levels are added to specify if a profile should
be used instead of testing for the presence of a profile file.

This change should allow for different compiler-filters to be set for
different package manager use cases.

Bug: 27689078
Change-Id: Id6706d0ed91b45f307142692ea4316aa9713b023
f6a35de9eeefb20f6446f1b4815b4dcb0161d09c 21-Mar-2016 Vladimir Marko <vmarko@google.com> Optimizing: Fix register allocator validation memory usage.

Also attribute ArenaBitVector allocations to appropriate
passes. This was used to track down the source of the
excessive memory alloactions.

Bug: 27690481

Change-Id: Ib895984cb7c04e24cbc7abbd8322079bab8ab100
a1de9188a05afdecca8cd04ecc4fefbac8b9880f 25-Feb-2016 Vladimir Marko <vmarko@google.com> Optimizing: Reduce memory usage of HInstructions.

Pack narrow fields and flags into a single 32-bit field.

Change-Id: Ib2f7abf987caee0339018d21f0d498f8db63542d
c7098ff991bb4e00a800d315d1c36f52a9cb0149 09-Feb-2016 David Srbecky <dsrbecky@google.com> Remove HNativeDebugInfo from start of basic blocks.

We do not require full environment at the start of basic block.
The dex pc contained in basic block is sufficient for line mapping.

Change-Id: I5ba9e5f5acbc4a783ad544769f9a73bb33e2bafa
badd826664896d4a9628a5a89b78016894aa414b 02-Feb-2016 David Brazdil <dbrazdil@google.com> ART: Run SsaBuilder from HGraphBuilder

First step towards merging the two passes, which will later result in
HGraphBuilder directly producing SSA form. This CL mostly just updates
tests broken by not being able to inspect the pre-SSA form.

Using HLocals outside the HGraphBuilder is now deprecated.

Bug: 27150508
Change-Id: I00fb6050580f409dcc5aa5b5aa3a536d6e8d759e
6e332529c33be4d7dae5dad3609a839f4c0d3bfc 02-Feb-2016 David Brazdil <dbrazdil@google.com> ART: Remove HTemporary

Change-Id: I21b984224370a9ce7a4a13a9652503cfb03c5f03
b331febbab8e916680faba722cc84b66b84218a3 05-Feb-2016 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Implement on-stack replacement for arm/arm64/x86/x86_64.""

This reverts commit bd89a5c556324062b7d841843b039392e84cfaf4.

Change-Id: I08d190431520baa7fcec8fbdb444519f25ac8d44
bd89a5c556324062b7d841843b039392e84cfaf4 05-Feb-2016 David Brazdil <dbrazdil@google.com> Revert "Implement on-stack replacement for arm/arm64/x86/x86_64."

DCHECK whether loop headers are covered fails.

This reverts commit 891bc286963892ed96134ca1adb7822737af9710.

Change-Id: I0f9a90630b014b16d20ba1dfba31ce63e6648021
891bc286963892ed96134ca1adb7822737af9710 29-Jan-2016 Nicolas Geoffray <ngeoffray@google.com> Implement on-stack replacement for arm/arm64/x86/x86_64.

High-level overview:
- osr_method_threshold is used to know when to compile a method
in osr mode (-> treat all loops as irreducible).
- branch instructions in the compiler query whether they can
jump to an osr method.
- An osr entry point is found through the stack maps: if a stack
map is duplicated in the CodeInfo, it is an osr entry point.

Change-Id: Ifb39338cd281e2c7eccce67f4e18d46428be71e4
fedd91d50930e160c021d65b3740264f6ffec260 07-Jan-2016 Alex Light <allight@google.com> Optimizing compiler support for directly calling interface methods

This teaches the optimizing compiler how to perform invoke-super on
interfaces. This should make the invokes generally faster.

Bug: 24618811

Change-Id: I7f9b0fb1209775c1c8837ab5d21f8acba3cc72a5
6de1938e562b0d06e462512dd806166e754035ea 08-Jan-2016 David Brazdil <dbrazdil@google.com> ART: Remove incorrect HFakeString optimization

Simplification of HFakeString assumes that it cannot be used until
String.<init> is called which is not true and causes different
behaviour between the compiler and the interpreter. This patch
removes the optimization together with the HFakeString instruction.

Instead, HNewInstance is generated and an empty String allocated
until it is replaced with the result of the StringFactory call. This
is consistent with the behaviour of the interpreter but is too
conservative. A follow-up CL will attempt to optimize out the initial
allocation when possible.

Bug: 26457745
Bug: 26486014

Change-Id: I7139e37ed00a880715bfc234896a930fde670c44
f555258861aea7df8af9c2241ab761227fd2f66a 27-Dec-2015 David Brazdil <dbrazdil@google.com> ART: Create BoundType for CheckCast early

ReferenceTypePropagation creates a BoundType for each CheckCast and
replaces all dominated uses of the casted object with it. This does
not include Phi uses on the boundary of the dominated scope, reducing
typing precision. This patch creates the BoundType in Builder, causing
SsaBuilder to replace uses of the object automatically.

Bug: 26081304

Change-Id: I083979155cccb348071ff58cb9060a896ed7d2ac
0cf4493166ff28518c8eafa2d0463f6e817cce75 09-Dec-2015 David Srbecky <dsrbecky@google.com> Generate more stack maps during native debugging.

Generate extra stack map at the start of each java statement.
The stack maps are later translated to DWARF which allows
LLDB to set breakpoints and view local variables.

Change-Id: If00ab875513308e4a1399d1e12e0fe8934a6f0c3
42ef8ab151a3d0cbb42cb43f6841c3708d65fca3 04-Dec-2015 Andreas Gampe <agampe@google.com> ART: Stash a resolved method late in the verifier

Invoke-interface should only be called on an interface method.
We cannot move the check earlier, as there are other checks
that must be done that can fail a class hard. So postpone
a push to the dex cache.

Clean up the test a bit.

Also templatize ResolveMethod with a version always checking
the invoke type, and on a cache miss check whether type target
type is an interface when an interface invoke type was given.

Bug: 21869691
Change-Id: I94cbb23339cbbb3cb6be9995775e4dcefacce7fd
1ddf27f2ca782204fd2e93d38fc75e019a233013 10-Dec-2015 Nicolas Geoffray <ngeoffray@google.com> Fix braino when resolving an invoke-super.

We should check the actual_method, and not the resolved_method,
on whether it is in the same dex file.

bug:26022686

Change-Id: I8a9b0c68e162015e0aec397545d0607482949967
c96205e03bd4f991ad1540df38f9f692ef211b22 10-Dec-2015 Andreas Gampe <agampe@google.com> Revert "ART: Check invoke-interface earlier in verifier"

This reverts commit dae24142127c64551142a50423085aabdb0a6060.

It is important to check the name of the method being called.

Bug: 21869691
917d01680714b2295f109f8fea0aa06764a30b70 24-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Don't generate a slow path for strings in the dex cache.

Change-Id: I1d258f1a89bf0ec7c7ddd134be9215d480f0b09a
41844e5071b2540d7b974ba09859170af2720776 10-Dec-2015 Nicolas Geoffray <ngeoffray@google.com> Fix braino when resolving an invoke-super.

We should check the actual_method, and not the resolved_method,
on whether it is in the same dex file.

bug:26022686

Change-Id: I8a9b0c68e162015e0aec397545d0607482949967
dae24142127c64551142a50423085aabdb0a6060 04-Dec-2015 Andreas Gampe <agampe@google.com> ART: Check invoke-interface earlier in verifier

Invoke-interface should only be called on an interface method.
Move the check earlier, as otherwise we'll try to resolve and
potentially inject a method into the dex cache.

Also templatize ResolveMethod with a version always checking
the invoke type, and on a cache miss check whether type target
type is an interface when an interface invoke type was given.

Bug: 21869691
Change-Id: Ica27158f675b5aa223d9229248189612f4706832
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
42e372e5a34d0fef88007bc5f40dd0fc7c03b58b 24-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Optimize HLoadClass when we know the class is in the cache.

Change-Id: Iaa74591eed0f2eabc9ba9f9988681d9582faa320
d9dc6f45c3f5fb0e5d279e6c038692258b27192b 24-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> A few more optimizations on avoiding HClinit.

Change-Id: I622a98b620e9d261cb654e2f5ab578bd8b3484b1
317f9cebedc0117ce89931a1f28a82e989057c31 23-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Fix lint error.

Change-Id: I29632dc7e49f7ec63040455fa40fcf87e9282e5e
729645a937eb9f04a311b3c22471dcf3ebe9bcec 19-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Explicitly add HLoadClass/HClinitCheck for HNewInstance.

bug:25735083
bug:25173758

Change-Id: Ie81cfa4fa9c47cc025edb291cdedd7af209a03db
fb8464ae5f5194dc16278e528cfcbff71498c767 02-Nov-2015 Mingyao Yang <mingyao@google.com> Revert "Revert "Enable store elimination for singleton objects.""

This reverts commit 55d02cf056f993aeafebd54e7b7c68c7a48507c9, and
makes the following change:
Currently we leverage loop side effects to decide whether heap values are
killed by the loop. Stores need to be kept if heap values may be killed
by loops and the corresponding loads cannot be eliminated. Similar thing
need to be done for each predecessor when we merge predecessor heap values.
To do that, the HInstanceFieldSet instruction itself is put in the heap
value array instead of the value of the store instruction. The store
instruction may be added to possibly_removed_stores_ first, but can later
be removed from possibly_removed_stores_ when it's found out that the store
needs to be kept due to merging/loop side effects.

Change-Id: I4f7bb1960f7b47240873e00ff1adac46fc102a02
347647f279db4da1b3b1eca3a162b0eabc6268d2 13-Oct-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Silence "No verification for method calling String.<init>"

Changed message severity from warning to debug. This issue
is benign.

Bug: 24558132
Change-Id: I27ad0fe68df6a5a0bbd3bc06d4510395e10e7a85
b554b5a5ae3cdc66969d61be20783a8af816206e 06-Nov-2015 Vladimir Marko <vmarko@google.com> Optimizing: Remove unused ArtMethod* input from HInvokeStaticOrDirect.

Change-Id: Iea99fa683440673ff517e246f35fade96600f229
9bc436160b4af99067973affb0b1008de9a2b04c 05-Nov-2015 David Brazdil <dbrazdil@google.com> ART: Fix simplification of catch blocks in the presence of dead code

Simplification of catch blocks transforms the code so that catch
blocks have only exceptional predecessors. However, it is invoked
before trivially dead code is eliminated which breaks simple
assumptions such as the fact that a catch block cannot start with
move-exception if it has non-exceptional predecessors. This patch
fixes the algorithm to work under these relaxed conditions.

Bug: 25494450
Bug: 25492628
Change-Id: Idc8d010102a4b8b9a6cd918b98d6e11d1838db0c
55d02cf056f993aeafebd54e7b7c68c7a48507c9 29-Oct-2015 Andreas Gampe <agampe@google.com> Revert "Enable store elimination for singleton objects."

This reverts commit 7f43a3d48fc29045875d50e10bbc5d6ffc25d61e.

Fails booting.

Bug: 25357772
Change-Id: Ied19536f3ce8d81e76885cb6baed4853e2ed6714
7f43a3d48fc29045875d50e10bbc5d6ffc25d61e 28-Oct-2015 Mingyao Yang <mingyao@google.com> Enable store elimination for singleton objects.

Enable store elimination for singleton objects. However for finalizable object,
don't eliminate stores. Also added a testcase.

Change-Id: Icf991e7ded5b490f55f580ef928ece5c45e89902
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
8df69d42a9e3ccd9456ff72fac8dbd1999f98755 23-Oct-2015 Mingyao Yang <mingyao@google.com> Revert "Revert "load store elimination.""

This reverts commit 8030c4100d2586fac39ed4007c61ee91d4ea4f25.

Change-Id: I79558d85484be5f5d04e4a44bea7201fece440f0
8030c4100d2586fac39ed4007c61ee91d4ea4f25 15-Oct-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "load store elimination."

Breaks libcore tests:

libcore.java.lang.ref.FinalizeTest#testWatchdogDoesNotFailForObjectsThatAreNearTheDeadline
libcore.java.util.ResourceLeakageDetectorTest#testDetectsUnclosedCloseGuard
org.apache.harmony.tests.java.lang.ref.ReferenceTest#test_finalizeReferenceInteraction

This reverts commit 589dac7f0ce078d19aad7e35bb0195c47ddf01d2.

Change-Id: I55115765c10762d5bc152d3425e4622560d8b9f4
589dac7f0ce078d19aad7e35bb0195c47ddf01d2 24-Aug-2015 Mingyao Yang <mingyao@google.com> load store elimination.

This adds a pass to eliminate some unnecessary heap loads/stores. It
first collects heap locations and then tracks values stored to those heap
locations. Alias analysis is done based on offset, type, singleton,
pre-existence, etc.

Change-Id: I11a9d8ef20d1b2f245607eb25118e9aff9be472a
e6e3beaf2d35d18a79f5e7b60a21e75fac9fd15d 14-Oct-2015 Calin Juravle <calin@google.com> Revert "Revert "optimizing: propagate type information of arguments""

This reverts commit 89c0d32437011bbe492fe14c766cd707046ce043.

Change-Id: I603a49794e155cc97410b8836c8ea425bfdc98eb
c05aca78fad20901ae17902a3671ccfca9071758 13-Oct-2015 Calin Juravle <calin@google.com> Revert "optimizing: propagate type information of arguments"

This reverts commit 2c1ffc3a06e9ed0411e29e7dc2558b5d657ede7a.

Change-Id: I3291070c373e661fa578f5a38becbb5a502baf94
2c1ffc3a06e9ed0411e29e7dc2558b5d657ede7a 12-Oct-2015 Calin Juravle <calin@google.com> optimizing: propagate type information of arguments

This helps inlining and type check elimination.

e.g:

void foo(ArrayList a) {
int size = a.size(); // this can be inlined now.
}

Change-Id: I3ffeaa79d9df444aa19511c83c544cb5f9d9ab20
dbc2337eb9f010395cb78824a44481ddf2eb748a 12-Oct-2015 Vladimir Marko <vmarko@google.com> Optimizing: Avoid string init register set copy for debuggable.

Change-Id: I9c0d2e1353c68129db06d53a190a015710e4fd0d
4e2a55760b231554b72ba6703a22fcc7ab1f714e 07-Oct-2015 Calin Juravle <calin@google.com> Assert that referrers class should not need access check.

Change-Id: Ia682befdb0dc665f74c0f96454cc007304ff2397
ec7802a102d49ab5c17495118d4fe0bcc7287beb 01-Oct-2015 Vladimir Marko <vmarko@google.com> Add DCHECKs to ArenaVector and ScopedArenaVector.

Implement dchecked_vector<> template that DCHECK()s element
access and insert()/emplace()/erase() positions. Change the
ArenaVector<> and ScopedArenaVector<> aliases to use the new
template instead of std::vector<>. Remove DCHECK()s that
have now become unnecessary from the Optimizing compiler.

Change-Id: Ib8506bd30d223f68f52bd4476c76d9991acacadc
98893e146b0ff0e1fd1d7c29252f1d1e75a163f2 02-Oct-2015 Calin Juravle <calin@google.com> Add support for unresolved classes in optimizing.

Change-Id: I0e299a81e560eb9cb0737ec46125dffc99333b54
07380a2d6cb9feee02facc81f699eed5cb670cd5 17-Sep-2015 Calin Juravle <calin@google.com> Enable compilation of members with access check failures.

Change-Id: I0de73099b53612072c3e6f1235c22f96339fe440
e460d1df1f789c7c8bb97024a8efbd713ac175e9 29-Sep-2015 Calin Juravle <calin@google.com> Revert "Revert "Support unresolved fields in optimizing"

The CL also changes the calling convetion for 64bit static field set
to use kArg2 instead of kArg1. This allows optimizing to keep
the asumptions:
- arm pairs are always of form (even_reg, odd_reg)
- ecx_edx is not used as a register on x86.

This reverts commit e6f49b47b6a4dc9c7684e4483757872cfc7ff1a1.

Change-Id: I93159917565824084abc96775f31be1a4249f2f3
5233f93ee336b3581ccdb993ff6342c52fec34b0 29-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag even more arena allocations.

Tag previously "Misc" arena allocations with more specific
allocation types. Move some native heap allocations to the
arena in BCE.

Bug: 23736311
Change-Id: If8ef15a8b614dc3314bdfb35caa23862c9d4d25c
3b9f30487e160eb97f3fa8694351dc1073e2fd45 24-Sep-2015 Mark Mendell <mark.p.mendell@intel.com> Address HPackedSwitch issues raised after merge

There were some stylistic comments about the merged files. Fix those.

Add a test that PackedSwitch can be removed by DCE.

Change-Id: Idf45833956e9b58051f942a52b06a1e416606e2e
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
2aaa4b5532d30c4e65d8892b556400bb61f9dc8c 17-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag more arena allocations.

Replace GrowableArray with ArenaVector and tag arena
allocations with new allocation types.

As part of this, make the register allocator a bit more
efficient, doing bulk insert/erase. Some loops are now
O(n) instead of O(n^2).

Change-Id: Ifac0871ffb34b121cc0447801a2d07eefd308c14
d7558daaa86decf5a38f4f9bcd82267ab6e3e17f 22-Sep-2015 David Brazdil <dbrazdil@google.com> ART: Preserve loop headers with try/catch

Algorithm for inserting HTryBoundary instructions would generate a
non-natural loop when a loop header block was covered by a TryItem.
This patch changes the approach to fix the issue.

Bug: 23895756
Change-Id: I0e1ee6cf135cea326a96c97954907d202c9793cc
fe57faa2e0349418dda38e77ef1c0ac29db75f4d 18-Sep-2015 Mark Mendell <mark.p.mendell@intel.com> [optimizing] Add basic PackedSwitch support

Add HPackedSwitch, and generate it from the builder. Code generators
convert this to a series of compare/branch tests. Better implementation
in the code generators as a real jump table will follow as separate CLs.

Change-Id: If14736fa4d62809b6ae95280148c55682e856911
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
85c7bab43d11180d552179c506c2ffdf34dd749c 18-Sep-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Optimize code generation of check-cast and instance-of.""

This reverts commit 7537437c6a2f89249a48e30effcc27d4e7c5a04f.

Change-Id: If759cb08646e47b62829bebc3c5b1e2f2969cf84
7537437c6a2f89249a48e30effcc27d4e7c5a04f 17-Sep-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Optimize code generation of check-cast and instance-of."

Failures with libcore tests.

This reverts commit 64acf303eaa2f32c0b1d8cfcbf044a822c5eec08.

Change-Id: Ie6f323fcf5d86bae5c334c1352bb21f1bad60a88
b7d8e8cf7063fdec1cce6ebd33e33804976bd978 17-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Do not use range-based loop when inserting elements.

When we iterate over the elements of a container and we may
insert new elements into that container, it's wrong to use
the range-based loop.

Bug: 24133462
Change-Id: Iee35fbcf88ed3bcd6155cbeba09bd256032a16be
e6f49b47b6a4dc9c7684e4483757872cfc7ff1a1 17-Sep-2015 Calin Juravle <calin@google.com> Revert "Support unresolved fields in optimizing"
breaks debuggable tests.

This reverts commit 23a8e35481face09183a24b9d11e505597c75ebb.

Change-Id: I8e60b5c8f48525975f25d19e5e8066c1c94bd2e5
64acf303eaa2f32c0b1d8cfcbf044a822c5eec08 14-Sep-2015 Nicolas Geoffray <ngeoffray@google.com> Optimize code generation of check-cast and instance-of.

On x86/x64/arm/arm64. Improve code size of selected apks from 0.3% to 1%,
and performance of DeltaBlue by 20%.

Change-Id: Ib5799f7a53443cd880a121dd7f21932ae9f5c7aa
23a8e35481face09183a24b9d11e505597c75ebb 08-Sep-2015 Calin Juravle <calin@google.com> Support unresolved fields in optimizing

Change-Id: I9941fa5fcb6ef0a7a253c7a0b479a44a0210aad4
175dc732c80e6f2afd83209348124df349290ba8 25-Aug-2015 Calin Juravle <calin@google.com> Support unresolved methods in Optimizing

Change-Id: If2da02b50d2fa668cd58f134a005f1752e7746b1
5d01db1aa7634a012109d43e6403451b76de1daa 25-Aug-2015 Calin Juravle <calin@google.com> BuildInvoke refactor: extract String.init in its own code path

This makes it clear that we special handle String init. Getting rid of
all `if (is_string_init)` improves readability into what we actually do
and expect for strings.

Change-Id: I9b4fba4c3ea89e0003c0704335cbe80e874d0e15
fa6b93c4b69e6d7ddfa2a4ed0aff01b0608c5a3a 15-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag arena allocations in HGraph.

Replace GrowableArray with ArenaVector in HGraph and related
classes HEnvironment, HLoopInformation, HInvoke and HPhi,
and tag allocations with new arena allocation types.

Change-Id: I3d79897af405b9a1a5b98bfc372e70fe0b3bc40d
77a48ae01bbc5b05ca009cf09e2fcb53e4c8ff23 15-Sep-2015 David Brazdil <dbrazdil@google.com> Revert "Revert "ART: Register allocation and runtime support for try/catch""

The original CL triggered b/24084144 which has been fixed
by Ib72e12a018437c404e82f7ad414554c66a4c6f8c.

This reverts commit 659562aaf133c41b8d90ec9216c07646f0f14362.

Change-Id: Id8980436172457d0fcb276349c4405f7c4110a55
659562aaf133c41b8d90ec9216c07646f0f14362 14-Sep-2015 David Brazdil <dbrazdil@google.com> Revert "ART: Register allocation and runtime support for try/catch"

Breaks libcore test org.apache.harmony.security.tests.java.security.KeyStorePrivateKeyEntryTest#testGetCertificateChain. Need to investigate.

This reverts commit b022fa1300e6d78639b3b910af0cf85c43df44bb.

Change-Id: Ib24d3a80064d963d273e557a93469c95f37b1f6f
b022fa1300e6d78639b3b910af0cf85c43df44bb 20-Aug-2015 David Brazdil <dbrazdil@google.com> ART: Register allocation and runtime support for try/catch

This patch completes a series of CLs that add support for try/catch
in the Optimizing compiler. With it, Optimizing can compile all
methods containing try/catch, provided they don't contain catch loops.
Future work will focus on improving performance of the generated code.

SsaLivenessAnalysis was updated to propagate liveness information of
instructions live at catch blocks, and to keep location information on
instructions which may be caught by catch phis.

RegisterAllocator was extended to spill values used after catch, and
to allocate spill slots for catch phis. Catch phis generated for the
same vreg share a spill slot as the raw value must be the same.

Location builders and slow paths were updated to reflect the fact that
throwing an exception may not lead to escaping the method.

Instruction code generators are forbidden from using of implicit null
checks in try blocks as live registers need to be saved before handing
over to the runtime.

CodeGenerator emits a stack map for each catch block, storing locations
of catch phis. CodeInfo and StackMapStream recognize this new type of
stack map and store them separate from other stack maps to avoid dex_pc
conflicts.

After having found the target catch block to deliver an exception to,
QuickExceptionHandler looks up the dex register maps at the throwing
instruction and the catch block and copies the values over to their
respective locations.

The runtime-support approach was selected because it allows for the
best performance in the normal control-flow path, since no propagation
of catch phi values is necessary until the exception is thrown. In
addition, it also greatly simplifies the register allocation phase.

ConstantHoisting was removed from LICMTest because it instantiated
(now abstract) HConstant and was bogus anyway (constants are always in
the entry block).

Change-Id: Ie31038ad8e3ee0c13a5bbbbaf5f0b3e532310e4e
3ecfd65143d95bd7c6cbe4f58c33af517d3761e0 07-Sep-2015 Yevgeny Rouban <yevgeny.y.rouban@intel.com> Add dex_pc to all HInstructions in builder.

Optimizing compiler generates minimum debug line info that
is built using the dex_pc information about suspend points.
This is not enough for performance and debugging needs.

This patch makes all HInstructions contain
dex_pc and all allocations in the builder define this value.

Change-Id: I1d14aefe075189b7b1b41b4384c3499474c19afc
Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
Signed-off-by: Serdjuk, Nikolay Y <nikolay.y.serdjuk@intel.com>
6058455d486219994921b63a2d774dc9908415a2 03-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag basic block allocations with their source.

Replace GrowableArray with ArenaVector in HBasicBlock and,
to track the source of allocations, assign one new and two
Quick's arena allocation types to these vectors. Rename
kArenaAllocSuccessor to kArenaAllocSuccessors.

Bug: 23736311
Change-Id: Ib52e51698890675bde61f007fe6039338cf1a025
736b560f2d2c89b63dc895888c671b5519afa4c8 02-Sep-2015 Mathieu Chartier <mathieuc@google.com> Reduce how often we call FindDexCache

Before host boot.oat -j4 optimizing compile:
real 1m17.792s
user 3m26.140s
sys 0m8.340s

After:
real 1m12.324s
user 3m22.718s
sys 0m8.320s

Change-Id: If18e9e79e06cdf1676692e5efacb682bf93889c3
145acc5361deb769eed998f057bc23abaef6e116 03-Sep-2015 Vladimir Marko <vmarko@google.com> Revert "Optimizing: Tag basic block allocations with their source."

Reverting so that we can have more discussion about the STL API.

This reverts commit 91e11c0c840193c6822e66846020b6647de243d5.

Change-Id: I187fe52f2c16b6e7c5c9d49c42921eb6c7063dba
91e11c0c840193c6822e66846020b6647de243d5 02-Sep-2015 Vladimir Marko <vmarko@google.com> Optimizing: Tag basic block allocations with their source.

Replace GrowableArray with ArenaVector in HBasicBlock and,
to track the source of allocations, assign one new and two
Quick's arena allocation types to these vectors. Rename
kArenaAllocSuccessor to kArenaAllocSuccessors.

Bug: 23736311
Change-Id: I984aef6e615ae2380a532f5c6726af21015f43f5
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
599262ca1f45ff41ec1bbf31556ab5bf7e94d87a 20-Aug-2015 Calin Juravle <calin@google.com> Fix extra parantheses

:(

Change-Id: Ie48a54de1276fb9e478cb5927d714b2ff14ae6c6
0eedd7e0c923f3ef0b7103f58ca0b975613af144 20-Aug-2015 Calin Juravle <calin@google.com> Fix BuildInvoke

The invoke should be added to the graph before
PotentiallySimplifyFakeString.

Change-Id: I2afc1d16e6dae60957e7d1386fd028e4f3a5b27a
68ad649d3918f2eed3a37209c01a7f0a0faf09f0 18-Aug-2015 Calin Juravle <calin@google.com> Refactor BuildInvoke.

BuildInvoke got to be too complex an unreadble. This breaks it down in
smaller pieces.

Change-Id: Ibda63f69f5a1be537ae13e18a5f67c361173f4a6
581550137ee3a068a14224870e71aeee924a0646 19-Aug-2015 Vladimir Marko <vmarko@google.com> Revert "Revert "Optimizing: Better invoke-static/-direct dispatch.""

Fixed kCallArtMethod to use correct callee location for
kRecursive. This combination is used when compiling with
debuggable flag set.

This reverts commit b2c431e80e92eb6437788cc544cee6c88c3156df.

Change-Id: Idee0f2a794199ebdf24892c60f8a5dcf057db01c
ec16f79a4d0aeff319bf52139a0c82de3080d73c 19-Aug-2015 David Brazdil <dbrazdil@google.com> ART: Refactor try/catch block info, store exception type

This patch replaces HBasicBlock fields storing try/catch info with a
single TryCatchInformation data structure, saving memory for the
majority of non-try/catch blocks. It also changes builder to store
the exception type for catch blocks.

Change-Id: Ib3e43f7db247e6915d67c267fc62410420e230c9
b2c431e80e92eb6437788cc544cee6c88c3156df 19-Aug-2015 Vladimir Marko <vmarko@google.com> Revert "Optimizing: Better invoke-static/-direct dispatch."

Reverting due to failing ndebug tests.

This reverts commit 9b688a095afbae21112df5d495487ac5231b12d0.

Change-Id: Ie4f69da6609df3b7c8443412b6cf7f5c43c2c5d9
9b688a095afbae21112df5d495487ac5231b12d0 06-May-2015 Vladimir Marko <vmarko@google.com> Optimizing: Better invoke-static/-direct dispatch.

Add framework for different types of loading ArtMethod*
and code pointer retrieval. Implement invoke-static and
invoke-direct calls the same way as Quick. Document the
dispatch kinds in HInvokeStaticOrDirect's new enumerations
MethodLoadKind and CodePtrLocation.

PC-relative loads from dex cache arrays are used only for
x86-64 and arm64. The implementation for other architectures
will be done in separate CLs.

Change-Id: I468ca4d422dbd14748e1ba6b45289f0d31734d94
cb1c0557033065f2436ee79e7fa6c19d87064801 04-Aug-2015 David Brazdil <dbrazdil@google.com> ART: Move exception clearing into own instruction

Runtime delivers exceptions only to catch blocks which begin with a
MOVE_EXCEPTION instruction (in DEX). In that case, the catch block is
expected to clear the thread-local exception storage after having
read the exception reference.

This patch changes Optimizing to represent MOVE_EXCEPTION with two
instructions - HLoadException and HClearException - instead of one.
If the exception reference is not used, HLoadException can be safely
removed, saving a memory load without breaking the runtime behaviour.

Change-Id: Idad8a714467bf9d9d5fccefbc43c0bd8ae13ddba
9523a3ed0ae6fa31cd978a3999fd88233218f98b 17-Jul-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Use the quickened metadata to compile -QUICK opcodes.""

This reverts commit 8ab9a9010f3929acbb6c671008b8885b762b01e1.

Change-Id: I1e654d5010ea2112982c3055fcb8c8f9c10e9ac8
8ab9a9010f3929acbb6c671008b8885b762b01e1 17-Jul-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Use the quickened metadata to compile -QUICK opcodes."

Broke sdk build. Investigating.

This reverts commit 4515a67434c9e3e1627586629a1f2aba1a99aa6a.

Change-Id: I6c1107ab626758570a59dc6bf3e4228c70a57196
4515a67434c9e3e1627586629a1f2aba1a99aa6a 16-Jul-2015 Nicolas Geoffray <ngeoffray@google.com> Use the quickened metadata to compile -QUICK opcodes.

Change-Id: I28a8d68921698bea81f54c95cc6e4c6d2c03f2b4
2e7cd752452d02499a2f5fbd604c5427aa372f00 10-Jul-2015 Nicolas Geoffray <ngeoffray@google.com> [optimizing] Don't rely on the verifier for String.<init>.

Continue work on cutting the dependency on the verifier.

Change-Id: I0f95b1eb2e10fd8f6bf54817f1202bdf6dfdb0fe
72783ff32da5d3f025bbe1636cee84328f1135c6 09-Jul-2015 David Brazdil <dbrazdil@google.com> ART: Fix bug in GraphBuilder

This fixes a bug where the GraphBuilder would split a throwing catch
block but would not update info about which blocks throw.

Change-Id: If5415f0c320aa488e06eb042e8fea6f03e30246a
6cd788f2b00e6a8149f46a17aab9162314960c00 08-Jul-2015 David Brazdil <dbrazdil@google.com> Address small comments in HGraphBuilder

Change-Id: Ife0a19f6e07146c8e03922f1330527d092f5e236
bff7503625400b610a43678c6930354146ce5f92 08-Jul-2015 David Brazdil <dbrazdil@google.com> Revert "Revert "ART: Ignore try blocks with no throwing instructions""

The original CL broke libcore tests because monitor-exit instructions
did not have any side-effects and got removed by DCE once not labelled
throwing any more.

This reverts commit efe374d7c25c1d48945a9198d96469de99e0c1bd.

Change-Id: I624c0f91676d9baaada6f33be9d7091f68d57535
efe374d7c25c1d48945a9198d96469de99e0c1bd 08-Jul-2015 David Brazdil <dbrazdil@google.com> Revert "ART: Ignore try blocks with no throwing instructions"

Turns out monitor-exit *can* throw... Need to investigate

This reverts commit 8f8ee680bec71a28d9d7b7538e8c7ca100a18184.

Change-Id: I8b42690918833c917b6a7fc3ceea932b7c1a6f15
8f8ee680bec71a28d9d7b7538e8c7ca100a18184 08-Jul-2015 David Brazdil <dbrazdil@google.com> ART: Ignore try blocks with no throwing instructions

In order to avoid complex removal of redundant exceptional edges in
the SSA builder, this patch modified the graph builder to consider
blocks without throwing instructions as not in a try block, even if
covered by a TryItem.

In some corner cases, this may generate more TryBoundaries than
necessary, but those can be removed once the SSA form is built.

Change-Id: I158c4542b2c1964a8dd532f82e921b9cb1997e1e
4fa13f65ece3b68fe3d8722d679ebab8656bbf99 06-Jul-2015 Roland Levillain <rpl@google.com> Fuse long and FP compare & condition on ARM in Optimizing.

Also:
- Stylistic changes in corresponding parts on the x86 and
x86-64 code generators.
- Update and improve the documentation of
art::arm::Condition.

Bug: 21120453
Change-Id: If144772046e7d21362c3c2086246cb7d011d49ce
c470193cfc522fc818eb2eaab896aef9caf0c75a 10-Apr-2015 Mark Mendell <mark.p.mendell@intel.com> Fuse long and FP compare & condition on x86/x86-64 in Optimizing.

This is a preliminary implementation of fusing long/float/double
compares with conditions to avoid materializing the result from the
compare and condition.

The information from a HCompare is transferred to the HCondition if it
is legal. There must be only a single use of the HCompare, the HCompare
and HCondition must be in the same block, the HCondition must not need
materialization.

Added GetOppositeCondition() to HCondition to return the flipped
condition.

Bug: 21120453
Change-Id: I1f1db206e6dc336270cd71070ed3232dedc754d6
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
281a6320242fd4c229607a663874a8a3b19804f0 03-Jul-2015 David Brazdil <dbrazdil@google.com> ART: Fix graph for switch leaving a try block

Blocks that GraphBuilder creates for switch-case logic are given
a dex_pc of the branch targets they serve, while in fact they should
be considered part of the switch instruction itself and get its pc.
This caused the try/catch algorithm to either miss try boundaries or
create bogus edges.

This patch fixed the dex_pc of the switch-case blocks and modifies
the try/catch logic to iterate over all blocks as opposed to just
branch targets since multiple blocks can now cover the same dex_pc.

Change-Id: I30fe4f8db0647b869979197a3bc847cf212a7315
49bace1ccbec6f12b5b475ccc2ce76e0b666b500 01-Jul-2015 David Brazdil <dbrazdil@google.com> Address additional comments on try-catch CL

Extra documentation of try-catch building.

Change-Id: I5048c5fcb354c76fa4a60c3d8d21dd216bc9f6cd
56e1accf3966ae92e151567abf4561ef3f6466f4 30-Jun-2015 David Brazdil <dbrazdil@google.com> ART: Changes to try-catch in GraphBuilder

This patch adds an additional case into the insertion algorithm for
HTryBoundary inside HGraphBuilder in order to better handle catch
blocks covered by a TryItem.

Building SSA form also required to stop combining HTryBoundaries for
neighbouring TryItems because it was not clear which exception
handlers belong to which try block.

Change-Id: Ic68bd6ef98fee784609fa593cb08dca1f00a15e0
a1935c4fa255b5c20f5e9b2abce6be2d0f7cb0a8 26-Jun-2015 Roland Levillain <rpl@google.com> MIPS: Initial version of optimizing compiler for MIPS64R6.

(cherry picked from commit 4dda3376b71209fae07f5c3c8ac3eb4b54207aa8)
(amended for mnc-dev)

Bug: 21555893
Change-Id: I874dc356eee6ab061a32f8f3df5f8ac3a4ab7dcf
Signed-off-by: Alexey Frunze <Alexey.Frunze@imgtec.com>
Signed-off-by: Douglas Leung <douglas.leung@imgtec.com>
fc6a86ab2b70781e72b807c1798b83829ca7f931 26-Jun-2015 David Brazdil <dbrazdil@google.com> Revert "Revert "ART: Implement try/catch blocks in Builder""

This patch enables the GraphBuilder to generate blocks and edges which
represent the exceptional control flow when try/catch blocks are
present in the code. Actual compilation is still delegated to Quick
and Baseline ignores the additional code.

To represent the relationship between try and catch blocks, Builder
splits the edges which enter/exit a try block and links the newly
created blocks to the corresponding exception handlers. This layout
will later enable the SsaBuilder to correctly infer the dominators of
the catch blocks and to produce the appropriate reverse post ordering.
It will not, however, allow for building the complete SSA form of the
catch blocks and consequently optimizing such blocks.

To this end, a new TryBoundary control-flow instruction is introduced.
Codegen treats it the same as a Goto but it allows for additional
successors (the handlers).

This reverts commit 3e18738bd338e9f8363b26bc895f38c0ec682824.

Change-Id: I4f5ea961848a0b83d8db3673763861633e9bfcfb
3e18738bd338e9f8363b26bc895f38c0ec682824 26-Jun-2015 David Brazdil <dbrazdil@google.com> Revert "ART: Implement try/catch blocks in Builder"

Causes OutOfMemory issues, need to investigate.

This reverts commit 0b5c7d1994b76090afcc825e737f2b8c546da2f8.

Change-Id: I263e6cc4df5f9a56ad2ce44e18932ca51d7e349f
cf950c2587932c94f9b04a1dc47a7b8462c9e2b6 26-Jun-2015 David Brazdil <dbrazdil@google.com> Revert "ART: Fix gtests after try/catch change"

Need to revert the whole try/catch CL until issues are fixed.

This reverts commit a65930de077a4d7c1110e66ccd950061a85353d0.

Change-Id: Idd69215c87230a8616923665a55fe81891c78bec
a65930de077a4d7c1110e66ccd950061a85353d0 26-Jun-2015 David Brazdil <dbrazdil@google.com> ART: Fix gtests after try/catch change

The try/catch CL changed the order in which instructions were added
into entry/exit blocks which broke the sensitive gtests. This patch
swaps the order back.

Change-Id: Ib337491e5571a2cd38d6784275642f008886cc2a
0b5c7d1994b76090afcc825e737f2b8c546da2f8 11-Jun-2015 David Brazdil <dbrazdil@google.com> ART: Implement try/catch blocks in Builder

This patch enables the GraphBuilder to generate blocks and edges which
represent the exceptional control flow when try/catch blocks are
present in the code. Actual compilation is still delegated to Quick
and Baseline ignores the additional code.

To represent the relationship between try and catch blocks, Builder
splits the edges which enter/exit a try block and links the newly
created blocks to the corresponding exception handlers. This layout
will later enable the SsaBuilder to correctly infer the dominators of
the catch blocks and to produce the appropriate reverse post ordering.
It will not, however, allow for building the complete SSA form of the
catch blocks and consequently optimizing such blocks.

To this end, a new TryBoundary control-flow instruction is introduced.
Codegen treats it the same as a Goto but it allows for additional
successors (the handlers).

Change-Id: I415b985596d5bebb7b1bb358a46e08b7b04bb53a
310b0f5f15ac9ef8fb7ed0a12ff9ba3e4da17033 24-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Fix another case of un-verified dead code.

bug:22042796
https://code.google.com/p/android/issues/detail?id=178008

(cherry picked from commit 1efcc22cd1895c48adccbe49270d8e8583c2b12d)

Change-Id: I5c0d783e842da39cd3dcbb2f18ccf784e797a64f
fe659462e7d58bb2585b1bd029f9e08fd9dd32ae 24-Jun-2015 David Brazdil <dbrazdil@google.com> ART: Stop creating a fallthrough block for Goto

Optimizing's Builder used to create a basic block after a Goto under
the assumption that control flow can fall through.

Bug: 19084197
Change-Id: Id85f31df98a4177466750d3cd0bc8bb74782ca2d
1efcc22cd1895c48adccbe49270d8e8583c2b12d 24-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Fix another case of un-verified dead code.

bug:22042796
https://code.google.com/p/android/issues/detail?id=178008

Change-Id: Ie77ccf17ce2a69c86b2278f7920aa4ad39bf142b
042fd00295d21f936ba7a8c16915ce678970e658 22-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Use IsAssignableFrom instead of IsSubclass for robustness.""

Don't use IsAssignableFrom, but check beforehand if the referrer is an
interface. Otherwise, we are being too aggressive on removing clinit
checks on interfaces (being a subclass doesn't imply the interface
has been initialized).

bug:21870666

This reverts commit 463580ca5a1e75e27ad0207537ffc6252091326a.

(cherry picked from commit b783b408112d1797da646f576a40f94bcb5162f3)

Change-Id: Ida03f453c9b0d4dda87a5696098f9ffbd69a3aa3
b783b408112d1797da646f576a40f94bcb5162f3 22-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Use IsAssignableFrom instead of IsSubclass for robustness.""

Don't use IsAssignableFrom, but check beforehand if the referrer is an
interface. Otherwise, we are being too aggressive on removing clinit
checks on interfaces (being a subclass doesn't imply the interface
has been initialized).

bug:21870666

This reverts commit 463580ca5a1e75e27ad0207537ffc6252091326a.

Change-Id: I2a13974d28477ee3e5224142cc260cbf46d19aa9
c48c7e6a540a0e23ff26ce12e2fe94adefd8ed48 20-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Use compiling class instead of outer class for access checks.

bug:21869678

(cherry picked from commit afd06414598e011693137ba044e38756609b2179)

Change-Id: I982ccdf46e3f4d0cc1901439e0bc2dcfa0fc661f
7d59309458c69e1b2b2e85be5acc150979198f6f 19-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Use compiling class instead of referrer for access checks.

bug:21869670

(cherry picked from commit 30451743493bc2f589e96d68ab98f557461f97f9)

Change-Id: Ia18986797d166470801e7a9a690c054d2dc57952
be438619f63bcfa954fbc2cd19fd3d62e20fc379 18-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Don't check the return type in the builder.

The verifier will not complain about dead code. For the compiler,
it is benign.

bug:21863767

(cherry picked from commit 69505f86a1a653bf86c1f2b423b3e0605137d5d1)

Change-Id: I2bc7888b39c91862c6dade130eccdf92f19b3f6f
463580ca5a1e75e27ad0207537ffc6252091326a 22-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Use IsAssignableFrom instead of IsSubclass for robustness."

Not correct for Quick.

Bug:21870666

This reverts commit af268bbc4fbd0b9847acf1f7b79c038806118467.

Change-Id: Id44849cc877a42495619fd71bfd2db75159b6868
753f1fb083d5221f51b1d60d4089a33527ae5bc9 18-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Bailout from compilation if an invoke is malformed.

Because the verifier does not check trivially dead instructions,
the compilers must prepare for bogus instructions. This change
fixes the case the arguments for an invoke do not match the
formal parameters.

bug:21865459

(cherry picked from commit 2e33525bd4eb892246b4c244c6d4ebf6c6d07501)

Change-Id: I392f86eafefde28263fe35a31f17b398ff8dfc24
afd06414598e011693137ba044e38756609b2179 20-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Use compiling class instead of outer class for access checks.

bug:21869678
Change-Id: Ica6ecc759adc76950dcfe9d4d859dd593a742c62
ff82263e2b96ad099c56c19b91c2286baaf82fa7 21-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Fix String Change baseline compiler errors.

The String Change adds multiple move results if the uninitialized string
is in multiple registers. This adds StoreLocals on the same instruction,
which isn't allowed. Now, a LoadLocal is added for each extra move
needed.

bug:21902634

(cherry picked from commit aa919207d2fb63af11d72d3b7cdbc435769565af)

Change-Id: I057d14cdac437d06eec20caaddd430c304e58196
aa919207d2fb63af11d72d3b7cdbc435769565af 21-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Fix String Change baseline compiler errors.

The String Change adds multiple move results if the uninitialized string
is in multiple registers. This adds StoreLocals on the same instruction,
which isn't allowed. Now, a LoadLocal is added for each extra move
needed.

Change-Id: I49f676cb85de051e737e0653138cbb947a73e48b
af268bbc4fbd0b9847acf1f7b79c038806118467 19-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Use IsAssignableFrom instead of IsSubclass for robustness.

We can get interface methods as referrer. Instead of crashing,
just use IsAssignableFrom.

bug:21870666

Change-Id: I7978e36fb981d44611635fbaf3899138bae60672
4dda3376b71209fae07f5c3c8ac3eb4b54207aa8 02-Jun-2015 Alexey Frunze <Alexey.Frunze@imgtec.com> MIPS: Initial version of optimizing compiler for MIPS64R6.

Bug: 21555893
Change-Id: I874dc356eee6ab061a32f8f3df5f8ac3a4ab7dcf
Signed-off-by: Alexey Frunze <Alexey.Frunze@imgtec.com>
Signed-off-by: Douglas Leung <douglas.leung@imgtec.com>
30451743493bc2f589e96d68ab98f557461f97f9 19-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Use compiling class instead of referrer for access checks.

bug:21869670
Change-Id: Ief329247e90202835e27fa38803e02dd2e2ae8ca
cad65427d39c8ca9849d49d049ca6d263ada938a 19-Jun-2015 Jeff Hao <jeffhao@google.com> Fix StringChange for optimizing compiler.

Uses optimizing compiler more and fixes x86_64 invoke codegen.

Bug: 21902634

(cherry-picked from commit e0a9a53ec4b4ccbf9b1d67957fb99a45b469ccc2)

Change-Id: I56881889bee7092b8401b090af1c0f1004c11667
e0a9a53ec4b4ccbf9b1d67957fb99a45b469ccc2 19-Jun-2015 Jeff Hao <jeffhao@google.com> Fix StringChange for optimizing compiler.

Uses optimizing compiler more and fixes x86_64 invoke codegen.

Bug: 21902634
Change-Id: Ia2a87d013c4746b107014a04a22a0a37269cfdb2
69505f86a1a653bf86c1f2b423b3e0605137d5d1 18-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Don't check the return type in the builder.

The verifier will not complain about dead code. For the compiler,
it is benign.

bug:21863767

Change-Id: I6ef7be233d1cd69dddcc4499e4e4fad54753099f
df75bca6bd100ca9c2c395b1b8d2f8a871ab2c62 17-Jun-2015 David Brazdil <dbrazdil@google.com> ART: Allow PackedSwitch instructions with zero targets

Optimizing and the interpreter wrongly assumed that a PackedSwitch
always has at least one target. This patch removes the corresponding
DCHECKs and adds a regression test case.

This is a resubmission of CL I32b7033ed38de6f1d1a6ee5d5bf12f3a47c9b37e

Bug: 21863783
Change-Id: I04e6e124bdd16591ba27c79490e6ce183c36b691
(cherry picked from commit 2ef645ba50544b879a82ea30e606f18c9af98917)
2e33525bd4eb892246b4c244c6d4ebf6c6d07501 18-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Bailout from compilation if an invoke is malformed.

Because the verifier does not check trivially dead instructions,
the compilers must prepare for bogus instructions. This change
fixes the case the arguments for an invoke do not match the
formal parameters.

bug:21865459

Change-Id: Ie9fa9dbaedaad0350a52391252e18c045056454d
2ef645ba50544b879a82ea30e606f18c9af98917 17-Jun-2015 David Brazdil <dbrazdil@google.com> ART: Allow PackedSwitch instructions with zero targets

Optimizing and the interpreter wrongly assumed that a PackedSwitch
always has at least one target. This patch removes the corresponding
DCHECKs and adds a regression test case.

This is a resubmission of CL I32b7033ed38de6f1d1a6ee5d5bf12f3a47c9b37e

Bug: 21863783
Change-Id: I04e6e124bdd16591ba27c79490e6ce183c36b691
15875b0d36fce555534bb840b13b39d61fd108f2 17-Jun-2015 David Brazdil <dbrazdil@google.com> Revert "ART: Allow PackedSwitch instructions with zero targets"

This fixed Optimizing but revealed the same issue in the interpreter.

This reverts commit 241f9c41924e33e0c3bab9a7c4306397458749ca.

Change-Id: Iad5a28b24f2c21d3575cf8ecc8b7c8fbf98d1132
241f9c41924e33e0c3bab9a7c4306397458749ca 17-Jun-2015 David Brazdil <dbrazdil@google.com> ART: Allow PackedSwitch instructions with zero targets

Optimizing's Builder wrongly assumed that a PackedSwitch always has
at least one target. This patch removes the corresponding DCHECK and
adds a regression test case.

Bug:21863783
Change-Id: I32b7033ed38de6f1d1a6ee5d5bf12f3a47c9b37e
ae09d2d244cf2f506822b3e14731b81c3b278f9d 29-May-2015 Guillaume "Vermeille" Sanchez <guillaumesa@google.com> Bring ReferenceTypePropagation to HInvoke return types

Change-Id: Id0683f67e32874713a30c072c71dc537b1271926
6c0c4f230f417ed484bae5c01b79551af7659389 12-Jun-2015 Calin Juravle <calin@google.com> Revert "Revert "Revert "Bring ReferenceTypePropagation to HInvoke return types"""

This reverts commit a981f9d5cac9a479d3b5d16508d71cfe17d95117.

Change-Id: I69faf16d5ef0ecc234fb52e071b682e728a8bf97
a981f9d5cac9a479d3b5d16508d71cfe17d95117 12-Jun-2015 Calin Juravle <calin@google.com> Revert "Revert "Bring ReferenceTypePropagation to HInvoke return types""

This reverts commit 958857d0f9686770a3b1117166d5fa700b39704a.

Change-Id: I196ff2a4453489f0105efc54eee73a2a9321ac4e
958857d0f9686770a3b1117166d5fa700b39704a 12-Jun-2015 Calin Juravle <calin@google.com> Revert "Bring ReferenceTypePropagation to HInvoke return types"

We exceed stack frame size with Clang in art::OptimizingCompiler::CompileOptimized


This reverts commit ddedddcedaae78fc6aa29940fdb1fbe40bb05774.

Change-Id: I6f992dda228acb9cae2087d1e6c78f2afdf30050
ddedddcedaae78fc6aa29940fdb1fbe40bb05774 29-May-2015 Guillaume "Vermeille" Sanchez <guillaumesa@google.com> Bring ReferenceTypePropagation to HInvoke return types

Change-Id: I9a7e974787cb8ba75b86bd07e8a37c5fe99911c3
da9badb9edea5e0d18cd9f97eff0d0937ad48310 06-Jun-2015 Andreas Gampe <agampe@google.com> ART: Check long and double register pairs in invokes

For invokes, ensure that long and double parameters are actually
in registers pairs. We were testing the pair, but skipping the
actual high parameter register.

Bug: 17410612
Change-Id: I8f4c3335ea8b7dc3cf252bee52a5a706ae8905f8
69aa60163989c33a008115205d39732a76ecc1dc 09-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Pass current method to HNewInstance and HNewArray.""

Problem exposed by this change was fixed in:
https://android-review.googlesource.com/#/c/154031/

This reverts commit 7b0e353b49ac3f464c662f20e20e240f0231afff.

Change-Id: I680c13dc9db9ba223ab11c7af255222860b4e6d2
7b0e353b49ac3f464c662f20e20e240f0231afff 09-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Pass current method to HNewInstance and HNewArray."

082-inline-execute fails on x86.

This reverts commit e21aa42e1341d34250742abafdd83311ad9fa737.

Change-Id: Ib3fd25faee2e0128001e40d3d51a74f959bc4449
94015b939060f5041d408d48717f22443e55b6ad 04-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Use HCurrentMethod in HInvokeStaticOrDirect.""

Fix was to special case baseline for x86, which does not have enough
registers to allocate the current method.

This reverts commit c345f141f11faad177aa9635a78088d00cf66086.

Change-Id: I5997aa52f8d4df373ae5ff4d4150dac0c44c4c10
e21aa42e1341d34250742abafdd83311ad9fa737 08-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Pass current method to HNewInstance and HNewArray.

Also remove unsed CodeGenerator::LoadCurrentMethod.

Change-Id: I4b8d3f2a30b8e2c76b6b329a72555483c993cb73
c345f141f11faad177aa9635a78088d00cf66086 04-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Use HCurrentMethod in HInvokeStaticOrDirect."

Fails on baseline/x86.

This reverts commit 38207af82afb6f99c687f64b15601ed20d82220a.

Change-Id: Ib71018367eb7c6046965494a7e996c22af3de403
38207af82afb6f99c687f64b15601ed20d82220a 01-Jun-2015 Nicolas Geoffray <ngeoffray@google.com> Use HCurrentMethod in HInvokeStaticOrDirect.

Change-Id: I0d15244b6b44c8b10079398c55da5071a3e3af66
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
012a072d06474404ff488d181eb3d4a504c5cbe7 02-Jun-2015 Calin Juravle <calin@google.com> Revert "Revert "Revert "Bring ReferenceTypePropagation to HInvoke return types"""

This reverts commit 82cc909ff81cc25f7fe97ddac3a1a1f6dc9f5792.

Change-Id: If29dbe0dfd65998047c7ac4ef06c4789355b6bda
82cc909ff81cc25f7fe97ddac3a1a1f6dc9f5792 02-Jun-2015 Calin Juravle <calin@google.com> Revert "Revert "Bring ReferenceTypePropagation to HInvoke return types""

This reverts commit 8ccf8a0ce31083faa0d9c502f1f0f12a825f6c5d.

Change-Id: I729c147989e0e98d0739d7596b5bb41a72971624
8ccf8a0ce31083faa0d9c502f1f0f12a825f6c5d 02-Jun-2015 Calin Juravle <calin@google.com> Revert "Bring ReferenceTypePropagation to HInvoke return types"

This reverts commit 77e48c64e7c1c0084217b8df1b47ac6367e61cc7.

Change-Id: Ic6967b2ea7588862ac190e1c0555af615027b5b6
77e48c64e7c1c0084217b8df1b47ac6367e61cc7 29-May-2015 Guillaume "Vermeille" Sanchez <guillaumesa@google.com> Bring ReferenceTypePropagation to HInvoke return types

Change-Id: Ie8f6b0ea5bd841c9555f3b1b6d4b7dce92a117f1
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
d23eeef3492b53102eb8093524cf37e2b4c296db 18-May-2015 Nicolas Geoffray <ngeoffray@google.com> Support for inlining methods that call/throw.

Mostly fixes here and there to make it working.

Change-Id: I1b535e895105d78b65634636d675b818551f783e
fbdaa30a448029d75422c76f29087a4e39630f4a 29-May-2015 Nicolas Geoffray <ngeoffray@google.com> Use the new HCurrentMethod in HLoadString.

Change-Id: I23d27e5e10736d127519eb3238ff8f25df3843a2
104fd8a3f30ddcf07831250571aa2a233cd5c04d 20-May-2015 Guillaume "Vermeille" Sanchez <guillaumesa@google.com> Bring Reference Type Propagation to Instance/StaticInstanceField

For this, we need the field index in FieldInfo, hence the add of the field.

Change-Id: Id219bd826d8496acf3981307a8c42e2eb6ddb712
76b1e1799a713a19218de26b171b0aef48a59e98 27-May-2015 Nicolas Geoffray <ngeoffray@google.com> Add a HCurrentMethod node.

This enables register allocation for the current method, so
that users of it don't always load it from the stack.

Currently only used by HLoadClass. Will make follow-up
CLs for the other users.

Change-Id: If73324d85643102faba47fabbbd2755eb258c59c
81d804a51d4fc415e1544a5a09505db049f4eda6 20-May-2015 Guillaume "Vermeille" Sanchez <guillaumesa@google.com> Bring Reference Type Propagation to NewArray

Change-Id: Ieff4f38854e06b0ed4b5689ced94a4289053d80d
d5111bf05fc0a9974280a80eeb43db6d5227a81e 22-May-2015 Nicolas Geoffray <ngeoffray@google.com> Do not use dex_compilation_unit after inlining.

It's incompatible with inlining, as inlined invokes/load class/new
can be from another dex file.

Change-Id: I8897b6a012942bc8e136f2bea70252d3fb3a7fa5
3cd4fc8bbb40a57d2ffde85f543c124f53237c1d 14-May-2015 Calin Juravle <calin@google.com> Eliminate redundant constructor barriers when inlining.

Bug: 20410297
Change-Id: I2097743d00eb795d050d390b1918e38c7f41d506
702d26018769f9fbc4763c7ed02331aed596ac7d 30-Apr-2015 Calin Juravle <calin@google.com> Skip compilation when falling-through out of method code.

Bug: 19988134
Change-Id: I68638ce9551848a67af587595f264b51f976df11
2af2307f3903a75a379029c049b86f9903fc81a5 30-Apr-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "GVN final fields even with side effects."

This reverts commit 781733632637db98d79dfffad72bf063be3259be.

Change-Id: Id7c4591f6b8190921852044b278d11627457c570
781733632637db98d79dfffad72bf063be3259be 29-Apr-2015 Nicolas Geoffray <ngeoffray@google.com> GVN final fields even with side effects.

Two accesses of a final field can be GVN'ed even if there are
side effects between them.

Change-Id: I04495ae83c7858f4216b083ad1c29851954320ad
3e3d73349a2de81d14e2279f60ffbd9ab3f3ac28 28-Apr-2015 Roland Levillain <rpl@google.com> Have HInvoke instructions know their number of actual arguments.

Add an art::HInvoke::GetNumberOfArguments routine so that
art::HInvoke and its subclasses can return the number of
actual arguments of the called method. Use it in code
generators and intrinsics handlers.

Consequently, no longer remove a clinit check as last input
of a static invoke if it is still present during baseline
code generation, but ensure that static invokes have no such
check as last input in optimized compilations.

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

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

Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
1152c926076a760490085c4497c3f117fa8da891 24-Apr-2015 Mark Mendell <mark.p.mendell@intel.com> [optimizing] Rename HasArrayAccesses and check it

Since the flag is only used to see if there is a HBoundsCheck, rename
HasArrayAccesses() to HasBoundsChecks().

Add a check in graph_checker to see that the flag is set if we see a
HBoundsCheck instruction.

Change-Id: I10fe92897374fb247082152dd75c3611cc40ff30
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
20e8d43ab82b28f16b1630d5081d75a922d3f67a 24-Apr-2015 Mark Mendell <mark.p.mendell@intel.com> [optimizing] Ensure FillNewArray sets array access

A method that only used filled new like 'int[]{0,0}' didn't have the
array access flag set, so BCE didn't remove the checks.

Change-Id: Iedec50daf0d25b1cc3872eb1a4cfc7b8bb31e6bf
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
5f02c6caf9f38be49e655f8bdeeeb99b6faf9383 24-Apr-2015 Roland Levillain <rpl@google.com> Reduce the number of explicit clinit checks for static invokes.

Do not generate explicit clinit checks for static invokes
when the class of the called method is a super class of the
caller method's class (referrer class).

Change-Id: I86ba18facef261fbb71f7ed20867756630ed3c53
4c0eb42259d790fddcd9978b66328dbb3ab65615 24-Apr-2015 Roland Levillain <rpl@google.com> Ensure inlined static calls perform clinit checks in Optimizing.

Calls to static methods have implicit class initialization
(clinit) checks of the method's declaring class in
Optimizing. However, when such a static call is inlined,
the implicit clinit check vanishes, possibly leading to an
incorrect behavior.

To ensure that inlining static methods does not change the
behavior of a program, add explicit class initialization
checks (art::HClinitCheck) as well as load class
instructions (art::HLoadClass) as last input of static
calls (art::HInvokeStaticOrDirect) in Optimizing' control
flow graphs, when the declaring class is reachable and not
known to be already initialized. Then when considering the
inlining of a static method call, proceed only if the method
has no implicit clinit check requirement.

The added explicit clinit checks are already removed by the
art::PrepareForRegisterAllocation visitor. This CL also
extends this visitor to turn explicit clinit checks from
static invokes into implicit ones after the inlining step,
by removing the added art::HLoadClass nodes mentioned
hereinbefore.

Change-Id: I9ba452b8bd09ae1fdd9a3797ef556e3e7e19c651
0c25d1048154495ae0523ba2f5063385eb15aa5f 20-Apr-2015 Calin Juravle <calin@google.com> optimizing: fix gtests

by taking into account that the compilation unit is null during tests.

Change-Id: I01a28ce8f03c927ff679b84bcdf2464fa97e0924
27df758e2e7baebb6e3f393f9732fd0d064420c8 17-Apr-2015 Calin Juravle <calin@google.com> [optimizing] Add memory barriers in constructors when needed

If a class has final fields we must add a memory barrier before
returning from constructor. This makes sure the fields are visible to
other threads.

Bug: 19851497
Change-Id: If8c485092fc512efb9636cd568cb0543fb27688e
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
1b498727f79e85756a9eee86d31214393dc7002c 31-Mar-2015 David Brazdil <dbrazdil@google.com> ART: Same skip-compilation heuristic in both backends

When deciding if a method should be compiled, Optimizing counts the
DEX instructions while Quick approximates this figure as the size of
the CodeItem. This patch modifies Optimizing to use the same logic
so that the two backends reject the same set of methods.

Change-Id: Icb12bf2977f948198df08d59f243532ec8c61783
20f85597828194c12be10d3a927999def066555e 19-Mar-2015 Vladimir Marko <vmarko@google.com> Fixed layout for dex caches in boot image.

Define a fixed layout for dex cache arrays (type, method,
string and field arrays) for dex caches in the boot image.
This gives those arrays fixed offsets from the boot image
code and allows PC-relative addressing of their elements.

Use the PC-relative load on arm64 for relevant instructions,
i.e. invoke-static, invoke-direct, const-string,
const-class, check-cast and instance-of. This reduces the
arm64 boot.oat on Nexus 9 by 1.1MiB.

This CL provides the infrastructure and shows on the arm64
the gains that we can achieve by having fixed dex cache
arrays' layout. To fully use this for the boot images, we
need to implement the PC-relative addressing for other
architectures. To achieve similar gains for apps, we need
to move the dex cache arrays to a .bss section of the oat
file. These changes will be implemented in subsequent CLs.

(Also remove some compiler_driver.h dependencies to reduce
incremental build times.)

Change-Id: Ib1859fa4452d01d983fd92ae22b611f45a85d69b
8d5b8b295930aaa43255c4f0b74ece3ee8b43a47 24-Mar-2015 David Brazdil <dbrazdil@google.com> ART: Force constants into the entry block

Optimizations such as GVN and BCE make the assumption that all
constants are located in the entry block of the CFG, but not all
passes adhere to this rule.

This patch makes constructors of constants private and only accessible
to friend classes - HGraph for int/long constants and SsaBuilder for
float/double - which ensure that they are placed correctly and not
duplicated.

Note that the ArenaAllocatorAdapter was modified to not increment
the ArenaAllocator's internal reference counter in order to allow
for use of ArenaSafeMap inside an arena-allocated objects. Because
their destructor is not called, the counter does not get decremented.

Change-Id: I36a4fa29ae34fb905cdefd482ccbf386cff14166
790412959a6413a585f45fc5f77fe7106311a00c 26-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Use the original invoke type when inlining.

When resolving a method through the compiler driver, the code makes
sure the call in the DEX bytecode matches the kind of method found,
to check for IncompatibleClassChangeError. Because when we sharpen
an invoke virtual, we transform the invoke kind to direct, we must not
use the new kind, but the one in DEX.

Change-Id: Iaf77b27b529c659ea48ffb19f46427552c9e3654
9437b78780f9e6ffa5797ebe82de8e8d7f3a5ed6 25-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Inline across dex files.""

This reverts commit 6a816cf624ba56bf2872916d7b65b18fd9a411ef.

Change-Id: I36cb524108786dd7996f2aea0443675be1f1b859
46e2a3915aa68c77426b71e95b9f3658250646b7 16-Mar-2015 David Brazdil <dbrazdil@google.com> ART: Boolean simplifier

The optimization recognizes the negation pattern generated by 'javac'
and replaces it with a single condition. To this end, boolean values
are now consistently assumed to be represented by an integer.

This is a first optimization which deletes blocks from the HGraph and
does so by replacing the corresponding entries with null. Hence,
existing code can continue indexing the list of blocks with the block
ID, but must check for null when iterating over the list.

Change-Id: I7779da69cfa925c6521938ad0bcc11bc52335583
6a816cf624ba56bf2872916d7b65b18fd9a411ef 24-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Inline across dex files."

bug: 19904089
bug: 19903495

This reverts commit 7e4c3508e4f5512650b63c41f7872a749e99aee9.

Change-Id: I15df746b5f1882cce78eedde6c05c0d3b69bfa4a
7e4c3508e4f5512650b63c41f7872a749e99aee9 18-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Inline across dex files.

Change-Id: I5c2c44f5130b50f0bad21a6877a3935dc60b4a85
9ccd151d0d27a729f88af9d00285afe4d147981a 21-Mar-2015 Jeff Hao <jeffhao@google.com> Fix verifier handling of empty switch as last instruction.

Also fixes optimizing compiler's assumption that switch is non-empty and
adds test case.

Bug: 19827056
Change-Id: I5ac891d5062f528ef3be787b1094cba7b4c0fbd0
e4335eb5bcbca6927e51c10cf0de3516d94ef599 03-Mar-2015 Mingyao Yang <mingyao@google.com> Make BCE a no-op if there is no array access.

Change-Id: I8456182808c1dbaa0c0ae1b8c2e94bb17baf5f29
5e8b137d28c840b128e2488f954cccee3e86db14 23-Jan-2015 David Brazdil <dbrazdil@google.com> Create HGraph outside Builder, print timings

This patch refactors the way HGraph objects are created, moving the
instantiation out of the Builder class and creating the CodeGenerator
earlier. The patch uses this to build a single interface for printing
timings info and dumping the CFG.

Change-Id: I2eb63eabf28e2d0f5cdc7affaa690c3a4b1bdd21
2fd6aa5cb76f0c71cbdcd1189c76e68bf84e8308 02-Feb-2015 David Brazdil <dbrazdil@google.com> Fix broken gtests after SuspendCheck optimization

Fixes hardcoded graph dumps in pretty printer tests and an assumption
that non-zero branch offset in dex implies presence of HInstructions.

Change-Id: Iee273c06b7b36410b4621107bef2f3592ece2f5b
852eaffe8e478186e134d88a02843a469118ef8c 02-Feb-2015 David Brazdil <dbrazdil@google.com> No SuspendChecks when branching to return block

The return basic block is usually placed at the beginning of the DEX
file, making the branches to it back edges where the Optimizing's
graph builder places SuspendCheck instructions, only to be removed
later by the instruction_simplifier pass. Since huge auto-generated
methods tend to contain hundreds/thousands of these, this patch
recognizes the pattern and prevents builder from generating the
redundant check in the first place.

Change-Id: I065a3c2f71964b8fc2e53dc20730ba42938b78a1
cb1b00aedd94785e7599f18065a0b97b314e64f6 28-Jan-2015 Nicolas Geoffray <ngeoffray@google.com> Use the non access check entrypoint when possible.

Change-Id: I0b53d63141395e26816d5d2ce3fa6a297bb39b54
10e244f9e7f6d96a95c910a2bedef5bd3810c637 26-Jan-2015 Calin Juravle <calin@google.com> optimizing: NullCheck elimination

How it works:
- run a type analysis to propagate null information on instructions
- during the last instruction simplifier remove null checks for which
the input is known to be not null

The current type analysis is actually a nullability analysis but it will
be reused in follow up CLs to propagate type information: so it keeps
the more convenient name.

Change-Id: I54bb1d32ab24604b4d677d1ecdaf8d60a5ff5ce9
1cf95287364948689f6a1a320567acd7728e94a3 12-Dec-2014 Nicolas Geoffray <ngeoffray@google.com> Small optimization for recursive calls: avoid dex cache.

Change-Id: I044757a2f06e535cdc1480c4fc8182b89635baf6
71fb52fee246b7d511f520febbd73dc7a9bbca79 30-Dec-2014 Andreas Gampe <agampe@google.com> ART: Optimizing compiler intrinsics

Add intrinsics infrastructure to the optimizing compiler.

Add almost all intrinsics supported by Quick to the x86-64 backend.
Further intrinsics require more assembler support.

Change-Id: I48de9b44c82886bb298d16e74e12a9506b8e8807
02d81cc8d162a31f0664249535456775e397b608 05-Jan-2015 Serban Constantinescu <serban.constantinescu@arm.com> Opt Compiler: ARM64: Add support for rem-float, rem-double and volatile.

Add support for rem-float, rem-double and volatile memory accesses
using acquire-release and memory barriers.

Change-Id: I96a24dff66002c3b772c3d8e6ed792e3cb59048a
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
52c489645b6e9ae33623f1ec24143cde5444906e 16-Dec-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add support for volatile

- for backends: arm, x86, x86_64
- added necessary instructions to assemblies
- clean up code gen for field set/get
- fixed InstructionDataEquals for some instructions
- fixed comments in compiler_enums

* 003-opcode test verifies basic volatile functionality

Change-Id: I144393efa312dfb2c332cb84056b00edffee338a
4e44c829e282b3979a73bfcba92510e64fbec209 17-Dec-2014 Nicolas Geoffray <ngeoffray@google.com> Revert "Small optimization for recursive calls: avoid dex cache."

Fails on target.

This reverts commit 390f59f9bec64fd81b05e796dfaeb03ab6d4cc81.

Change-Id: Ic3865b8897068ba20df0fbc2bcf561faf6c290c1
390f59f9bec64fd81b05e796dfaeb03ab6d4cc81 12-Dec-2014 Nicolas Geoffray <ngeoffray@google.com> Small optimization for recursive calls: avoid dex cache.

Change-Id: Ic4054b6c38f0a2a530ba6ef747647f86cee0b1b8
e53798a7e3267305f696bf658e418c92e63e0834 01-Dec-2014 Nicolas Geoffray <ngeoffray@google.com> Inlining support in optimizing.

Currently only inlines simple things that don't require an
environment, such as:
- Returning a constant.
- Returning a parameter.
- Returning an arithmetic operation.

Change-Id: Ie844950cb44f69e104774a3cf7a8dea66bc85661
48c2b03965830c73cdddeae8aea8030f08430137 09-Dec-2014 Calin Juravle <calin@google.com> Add more compilation stats to optimizing

Optimizing is getting closer to have full coverage and this provides a
nice overview on why certain methods are not compiled/optimized.

Also, clean up some of the builder methods.

Change-Id: Id2f31441a788b797b0efea7ec78bee27bb654186
d2ec87d84057174d4884ee16f652cbcfd31362e9 08-Dec-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add REM_FLOAT and REM_DOUBLE

- for arm, x86, x86_64 backends
- reinstated fmod quick entry points for x86. This is a partial revert
of bd3682eada753de52975ae2b4a712bd87dc139a6 which added inline assembly
for floting point rem on x86. Note that Quick still uses the inline
version.
- fix rem tests for longs

Change-Id: I73be19a9f2f2bcf3f718d9ca636e67bdd72b5440
4c0b61f506644bb6b647be05d02c5fb45b9ceb48 05-Dec-2014 Roland Levillain <rpl@google.com> Add support for double-to-int & double-to-long in optimizing.

- Add support for the double-to-int and double-to-long Dex
instructions in the optimizing compiler.
- Add S1 to the list of ARM FPU parameter registers so that
a double value can be passed as parameter during a call
to the runtime through D0.
- Have art::x86_64::X86_64Assembler::cvttsd2si work with
64-bit operands.
- Generate x86, x86-64 and ARM (but not ARM64) code for
double to int and double to long HTypeConversion nodes.
- Add related tests to test/422-type-conversion.

Change-Id: Ic93b9ec6630c26e940f7966a3346ad3fd5a2ab3a
e4d4d323aa42506351b03e842818e9ec09ea6c37 04-Dec-2014 Andreas Gampe <agampe@google.com> ART: Add SparseSwitch support to the optimizing compiler

Add simple sparse-switch support through chained IFs. Refactor a
bit to better reuse code between switch types.

Now enables compiled versions of 015-switch and 095-switch-MAX_INT.

Bug: 18410979
Change-Id: Ib617e4b877f0b7fbc3bb289800f612f013480713
d881df5aad7950a185480876951762c1f60ea708 25-Nov-2014 Andreas Gampe <agampe@google.com> ART: Add PackedSwitch support to the optimizing compiler

Add simple packed-switch support through chained IFs.

Now enables compiled versions of 015-switch and 095-switch-MAX_INT.

Change-Id: I17cc8d659d1dd2d64227851c23998c04367e8cf5
8964e2b689d80fe546604ac8c724078645095cf1 04-Dec-2014 Roland Levillain <rpl@google.com> Add support for float-to-double & double-to-float in optimizing.

Change-Id: I41b0fee5a28c83757697c8d000b7e224cf5a4534
624279f3c70f9904cbaf428078981b05d3b324c0 04-Dec-2014 Roland Levillain <rpl@google.com> Add support for float-to-long in the optimizing compiler.

- Add support for the float-to-long Dex instruction in the
optimizing compiler.
- Add a Dex PC field to art::HTypeConversion to allow the
x86 and ARM code generators to produce runtime calls.
- Instruct art::CodeGenerator::RecordPcInfo not to record
PC information for HTypeConversion instructions.
- Add S0 to the list of ARM FPU parameter registers.
- Have art::x86_64::X86_64Assembler::cvttss2si work with
64-bit operands.
- Generate x86, x86-64 and ARM (but not ARM64) code for
float to long HTypeConversion nodes.
- Add related tests to test/422-type-conversion.

Change-Id: I954214f0d537187883f83f7a83a1bb2dd8a21fd4
3f8f936aff35f29d86183d31c20597ea17e9789d 02-Dec-2014 Roland Levillain <rpl@google.com> Add support for float-to-int in the optimizing compiler.

- Add support for the float-to-int Dex instruction in the
optimizing compiler.
- Factor type conversion related lines in
compiler/optimizing/builder.cc.
- Generate x86, x86-64 and ARM (but not ARM64) code for
float to int HTypeConversion nodes.
- Add related tests to test/422-type-conversion.

Change-Id: I2382dfc04bf394ed75f675148cfcf98216d65bc6
c7c8fe21f9688c52fdd92c1ff5deeffd620b99cf 02-Dec-2014 Calin Juravle <calin@google.com> [optimizing compiler] Fix invoke-direct

Always compute invoke info via compiler driver. This ensures that the
method is not called directly if its access cannot be verified.

Change-Id: I04b35563a1148bc5cb16b37324419e2a977ec8db
43a539f780af20a1854bca81c3d4835a585f0620 02-Dec-2014 Nicolas Geoffray <ngeoffray@google.com> Add some heursitics for compiling, close to Quick's.

Quick has more machinery to give up/not give up, but we can
backport them later.

Change-Id: I5eb62c664246f4ce46f0400cf24ec34a72afb51e
6d0e483dd2e0b63e952de060738c10e2abd12ff7 27-Nov-2014 Roland Levillain <rpl@google.com> Add support for long-to-float in the optimizing compiler.

- Add support for the long-to-float Dex instruction in the
optimizing compiler.
- Have art::x86_64::X86_64Assembler::cvtsi2ss work with
64-bit operands.
- Generate x86, x86-64 and ARM (but not ARM64) code for
long to float HTypeConversion nodes.
- Add related tests to test/422-type-conversion.

Change-Id: Ic983cbeb1ae2051add40bc519a8f00a6196166c9
ddb7df25af45d7cd19ed1138e537973735cc78a5 25-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}

Adds:
- float comparison for arm, x86, x86_64 backends.
- ucomis{s,d} assembly to x86 and x86_64.
- vmstat assebmly for thumb2
- new assembly tests

Change-Id: Ie3e19d0c08b3b875cd0a4be4ee4e9c8a4a076290
647b9ed41cdb7cf302fd356627a3ba372419b78c 27-Nov-2014 Roland Levillain <rpl@google.com> Add support for long-to-double in the optimizing compiler.

- Add support for the long-to-double Dex instruction in the
optimizing compiler.
- Enable requests of temporary FPU (double) registers during
code generation.
- Fix art::x86::X86Assembler::LoadLongConstant and extend
it to int64_t values.
- Have art::x86_64::X86_64Assembler::cvtsi2sd work with
64-bit operands.
- Generate x86, x86-64 and ARM (but not ARM64) code for
long to double HTypeConversion nodes.
- Add related tests to test/422-type-conversion.

Change-Id: Ie73d9e5e25bd2e15f585c371e8fc2dcb83438ccd
91debbc3da3e3376416e4394155d9f9e355255cb 26-Nov-2014 Calin Juravle <calin@google.com> Revert "[optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}"

Fails on arm due to missing vmrs op after vcmp. I revert this instead of pushing the fix because I don't understand yet why it compiles with run-test but not with dex2oat.

This reverts commit fd861249f31ab360c12dd1ffb131d50f02b0bfc6.

Change-Id: Idc2d30f6a0f39ddd3596aa18a532ae90f8aaf62f
fd861249f31ab360c12dd1ffb131d50f02b0bfc6 25-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}

- adds float comparison for arm, x86, x86_64 backends.
- adds ucomis{s,d} assembly to x86 and x86_64.

Change-Id: I232d2b6e9ecf373beb5cc63698dd97a658ff9c83
799f506b8d48bcceef5e6cf50f3f5eb6bcea05e1 26-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Revert "[optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}"

Fails on x86_64 and target.

This reverts commit cea28ec4b9e94ec942899acf1dbf20f8999b36b4.

Change-Id: I30c1d188c7ecfe765f137a307022ede84f15482c
cea28ec4b9e94ec942899acf1dbf20f8999b36b4 25-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add CMP{L,G}_{FLOAT,DOUBLE}

- adds float comparison for arm, x86, x86_64 backends.
- adds ucomis{s,d} assembly to x86 and x86_64.

Change-Id: Ie91e04bfb402025073054f3803a3a569e4705caa
9aec02fc5df5518c16f1e5a9b6cb198a192db973 19-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add shifts

Added SHL, SHR, USHR for arm, x86, x86_64.

Change-Id: I971f594e270179457e6958acf1401ff7630df07e
cff137481eda0eb8dbdf9d2a303ae2bdac2c7322 17-Nov-2014 Roland Levillain <rpl@google.com> Add support for int-to-float & int-to-double in optimizing.

- Add support for the int-to-float and int-to-double Dex
instructions in the optimizing compiler.
- Generate x86, x86-64 and ARM (but not ARM64) code for
byte to float, short to float, int to float, char to
float, byte to double, short to double, int to double and
char to double HTypeConversion nodes.
- Add related tests to test/422-type-conversion.

Change-Id: I963f9d0184a5d3721af2d8f593f133d5af7aa6a3
bacfec30ee9f2f6fdfd190f11b105b609938efca 14-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add REM_INT, REM_LONG

- for arm, x86, x86_64
- minor cleanup/fix in div tests

Change-Id: I240874010206a5a9b3aaffbc81a885b94c248f93
01a8d7135c59b4a664d1e0c0e4d8db343d4118ef 14-Nov-2014 Roland Levillain <rpl@google.com> Add support for int-to-short in the optimizing compiler.

- Add support for the int-to-short Dex instruction in the
optimizing compiler.
- Generate x86, x86-64 and ARM (but not ARM64) code for
byte to short, int to short and char to short
HTypeConversion nodes.
- Add related tests to test/422-type-conversion.

Change-Id: If1829549708d9c3473efaa641f7f0bcfa6080ae9
981e45424f52735b1c61ae0eac7e299ed313f8db 14-Nov-2014 Roland Levillain <rpl@google.com> Add support for int-to-char in the optimizing compiler.

- Add support for the int-to-char Dex instruction in the
optimizing compiler.
- Implement the ARM and Thumb-2 UBFX instructions and add
tests for them.
- Generate x86, x86-64 and ARM (but not ARM64) code for
byte to char, short to char, int to char (and char to
char!) HTypeConversion nodes.
- Add related tests to test/422-type-conversion.

Change-Id: I5cd4c6d86f0f6a966c059715b98db35cc8f9de76
51d3fc40637fc73d4156ad617cd451b844cbb75e 13-Nov-2014 Roland Levillain <rpl@google.com> Add support for int-to-byte in the optimizing compiler.

- Add support for the int-to-byte Dex instruction in the
optimizing compiler.
- Implement the ARM and Thumb-2 SBFX instructions.
- Generate x86, x86-64 and ARM (but not ARM64) code for
char to byte, short to byte and int to byte
HTypeConversion nodes.
- Add related tests to test/422-type-conversion.

Change-Id: Ic8b8911b90d4b5281fad15bcee96bc3ee85dc577
225ff81cd34e20c97897a6b3f755a0a284b08f46 13-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] Rename dex_offset to dex_pc in the builder

The term dex offset comes from Dalvik where these were addresses in
memory. Currently these should be dex PCs, namely offsets from the start
of code items. Quick lacks this clean up but there's no need to bring
over the convention to optimizing.

(thanks to irogers for the commit message text)

Change-Id: If86c0cf021a06f04a21462053e9d5f31bba7f65d
d6fb6cfb6f2d0d9595f55e8cc18d2753be5d9a13 11-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add DIV_LONG

- for backends: arm, x86, x86_64
- added cqo, idivq, testq assembly for x64_64
- small cleanups

Change-Id: I762ef37880749038ed25d6014370be9a61795200
f97f9fbfdf7f2e23c662f21081fadee6af37809d 11-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] add HTemporary support for long and doubles

Change-Id: I5247ecd71d0193050484b7632c804c9bfd20f924
9574c4b5f5ef039d694ac12c97e25ca02eca83c0 12-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Implement and/or/xor in optimizing.

Change-Id: I7cf6da1fd334a7177a5580931b8f174dd40b7cec
b7baf5c58d0e864f8c3f889357c51288aed42e61 11-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Implement monitorenter/monitorexit.

Pretty simple as they just invoke the runtime.

Change-Id: I5fcb2c783deac27e55e28d8b3da3e68ea4b77363
0d8db99ac5d838f81e0d3be83a5b00d5475edf86 11-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Implement invokesuper in optimizing.

- Ensure dex2oat is in PIC mode, as this will drive the decisions
made in the compiler driver, and optimizing only suppots PIC
anyway.

- Since invokesuper is sharpened into invoke-direct, also support
sharpening of invokeinterface and invokevirtual.

Change-Id: I0a1bd79a13dc1c9e67e3cb11d38f0cd4459968ae
57a88d4ac205874dc85d22f9f6a9ca3c4c373eeb 10-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Implement checkcast for optimizing.

- Ended up not using HTypeCheck because of how
instanceof and checkcast end up having different logic
for code generation.

- Fix a x86_64 assembler bug triggered by now enabling
more methods to be compiled. Difficult to test today
without b/18117217.

Change-Id: I3022e7ae03befb1d10bea9637ad21fadc430abe0
946e143941d456a4ec666f7f54719c65c5aa3f5d 11-Nov-2014 Roland Levillain <rpl@google.com> Revert "Revert "Add support for long-to-int in the optimizing compiler.""

This reverts commit 3adfd1b4fb20ac2b0217b5d2737bfe30ad90257a.

Change-Id: Iacf0c6492d49267e24f1b727dbf6379b21fd02db
3adfd1b4fb20ac2b0217b5d2737bfe30ad90257a 11-Nov-2014 Roland Levillain <rpl@google.com> Revert "Add support for long-to-int in the optimizing compiler."

This reverts commit 647b96f29cb81832e698f863884fdba06674c9de.

Change-Id: I552f23585463c676acbd547521b4d3ee5c0342eb
647b96f29cb81832e698f863884fdba06674c9de 11-Nov-2014 Roland Levillain <rpl@google.com> Add support for long-to-int in the optimizing compiler.

- Add support for the long-to-int Dex instruction in the
optimizing compiler.
- Generate x86, x86-64 and ARM (but not ARM64) code for
long-to-int HTypeConversion nodes.
- Add related tests to test/422-type-conversion.
- Also fix comments in test/415-optimizing-arith-neg and
in test/416-optimizing-arith-not.

Change-Id: I3084af30f2a495d178362ae1154dc7ceb7bf3a58
52839d17c06175e19ca4a093fb878450d1c4310d 07-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Support invoke-interface in optimizing.

Change-Id: Ic18d7c3d2810557231caf0571956e0c431f5d384
dadf3173e1070ccab89b86b2ef2ab9fb7030856f 07-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Silent cpplint on dex instruction switch.

Change-Id: I57a2307c80d38ba29a16cac729bcf3a491549c30
6f5c41f9e409bc4da53b5d7c385202255e391e72 06-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Implement instanceof in optimizing.

- Only fast-path for now: null or same class.
- Use pQuickInstanceofNonTrivial for slow path.

Change-Id: Ic5196b94bef792f081f3cb4d15157058e1381e6b
52e832b1278449e62d9eb502d54d5ff18f8606ed 06-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Support floats and doubles in fields.

Change-Id: I19832106633405403f0461b3fe13b268abe39db3
0f00db73c6e0ea423b4c9e871b5bb06d9627e3b0 06-Nov-2014 Calin Juravle <calin@google.com> Fixed BuildCheckedDiv signature

The second_reg might actually be a constant.

Change-Id: I08cecc41e3d65ab73b41eba2aca702dea8e1ed95
865fc88fdfd006ce0362c2c0d55c66a7bffdab61 06-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add DIV_INT_2ADDR

Change-Id: I38fc7e216f820d8ccc8bbf8b8e7a67b75fb9de87
de58ab2c03ff8112b07ab827c8fa38f670dfc656 05-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Implement try/catch/throw in optimizing.

- We currently don't run optimizations in the presence of a try/catch.
- We therefore implement Quick's mapping table.
- Also fix a missing null check on array-length.

Change-Id: I6917dfcb868e75c1cf6eff32b7cbb60b6cfbd68f
3dbcb38a8b2237b0da290ae35dc0caab3cb47b3d 28-Oct-2014 Roland Levillain <rpl@google.com> Support float & double negation in the optimizing compiler.

- Add support for the neg-float and neg-double Dex
instructions in the optimizing compiler.
- Generate x86, x86-64 and ARM (but not ARM64) code for
float and double HNeg nodes.
- Add related tests to test/415-optimizing-arith-neg.

Change-Id: I29739a86e13dbe6f64e191641d01637c867cba6c
d375fabd9e8cbb805fd12a33d94aa0729432ff3a 06-Nov-2014 Calin Juravle <calin@google.com> Fix build.

BuildCheckedDiv doesn't handle 12x instruction correctly.

Change-Id: I59571397cfb1b7ee89538e8e0b57725b863b0ee1
d0d4852847432368b090c184d6639e573538dccf 04-Nov-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add div-int and exception handling.

- for backends: arm, x86, x86_64
- fixed a register allocator bug: the request for a fixed register for
the first input was ignored if the output was kSameAsFirstInput
- added divide by zero exception
- more tests
- shuffle around some code in the builder to reduce the number of lines
of code for a single function.

Change-Id: Id3a515e02bfbc66cd9d16cb9746f7551bdab3d42
dff1f2812ecdaea89978c5351f0c70cdabbc0821 05-Nov-2014 Roland Levillain <rpl@google.com> Support int-to-long conversions in the optimizing compiler.

- Add support for the int-to-float Dex instruction in the
optimizing compiler.
- Add a HTypeConversion node type for control-flow graphs.
- Generate x86, x86-64 and ARM (but not ARM64) code for
int-to-float HTypeConversion nodes.
- Add a 64-bit "Move doubleword to quadword with
sign-extension" (MOVSXD) instruction to the x86-64
assembler.
- Add related tests to test/422-type-conversion.

Change-Id: Ieb8ec5380f9c411857119c79aa8d0728fd10f780
424f676379f2f872acd1478672022f19f3240fc1 03-Nov-2014 Nicolas Geoffray <ngeoffray@google.com> Implement CONST_CLASS in optimizing compiler.

Change-Id: Ia8c8dfbef87cb2f7893bfb6e178466154eec9efd
b5f62b3dc5ac2731ba8ad53cdf3d9bdb14fbf86b 30-Oct-2014 Nicolas Geoffray <ngeoffray@google.com> Support for CONST_STRING in optimizing compiler.

Change-Id: Iab8517bdadd1d15ffbe570010f093660be7c51aa
19a19cffd197a28ae4c9c3e59eff6352fd392241 22-Oct-2014 Nicolas Geoffray <ngeoffray@google.com> Add support for static fields in optimizing compiler.

Change-Id: Id2f010589e2bd6faf42c05bb33abf6816ebe9fa9
7c4954d429626a6ceafbf05be41bf5f840894e44 28-Oct-2014 Calin Juravle <calin@google.com> [optimizing compiler] Add division for floats and doubles

backends: x86, x86_64, arm.

Also:
- ordered instructions based on their name.
- add missing kNoOutputOverlap to add/sub/mul.

Change-Id: Ie47cde3b15ac74e7a1660c67a2eed1d7871f0ad0
705664321a5cc1418255172f92d7d7195cf60a7b 24-Oct-2014 Roland Levillain <rpl@google.com> Add long bitwise not instruction in the optimizing compiler.

- Add support for the not-long (long integer one's
complement negation) instruction in the optimizing
compiler.
- Add a 64-bit NOT instruction (notq) to the x86-64
assembler.
- Generate ARM, x86 and x86-64 code for long HNot nodes.
- Gather not-related tests in test/416-optimizing-arith-not.

Change-Id: I2d5b75e9875664d6032d04f8401b2bbb84506948
2e07b4f0a84a7968b4690c2b1be2e2f75cc6fa8e 23-Oct-2014 Roland Levillain <rpl@google.com> Revert "Revert "Implement long negate instruction in the optimizing compiler.""

This reverts commit 30ca3d847fe72cfa33e1b2473100ea2d8bea4517.

Change-Id: I188ca8d460d55d3a9966bcf31e0588575afa77d2
8d6ae524ed5d2fed1f9e789d6de9764d374afa43 23-Oct-2014 Nicolas Geoffray <ngeoffray@google.com> Fix wrong unsigned to signed conversions.

The HIntConstant node takes an int32_t, so we have to keep things signed.

Change-Id: Ib3fa50e87f99118d320cbb381f619d5be9287530
30ca3d847fe72cfa33e1b2473100ea2d8bea4517 23-Oct-2014 Roland Levillain <rpl@google.com> Revert "Implement long negate instruction in the optimizing compiler."

This reverts commit 66ce173a40eff4392e9949ede169ccf3108be2db.
66ce173a40eff4392e9949ede169ccf3108be2db 23-Oct-2014 Roland Levillain <rpl@google.com> Implement long negate instruction in the optimizing compiler.

- Add support for the neg-long (long integer two's
complement negate) instruction in the optimizing compiler.
- Add a 64-bit NEG instruction (negq) to the x86-64
assembler.
- Generate ARM, x86 and x86-64 code for integer HNeg nodes.
- Put neg-related tests into test/415-optimizing-arith-neg.

Change-Id: I1fbe9611e134408a6b8745d1df20ab6ffa5e50f2
096cc029451f4d48a79361ec206b6a7f3f58dd7c 23-Oct-2014 Calin Juravle <calin@google.com> [optimizing compiler] Handle SUB_FLOAT/DOUBLE nodes

Also add 414-optimizing-arith-sub to
TEST_ART_BROKEN_OPTIMIZING_ARM64_RUN_TESTS.

Change-Id: Ia1b7ff7857bc0e488b9b8ed8a36efb1a3a9bad36
1cc5f251df558b0e22cea5000626365eb644c727 22-Oct-2014 Roland Levillain <rpl@google.com> Implement int bit-wise not operation in the optimizing compiler.

- Add support for the not-int (integer one's complement
negate) instruction in the optimizing compiler.
- Extend the HNot control-flow graph node type and make it
inherit from HUnaryOperation.
- Generate ARM, x86 and x86-64 code for integer HNeg nodes.
- Exercise these additions in the codegen_test gtest, as there
is not direct way to assess the support of not-int from a
Java source. Indeed, compiling a Java expression such as
`~a' using javac and then dx generates an xor-int/lit8 Dex
instruction instead of the expected not-int Dex instruction.
This is probably because the Java bytecode has an `ixor'
instruction, but there's not instruction directly
corresponding to a bit-wise not operation.

Change-Id: I223aed75c4dac5785e04d99da0d22e8d699aee2b
b5bfa96ff20e86316961327dec5c859239dab6a0 21-Oct-2014 Calin Juravle <calin@google.com> Add multiplication for floats/doubles in optimizing compiler

Change-Id: I61de8ce1d9e37e30db62e776979b3f22dc643894
a3d05a40de076aabf12ea284c67c99ff28b43dbf 20-Oct-2014 Nicolas Geoffray <ngeoffray@google.com> Implement array creation related DEX instructions.

Implement new-array, filled-new-array, and fill-array-data.

Change-Id: I405560d66777a57d881e384265322617ac5d3ce3
88cb1755e1d6acaed0f66ce65d7a2a4465053342 20-Oct-2014 Roland Levillain <rpl@google.com> Implement int negate instruction in the optimizing compiler.

- Add support for the neg-int (integer two's complement
negate) instruction in the optimizing compiler.
- Add a HNeg node type for control-flow graphs and an
intermediate HUnaryOperation base class.
- Generate ARM, x86 and x86-64 code for integer HNeg nodes.

Change-Id: I72fd3e1e5311a75c38a8cb665a9211a20325a42e
34bacdf7eb46c0ffbf24ba7aa14a904bc9176fb2 07-Oct-2014 Calin Juravle <calin@google.com> Add multiplication for integral types

This also fixes an issue where we could allocate a pair register even if
one of its parts was already blocked.

Change-Id: I4869175933409add2a56f1ccfb369c3d3dd3cb01
7fb49da8ec62e8a10ed9419ade9f32c6b1174687 06-Oct-2014 Nicolas Geoffray <ngeoffray@google.com> Add support for floats and doubles.

- Follows Quick conventions.
- Currently only works with baseline register allocator.

Change-Id: Ie4b8e298f4f5e1cd82364da83e4344d4fc3621a3
3c04974a90b0e03f4b509010bff49f0b2a3da57f 24-Sep-2014 Nicolas Geoffray <ngeoffray@google.com> Optimize suspend checks in optimizing compiler.

- Remove the ones added during graph build (they were added
for the baseline code generator).
- Emit them at loop back edges after phi moves, so that the test
can directly jump to the loop header.
- Fix x86 and x86_64 suspend check by using cmpw instead of cmpl.

Change-Id: I6fad5795a55705d86c9e1cb85bf5d63dadfafa2a
e982f0b8e809cece6f460fa2d8df25873aa69de4 13-Aug-2014 Nicolas Geoffray <ngeoffray@google.com> Implement invoke virtual in optimizing compiler.

Also refactor 004 tests to make them work with both Quick and
Optimizing.

Change-Id: I87e275cb0ae0258fc3bb32b612140000b1d2adf8
fbc695f9b8e2084697e19c1355ab925f99f0d235 15-Sep-2014 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Implement suspend checks in new compiler.""

This reverts commit 7e3652c45c30c1f2f840e6088e24e2db716eaea7.

Change-Id: Ib489440c34e41cba9e9e297054f9274f6e81a2d8
7e3652c45c30c1f2f840e6088e24e2db716eaea7 15-Sep-2014 Nicolas Geoffray <ngeoffray@google.com> Revert "Implement suspend checks in new compiler."

This reverts commit 6fbce029fba3ed5da6c36017754ed408e6bcb632.

Change-Id: Ia915c27873b021e658a10212e559095dfc91284e
ad1977fb16e11ee2de12a49ebc425f7a872a984a 15-Sep-2014 Nicolas Geoffray <ngeoffray@google.com> Revert "Add tests for IF_EQZ for suspend checks."

This reverts commit 58bdd18fb060979c22a1fd1a15c2efdcdd19c1c5.

Change-Id: I1bd4db03743cf57a1fd930baf6d9fe0105453c8c
58bdd18fb060979c22a1fd1a15c2efdcdd19c1c5 15-Sep-2014 Nicolas Geoffray <ngeoffray@google.com> Add tests for IF_EQZ for suspend checks.

Also remove leftover debugging.

Change-Id: If7d3119bc03b9ad6c1228fbde781162d0e62753f
6fbce029fba3ed5da6c36017754ed408e6bcb632 10-Sep-2014 Nicolas Geoffray <ngeoffray@google.com> Implement suspend checks in new compiler.

For simplicity, they are currently placed on all (dex-level)
back edges, and at method entry.

Change-Id: I6e833e244d559dd788c69727e22fe40aff5b3435
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
3c7bb98698f77af10372cf31824d3bb115d9bf0f 23-Jul-2014 Nicolas Geoffray <ngeoffray@google.com> Implement array get and array put in optimizing.

Also fix a couple of assembler/disassembler issues.

Change-Id: I705c8572988c1a9c4df3172b304678529636d5f6
f12feb8e0e857f2832545b3f28d31bad5a9d3903 17-Jul-2014 Nicolas Geoffray <ngeoffray@google.com> Stack overflow checks and NPE checks for optimizing.

Change-Id: I59e97448bf29778769b79b51ee4ea43f43493d96
e50383288a75244255d3ecedcc79ffe9caf774cb 04-Jul-2014 Nicolas Geoffray <ngeoffray@google.com> Support fields in optimizing compiler.

- Required support for temporaries, to be only used by baseline compiler.
- Also fixed a few invalid assumptions around locations and instructions
that don't need materialization. These instructions should not have an Out.

Change-Id: Idc4a30dd95dd18015137300d36bec55fc024cf62
abed4d094913db58d7624ea9d98f567fdaa751ac 14-Jul-2014 Nicolas Geoffray <ngeoffray@google.com> Bailout if the field access is not supported.

Change-Id: I50a184e087d2e68173d886196842981330590253
412f10cfed002ab617c78f2621d68446ca4dd8bd 19-Jun-2014 Nicolas Geoffray <ngeoffray@google.com> Support longs in the register allocator for x86_64.

Change-Id: I7fb6dfb761bc5cf9e5705682032855a0a70ca867
20dfc797dc631bf8d655dcf123f46f13332d3074 17-Jun-2014 Dave Allison <dallison@google.com> Add some more instruction support to optimizing compiler.

This adds a few more DEX instructions to the optimizing compiler's
builder (constants, moves, if_xx, etc).

Also:
* Changes the codegen for IF_XX instructions to use a condition
rather than comparing a value against 0.
* Fixes some instructions in the ARM disassembler.
* Fixes PushList and PopList in the thumb2 assembler.
* Switches the assembler for the optimizing compiler to thumb2
rather than ARM.

Change-Id: Iaafcd02243ccc5b03a054ef7a15285b84c06740f
ddb311fdeca82ca628fed694c4702f463b5c4927 16-May-2014 Nicolas Geoffray <ngeoffray@google.com> Build live ranges in preparation for register allocation.

Change-Id: I7ae24afaa4e49276136bf34f4ba7d62db7f28c01
f635e63318447ca04731b265a86a573c9ed1737c 14-May-2014 Nicolas Geoffray <ngeoffray@google.com> Add a compilation tracing mechanism to the new compiler.

Code mostly imported from: https://android-review.googlesource.com/#/c/81653/.

Change-Id: I150fe942be0fb270e03fabb19032180f7a065d13
29a2648821ea4d0b5d3aecb9f835822fdfe6faa1 03-May-2014 Ian Rogers <irogers@google.com> Move DecodedInstruction into MIR.

Change-Id: I188dc7fef4f4033361c78daf2015b869242191c6
db928fcc975b431d8a78700c11bd7da21090384a 16-Apr-2014 Nicolas Geoffray <ngeoffray@google.com> Simplify HInvokeStatic code generation.

HPushArgument is not needed for now (but might be when we start
optimizing). Also, calling convention for 64bits backend will
require to know more about the argument than the argument's
index. Therefore currently let HInvokeStatic setup the arguments,
which is possible because arguments of a calls are virtual registers
and not instructions.

Change-Id: I8753ed6083aa083c5180ab53b436dc8de4f1fe31
01bc96d007b67fdb7fe349232a83e4b354ce3d08 11-Apr-2014 Nicolas Geoffray <ngeoffray@google.com> Long support in optimizing compiler.

- Add stack locations to the Location class.
- Change logic of parameter passing/setup by setting the
location of such instructions the ones for the calling
convention.

Change-Id: I4730ad58732813dcb9c238f44f55dfc0baa18799
b55f835d66a61e5da6fc1895ba5a0482868c9552 07-Apr-2014 Nicolas Geoffray <ngeoffray@google.com> Test control flow instruction with optimizing compiler.

Add support for basic instructions to implement these tests.

Change-Id: I3870bf9301599043b3511522bb49dc6364c9b4c0
f583e5976e1de9aa206fb8de4f91000180685066 07-Apr-2014 Nicolas Geoffray <ngeoffray@google.com> Add support for taking parameters in optimizing compiler.

- Fix stack layout to mimic Quick's.
- Implement some sub operations.

Change-Id: I8cf75a4d29b662381a64f02c0bc61d859482fc4e
2e7038ac5848468740d6a419434d3dde8c585a53 03-Apr-2014 Nicolas Geoffray <ngeoffray@google.com> Add support for new-instance and invoke-direct.

Change-Id: I2daed646904f7711972a7da15d88be7573426932
4a34a428c6a2588e0857ef6baf88f1b73ce65958 03-Apr-2014 Nicolas Geoffray <ngeoffray@google.com> Support passing arguments to invoke-static* instructions.

- Stop using the frame pointer for accessing locals.
- Stop emulating a stack when doing code generation. Instead,
rely on dex register model, where instructions only reference
registers.

Change-Id: Id51bd7d33ac430cb87a53c9f4b0c864eeb1006f9
d8ee737fdbf380c5bb90c9270c8d1087ac23e76c 28-Mar-2014 Nicolas Geoffray <ngeoffray@google.com> Add support for adding two integers in optimizing compiler.

Change-Id: I5524e193cd07f2692a57c6b4f8069904471b2928
8ccc3f5d06fd217cdaabd37e743adab2031d3720 19-Mar-2014 Nicolas Geoffray <ngeoffray@google.com> Add support for invoke-static in optimizing compiler.

Support is limited to calls without parameters and returning
void. For simplicity, we currently follow the Quick ABI.

Change-Id: I54805161141b7eac5959f1cae0dc138dd0b2e8a5
787c3076635cf117eb646c5a89a9014b2072fb44 17-Mar-2014 Nicolas Geoffray <ngeoffray@google.com> Plug new optimizing compiler in compilation pipeline.

Also rename accessors to ART's conventions.

Change-Id: I344807055b98aa4b27215704ec362191464acecc
bab4ed7057799a4fadc6283108ab56f389d117d4 11-Mar-2014 Nicolas Geoffray <ngeoffray@google.com> More code generation for the optimizing compiler.

- Add HReturn instruction
- Generate code for locals/if/return
- Setup infrastructure for register allocation. Currently
emulate a stack.

Change-Id: Ib28c2dba80f6c526177ed9a7b09c0689ac8122fb
3ff386aafefd5282bb76c8a50506a70a4321e698 04-Mar-2014 Nicolas Geoffray <ngeoffray@google.com> Add register support to the optimizing compiler.

Also make if take an input and build the use list for instructions.

Change-Id: I1938cee7dce5bd4c66b259fa2b431d2c79b3cf82
d4dd255db1d110ceb5551f6d95ff31fb57420994 28-Feb-2014 Nicolas Geoffray <ngeoffray@google.com> Add codegen support to the optimizing compiler.

Change-Id: I9aae76908ff1d6e64fb71a6718fc1426b67a5c28
be9a92aa804c0d210f80966b74ef8ed3987f335a 25-Feb-2014 Nicolas Geoffray <ngeoffray@google.com> Add conditional branches, and build dominator tree.

Change-Id: I4b151a07b72692961235a1419b54b6b45cf54e63
818f2107e6d2d9e80faac8ae8c92faffa83cbd11 18-Feb-2014 Nicolas Geoffray <ngeoffray@google.com> Re-apply: Initial check-in of an optimizing compiler.

The classes and the names are very much inspired by V8/Dart.
It currently only supports the RETURN_VOID dex instruction,
and there is a pretty printer to check if the building of the
graph is correct.

Change-Id: I28e125dfee86ae6ec9b3fec6aa1859523b92a893
1af0c0b88a956813eb0ad282664cedc391e2938f 19-Feb-2014 Nicolas Geoffray <ngeoffray@google.com> Revert "Initial check-in of an optimizing compiler."

g++ warnings turned into errors.

This reverts commit 68a5fefa90f03fdf5a238ac85c9439c6b03eae96.

Change-Id: I09bb95d9cc13764ca8a266c41af04801a34b9fd0
68a5fefa90f03fdf5a238ac85c9439c6b03eae96 18-Feb-2014 Nicolas Geoffray <ngeoffray@google.com> Initial check-in of an optimizing compiler.

The classes and the names are very much inspired by V8/Dart.
It currently only supports the RETURN_VOID dex instruction,
and there is a pretty printer to check if the building of the
graph is correct.

Change-Id: Id5ef1b317ab997010d4e3888e456c26bef1ab9c0