History log of /art/runtime/verifier/reg_type.cc
Revision Date Author Comments
a22a656c7a641243f1ea989d32231d1962331d29 14-Mar-2017 Vladimir Marko <vmarko@google.com> Fix RegType invariant checks.

Move the checks from the base constructor to constructors of
the most derived classes. While in the base constructor, the
vtable points to the base class implementations of virtual
function, so we were not checking what we intended. And when
the check failed, we tried to call a pure virtual function
RegType::Dump() and crashed while constructing an abort
message.

Also, avoid an unnecessary std::string construction in
RegType::CheckInvariants() as StringPiece can be compared
with const char* directly.

Test: testrunner.py --host
Bug: 32548008
Change-Id: Ice7ca298132f87f8b1671b6578aeec221f0e7930
46ee31b67d7ee1bd085fbc240502053caa3cf8fa 14-Dec-2016 Andreas Gampe <agampe@google.com> ART: Move to libbase StringPrintf

Remove ART's StringPrintf implementation. Fix up clients. Add
missing includes where necessary.

Test: m test-art-host
Change-Id: I564038d5868595ac3bb88d641af1000cea940e5a
709b070044354d9f47641f273edacaeeb0240ab7 13-Oct-2016 David Sehr <sehr@google.com> Remove mirror:: and ArtMethod deps in utils.{h,cc}

The latest chapter in the ongoing saga of attempting to dump a DEX
file without having to start a whole runtime instance. This episode
finds us removing references to ArtMethod/ArtField/mirror.

One aspect of this change that I would like to call out specfically
is that the utils versions of the "Pretty*" functions all were written
to accept nullptr as an argument. I have split these functions up as
follows:
1) an instance method, such as PrettyClass that obviously requires
this != nullptr.
2) a static method, that behaves the same way as the util method, but
calls the instance method if p != nullptr.
This requires using a full class qualifier for the static methods,
which isn't exactly beautiful. I have tried to remove as many cases
as possible where it was clear p != nullptr.

Bug: 22322814
Test: test-art-host
Change-Id: I21adee3614aa697aa580cd1b86b72d9206e1cb24
bc5a795c0d486c84913d987cad5846ded840cea6 18-Oct-2016 Mathieu Chartier <mathieuc@google.com> Move art/native to ObjPtr

Bug: 31113334

Test: test-art-host

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

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

Changed AddLocalReference / Decode to use ObjPtr.

Changed libartbenchmark to be debug to avoid linkage errors.

Bug: 31113334

Test: test-art-host

Change-Id: I4d2e160483a29d21e1e0e440585ed328b9811483
ca3c8c33501bf199d6fd0a5db30a27d8e010cb23 06-Sep-2016 David Brazdil <dbrazdil@google.com> Collect verifier dependencies

MethodVerifier tests whether a DEX method is valid w.r.t. the classes
in class path. Since the APK does not change across OTA updates, it
is not necessary to analyze the bytecode again with MethodVerifier,
as long as its dependencies on the class path (which may have changed)
are satisfied.

This patch introduces VerifierDeps, a class path dependency collector,
and adds hooks into MethodVerifier where classes/methods/fields are
resolved and where assignability of types is tested.

Test: m test-art-host-gtest-verifier_deps_test
Bug: 30937355
Change-Id: Iee0b321d772a5c7d1cb471aaa6e13918310b7e2f
bdf7f1c3ab65ccb70f62db5ab31dba060632d458 31-Aug-2016 Andreas Gampe <agampe@google.com> ART: SHARED_REQUIRES to REQUIRES_SHARED

This coincides with the actual attribute name and upstream usage.
Preparation for deferring to libbase.

Test: m
Test: m test-art-host
Change-Id: Ia8986b5dfd926ba772bf00b0a35eaf83596d8518
0d638bb49054e5278855483290c7a5c7d683e153 27-Jul-2016 David Brazdil <dbrazdil@google.com> ART: Fix RegTypeCache for instance field declaring class

For bytecode instruction:

iget(-*) ClassB->field:type

where the resolved field is actually declared in ClassA (ClassB
extends ClassA), MethodVerifier would create a RegType representing
ClassA but cache it under the descriptor "ClassB".

This is a bug but does not have any implications on correctness
because earlier resolution of ClassB (part of IGET handling) creates
another cache entry with the "ClassB" descriptor. Because the latter,
wrong entry is always imprecise (ClassA cannot be final because ClassB
extends it), either the earlier entry will be discovered or neither
of them will be a match.

Descriptor was replaced with the correct one and a DCHECK added when
creating a RegType to make sure the descriptor matches.

Bug: 30458218
Change-Id: I19e1bdd5dd79e5eac558122a06b9128d0a5c021f
Test: m test-art-host-run-test
Test: art/test/run-test --host 800-smali
8d8fc48664205e433cfa5540753b38043d918873 26-Mar-2016 Andreas Gampe <agampe@google.com> ART: Relax verifier checks

Only bail for unresolved merge types in a couple of cases. Follow-up
to bb18a03c44d99b3cae232d445d56e80d8388cca9.

Bug: 27799205
Change-Id: If448e14036bc5e245677e0cd8cdddee02b320525
bb18a03c44d99b3cae232d445d56e80d8388cca9 23-Mar-2016 Andreas Gampe <agampe@google.com> ART: Allow array-ness for unresolved merge types

In case component types aren't resolvable, array types won't be
either. They then may be merged. The merge is still potentially
an array type.

Ensure that merging an unresolved array type with a primitive
array type or a non-array type will be resolved to java.lang.Object.

Added tests.

Bug: 27799205
Change-Id: I9beff75318814dddd842abd64ef9a5d2644d801e
87a5575ada60051a3d45630da9ae3d634b993b60 15-Jan-2016 David Brazdil <dbrazdil@google.com> ART: Change merge(uninitialized, null) to produce conflict

The verifier would treat the result of merge(uninitialized, null) as
an uninitialized value, allowing a constructor to be called on null.
This patch conservatively prevents any usage of the merged register
by treating it as conflicting. Note that this could be relaxed with
a new common type for initialized and uninitialized references.

Bug: 26579108
Bug: 22411633

Change-Id: Ic5a1a3909c80287deece92dbb3254f437074e9b6
de40d478930d0889a2aea5cbf58aa63da24e5dfa 16-Oct-2015 Mathieu Chartier <mathieuc@google.com> Use arenas for the verifier

Improvements are from using arenas for verifier. The things that
were moved into arenas are register lines, reg types, and reg type
descriptors.

Also some minor cleanup. Fixed double space formatting error in
string piece.

========================================
Before:
=======================================
compile GmsCore 50x on host -j1:
real 3m5.510s
user 2m48.139s
sys 0m11.753s

50 random APKs:
real 1m18.157s
user 1m8.167s
sys 0m8.071s

RAM (GmsCore):
(threads: 1) arena alloc=0B java alloc=27MB native alloc=64MB free=792KB
(threads: 4) arena alloc=0B java alloc=27MB native alloc=64MB free=397KB
Perf:

=============================
After:
=============================
compile GmsCore 50x on host -j1:
real 2m31.455s
user 2m14.784s
sys 0m10.888s

50 random APKs:
Speed up from arena allocating:
real 1m12.094s
user 1m2.325s
sys 0m7.872s

Speed up from areans + CreateFindClassDefIndex + unordered_map for DexFileVerifier.
real 1m8.654s
user 0m58.955s
sys 0m7.777s

RAM (GmsCore):
(threads: 1) arena alloc=1049KB java alloc=27MB native alloc=65MB free=538KB
(threads: 4) arena alloc=4MB java alloc=27MB native alloc=69MB free=650KB

Perf on host key results:
_int_malloc: 3.60% -> 1.39%
malloc: 1.48% -> 0.65%
_int_free: 1.59% -> 0.61%
RegTypeCache::FromClass: 1.47% -> 0.86%
malloc_consolidate: 0.89% -> 0.63%

Real speed up is ~22% on GmsCore, ~14% on the set of 60 APKs.

Bug: 10921004

Change-Id: If13d4ab4284a176f93a26a412549b6b1149dfb16
f695a009725c8c840d916d01c14998f5c5f816d2 07-Aug-2015 Andreas Gampe <agampe@google.com> ART: Change UnresolvedMergedType internal representation

Squashed cherry-picks:
* 067f1ed7816cf4eb5d6258ca31b387ddb2073ab7
* 750f7c2827318f6d07620f2ef0321218ea4d8670
* 2f90b3415aadc2587d26c767c6bfb235797119a8
* 2ea7b70b2347969f3735bd0ec1b462bd6d2ff1bd

Bug: 22881413
750f7c2827318f6d07620f2ef0321218ea4d8670 06-Aug-2015 Andreas Gampe <agampe@google.com> ART: Change UnresolvedMergedType internal representation

Use a BitVector instead of the tree representation. This
avoids flattening the components and other instances.

Bug: 22881413
Change-Id: Ibf7cfb54443affeb1753bf114c0f306125391c62
be2aa44277e5be04d6e3a9b80af9df01e26b73c0 28-Jul-2015 Andreas Gampe <agampe@google.com> ART: Relax IsInstantiable check

Relax the IsInstantiable check when converting an uninitialized
reference type. This is a double protection that leads to wrong
behavior as it may trigger an incorrect hard failure.

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

Also enable -Wthread-safety-negative.

Changes:
Switch to capabilities and negative capabilities.

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

Bug: 20072211

Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
891dfaa94eda54ab620d203200191c4be46afb70 14-Jul-2015 Andreas Gampe <agampe@google.com> ART: Fix UninitializedReference handling

The merge rules in the verifier allowed Object to be successfully
merged with uninitialized references. This is invalid and should
result in a conflict. Fix by moving UninitializedReference rules
earlier.

Also add a test that forward merging is correctly allowed, both
with a valid result as well as a conflict.

Also add tests that backwards branches have the expected behavior.

Bug: 22411633
Change-Id: If837376c15f0b3550d6ce1721a3cde5901c80c7f
747e536860bdb0099f60fe52ed94e6cf7c79b312 15-Jul-2015 Vladimir Marko <vmarko@google.com> Clean up after verifier changes wrt. conflict/undefined reg.

Remove unused path in RegType::Merge() and compare undefined
type as pointers. Reduce the number of edges to merge in
b_22331663.smali to just those that we really want to test.

Bug: 22331663
Change-Id: I16b83c4c97fd40be9dd246ef13ccda6e924eef60
25e1af5b4e1ce7e03a188ca1d0197a9f5b6acaf8 09-Jul-2015 Andreas Gampe <agampe@google.com> ART: Change merges with Undefined to Undefined

The result of a merge with an Undefined type should be Undefined.
Conflicts are allowed to be copied around, but Undefined registers
should not be touched at all, except to be written into.

Add a success test case (the register isn't used) and a fail test
case (the register is tried to be copied).

Bug: 22331663
Bug: 22371999

(cherry picked from commit 97a1ff353f254b6e46c7501fe3f0e3254c2517b4)

Change-Id: I9697ce31c1d2ab5aee0433dcf1253bcca79c2983
97a1ff353f254b6e46c7501fe3f0e3254c2517b4 09-Jul-2015 Andreas Gampe <agampe@google.com> ART: Change merges with Undefined to Undefined

The result of a merge with an Undefined type should be Undefined.
Conflicts are allowed to be copied around, but Undefined registers
should not be touched at all, except to be written into.

Add a success test case (the register isn't used) and a fail test
case (the register is tried to be copied).

Bug: 22331663
Bug: 22371999
Change-Id: I9697ce31c1d2ab5aee0433dcf1253bcca79c2983
bb87e0f1a52de656bc77cb01cb887e51a0e5198b 03-Apr-2015 Mathieu Chartier <mathieuc@google.com> Refactor and improve GC root handling

Changed GcRoot to use compressed references. Changed root visiting to
use virtual functions instead of function pointers. Changed root visting
interface to be an array of roots instead of a single root at a time.
Added buffered root marking helper to avoid dispatch overhead.

Root marking seems a bit faster on EvaluateAndApplyChanges due to batch
marking. Pause times unaffected.

Mips64 is untested but might work, maybe.

Before:
MarkConcurrentRoots: Sum: 67.678ms 99% C.I. 2us-664.999us Avg: 161.138us Max: 671us

After:
MarkConcurrentRoots: Sum: 54.806ms 99% C.I. 2us-499.986us Avg: 136.333us Max: 602us

Bug: 19264997

Change-Id: I0a71ebb5928f205b9b3f7945b25db6489d5657ca
16f149c2cb43a14d8f33d7d0fa36cd784e900f07 23-Mar-2015 Andreas Gampe <agampe@google.com> ART: Change RETURN_OBJECT verification for arrays

Arrays appear to be valid (as according to spec), even if their
components are erroneous. If a component is erroneous, it may not
have loaded superclass or interface information, and so fail a
direct check for assignability.

Add a cutout that checks whether the declared return-type or the
actual return-type are arrays with erroneous components (and if so,
have the same 'depth'). In that case, generate a soft instead of a
hard error.

Also includes a fix to DumpClass.

Bug: 19683465
Change-Id: Ie73de03adeb0af7e939370d7363684fe125d7994
12d625f87bcd6c4059a205bb39007a255f57f382 13-Mar-2015 Mathieu Chartier <mathieuc@google.com> Change method verifiers to be thread local roots

Bug: 10921004

Change-Id: I3a1425d76cd380587ba67ef6d5ec1227564e55bf
e34fa1df67fbe0173b4ea9abddcc3ae3d0537037 14-Jan-2015 Mathieu Chartier <mathieuc@google.com> Print more info in MarkSweep::VerifyRoot

Refactored old root callback to use a new class called RootInfo.
RootInfo contains all the relevant info related to the root
associated with the callback. The MarkSweep::VerifyRoot function
now uses this info to print the StackVisitor's described location
if the GC root is of the type kRootJavaFrame.

Some other cleanup.

Example output:
E/art (12167): Tried to mark 0x123 not contained by any spaces
E/art (12167): Attempting see if it's a bad root
E/art (12167): Found invalid root: 0x123 with type RootJavaFrame
E/art (12167): Location=Visiting method
'void java.lang.Runtime.gc()' at dex PC 0xffffffff (native PC 0x0)
vreg=0

(cherry picked from commit 12f7423a2bb4bfab76700d84eb6d4338d211983a)

Bug: 18588862
Change-Id: Ic5a2781f704e931265ffb3621c2eab4b2e25f60f
12f7423a2bb4bfab76700d84eb6d4338d211983a 14-Jan-2015 Mathieu Chartier <mathieuc@google.com> Print more info in MarkSweep::VerifyRoot

Refactored old root callback to use a new class called RootInfo.
RootInfo contains all the relevant info related to the root
associated with the callback. The MarkSweep::VerifyRoot function
now uses this info to print the StackVisitor's described location
if the GC root is of the type kRootJavaFrame.

Some other cleanup.

Example output:
E/art (12167): Tried to mark 0x123 not contained by any spaces
E/art (12167): Attempting see if it's a bad root
E/art (12167): Found invalid root: 0x123 with type RootJavaFrame
E/art (12167): Location=Visiting method
'void java.lang.Runtime.gc()' at dex PC 0xffffffff (native PC 0x0)
vreg=0

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

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

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

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

Change-Id: Id59ce3cc520701c6ecf612f7152498107bc40684
5441091dc78c64a683cb336ff27e80c364bc2cd3 11-Sep-2014 Ian Rogers <irogers@google.com> Re-add read barrier to roots in the verifier.

Fixes read-barriers but keeps verifier API invariants. Based on:
https://android-review.googlesource.com/#/c/102962
Bug: 17398101

Change-Id: Iad986784a5d735ccb3214362ccfc7ef69bc02c57
d8f69b086baf6717ce949d1c4de90d73b91083b0 10-Sep-2014 Ian Rogers <irogers@google.com> Revert "Add read barriers for the roots in the verifier."

This reverts commit 7da9586b559290e1c16207c6513ffe485de61655.

Bug: 17398101

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

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

Don't generate GC maps when compilation is disabled.

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

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

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

Bug: 16853450
Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad

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

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

Don't generate GC maps when compilation is disabled.

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

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

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

Bug: 16853450
Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad
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
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
ffddfdf6fec0b9d98a692e27242eecb15af5ead2 03-Jun-2014 Tim Murray <timmurray@google.com> DO NOT MERGE

Merge ART from AOSP to lmp-preview-dev.

Change-Id: I0f578733a4b8756fd780d4a052ad69b746f687a9
b74cd29802f364b4cec88f4913fa38ade26b8fab 29-May-2014 Mathieu Chartier <mathieuc@google.com> Compaction cleanup for FindArrayClass.

We now pass double pointer in to signify that it can cause thread
suspension, this double pointer gets wrapped by a handle if don't
find the array class in the cache.

Change-Id: I43436b6c35597c7252b65d1180baddb5ac4caabb
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
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
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
815873ecc312b1d231acce71e1a16f42cdaf09f2 14-Feb-2014 Mathieu Chartier <mathieuc@google.com> Change root visitor to use Object**.

Simplifies code and improves the performance of root visiting since
we usually don't need to check to see if the object moved.

Change-Id: Iba998f5a15ae1fa1b53ca5226dd2168a411196cf
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
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
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
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
41c65c19c15ffac41089fa9f37502f94c046960d 06-Sep-2013 Ian Rogers <irogers@google.com> Add a pool of small cat1 constants to the verifier.

This avoids creating constants in roughly half the cases seen in boot/core.
Also, strengthen the types on a few of the RegTypeCache routines, add some
documentation and move methods to the appropriate location and out of being
public when possible.

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

Needed to update cpplint to handle const auto.

Fixed a few cpplint errors that were being missed before.

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

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

Change-Id: Ifc678d59a8bed24ffddde5a0e543620b17b0aba9
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