History log of /art/runtime/verifier/method_verifier.cc
Revision Date Author Comments
34fa79ece5b3a1940d412cd94dbdcc4225aae72f 15-Sep-2014 Brian Carlstrom <bdc@google.com> Avoid printing absolute addresses in oatdump

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

Bug: 15567083
Change-Id: Id86a21e06d4a28f29f16fd018cba7e55c57f849a
6167864e28e4e12658ebdbaf1d5239acdaf4aaa4 13-Sep-2014 Mathieu Chartier <mathieuc@google.com> Fix stale root error in verifier

There was a stale root error caused by the static roots from
the reg types. These were visitied if there was an active verifier
in the method_verifiers_ but this is not always the case when a GC
is run. The fix is to always visit the static method verifier roots.

This only showed up as a bug without an image since these roots
were primitive classes and always in the image, and therefore
didn't ever need to be updated due to moving GC.

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

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

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

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

Bug: 16161620
Change-Id: I2f591d53b7d1559171e70aaaf22225d94b4882f5
74ae47a0590feceea31a2388f98c83e3ec0df0ec 07-Sep-2014 Andreas Gampe <agampe@google.com> ART: Fix unchecked register index validity

The static check of index validity is against the type given by
the instruction, e.g., boolean for SPUT_BOOLEAN, but the target_type
is the resolved field type and can differ. An additional check is
necessary to avoid a read out of bounds.

Bug: 17411109
Change-Id: Ie4ed8bbda79f3f6403a24e727450a943447aa71d
6dd35ccbfbb29201c84a54261d75977c598ef2e6 27-Aug-2014 Ian Rogers <irogers@google.com> Revert "Avoid using NanoTime for compiler and verifier"

This reverts commit c89e6edbdce97c7d199b54bf63aed7ea01ebf1ff.

Change-Id: Id3b89121a19e64bf3c457c39b375f3d3c0fcc579
c89e6edbdce97c7d199b54bf63aed7ea01ebf1ff 27-Aug-2014 Mathieu Chartier <mathieuc@google.com> Avoid using NanoTime for compiler and verifier

Target timings before with -j2 --compiler-filter=interpret-only:
Approximate speedup 3%.

Before:
real 0m36.852s
real 0m36.050s
real 0m36.246s

After:
real 0m35.667s
real 0m35.779s
real 0m35.458s

Bug: 16853450

Change-Id: Id996172d8283639fe293ddfc26d01fc1a0beed0b
b68c6e578a28a9717d78dfd522d9d9b8befaedf2 19-Aug-2014 Mathieu Chartier <mathieuc@google.com> Reduce interpret-only compile time.

Before:
39.04user 5.18system 0:29.24elapsed 151%CPU (0avgtext+0avgdata 164176maxresident)k
38.87user 5.16system 0:29.14elapsed 151%CPU (0avgtext+0avgdata 164144maxresident)k

After:
36.26user 3.25system 0:27.00elapsed 146%CPU (0avgtext+0avgdata 162592maxresident)k
36.25user 3.28system 0:26.28elapsed 150%CPU (0avgtext+0avgdata 162688maxresident)k

Disabled implicit stack protection for the compiler, this reduces page faults.

Added support for not timing every method compilation and verification. NanoTime is
slow and adds ~2 seconds of real time. This is currently enabled since people want
to know which methods are slow to compile.

Bug: 16853450

(cherry picked from commit 8e219ae27624116b6d23e858fb21e93342f81d66)

Change-Id: I349ffb3f36db8c437137387aa6914dc17d743f09
ccb1a5d46bc1b4ee888e74775f5c1291d600ff54 22-Aug-2014 Stephen Kyle <stephen.kyle@arm.com> ART: Reject field accesses to non-reference vregs.

The verifier will now reject any iget/iput insts
that do not have a reference object in vB.

Bug: 17207857
Signed-off-by: Stuart Monteith <stuart.monteith@arm.com>

(cherry picked from commit 695c5982eeddee18c643cc2f94c9d78fa75599ab)

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

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

Don't generate GC maps when compilation is disabled.

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

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

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

Bug: 16853450
Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad

Conflicts:
runtime/utils.cc
04ce113458b6b01f96d58dbb4c41682ee22d8b5d 04-Aug-2014 Jeff Hao <jeffhao@google.com> Make verifier identify unresolved methods as constructors by <init>.

Check was previously missing brackets in the method name.

Bug: 16560516
Change-Id: I6b28f8413f3d4c14269a6de38731213d7c964af6
0d08727e19b46770f0f27633d08caf13d9bb3e98 04-Aug-2014 Jeff Hao <jeffhao@google.com> Make verifier identify unresolved methods as constructors by <init>.

Check was previously missing brackets in the method name.

Bug: 16560516

(cherry picked from commit 04ce113458b6b01f96d58dbb4c41682ee22d8b5d)

Change-Id: Ie98c5b84e73ffc43ea08e1b08ae9c6e41bcd5891
0e7f37de5bcebb413712eddd1831f30bd0818664 16-Jul-2014 Mingyao Yang <mingyao@google.com> Set vtable in class object to null after linking.

This is follow-up work of embedding imt and vtable for
faster interface/virtual call dispatching.
Once vtable becomes embedded, the original vtable is nulled.

(cherry picked from commit 2cdbad7c62f126581ec5177104de961c4d71adaa)

Change-Id: I6acdcd1ee560d387fb77c55c58bbe3598c197ba1
e19f2b00eebd61e73761ab531866654f08968711 16-Jul-2014 Mingyao Yang <mingyao@google.com> Set vtable in class object to null after linking.

This is follow-up work of embedding imt and vtable for
faster interface/virtual call dispatching.
Once vtable becomes embedded, the original vtable is nulled.

(cherry picked from commit 2cdbad7c62f126581ec5177104de961c4d71adaa)

Change-Id: I6acdcd1ee560d387fb77c55c58bbe3598c197ba1
7da9586b559290e1c16207c6513ffe485de61655 30-Jul-2014 Hiroshi Yamauchi <yamauchi@google.com> Add read barriers for the roots in the verifier.

Note: Because the roots (the class references in RegType objects) can
be updated by the read barriers, a lot of uses of type "const RegType"
were replaced with "RegType".

Bug: 12687968
Change-Id: I6cf37a87f352938d43fb51560a8d927ada104f50
4c6427a757cae2b1c79aafca71be780e54620e68 28-Jul-2014 Andreas Gampe <agampe@google.com> ART: Reject array-length on non-reference register

It should be a hard verifier failure if we detect an array-length
instruction over a non-reference-type register.

Bug: 16595896

(cherry picked from commit 65c9db8dfbeea3f708f95f058f4fed7c2af71052)

Change-Id: I56babcbe95d50fd66a132cf4434cf5fa780beb4e
65c9db8dfbeea3f708f95f058f4fed7c2af71052 28-Jul-2014 Andreas Gampe <agampe@google.com> ART: Reject array-length on non-reference register

It should be a hard verifier failure if we detect an array-length
instruction over a non-reference-type register.

Bug: 16595896
Change-Id: I059510b15c846551b2f8ded86cfd8127543324f4
328fbbf9b2de27f02dbbee4e91bb5e612ef43203 22-Jul-2014 Andreas Gampe <agampe@google.com> ART: Check high part of dalvik register pairs on put-wide

When verifying a put-wide, it is necessary to check the lo and the hi
register for the right type.

Bug: 16018242

(cherry picked from commit 2a593a14e8e0df01a50139e0d48c7be46fb057ef)

Change-Id: I9e661951d592e155e0f281ea959e778d8f4a67ab
2cdbad7c62f126581ec5177104de961c4d71adaa 16-Jul-2014 Mingyao Yang <mingyao@google.com> Set vtable in class object to null after linking.

This is follow-up work of embedding imt and vtable for
faster interface/virtual call dispatching.
Once vtable becomes embedded, the original vtable is nulled.

Change-Id: I307696657d1e283654169dbecb8f7815c42bbabc
2a593a14e8e0df01a50139e0d48c7be46fb057ef 22-Jul-2014 Andreas Gampe <agampe@google.com> ART: Check high part of dalvik register pairs on put-wide

When verifying a put-wide, it is necessary to check the lo and the hi
register for the right type.

Bug: 16018242
Change-Id: I9e661951d592e155e0f281ea959e778d8f4a67ab
f021cc085ac00ee2b6eaac6ffdf8f01596289dc7 19-Jul-2014 Andreas Gampe <agampe@google.com> ART: Also accept java.lang.Throwable as a catch-all handler.

Accept catch handlers with catch type of java.lang.Throwable as
catch-all handlers.

(cherry picked from commit f91baf17ad11a86c84c9fc34ff70feee65a43233)

Bug: 16308310
Change-Id: Ie9b9582ee71c94c82b7695dc6f9c2c6df3d869d8
493c9beb3635d091c159043337836d6fa5d10107 18-Jul-2014 Andreas Gampe <agampe@google.com> ART: Make a soft failure in method verifier hard, add check

Make the soft error of using a primitive type in an instanceof a
hard verifier error.

Add a check when doing check_cast peep-hole optimization to check
whether the cast type is valid.

(cherry picked from commit 00633eb490ad21f711dcfccfb3a70992b2f8a72a)

Bug: 16020300
Change-Id: Icaea560d17804f24a13dc09c115e9ec7039cb472
f91baf17ad11a86c84c9fc34ff70feee65a43233 19-Jul-2014 Andreas Gampe <agampe@google.com> ART: Also accept java.lang.Throwable as a catch-all handler.

Accept catch handlers with catch type of java.lang.Throwable as
catch-all handlers.

Bug: 16308310
Change-Id: Ie9b9582ee71c94c82b7695dc6f9c2c6df3d869d8
00633eb490ad21f711dcfccfb3a70992b2f8a72a 18-Jul-2014 Andreas Gampe <agampe@google.com> ART: Make a soft failure in method verifier hard, add check

Make the soft error of using a primitive type in an instanceof a
hard verifier error.

Add a check when doing check_cast peep-hole optimization to check
whether the cast type is valid.

Bug: 16020300
Change-Id: Icaea560d17804f24a13dc09c115e9ec7039cb472
e5877a12c30afe10a5c6a1afaff7a47ef44a2a5f 16-Jul-2014 Ian Rogers <irogers@google.com> Fix x86 build.

Also fix attributes/annotalysis on entrypoint_utils functions now we have
clang that is smarter wrt warnings than GCC.

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

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

Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
ebbdd87cbb57e45da341fbf7325406e982810c10 08-Jul-2014 Ian Rogers <irogers@google.com> Only allow instance-of to improve knowledge of a type for downcasts.

Previous "not upcast" test could improve a type to an impossible type that
following a merge back with the original register would lead to conflict
(and subsequent verifier errors).
Modify UpdateRegisters so that the work line will be updated if merging
causes changes in the fall-through case.

Bug: 15808277
Issue: https://code.google.com/p/android/issues/detail?id=72093
Change-Id: Ib16cae8506246177e902825af036d5a397ad0dac
c3314311df5ae50ea9151ac4933d3eccbdefb41a 20-Jun-2014 Andreas Gampe <agampe@google.com> ART: Method verifier must check invoke-virtuals for non-zero args

Compiler checks rely on all instructions, not just reachable ones,
so add two new verifier flags.

Bug: 15755602
Change-Id: Ia9c2146cf82d94ce4d69fb6f7be6450137bb84bd
77cd4d677c682c194b8325b209cb76720be4046a 20-Jun-2014 Andreas Gampe <agampe@google.com> ART: Method verifier needs to check 2-reg values

The method verifier did not check against the second register
for a J or D parameter from a method signature.

The register line had a wrong DCHECK that did not catch this even
in debug mode.

Bug: 15751498
Change-Id: Ic6af08bf4704b3ab0f308dd9f0da28691a4cb024
95c0bf8fb5847cff263639f889d04c7c3c26eedd 16-Jun-2014 Andreas Gampe <agampe@google.com> ART: Make verifier check invocation args of unresolved methods

In the case of unresolvable methods it is not enough to bail out
with a soft verifier failure, as the compiler relies on the
invocation being well-formed. Check all arguments against the
proto id in such a case.

Also make sure to complete parsing arguments in the case the
method was resolved.

Refactored code to unite these two cases.

Bug: 15616104
Change-Id: I5ec58cbfbf6b09eaaf07ddf15edae7c6a8b62b17
073ed9ba97df41862403f64d7a2e824d09ab50ed 14-Jun-2014 Andreas Gampe <agampe@google.com> ART: Ignore timing issues in debug builds

When in debug builds, do not warn about slow verification and
compilation.

Change-Id: Ib982e1c7cf40cf624688bbf6c41f0a7cc53bbc67
acc4d2f72a2cadce2964dd2cc9eb20f73fc552ff 13-Jun-2014 Andreas Gampe <agampe@google.com> ART: Check the number of invocation args in verifier

Check the number of invocation arguments against the method's
prototype signature. It could happen that the method wasn't
available, yet, in which case we would let a clearly wrong
instruction through.

This generalizes https://android-review.googlesource.com/#/c/97779/

Bug: 15570483
Change-Id: Ie81aff3c1166a2b2bf1385414dff2e22fbb40ef2
e2256621883f321513a6397ca82a271c64d7c393 12-Jun-2014 Andreas Gampe <agampe@google.com> ART: Do not allow quickened dex codes in compiler mode.

The method verifier will reject quickened dex opcodes when the
runtime is in compiler mode, as we do not expect them here.

Bug: 15570344
Change-Id: I072567835139860213f9882cac995370b4548a79
5fb22a916dcb652fd2c2a2421de621f458177dcd 13-Jun-2014 Ian Rogers <irogers@google.com> Don't verify runtime only opcodes in the data-flow phase of verification.

Bug: 15570344
Change-Id: I0304e8742a1d0318783ba72862e684ab91f63d0e
9f2b6433c17ec8ea30015fd1b20e7a0ad3d4159e 13-Jun-2014 Andreas Gampe <agampe@google.com> ART: Invoke_virtual needs at least receiver parameter

Makes the method verifier reject invoke_virtual instructions that
claim they do not need any parameters.

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

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

Bug: 13077697

Change-Id: I71f964d4d810ab4debda1a09bc968af8f3c874a3
576ca0cd692c0b6ae70e776de91015b8ff000a08 07-Jun-2014 Ian Rogers <irogers@google.com> Reduce header files including header files.

Main focus is getting heap.h out of runtime.h.

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

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

Bug: 13077697

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

Merge ART from AOSP to lmp-preview-dev.

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

Fixed the generic trampoline to not use ToJObject when unnecessary.

Bug: 15167269

This reverts commit 3bdb873122964da7937eb070cbcf2ef638a8e459.

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

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

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

This reverts commit e09ae0920be57760fb390b6944bce420fa0b5582.

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

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

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

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

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

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

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

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

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

Bug: 8981901

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

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

Renamed StackIndirectReferenceTable to HandleScope.

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

Renamed Handle::get -> Get.

Bug: 8473721

Change-Id: Idbfebd4f35af629f0f43931b7c5184b334822c7a
6c9678f64d022a76aa43c4eba5e30d9759e2a77e 08-May-2014 Ian Rogers <irogers@google.com> Allow invoke-virtual-quick on interface types.

Fix a broken assumption that receivers for invoke-virtual are non-interface
types.

Bug: 14469172
Change-Id: I0d6e19141d4f52a4bd27bf1cb5f8d0e85fc9cf49
a4cf1df04b3de24e69c044e0aae4c2573d6c37d1 08-May-2014 Ian Rogers <irogers@google.com> Allow invoke-virtual-quick on interface types.

Fix a broken assumption that receivers for invoke-virtual are non-interface
types.

Bug: 14469172
Change-Id: I0d6e19141d4f52a4bd27bf1cb5f8d0e85fc9cf49
deca99bf42d0f5300b1dacc1df383b5950209645 06-May-2014 Brian Carlstrom <bdc@google.com> Add more context for CHECKs

Bug: 14469172
Change-Id: I7b75c63c857d0fd7e3b08990f21a73d2dfe430b1
33f2e594cc37570de9fc806e1cf66767205f20a2 06-May-2014 Brian Carlstrom <bdc@google.com> Add more context for CHECKs

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

Change-Id: I188dc7fef4f4033361c78daf2015b869242191c6
2ed76f95dd5a7edada82407a1853be803c9853a9 22-Apr-2014 Sebastien Hertz <shertz@google.com> Resolve method's argument reference types

Using ResolveClassAndCheckAccess allows to resolve reference types and check
we have access to these types too. This also prevents from getting unresolved
reference types, which has been observed during deoptimization.

Bug: 13464407
Change-Id: I4c02fdff191c195f34502a4d4a20357419982eb1
479fc1ecc12fa6560ca90d841c4d5174fb346618 04-Apr-2014 Sebastien Hertz <shertz@google.com> Support field watchpoint in interpreter

We report field read/write events to instrumentation from the interpreter. This
allows it to send JDWP field access and field modification events to debugger.
This completes CL https://android-review.googlesource.com/90390.

We also fix the JDWP FieldOnly modifier by introducing ModBasket.fieldTypeID.
We incorrectly used ModBasket.classId which is actually dedicated to ClassOnly
modifier based on thread's location's class id.

Finally, we now enable canWatchFieldModification and canWatchFieldAccess JDWP
capabilities so a debugger can request these events to be reported.

Bug: 8267708
Change-Id: I987852ad47abb27b2f7e78544a8189c7a4e2f462
b878f2133a04593643228eb1d47993092528b963 25-Apr-2014 Jeff Hao <jeffhao@google.com> Make unresolved exception types cause soft verification errors.

Before, the verifier would allow the first exception it finds
for a catch block to be unresolved, but this causes problems if
it merges other exceptions later. The verifier should soft fail
for any unresolved exception type it finds.

Bug: 14256107
Change-Id: I22563ebfe8c9680cc676b73516d5b48bc9c4ecf3
9bc54406ba3377980cfce44901dc2be246178ba9 18-Apr-2014 Ian Rogers <irogers@google.com> Interpreter-only mode should cause dex-to-dex compilation.

Also, fix quick iget/iput that had similar issues to:
https://android-review.googlesource.com/91423
Also, remove fall-back resolution code from quick invokes/igets/iputs as we
allow class loading for the exception throw and regular verification already
allows class loading.
Bug: 14133618

Change-Id: I51199e6e2392da0354f64b157e79af494c183778
639815628cf52a4a944a4322cb09da37cded2de9 17-Apr-2014 Andreas Gampe <agampe@google.com> Fix a class-loading bug in the verifier when throwing NPE

When throwing an NPE for invocation, we try to resolve the class of
the method being called. When in the interpreter and having quickened
code, that failed.

Bug: 14133618
Change-Id: I4964b908bb26a82a12263fb86f5dc39c9042479b
d1c88b5030f6f7d1f5aea2e6b69a9c0b41515c67 10-Apr-2014 Mathieu Chartier <mathieuc@google.com> Change FindClass in GetQuickInvokedMethod to use reg_types_.

FindClass can do ScopedThreadStateChange which causes check failures
during SIGQUIT.

Bug: 13929160
Change-Id: I00be4972423c04254a922de3aa731e8edb38ca02
4b06a725fe722063cb595d42ed4ed8b4fd05db9c 10-Apr-2014 Mathieu Chartier <mathieuc@google.com> Change FindClass in GetQuickInvokedMethod to use reg_types_.

FindClass can do ScopedThreadStateChange which causes check failures
during SIGQUIT.

Bug: 13929160
Change-Id: I00be4972423c04254a922de3aa731e8edb38ca02
757b304a2dfaeaee01071c9e2ee5e5a18ea18545 28-Mar-2014 Sebastien Hertz <shertz@google.com> Properly dump register type in verifier failure messages

Fixes failure messages where we miss to dereference pointer to RegType. This
caused to dump the address of the reg type instead of the reg type itself.

Also moves merging tests of primitive types from RegTypeReferenceTest to
RegTypeTest class.

Change-Id: I71cea419fdaa9ac46d7c011eb23e8746a14fb378
aa0c00c97bc1fe5c8def7c6cdebfd119e86d07e5 14-Mar-2014 Sebastien Hertz <shertz@google.com> Fix reg type merging in the verifier

Fixes bad merging of float, long and double reg types with constant types. Adds
merging tests in reg_type_test.

Bug: https://code.google.com/p/android/issues/detail?id=66434
Bug: 13464407
Change-Id: I56761f5f5562b742d0ef9cc66b58d55f7b668949
c645f1ddb7c40bea6a38eda4b3f83f6b6dec405b 07-Mar-2014 Mathieu Chartier <mathieuc@google.com> Add more VerifyObject calls.

Added verify object calls to SirtRef, IndirectReferenceTable,
ReferenceTable.

Removed un-needed verify object in ScopedObjectAccess / DecodeJObject
since object sources are handled.

Bug: 12934910
Change-Id: I55a46a8ea61fed2a77526eda27fd2cce97a9b125
b04388f6f05be900386da1ca66615d9542c35475 05-Mar-2014 Brian Carlstrom <bdc@google.com> Fix oatdump for interpret-only boot classpath

Change-Id: I12cf5046b01dfba110bf0604fe01a8abf8b352dc
a2806550cefb7c70781d8ee6279e6ad5769804cb 27-Feb-2014 Brian Carlstrom <bdc@google.com> Remove some stray stringpiece.h includes

Bug: 13186058
Change-Id: I2cb313425864a5d4e988fcf71a99c60ad63c63fb
9837939678bb5dcba178e5fb00ed59b5d14c8d9b 25-Feb-2014 Ian Rogers <irogers@google.com> Avoid std::string allocations for finding an array class.

Introduce ClassLinker::FindArrayClass which performs an array class lookup
given the element/component class. This has a 16 element cache of recently
looked up arrays.
Pass the current thread to ClassLinker Find .. Class routines to avoid calls
to Thread::Current().
Avoid some uses of FindClass in the debugger where WellKnownClasses is a
faster and more compacting GC friendly alternative.

Change-Id: I60e231820b349543a7edb3ceb9cf1ce92db3c843
83c8ee000d525017ead8753fce6bc1020249b96a 28-Jan-2014 Mathieu Chartier <mathieuc@google.com> Add root types and thread id to root visiting.

Enables us to pass the root type and thread id to hprof.

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

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

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

Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
eae2fb27c91aa7972dffcb32d5e405567badd6aa 14-Jan-2014 Mathieu Chartier <mathieuc@google.com> Don't resolve types in verifier when we can't load classes.

Added a boolean parameter to GetReturnType which tells us whether or
not we can resolve types. We pass in can_load_classes_.

Bug: 11689500
Change-Id: Ib3d35f441e08c2409ce14ac269854012dc978ddd
849600bb5cfc02bf5ab4aa9a810667ebd3b53328 20-Dec-2013 Sebastien Hertz <shertz@google.com> Use imprecise constants at compilation time.

During veriifcation, we create constant types for the following instructions:
const/4, const/16, const and const/high16. We used to create "precise" constant
types for each constant we process in the method being verified. Though precise
constants are only useful for deoptimization which happens at runtime.

This CL now creates "imprecise" constant types at compilation time. Since it
reduces the number of constant types we create during verification, it should
also reduce the amount of time spent in verification at compilation time.

Bug: 12167380
Bug: 12126841
Change-Id: I70522c4133a74a533fc2d2cb8d4f49888e590828
2b5eaa2b49f7489bafdadc4b4463ae27e4261817 13-Dec-2013 Vladimir Marko <vmarko@google.com> Move compiler code out of method verifier.

We want to detect small methods for inlining at the end of
the method verification. Instead of adding more compiler
code to the runtime, we create a callback from the runtime
into the compiler, so that we can keep the code there.
Additionally, we move the compiler-related code that was
already in the method verifier to the compiler since it
doesn't really belong to the runtime in the first place.

Change-Id: I708ca13227c809e07917ff3879a89722017e83a9
2d7e5aa6c707537f1906ed77b0ff29ec3dd261f7 14-Dec-2013 Jeff Hao <jeffhao@google.com> Add classes that fail verification early to rejected class list.

Change-Id: I5e06ec2dc3dfd061fcd6c099e10991482a1aaf65
c528dba35b5faece51ca658fc008b688f8b690ad 26-Nov-2013 Mathieu Chartier <mathieuc@google.com> Enable moving classes.

Slight reduction in Zygote size, memory savings are in the noise.
Before: Zygote size: 8739224
After: Zygote size: 8733568

Fixed a bug where we didn't set the concurrent start bytes after
switching the allocator from bump pointer to ROSAlloc in the
zygote. This caused excessive memory usage.

Added the method verifiers as roots to fix an issue caused by
RegTypes holding a Class*.

Added logic to clear card table in the SemiSpace collector, this
reduces DalvikOther from ~2400k -> ~1760k when using the SemiSpace
collector.

Added a missing lock to the timing loggers which caused a rare
one time crash in std::set.

Bug: 11771255
Bug: 8499494
Bug: 10802951

Change-Id: I99d2b528cd51c1c5ed7012e3220b3aefded680ae
8171fc34bf74ed0df02385787d916bc13eb7f160 26-Nov-2013 Vladimir Marko <vmarko@google.com> Don't prefix GC map by length.

Bug: 11767815
Change-Id: I063917aefdf7674ee1a77736db059c9ee95ea075
4137f4828a6a7c48aa1b161cecb82e1e0880aa16 22-Nov-2013 Jeff Hao <jeffhao@google.com> Make verifier log hard failures by default.

Previously required verbose verifier logging to see reasons for hard failures.

Change-Id: I2d05dfec95aeb48e8e1d9d3e4386916ab90071a4
c255e9723c4ac6eff7778ade21296bb5f11ea7bf 19-Nov-2013 Vladimir Marko <vmarko@google.com> Avoid unnecessary copy of dex_gc_map.

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

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

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

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

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

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

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

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

Bug: 8981901

Change-Id: I3c886fd322a6eef2b99388d19a765042ec26ab99
d60f3eee1866d950c0f0bfa6466955538ae81feb 04-Nov-2013 Jeff Hao <jeffhao@google.com> Verifier uses exception type instead of conflict if unresolved.

Fixes OneMedical app installation issues.

Bug: 11335470
Change-Id: I10ef8c84ef5bf5587283413b8cea89202407fe2b
(cherry picked from commit c26a56cb596c3c8efd519c4014fc2ebb3e48b221)
c26a56cb596c3c8efd519c4014fc2ebb3e48b221 04-Nov-2013 Jeff Hao <jeffhao@google.com> Verifier uses exception type instead of conflict if unresolved.

Fixes OneMedical app installation issues.

Bug: 11335470
Change-Id: I10ef8c84ef5bf5587283413b8cea89202407fe2b
dfb325e0ddd746cd8f7c2e3723b3a573eb7cc111 30-Oct-2013 Ian Rogers <irogers@google.com> Don't use UTF16 length as length for MUTF8.

Bug 11367555.

Change-Id: Ia0b07072a1a49d435c3b71ed9a668b316b7ff5d8
8249b425ba81d804c222c746e31bfcac9516e759 29-Oct-2013 Sebastien Hertz <shertz@google.com> Avoid verifier crash for quickened invoke on null.

When verifying an invoke-virtual-quick on a "null" instance, we can't infer the
class of the method being invoked. This CL handles this case and avoid a crash
due to a failed check in RegType::GetClass.

Also revert changes made to test 082-inline-execute since it succeeds with this
CL now.

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

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

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

Change-Id: I9cb3859ec70cca71ed79331ec8df5bec969d6745
a6b22c5be364a4ea926bfd2d0ea6169b22bdd10b 04-Oct-2013 Jeff Hao <jeffhao@google.com> Verifier allows arguments of integral types to be interchangeable.

This fixes a bug where code was passing an int into a method with a
byte argument. The RI allows this, but the verifier was rejecting it.

Bug: 11033423
Change-Id: I2a6af3bbbc6e9288fc000f711ae1337ab5786d1a
d91d6d6a80748f277fd938a412211e5af28913b1 26-Sep-2013 Ian Rogers <irogers@google.com> Introduce Signature type to avoid string comparisons.

Method resolution currently creates strings to then compare with strings formed
from methods in other dex files. The temporary strings are purely created for
the sake of comparisons. This change creates a new Signature type that
represents a method signature but not as a string. This type supports
comparisons and so can be used when searching for methods in resolution.

With this change malloc is no longer the hottest method during dex2oat (now its
memset) and allocations during verification have been reduced. The verifier is
commonly what is populating the dex cache for methods and fields not declared
in the dex file itself.

Change-Id: I5ef0542823fbcae868aaa4a2457e8da7df0e9dae
d0fbd85a82a266c21d6b72c61d6dc098ec362de7 25-Sep-2013 Ian Rogers <irogers@google.com> Reduce memory allocation in verifier.

Remove the use of a map PcToRegisterLineTable for efficiency (matches Dalvik).
Place the register line register values inside the RegisterLine, saves a
secondary allocation and indirection.
Avoid the use of a deque in RegisterLine to avoid an allocation.
Simplify the SirtRef destructor in non-debug builds.
Saves >100ms from the two threaded compile time of ThinkFree on host.

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

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

Change-Id: I47a12c3c76f46e2c9805be1c3a3e3870fe1f5d85
deb43702e611d6c75b459ea352a00f5d98fc0aa9 04-Sep-2013 Jeff Hao <jeffhao@google.com> Fix handling of unresolved references in verifier.

The verifier should not treat use of unresolved references as a reason to reject
the entire class. Instead, the verifier treats the instruction as a throw. If
that class is run, the interpreter with extra checks will throw an exception.

Bug: 10457426

(cherry picked from commit a3faaf4bece7f42529c013fe87bd41de59798656)

Change-Id: I161bfdbfa116890ffa9e7a593c756229bd939eb4
a3faaf4bece7f42529c013fe87bd41de59798656 04-Sep-2013 Jeff Hao <jeffhao@google.com> Fix handling of unresolved references in verifier.

The verifier should not treat use of unresolved references as a reason to reject
the entire class. Instead, the verifier treats the instruction as a throw. If
that class is run, the interpreter with extra checks will throw an exception.

Bug: 10457426

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

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

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

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

Change-Id: I20c73a3b17d86286428ab0fd21bc13f51f36c85c
dd3c27eeb8286ab53d8a2f1aec76a7a919ba353a 05-Sep-2013 Jeff Hao <jeffhao@google.com> Fix verifier upcasting type after instance_of.

The verifier automatically changed the type of a register to be
the checked type in an instance_of instruction, even if the
checked type was the register type's superclass. This would loosen
the type information of the register and cause problems later.

Bug: 10614872

(cherry picked from commit c642ec8987746a2a44b990bd5354306242d709da)

Change-Id: Ib447557d3582dad6ac01f0e3b4ee497a27a45172
c642ec8987746a2a44b990bd5354306242d709da 05-Sep-2013 Jeff Hao <jeffhao@google.com> Fix verifier upcasting type after instance_of.

The verifier automatically changed the type of a register to be
the checked type in an instance_of instruction, even if the
checked type was the register type's superclass. This would loosen
the type information of the register and cause problems later.

Bug: 10614872

Change-Id: I67aa2c66be754d946e928b8a64431f193539b842
b8a0b94735f188bc739e4c55479c37699006b881 21-Aug-2013 Ian Rogers <irogers@google.com> Switch JNI globals lock to reader-writer.

Also, verifier rejected classes lock. These locks show as contended during
dex2oat, however, they're commonly only read access is required.

Change-Id: If8bb834cc69cd8c26494c87fb7f7b20d4e41cdfd
90af14d2743614e3e1453984b14258a6f145501d 16-Aug-2013 Dragos Sbirlea <dragoss@google.com> Get SEA fibonacci running in interpreter mode.

Android.mk: Added new file to build.
compile_driver.cc: Moved SE_IR usage test in the block
protected by bool compile, which is enabled by
adding a sepatate test in IsCnadidateForCompilation.
class_linker.cc: Added check in NeedsInterpreter to enable SEA_IR.
art_method-inl.h: DIsabled check in SEA_IR mode.
method_verifier.cc: Added check for SEA_IR mode.
method_verifier.h: Chenged IsCandidateForCompilation signature to
allow testing the function name (for SEA_IR selective
compilation).
dot_gen.h: Updated ART file API usage to altest version.
sea_ir/frontend.cc: Passing function symbol name to CompileMethod.
instruction_Nodes.h: Added accessor for method index for
InvokeStatic IR node.
sea.cc: Added additional IR SignatureNode for function calls (extra
Method parameter). Fixed UnnamedConstant constant value.
sea.h: Passing function_name to GenerateLLVM.
type_inference_visitor.cc: Aded type for first (placeholder) method
parameter.

Change-Id: I295858ea0761a3dffb36f35748d8b93d4919d6a9
0f40ac31134d9ae0f059d4c448165599dc8459c1 14-Aug-2013 Ian Rogers <irogers@google.com> Fix races in small mode compiler filters setup

Fixes host tests in small art mode.

Change-Id: I2579f872583f425607f91c1e58df68b05b5098bb
97a03e3cc86002b10889562a6b5b164cd2b99e7e 14-Aug-2013 Ian Rogers <irogers@google.com> Fix small art build.

Change-Id: Idaade55babbab192c87b32c077d2ec01ac9ef0e2
75a43f10f55e2aa550de51e969cc1e60d583b632 14-Aug-2013 Anwar Ghuloum <anwarg@google.com> Clean up logcat spam from compiler and verifier

Moved to VLOG(...), adding verifer tag for VLOG.

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

Cherry-picked from commit ed41d5c44299ec5d44b8514f6e17f802f48094d1.

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

Bug: 10014286.

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

Change-Id: Iddedf63b6f9d908717a4d30f963e9b81a9604d49
673b68360e9d030b250ed23bf33c33381640a220 31-Jul-2013 Jeff Hao <jeffhao@google.com> Make verifier allow integral types to be put in integral type arrays.

This fixes a problem where the verifier was rejecting when an integer
is put into a byte array. This also more closely matches the RI.

Also fixes various issues with debugging checks caught by cts.

Bug 10097083

Change-Id: Ie816fcdd85d6dc898feffa1e3fea8cfc2c6946ff

Conflicts:
runtime/verifier/method_verifier.cc

(cherry-picked from commit b24b4a7e0c4f9bbea49f9dd95b2600080c8293d9)
f9468a5ad69edbb92f7b0998960383787cf9cbb1 07-Aug-2013 Jeff Hao <jeffhao@google.com> Verifier checks that primitive put array/field type matches insn type.

Change-Id: Idd68a36d26451459e55fc586bbd1e71c51a81be9
(cherry picked from commit a464748006d101407108c3d9eefd865c44cce695)
7644966addc0d7760baffc8897799f019981d74f 01-Aug-2013 Jeff Hao <jeffhao@google.com> Move verification of primitive type puts into helper method.

Change-Id: Ia40d9f85303a52e20ca57acf13a0cfc8a9922024

Conflicts:
runtime/verifier/method_verifier.cc

(cherry-picked from commit fe1f7c84369abbf5a0121557aa0c6c58e9477710)
d678802609ad07ec2f307caecce5fe5a16fedd46 05-Aug-2013 Sebastien Hertz <shertz@google.com> Use reader writer mutex for safe checkcast map.

Use a ReaderWriterMutex to protect MethodVerifier::safecast_map_ like
what's done for MethodVerifier::dex_gc_maps_ and MethodVerifier::devirt_maps_.

Change-Id: Id2ac9c290cc524eb992ea7cabe63766e88753747
(cherry picked from commit b9c37fb5746cc240e86677e56cb0d74d829e3504)
a49bdffd3826ea45b5d8f435b2add160871351bb 31-Jul-2013 Ian Rogers <irogers@google.com> Don't add barriers to clinit methods.

Change-Id: I13e6c008feb8c19e452d6e2f88b2bbbcac997de5
(cherry picked from commit 9fc16eb43fe938f0cddb13638bd7cbc2ea9534a2)
ee17e0aa4d24deb11c1766bfcc6a864519df1c1e 31-Jul-2013 buzbee <buzbee@google.com> Compilation filter

This CL introduces a static compilation filter mechanism intended
to allow us to reduce compilation time and space requirements until
we have a profiling mechanism in place.

It supports 5 modes of filtering:

o interpret-only (compile nothing)
o deferred-compilation (compile only those methods believe to be
compute-intensive)
o space (optimized for space)
o balanced (best return on space investment)
o speed (compile everything)

A future CL will allow the default filtering mode to be set
via system property. For now, you can pass it in via command
line as follows:

dalvikvm -compiler-filter:[interpret-only|defer-compilation|
space|balanced|speed]

or dex2oat --runtime-arg -compiler-filter:[one of the above modes]

Creating a file named art/SMALL_ART will force the filter
default to interpret-only. Later on we'll move this capability
to a persistent system property.

or modify kDefaultCompilerFilter in runtime.h

It also changes the compiler driver to allow the compilers to
decline to compile a method by return NULL.

Change-Id: Ic73411818f8bb845a4a19a05b0395c50902c534f
(cherry picked from commit a024a0686c3b0fea13f362bff70d65981e5febc5)
a024a0686c3b0fea13f362bff70d65981e5febc5 31-Jul-2013 buzbee <buzbee@google.com> Compilation filter

This CL introduces a static compilation filter mechanism intended
to allow us to reduce compilation time and space requirements until
we have a profiling mechanism in place.

It supports 5 modes of filtering:

o interpret-only (compile nothing)
o deferred-compilation (compile only those methods believe to be
compute-intensive)
o space (optimized for space)
o balanced (best return on space investment)
o speed (compile everything)

A future CL will allow the default filtering mode to be set
via system property. For now, you can pass it in via command
line as follows:

dalvikvm -compiler-filter:[interpret-only|defer-compilation|
space|balanced|speed]

or dex2oat --runtime-arg -compiler-filter:[one of the above modes]

Creating a file named art/SMALL_ART will force the filter
default to interpret-only. Later on we'll move this capability
to a persistent system property.

or modify kDefaultCompilerFilter in runtime.h

It also changes the compiler driver to allow the compilers to
decline to compile a method by return NULL.

Change-Id: Ic73411818f8bb845a4a19a05b0395c50902c534f
a464748006d101407108c3d9eefd865c44cce695 07-Aug-2013 Jeff Hao <jeffhao@google.com> Verifier checks that primitive put array/field type matches insn type.

Change-Id: Idd68a36d26451459e55fc586bbd1e71c51a81be9
b9c37fb5746cc240e86677e56cb0d74d829e3504 05-Aug-2013 Sebastien Hertz <shertz@google.com> Use reader writer mutex for safe checkcast map.

Use a ReaderWriterMutex to protect MethodVerifier::safecast_map_ like
what's done for MethodVerifier::dex_gc_maps_ and MethodVerifier::devirt_maps_.

Change-Id: Id2ac9c290cc524eb992ea7cabe63766e88753747
fe1f7c84369abbf5a0121557aa0c6c58e9477710 01-Aug-2013 Jeff Hao <jeffhao@google.com> Move verification of primitive type puts into helper method.

Change-Id: Ia40d9f85303a52e20ca57acf13a0cfc8a9922024
b24b4a7e0c4f9bbea49f9dd95b2600080c8293d9 31-Jul-2013 Jeff Hao <jeffhao@google.com> Make verifier allow integral types to be put in integral type arrays.

This fixes a problem where the verifier was rejecting when an integer
is put into a byte array. This also more closely matches the RI.

Also fixes various issues with debugging checks caught by cts.

Bug 10097083

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

Change-Id: I323e9e8c29c3e39d50d9aba93121b26266c52a46
9fc16eb43fe938f0cddb13638bd7cbc2ea9534a2 31-Jul-2013 Ian Rogers <irogers@google.com> Don't add barriers to clinit methods.

Change-Id: I13e6c008feb8c19e452d6e2f88b2bbbcac997de5
2724776ad521eebb1c7f0e4be56d6e6ab4764f86 28-Jul-2013 buzbee <buzbee@google.com> Support inline dex data, take 2

Allow switch and array data blocks to appear interspersed
with Dex code (rather than just at the end).

Bug 10040419

Change-Id: Ia2850070f0e702381eb402f604d675e5a0b101de
c449aa8151bf81d93d22ff24677ccf09a6da218e 29-Jul-2013 Ian Rogers <irogers@google.com> Clear exception if catch block doesn't have move-exception.

Bug: 10040419

Change-Id: Icc7a55cb3cdfbc3efd2b161bbe22b3e5007de35f
46a1270fad27d81904ed60d0df56761356af500d 27-Jul-2013 Brian Carlstrom <bdc@google.com> Revert "Support inline dex data"

This reverts commit 728328a441c6d3172283f3e44d120550997b5887.
728328a441c6d3172283f3e44d120550997b5887 27-Jul-2013 buzbee <buzbee@google.com> Support inline dex data

Dx always places switch table and array data following executable
code. However, embedding data inline appears to be legal - and
the Garmin Connect app does this. Unknown is what tool generated
the odd dex code. This CL reworks dex parsing to support inline data.

Further, a verification check to require a move-exception at
the beginning of catch regions is disabled. Dalvik's verifier appears
to only require that if a move-exception exists, it must be at
the beginning of the catch. If there is value to the check
requiring a move-exception, we'll need to enable it based on a
future dex version.

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

Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
93c3396f8b33539489763ebdfafcedb4127009d9 26-Jul-2013 Brian Carlstrom <bdc@google.com> Fix style issues in MethodVerifier

Change-Id: I3aa5929311863e40840acebc5efafecb949fdea5
4d4adb1dae07bb7421e863732ab789413a3b43f0 24-Jul-2013 Sebastien Hertz <shertz@google.com> Prevent verifier from creating unused compilation data.

The verifier used to create data which may be unused like GC map. This is the
case for non-compiled method (which are interpreted). This CL aims to optimize
this.

Here are the changes:
- Move compilation selection to MethodVerifier::IsCandidateForCompilation.
- Compiler and verifier use this method to know if a method must be compiled.
- Only create compilation data while compiling using Runtime::IsCompiler.
- Do not create internal structures concerning GC map, ... in Runtime::Init and
Runtime::Shutdown when we are not compiling.
- Checks we are compiling when accessing these structures.
- Add missing destruction of MethodVerifier::safecast_map_lock_ and
MethodVerifier::safecast_map_ in Runtime::Shutdown.
- Call Runtime::Shutdown just before Runtime instance is destroyed to avoid a
crash.
- Add missing "GUARDED_BY" macro for MethodVerifier::rejected_classes_ field.
- Add "has_check_casts" to avoid the safecast pass if there is no check-cast
instruction.
- Add "has_virtual_or_interface_invokes" to avoid the devirtualization pass if
there is no invoke-virtual/range nor invoke-interface/range instructions.

Bug: 9987437
Change-Id: I418ee99f63e4203409cf5b7d2c2295b22fcf24c1
b8c7859f21f5ae4c9b90f2ef2effc51967299737 26-Jul-2013 Ian Rogers <irogers@google.com> Revert "Revert "Remove non-live vregs from GC map on return.""

This reverts commit 73dda0bc2adcd6a3a7d75f663a3559f8b527d485.
It also fixes the problematic line in the ReferenceMap test.

Change-Id: Ic3b62db7c040853a5ddfed589f6e0acff25d82b7
73dda0bc2adcd6a3a7d75f663a3559f8b527d485 25-Jul-2013 Ian Rogers <irogers@google.com> Revert "Remove non-live vregs from GC map on return."

This change causes a test regression on the oat tests, back out until the change also updates the test for the new GC map values.

This reverts commit c0d120a0b1389f1f402d13e20b9e4abd9ab7cd95.

Change-Id: I48bc951b1dad9a9ae83cccf0b5b68ad60fac052c
c0d120a0b1389f1f402d13e20b9e4abd9ab7cd95 24-Jul-2013 Ian Rogers <irogers@google.com> Remove non-live vregs from GC map on return.

Mark registers going into a return as conflict/bottom so that they aren't
considered for GC maps and deoptimization.

Bug 4191345.

Change-Id: I8af6c21824b6459788852be5417849e8ef999bcb
6d376aec61fc57b4caa840c1ae309e4f4f589792 24-Jul-2013 Ian Rogers <irogers@google.com> Tidy ws and document verifier instruction flags.

Change-Id: I6c58a76f3373b17fc001480c4db069fc942fce3a
02c8cc6d1312a2b55533f02f6369dc7c94672f90 19-Jul-2013 Brian Carlstrom <bdc@google.com> Fixing cpplint whitespace/blank_line, whitespace/end_of_line, whitespace/labels, whitespace/semicolon issues

Change-Id: Ide4f8ea608338b3fed528de7582cfeb2011997b6
1895ea386ca78573302483f589ebabd8ce1480e7 18-Jul-2013 Brian Carlstrom <bdc@google.com> Fix cpplint readability/fn_size issues

Change-Id: I1efdb07a948a2af49db1a9d21ccab16dacc03a54
df62950e7a32031b82360c407d46a37b94188fbb 18-Jul-2013 Brian Carlstrom <bdc@google.com> Fix cpplint whitespace/parens issues

Change-Id: Ifc678d59a8bed24ffddde5a0e543620b17b0aba9
0cd7ec2dcd8d7ba30bf3ca420b40dac52849876c 18-Jul-2013 Brian Carlstrom <bdc@google.com> Fix cpplint whitespace/blank_line issues

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

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

Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81