History log of /art/runtime/instrumentation.cc
Revision Date Author Comments
4ba674b914f24f2baf42769401cff43f8261abd6 10-May-2016 Mingyao Yang <mingyao@google.com> Fix an assert during jdwp debugging.

When debugger attaches, we patch entry points of methods in framework code.
During that process, it's possible that some method's declaring class isn't
resolved yet. We need to relax one assert for that case.

Bug: 28630805

(cherry picked from commit 3fd448a8b7903b00fceaed5853306e2d7eb31c72)

Change-Id: I59fd488ad75417a64b52321677ffcac6ccdc5ce1
b8aa1e4c10dcdc7fef96634f87e259dfee83a1cf 05-Apr-2016 Mathieu Chartier <mathieuc@google.com> Shard classloader classes lock

Used to guard adding and removing classes.

Previously we used the class linker classes lock, but this had
a deadlock issue since the reference processor may need to acquire
the lock to mark the classes of a class loader. Another thread could
be blocked trying to access weak globals while also holding the
class linker classes lock.

Bug: 27946564

(cherry picked from commit 1609e3a42051769f4a8be3b6731e7bb2f828b3bb)

Change-Id: Ic5cfe573c4e6822d49ad0862ffdd9d036e439a96
1609e3a42051769f4a8be3b6731e7bb2f828b3bb 05-Apr-2016 Mathieu Chartier <mathieuc@google.com> Shard classloader classes lock

Used to guard adding and removing classes.

Previously we used the class linker classes lock, but this had
a deadlock issue since the reference processor may need to acquire
the lock to mark the classes of a class loader. Another thread could
be blocked trying to access weak globals while also holding the
class linker classes lock.

Bug: 27946564
Change-Id: If7c13e8775f0912e104d1382eacdba7e7edf6818
50e933188d993c6eb67560db1fcad67ba1d182e1 16-Mar-2016 Mathieu Chartier <mathieuc@google.com> Fix race in AllocEntrypointsInstrumented

We were using the quick_alloc_entry_points_instrumentation_counter_,
this counter is updated before the threads are suspended. The
allocator could come out of a suspend point, see that threads are
supposedly still no instrumented, continue the allocation, then
suddenly quick_alloc_entry_points_instrumentation_counter_ becomes
1 and alloc_tracking_enabled_ becomes true resulting in a failing
DCHECK.

The fix is to add a boolean that is updated only when the threads
are suspended.

Bug: 27506909

(cherry picked from commit 77d993107773b7b9bd7f07ce08d0aaac1631bf84)

Change-Id: Id12983ef77c4fddb0394e4439ce0829777f1a70b
77d993107773b7b9bd7f07ce08d0aaac1631bf84 16-Mar-2016 Mathieu Chartier <mathieuc@google.com> Fix race in AllocEntrypointsInstrumented

We were using the quick_alloc_entry_points_instrumentation_counter_,
this counter is updated before the threads are suspended. The
allocator could come out of a suspend point, see that threads are
supposedly still no instrumented, continue the allocation, then
suddenly quick_alloc_entry_points_instrumentation_counter_ becomes
1 and alloc_tracking_enabled_ becomes true resulting in a failing
DCHECK.

The fix is to add a boolean that is updated only when the threads
are suspended.

Bug: 27506909
Change-Id: Ic3c6716d2af9c00189ce9271f7a2825b03cdd8a0
6ea1a0e2168c8d9b6d97c075c73a72d84080f45b 29-Jan-2016 Mingyao Yang <mingyao@google.com> AOT compile framework code as non-debuggable

When a debugger attaches, we patch method entry points in framework
code to interpreter bridge. The code will later be jitted as debuggable.

Change-Id: Id148069ccad95e2339ba214742ae3ef4f084f495
1aa8ec2ccdd7bedb6d30d91c89f1e94ab23c4439 01-Feb-2016 Mathieu Chartier <mathieuc@google.com> Fix up dex cache strings stored in classes

Previously we left the image pointer instead of fixing up the pointer
to the one in the BSS. This only showed up because JIT does the same
as boot image, bypassing null check.

Fixed a bug where oat files without embedded dex cache arrays would
get their dex cache arrays corrupted.

Added a non virtual class visitor for performance.

Bug: 26846419
Bug: 22858531

Change-Id: I8cd0d61e440f753b4628ddb8c932eb23a0a81027
81f0f953c4bb159997046c962d44cb1898b1778d 20-Jan-2016 Nicolas Geoffray <ngeoffray@google.com> Move backward branch instrumentation to all branch.

This is in preparation for osr, and later dead branch profiling.

Change-Id: I4597c0784c894c310f295dd534967d67dcefa419
91d65e024846717fce3572106cffe9b957b8902c 19-Jan-2016 Roland Levillain <rpl@google.com> Fix various typos in ART's comments and string literals.

Change-Id: I85d628055b1a61647a77fef730c9631c234e22a2
3fdb3fec5c36127d8568b2f89698906ba4b68576 14-Jan-2016 Mathieu Chartier <mathieuc@google.com> Don't allow thread suspension in ProfilingInfo::Create

AddSamples calls ProfilingInfo::Create which would occasionally
transition to suspended and wait for code cache GC to complete.
This CL removes the thread state change and
WaitForPotentialCollectionToComplete which caused thread suspension.

The thread suspension caused occasional stale object references in
InvokeVirtualOrInterface since moving GC could occur.
If this_object became stale, we would put it's stale class into the
profile info, resulting in a GC crash.

Bug: 26086970
Change-Id: I5a86561098d72b7be80e8a3bcf3d8401403a0b00
51a64d5d4fe91842cc2a5f2a412441147c145683 17-Dec-2015 Alex Light <allight@google.com> Make use of new method iterators.

Change-Id: I1f82f17951339b2054a1dac87bde79f9e803fc4a
73be1e8f8609708f6624bb297c9628de44fd8b6f 17-Sep-2015 Nicolas Geoffray <ngeoffray@google.com> Inline monomorphic calls.

Change-Id: If38171c2dc7d4a4378df5d050afc4fff4499c98f
9139e008abe30b7beaf4afd6533228a1dd9b202c 10-Oct-2015 Alex Light <allight@google.com> Correct exception behavior for default methods

Default methods are defined to throw an IncompatibleClassChangeError
(ICCE) when they are called and there is no "best" implementation.
Previously we would simply throw an ICCE during class loading as soon
as we noticed that this would happen if called. This makes us wait
until we actually attempt to execute the method. Furthermore, this
allows us to use other, non-conflicting, methods on the object as
normal.

Furthermore, this makes us correctly throw AbstractMethodErrors in
cases where all default implementations of a method are overridden by
abstract declarations.

Adds 3 tests for this new behavior.

Bug: 24618811

Change-Id: Id891958a81f9b3862b2ce5919636aabef7d3422e
5a23d2ea6e0d89112ff11ec765e676c03818b7c2 03-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Fix TODO on instrumentation and add some more DCHECKs.

bug:25343683
bug:25438583

Change-Id: I232deb1b6761466b514c687ce304f61928755cdc
514a616fd434212815bdd49cc1e2786817395969 03-Nov-2015 Nicolas Geoffray <ngeoffray@google.com> Fix broken handling of instrumentation lists.

- We cannot copy before iterating, as entries might be deleted.
- We cannot remove entries in the list, as mutators could be
currently iterating over it.

Solution in this change is to never remove list entries, but
put null when a listener is removed. When adding a listener, we
will either put it where there is a null slot, or at the end
of the list if there is no null slot.

Change-Id: Id94582fd971cd56bcb445caff64270d21987f700
1dad3f68b7f5a4a4cb2b281413357adc2309a8fd 23-Oct-2015 Nicolas Geoffray <ngeoffray@google.com> Support garbage collection of JITted code.

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

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

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

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

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

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

Change-Id: I6f35fc06d37220558dff61691e51ae20066b0dd6
b2feaafd89813af69c65da95e0b51b1a4cecaf0b 12-Oct-2015 Sebastien Hertz <shertz@google.com> Revert "Revert "Fix instrumentation frame check with inlining""

This reverts commit e3e2fe5ecc16184ba91018adb3bfbec1c5880c29.

Fixes an incorrect CHECK_GT into CHECK_GE in method
Instrumentation::ComputeFrameId.

Bug: 22519499
Change-Id: I0a11d378f3baa728b9176ff086fe4b835b30bb46
e3e2fe5ecc16184ba91018adb3bfbec1c5880c29 12-Oct-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Fix instrumentation frame check with inlining"

Times out on some run-tests.

Bug: 22519499

This reverts commit 3079e28b00accd19aa1153929fb00497d00956d9.

Change-Id: I4c612a5af20e4481eb9865f90abd429f4a40ce57
3079e28b00accd19aa1153929fb00497d00956d9 06-Oct-2015 Sebastien Hertz <shertz@google.com> Fix instrumentation frame check with inlining

When instrumenting code compiled with inlining, we must compute
frame IDs like instrumentation did for pushing instrumentation
stack frames.

Bug: 22519499
Change-Id: I4a72dbe9e4d2fd4985e49f8261b54c96df7c4a81
99170c636dfae4908b102347cfe9f92bad1881cc 06-Jul-2015 Mingyao Yang <mingyao@google.com> Deoptimization support in optimizing compiler for setting local values

Due to compiler optimizations, we may not always be able to update
the value of a local variable in a compiled frame (like a variable
seen as constant by the compiler). To avoid that situation, we simply
deoptimize compiled frames updated by the debugger so they are
executed by the interpreter with the updated value.

When the debugger attempts to set a local variable (actually a DEX
register or a pair of registers) in a compiled frame, we allocate a
ShadowFrame associated to that frame (using its frame id) and set the
new value in that ShadowFrame. When we know we are about to continue
the execution of the compiled frame, we deoptimize the stack using
the preallocated ShadowFrame (instead of creating a new one). We
initialize it with the current value of all DEX registers except
the ones that have been set by the debugger. Therefore, the
ShadowFrame represent the runtime context modified by the debugger.

Bumps oat version to force recompilation.

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

Usage replaces most SuspendAll and ResumeAll calls.

Change-Id: I355683a5365876242cea85a656dcb58455f7a294
5550ca8bcc742b109d77e62f3a0877c667d894d3 21-Aug-2015 Nicolas Geoffray <ngeoffray@google.com> Record profiling information before Jitting.

- Add a new instrumentation kind to record dynamic invokes.
- Use the JNI entry point field to store the profiling data.
- Record seen receivers for every dynamic invoke.

Change-Id: I2c1738ab2a72052d45964d055dc16b44b906e54c
0747466fca310eedea5fc49e37d54f240a0b3c0f 25-Aug-2015 Sebastien Hertz <shertz@google.com> Revert "Revert "Fix deoptimization with pending exception""

This reverts commit 6e2d5747d00697a25251d25dd33b953e54709507.

Fixes the deoptimization path from compiled code (generated by the
Optimizing compiler) by adding wrapper artDeoptimizeFromCompiledCode.
This wrapper, called through the matching assembler stub
art_quick_deoptimize_from_compiled_code, pushes the deoptimization
context just before deoptimizing the stack.

Bug: 23371176
Bug: 19944235
Change-Id: Ia7082656998aebdd0157438f7e6504c120e10d3e
6e2d5747d00697a25251d25dd33b953e54709507 25-Aug-2015 Sebastien Hertz <shertz@google.com> Revert "Fix deoptimization with pending exception"

This reverts commit 54b62480636ae846d705fc180c7bd6cd08ec1e42.

This is causing test failures with Optimizing compiler.

Bug: 23371176
Bug: 19944235
Change-Id: Ie3ffbcf2b6d2ca8bc93cb008a4e29a7567d04a7c
54b62480636ae846d705fc180c7bd6cd08ec1e42 20-Aug-2015 Sebastien Hertz <shertz@google.com> Fix deoptimization with pending exception

When deoptimizing the stack, we set a fake exception in the current
Thread* (see method Thread::GetDeoptimizationException). On the next
exception check, the QuickExceptionHandler will deoptimize the stack.

The issue is when we deoptimize while an exception is already pending
in the current Thread*: setting the fake exception will clobber the
pending exception which is not correct. This happens in the
artQuickToInterpreterBridge when returning from the interpreter and
we want to deoptimize the stack for debugging (like single-stepping).

This CL saves the pending exception before asking for deoptimization.
Then the exception is restored just before executing the deoptimized
frames with the interpreter.

Also cleans up the way we save deoptimization context (return value
and pending exception).

Bug: 23371176
Bug: 19944235
Change-Id: I7f4c8347b328817c452beda3399e210eba3a88a4
e0671ce5a6cb34e44e3afefa8e29c0c3e30d2855 29-Jul-2015 Mathieu Chartier <mathieuc@google.com> Clean up class visitors

Move from function pointers to virtual function visitors.

Change-Id: I68cb83c1d2ed9b5a89f8e534fe7ca4bbc1c91f45
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
7bf2b4f1d08050f80782217febac55c8cfc5e4ef 08-Jul-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Revert "Remove interpreter entrypoint in ArtMethod.""

The start of the interned strings in the image was not aligned
properly, now that ArtMethods just need to be word aligned.

This reverts commit 7070ccd8b6439477eafeea7ed3736645d78e003f.

bug:22242193

Change-Id: I580c23310c33c239fe0e5d15c72f23a936f58ed1
7070ccd8b6439477eafeea7ed3736645d78e003f 08-Jul-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Remove interpreter entrypoint in ArtMethod."

Build failures on bots. Investigating.

This reverts commit fa2c054b28d4b540c1b3651401a7a091282a015f.

Change-Id: Id65b2009aa66cb291fb8c39758a58e0b0d22616c
fa2c054b28d4b540c1b3651401a7a091282a015f 01-Jul-2015 Nicolas Geoffray <ngeoffray@google.com> Remove interpreter entrypoint in ArtMethod.

Saves 4/8 bytes for each ArtMethod.

Change-Id: I110ecdddf8516b0759a31fa157609643e6d60b15
ef484d442a3dcae2cd1842c5be0623f5cf71e4ab 18-May-2015 Mingyao Yang <mingyao@google.com> Fix nested deoptimization.

Handle nested deoptimization cases. Create a stacked shadow frame
records to keep track of deoptimization shadow frames. Shadow frames
under construction can be tracked in the same stack.

Bug: 20845490

(cherry picked from commit 1f2d3ba6af52cf6f566deb38b7e07735c9a08fb6)

Change-Id: I768285792c29e7c3cfcd21e7a2600802506024d8
1f2d3ba6af52cf6f566deb38b7e07735c9a08fb6 18-May-2015 Mingyao Yang <mingyao@google.com> Fix nested deoptimization.

Handle nested deoptimization cases. Create a stacked shadow frame
records to keep track of deoptimization shadow frames. Shadow frames
under construction can be tracked in the same stack.

Bug: 20845490
Change-Id: I768285792c29e7c3cfcd21e7a2600802506024d8
3d21bdf8894e780d349c481e5c9e29fe1556051c 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997

(cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33)

Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d

Fix some ArtMethod related bugs

Added root visiting for runtime methods, not currently required
since the GcRoots in these methods are null.

Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes
--trace run-tests 005, 044.

Fixed optimizing compiler bug where we used a normal stack location
instead of double on ARM64, this fixes the debuggable tests.

TODO: Fix JDWP tests.

Bug: 19264997

Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3

ART: Fix casts for 64-bit pointers on 32-bit compiler.

Bug: 19264997
Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457

Fix JDWP tests after ArtMethod change

Fixes Throwable::GetStackDepth for exception event detection after
internal stack trace representation change.

Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of
proxy method.

Bug: 19264997
Change-Id: I363e293796848c3ec491c963813f62d868da44d2

Fix accidental IMT and root marking regression

Was always using the conflict trampoline. Also included fix for
regression in GC time caused by extra roots. Most of the regression
was IMT.

Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to
detached thread.

EvaluateAndApplyChanges:
From ~2500 -> ~1980
GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots

Bug: 19264997
Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0

Fix bogus image test assert

Previously we were comparing the size of the non moving space to
size of the image file.

Now we properly compare the size of the image space against the size
of the image file.

Bug: 19264997
Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a

[MIPS64] Fix art_quick_invoke_stub argument offsets.

ArtMethod reference's size got bigger, so we need to move other args
and leave enough space for ArtMethod* and 'this' pointer.

This fixes mips64 boot.

Bug: 19264997
Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
e401d146407d61eeb99f8d6176b2ac13c4df1e33 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Move mirror::ArtMethod to native

Optimizing + quick tests are passing, devices boot.

TODO: Test and fix bugs in mips64.

Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS.
Some of the savings are from removal of virtual methods and direct
methods object arrays.

Bug: 19264997
Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
8e5bd18fc665d7ec5461ea068e98740a65da754c 06-May-2015 Nicolas Geoffray <ngeoffray@google.com> Add a flag to StackVisitor for inlining.

The flag tells whether the stack walk needs to include inlined
Java frames.

This does not do anything just yet, as we're not inlining anyways.

Change-Id: I716e25094fe56fa335ca1f9a398c1bcdba478e73
5eae455507399286c845ba54796c47087a72b3e2 01-Apr-2015 Sebastien Hertz <shertz@google.com> Support multiple instrumentation clients

Changes Instrumentation::ConfigureStubs to support multiple clients
that need different levels of instrumenation. A client is identified
by a string key used to save the desired instrumentation level.

Also adds regression gtest instrumentation_test and some cleanup.

Bug: 19829329

(cherry picked from commit 0462c4c87c39db6cfcd338f323844738109ac3c9)

Change-Id: I1fc24a86fcb7cb46d4be806895376c25cc0a0b3c
0462c4c87c39db6cfcd338f323844738109ac3c9 01-Apr-2015 Sebastien Hertz <shertz@google.com> Support multiple instrumentation clients

Changes Instrumentation::ConfigureStubs to support multiple clients
that need different levels of instrumenation. A client is identified
by a string key used to save the desired instrumentation level.

Also adds regression gtest instrumentation_test and some cleanup.

Bug: 19829329
Change-Id: I1fc24a86fcb7cb46d4be806895376c25cc0a0b3c
2cebb24bfc3247d3e9be138a3350106737455918 22-Apr-2015 Mathieu Chartier <mathieuc@google.com> Replace NULL with nullptr

Also fixed some lines that were too long, and a few other minor
details.

Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
40da286d3207d88ed8ff3f5caac4873874603428 27-Feb-2015 Andreas Gampe <agampe@google.com> ART: Streaming trace mode

Add a streaming mode for tracing. Streaming uses a buffer of 16KB
and writes to the output when that buffer gets full. Streaming mode
can be enabled with -Xmethod-trace-stream and is currently not
exposed otherwise.

Add a python script that can parse the streaming format, which
simply contains strings for newly encountered threads and methods
inline, and create output that can be used with traceview.

Add Trace::Pause and Trace::Abort, which can pause and abort tracing.
Abort is different from Stop in that it does not write the data.

Add code to the zygote hooks JNI implementation that pauses tracing
before the fork, making sure that a child cannot clobber the parent's
data.

Add code to the zygote hooks JNI implementation that aborts old
tracing and starts new tracing in the child after the fork. Currently
base the output on the pid. This will not work on an unmodified
device, as the profiles directory is not generally writable, but
we do not have enough information at that point. Consider a scheme
that restarts tracing later.

Change-Id: I93c7bf87e35af582bdfdd3ecc7c52454514220dd
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
4809d0a8a5fca85a67dd0588ead5dfbd0f1acf96 07-Apr-2015 Mathieu Chartier <mathieuc@google.com> Fix CC root visiting bug

Also some cleanup.

Change-Id: Ia3de8f2d409770be3619ec116e8b06ecd82338fe
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
eb07669e9784ccb41d75df180727e57fc4520e28 22-Aug-2014 Daniel Mihalyi <daniel.mihalyi@mattakis.com> JDWP: Optimized single step during debugging

For single stepping full deoptimization and undeoptimizations were
performed with significant overhead, because every code will be
executed in interpreted mode during a single step, even if it is not
strictly required.

For example, if we have a computation heavy method call and we would
like to step over it, that method (and all the methods called from it)
will run in interpreter mode. This can take so long in some cases
(e.g. multiple minutes) that it makes debugging process unusable.

The solution for this limitation is not using full deoptimizations for
single steps and force interpreter only for those methods that we are
about to step into, and require stack deoptimization before step outs.

Bug: 17750566
Bug: 18094282
Bug: https://code.google.com/p/android/issues/detail?id=77984

Change-Id: I683c52465883146c4c84ec47bf96f8efd920527f
Signed-off-by: Daniel Mihalyi <daniel.mihalyi@mattakis.com>
bf9fc581e8870faddbd320a935f9a627da724c48 14-Mar-2015 Mathieu Chartier <mathieuc@google.com> Add more info to who called SuspendAll

Helps diagnose related jank.

Change-Id: I38191cdda723c6f0355d0197c494a3dff2b6653c
14691c5e786e8c2c5734f687e4c96217340771be 05-Mar-2015 Nicolas Geoffray <ngeoffray@google.com> Compute the right catch location for the debugger.

Also remove tls ThrowLocation, it is not needed anymore.

Change-Id: I78fddf09ce968ca475e39c17fa76d699c589c8d9
7642cfc90fc9c3ebfd8e3b5041915705c93b5cf0 26-Feb-2015 Nicolas Geoffray <ngeoffray@google.com> Change how we report exceptions to the debugger.

This is only a refactoring/cleanup. Bug fixes with respect
to catch location, and more cleanups will follow.

Change-Id: I30d3c6260b0c8f8115a811621397225b88f2063a
e5f13e57ff8fa36342beb33830b3ec5942a61cca 24-Feb-2015 Mathieu Chartier <mathieuc@google.com> Revert "Revert "Add JIT""

Added missing EntryPointToCodePointer.

This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399.

Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
a5ca888d715cd0c6c421313211caa1928be3e399 24-Feb-2015 Nicolas Geoffray <ngeoffray@google.com> Revert "Add JIT"

Sorry, run-test crashes on target:
0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000'
10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000
10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c
10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0
10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010
10-05 12:15:51.633 I/DEBUG (27995):

Bug: 17950037
This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4.

Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
2535abe7d1fcdd0e6aca782b1f1932a703ed50a4 17-Feb-2015 Mathieu Chartier <mathieuc@google.com> Add JIT

Currently disabled by default unless -Xjit is passed in.

The proposed JIT is a method JIT which works by utilizing interpreter
instrumentation to request compilation of hot methods async during
runtime.

JIT options:
-Xjit / -Xnojit
-Xjitcodecachesize:N
-Xjitthreshold:integervalue

The JIT has a shared copy of a compiler driver which is accessed
by worker threads to compile individual methods.

Added JIT code cache and data cache, currently sized at 2 MB
capacity by default. Most apps will only fill a small fraction of
this cache however.

Added support to the compiler for compiling interpreter quickened
byte codes.

Added test target ART_TEST_JIT=TRUE and --jit for run-test.

TODO:
Clean up code cache.
Delete compiled methods after they are added to code cache.
Add more optimizations related to runtime checks e.g. direct pointers
for invokes.
Add method recompilation.
Move instrumentation to DexFile to improve performance and reduce
memory usage.

Bug: 17950037

Change-Id: Ifa5b2684a2d5059ec5a5210733900aafa3c51bca
4c4d609a3f1d67c76c855df13c2c1be9c315a6c9 23-Jan-2015 Mathieu Chartier <mathieuc@google.com> Fix compaction bugs related to IdentityHashCode

IdentityHashCode is a suspend point if monitor inflation occurs.

Change-Id: I114021aed8b3f3437109ef622298de05e13b4e34
90a33595bc637f5768a7726a186bdfe25efcd0d6 16-Jan-2015 Sebastien Hertz <shertz@google.com> Fix exception handling during deoptimization

When interpreting a deoptimized shadow frame, we may start with a
pending exception thrown by a previous deoptimized shadow frame (from
a previous invoke). Therefore, we need to handle it before executing
any instruction, otherwise we execute incorrect code.

Because we need the DEX pc of the throwing instruction to find a
matching catch handler, we initialize deoptimized shadow frames with
the current DEX pc at the time the stack is deoptimized.
When we are about to interpret a deoptimized shadow frame, we need to
update the shadow frame with the DEX pc of the next instruction to
interpret. There are three cases:
- if there is no pending exception, this is the instruction following
the current one.
- if there is a pending exception and we found a matching catch
handler, this is the first instruction of this handler.
- if there is a pending exception but there is no matching catch
handler, we do not execute the deoptimized shadow frame and continue
to its caller.

The verifier now fails when a method starts with a move-exception
instruction. Indeed we cannot start executing a method with a pending
exception.

Bug: 19057915
Bug: 19041195
Bug: 18607595

(cherry picked from commit 270a0e16c3b8e5b95cbfdbd8996ac137c7c6322b)

Change-Id: Ib4fdd0ad704b4f2369d229737c9cc77f559cea55
270a0e16c3b8e5b95cbfdbd8996ac137c7c6322b 16-Jan-2015 Sebastien Hertz <shertz@google.com> Fix exception handling during deoptimization

When interpreting a deoptimized shadow frame, we may start with a
pending exception thrown by a previous deoptimized shadow frame (from
a previous invoke). Therefore, we need to handle it before executing
any instruction, otherwise we execute incorrect code.

Because we need the DEX pc of the throwing instruction to find a
matching catch handler, we initialize deoptimized shadow frames with
the current DEX pc at the time the stack is deoptimized.
When we are about to interpret a deoptimized shadow frame, we need to
update the shadow frame with the DEX pc of the next instruction to
interpret. There are three cases:
- if there is no pending exception, this is the instruction following
the current one.
- if there is a pending exception and we found a matching catch
handler, this is the first instruction of this handler.
- if there is a pending exception but there is no matching catch
handler, we do not execute the deoptimized shadow frame and continue
to its caller.

The verifier now fails when a method starts with a move-exception
instruction. Indeed we cannot start executing a method with a pending
exception.

Bug: 19057915
Bug: 19041195
Bug: 18607595
Change-Id: I355ac81e6ac098edc7e3cc8c13dbfa24a2969ab2
a10aa3789544cf62a2d362c032ea8d9532b47b39 21-Jan-2015 Sebastien Hertz <shertz@google.com> Follow up on CL 123650

Change-Id: If575fdb9cc73e312e222e6853890e8dacd83b284
a8a697f48e92c85136fc7bec661623c434f67ede 15-Jan-2015 Sebastien Hertz <shertz@google.com> Update instrumentation stubs on resolved classes

We cannot update methods of a class in the process of being loaded.
We need it to be fully resolved (kStatusResolved) so we can access
its complete structure (including method index) and the compiled
code from the oat file.

We ensure that by skipping classes that are not resolved yet when we
update instrumentation (with all threads suspended). The entrypoints
will be updated when the class gets resolved by the ClassLinker. We
also do not update method entrypoints of erroneous classes
(kStatusError) because we cannot execute code for these methods.

This situation can happen when the debugger requests an event that
will cause a full deoptimization (like a METHOD_ENTRY event) while we
are loading a new class. Because we suspend all threads to update
instrumentation, we may visit a class that is being loaded but not
yet resolved.

Bug: 19012386
Bug: 18766029
Change-Id: I5a645dfaf5c25dcf4282c1aaeb24f1b6333baa37
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
956af0f0cb05422e38c1d22cbef309d16b8a1a12 11-Dec-2014 Elliott Hughes <enh@google.com> Remove portable.

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

Bug: 18473190
Change-Id: If505b4f62105899f4f1257d3bccda3e6eb0dcd7c

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

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

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

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

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

Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
aa756f3f60e75ba3a84f0e4122016a782a95d825 24-Oct-2014 Andreas Gampe <agampe@google.com> ART: Remove old LOG(INFO)

Clean up output, it's annoying.

Change-Id: Ifc1972dd3e988f36f781dc989d23cdb93e6f828e
c7dd295a4e0cc1d15c0c96088e55a85389bade74 22-Oct-2014 Ian Rogers <irogers@google.com> Tidy up logging.

Move gVerboseMethods to CompilerOptions. Now "--verbose-methods=" option to
dex2oat rather than runtime argument "-verbose-methods:".
Move ToStr and Dumpable out of logging.h, move LogMessageData into logging.cc
except for a forward declaration.
Remove ConstDumpable as Dump methods are all const (and make this so if not
currently true).
Make LogSeverity an enum and improve compile time assertions and type checking.
Remove log_severity.h that's only used in logging.h.
With system headers gone from logging.h, go add to .cc files missing system
header includes.
Also, make operator new in ValueObject private for compile time instantiation
checking.

Change-Id: I3228f614500ccc9b14b49c72b9821c8b0db3d641
1d8cdbc5202378a5f1a4b3a1fba610675ed4dcd5 23-Sep-2014 Ian Rogers <irogers@google.com> Refactor quick entrypoints

Remove FinishCalleeSaveFrameSetup.
Assembly routines write down anchor into TLS as well as placing runtime
method in callee save frame.
Simplify artSet64InstanceFromCode by not computing the referrer from the
stack in the C++ code.
Move assembly offset tests next to constant declaration and tidy arch_test.

Change-Id: Iededeebc05e54a1e2bb7bb3572b8ba012cffa1c8
677cd61ad05d993c4d3b22656675874f06d6aabc 15-Oct-2014 Ian Rogers <irogers@google.com> Make ART compile with GCC -O0 again.

Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on
architecture.
Add to instruction_set_test to warn when InstructionSetFeatures don't agree
with ones from system properties, AT_HWCAP and /proc/cpuinfo.
Clean-up class linker entry point logic to not return entry points but to
test whether the passed code is the particular entrypoint. This works around
image trampolines that replicate entrypoints.
Bug: 17993736

(cherry picked from commit 6f3dbbadf4ce66982eb3d400e0a74cb73eb034f3)

Change-Id: I3e7595f437db4828072589d475a5453b7f31003e
6f3dbbadf4ce66982eb3d400e0a74cb73eb034f3 15-Oct-2014 Ian Rogers <irogers@google.com> Make ART compile with GCC -O0 again.

Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on
architecture.
Add to instruction_set_test to warn when InstructionSetFeatures don't agree
with ones from system properties, AT_HWCAP and /proc/cpuinfo.
Clean-up class linker entry point logic to not return entry points but to
test whether the passed code is the particular entrypoint. This works around
image trampolines that replicate entrypoints.
Bug: 17993736

Change-Id: I5f4b49e88c3b02a79f9bee04f83395146ed7be23
9ef78b59da51080882e47505896b420977fd79ae 26-Sep-2014 Mathieu Chartier <mathieuc@google.com> Fix broken runtime SetStatsEnabled logic

Previously, Runtime::SetStatsEnabled wouldn't take stats_enabled_
into account when deciding whether or not to increment / decrement
teh stats enabled counter. This resulted in counter underflows and
other errors which caused some CTS tests to fail.

Also added some locking to prevent race conditions.

Bug: 17360878

(cherry picked from commit a98ffd745bbecb2e84a492194950c0b94966546b)

Change-Id: I21d241a58d35bd6a607aa2305c6da81720bd0886
a98ffd745bbecb2e84a492194950c0b94966546b 26-Sep-2014 Mathieu Chartier <mathieuc@google.com> Fix broken runtime SetStatsEnabled logic

Previously, Runtime::SetStatsEnabled wouldn't take stats_enabled_
into account when deciding whether or not to increment / decrement
teh stats enabled counter. This resulted in counter underflows and
other errors which caused some CTS tests to fail.

Also added some locking to prevent race conditions.

Bug: 17360878

Change-Id: I779237d55dda4f35054a4d27fb2c660a38750fc0
63bc11efaac0c041e849ab401f9fc368631a00f5 18-Sep-2014 Ian Rogers <irogers@google.com> DO NOT MERGE. Only have a portable entrypoint in portable builds.

Bug: 16214885

Change-Id: Iff7b7415efdbdabd7e6020e221a540f6a774c852
69dbec6d9d55eeb2867949c2791d01dc9aa916c8 16-Sep-2014 Jeff Hao <jeffhao@google.com> Avoid suspending for alloc trace enabling when already suspended.

Bug: 17499772

(cherry picked from commit 1d6ee090fddd4bfd35c304d6ceb929d5c529dfcc)

Change-Id: Id09809c476c685f0a197ee75bb08638931364efd
1d6ee090fddd4bfd35c304d6ceb929d5c529dfcc 16-Sep-2014 Jeff Hao <jeffhao@google.com> Avoid suspending for alloc trace enabling when already suspended.

Bug: 17499772
Change-Id: Id98c10967b28e8859e5ac46f5878c304fb85c498
e246f33605a2d6b96f2c7221fa0165dc067c3079 21-Aug-2014 Daniel Mihalyi <daniel.mihalyi@mattakis.com> Fixed wrong field usage in Instrumentation::RemoveListener

Signed-off-by: Daniel Mihalyi <daniel.mihalyi@mattakis.com>

Bug: 16814665

(cherry picked from commit 6644521cfaff718a55e3602efb3b54bf19a0cd1a)

Change-Id: Ie68c70ba6ee2e0bd918717c8659c057f98e66ff7
96add97815ba8418fb4e8c0fc08dbf9c7198f244 18-Aug-2014 Daniel Mihalyi <daniel.mihalyi@mattakis.com> Optimized instrumentation listener handling

Some instrumentation listener lists may be modified while iterating
over the list to deliver an instrumentation event. Therefore the
previous implementation copied the list of listeners before starting
the iteration.

This new implementation only copies the list of instrumentation
listeners when the list is changed. Instances of the list are
reference counted using std::shared_ptr<>.

Bug: 16814665

(cherry picked from commit ca1d06cfa2f2b8d2be4390644e126cb68cdbb5ba)

Change-Id: Ib2e6b980de85b75f1c8f4a8825bdc7767154663a
6644521cfaff718a55e3602efb3b54bf19a0cd1a 21-Aug-2014 Daniel Mihalyi <daniel.mihalyi@mattakis.com> Fixed wrong field usage in Instrumentation::RemoveListener

Change-Id: I574fcacf754c1da1dc03459d5859b04bcebeac11
Signed-off-by: Daniel Mihalyi <daniel.mihalyi@mattakis.com>
5afe466c027c6ac821bf7c9a88cd7de5260a639b 19-Aug-2014 Jeff Hao <jeffhao@google.com> Check for constructor first when installing tracing stubs.

Addresses comments in
https://android-review.googlesource.com/#/c/104383/ made after the commit.

Bug: 16386215
Change-Id: I0e59b8507f601fd6508fbda8d24dd3c98ead1537
5680277985570f25d5d3cbb44f51d10365b73025 19-Aug-2014 Jeff Hao <jeffhao@google.com> Check for constructor first when installing tracing stubs.

Addresses comments in
https://android-review.googlesource.com/#/c/104383/ made after the commit.

Bug: 16386215

(cherry picked from commit 5afe466c027c6ac821bf7c9a88cd7de5260a639b)

Change-Id: Ic81161d0b96a0633c4c534a93172cff59312fa61
ca1d06cfa2f2b8d2be4390644e126cb68cdbb5ba 18-Aug-2014 Daniel Mihalyi <daniel.mihalyi@mattakis.com> Optimized instrumentation listener handling

Some instrumentation listener lists may be modified while iterating
over the list to deliver an instrumentation event. Therefore the
previous implementation copied the list of listeners before starting
the iteration.

This new implementation only copies the list of instrumentation
listeners when the list is changed. Instances of the list are
reference counted using std::shared_ptr<>.

Change-Id: I1b84db1f2042836dc1110925243f49e5790156d6
95b4c65da93500cdbdcaa3e01010771ef3f466f1 15-Aug-2014 Jeff Hao <jeffhao@google.com> Prevent stubs from being installed in java.lang.reflect.Proxy.<init>.

This CL is a better fix for proxy tracing and undoes the changes in
https://android-review.googlesource.com/#/c/103025/

Bug: 16386215

(cherry picked from commit db8a664e0b68c7c4d36270cd21dce8de1912d7f9)

Change-Id: Ic9e0ea2af7cb2da5d90c56aa009de92dba14cc47
db8a664e0b68c7c4d36270cd21dce8de1912d7f9 15-Aug-2014 Jeff Hao <jeffhao@google.com> Prevent stubs from being installed in java.lang.reflect.Proxy.<init>.

This CL is a better fix for proxy tracing and undoes the changes in
https://android-review.googlesource.com/#/c/103025/

Change-Id: Ie82bb49f07774bd08a6720ddbe5b1f8ee9363acf
b21f1336be9dd0c2607b2ff53834d62a218d1c83 12-Aug-2014 Jeff Hao <jeffhao@google.com> Make method tracing deoptimize on startup.

Bug: 16848366

(cherry picked from commit bc678bba8ec45dfcb1865676dd6d8188da9e56fc)

Change-Id: Idf75288026a837b95f4619acadec57e38bacbd7b
bc678bba8ec45dfcb1865676dd6d8188da9e56fc 12-Aug-2014 Jeff Hao <jeffhao@google.com> Make method tracing deoptimize on startup.

Bug: 16848366
Change-Id: I929c48622987c090c5233490d4e7836a21e1b57e
94f7b49578b6aaa80de8ffed230648d601393905 23-Jul-2014 Hiroshi Yamauchi <yamauchi@google.com> Add GcRoot to clean up and enforce read barriers.

Introduce a value-type wrapper around Object* for GC roots so that 1)
we won't have to directly add the read barrier code in many places and
2) we can avoid accidentally bypassing/missing read barriers on GC
roots (the GcRoot interface ensures that the read barrier is executed
on a read).

The jdwp test passed.

Bug: 12687968
Change-Id: Ib167c7c325b3c7e3900133578815f04d219972a1
799eb3a5555254427db269921042419bc30d4d86 19-Jul-2014 Hiroshi Yamauchi <yamauchi@google.com> Add read barriers for the GC roots in Instrumentation.

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

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

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

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

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

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

Bug: 8142917
Change-Id: I4240d58cfbe9250107c95c0708c036854c455968
320deb2ebe5cce96ca2779875c82853182326685 11-Jun-2014 Sebastien Hertz <shertz@google.com> Fix missing single-step event

During debugging, we used to suspend too lately after a step. It occurred when
we were stepping out of an interpreted method into a compiled "caller" method.
The issue is we did not deoptimize when returning from the interpreted method
but only did it when returning from the compiled method. Therefore we were not
executing the rest of the compiled method's code with interpreter which
prevents from debugging it.

This CL fixes this issue by using instrumentation entry/exit stubs when calling
interpreted method from compiled code. Therefore, we execute instrumentation
exit stub when returning from interpreter and are able to deoptimize from this
point. This allows to execute compiled method's code with interpreter and to
debug it.

We now also prevent from reporting method entry/exit twice while instrumenting
interpreted methods. We report method entry/exit events only from interpreter.

Bug: 14422182
Bug: 11705760
Change-Id: Ia1175d36202239273083c4e9733c7e9290244090
bae182cbc6adc8796154162a87fc54ae804e0469 17-Dec-2013 Sebastien Hertz <shertz@google.com> Fix method tracing from command-line

Transitions current thread to the new kWaitingForMethodTracingStart thread
state when starting method tracing.

Ensures there is a current thread when method tracing is stopped due to runtime
shutdown. If the current thread has been detached, we now re-attach it.
Note: we only do this if method tracing has been activated from command-line.

Fixes instrumentation when forcing interpreter mode (-Xint) with method tracing
enabled.

Removes unused parameter from UnsafeLogFatalForThreadSuspendAllTimeout.

Bug: https://code.google.com/p/android/issues/detail?id=72094
Bug: 11683397
Change-Id: I70f000fb46ddd95d6ad51ea0a8eee77697a045e9
9f1020305292a21fd14a402b189c765a125226ab 23-May-2014 Sebastien Hertz <shertz@google.com> Fix exception reporting from interpreter

To comply with JDWP exception report rules, we must report an exception at the
location of the throw (or the first instruction encountered after a native
call). To do this, we use the CatchLocationFinder visitor to look for a catch
handler until we reach a native frame or the top frame.

Because interpreter handles pending exception on a method-by-method basis, we
need a flag to remember we already reported the exception and avoid reporting
it multiple times when unwinding methods. The drawback is we need to maintain
the state of this flag. We clear it when the exception is cleared. In the case
we temporarily clear the exception (when finding a catch handler for instance),
we restore the flag to its previous value at the same time we restore the
pending exception.

Bump oat version to force recompilation because we modify Thread offsets.

Bug: 14402770
Change-Id: Ic059c58f80b2023b118038301f8f0a24f1e18241
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
d58342caa97108ba413bad467c285c0377f138f5 05-Jun-2014 Andreas Gampe <agampe@google.com> ART: Add instrumentation stubs for ARM64 and X86-64

Adds instrumentation stubs necessary for debugger support.

Refactors MethodAndCode to a top-level TwoWordReturn. A function
having a return type of TwoWordReturn will return its two-word
content, either 2x32b or 2x64b, in two registers according to
the architecture's ABI.

Bug: 15443938
Change-Id: Id7e1fbd4ad8eb6f29e23d48903c76f77b28d981a
83f8f65641dcc83c1aece4f40860a89505084c49 28-May-2014 Jeff Hao <jeffhao@google.com> Fix method tracing's handling of shadow frames on startup.

Bug: 15142926

(cherry picked from commit a15a81b2bd6d08d131e0726ddb622d940ed3c6da)

Change-Id: I3c099a2ba15faeed8d40472566ada197d46a72e5
a15a81b2bd6d08d131e0726ddb622d940ed3c6da 28-May-2014 Jeff Hao <jeffhao@google.com> Fix method tracing's handling of shadow frames on startup.

Bug: 15142926
Change-Id: I7d7896ec3f62f46a43578f536292db6e219d83f0
3e5cf305db800b2989ad57b7cde8fb3cc9fa1b9e 21-May-2014 Ian Rogers <irogers@google.com> Begin migration of art::Atomic to std::atomic.

Change-Id: I4858d9cbed95e5ca560956b9dabd976cebe68333
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
8a630577ed2d9e9571c3434c505e5de223b23c07 09-Apr-2014 Vladimir Marko <vmarko@google.com> Move mapping table and vmap table offsets to OatMethodHeader.

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

Bug: 11767815
Change-Id: I46ce2067e1ecd915da3890606498e31ffc332813
3f52eafe5577b8489f90dc8ed5981b3455206147 04-Apr-2014 Sebastien Hertz <shertz@google.com> Prepare field watchpoint support

Adds field read/write events in the instrumentation. The debugger now registers
as a listener for these events so JDWP field access and field modification
events can be reported.

This CL will be followed by another one to report these events from the
interpreter. Therefore no JDWP field access and field modification events
can be sent for now.

Bug: 8267708
Change-Id: If2a93eb590805567d69015c83cce9cd2ab712cbd
7ec2f1ca3cbd021848da75d5566f7239ce29676f 27-Mar-2014 Sebastien Hertz <shertz@google.com> Speed up single-stepping

During single-stepping sequence, we need to deoptimize everything when we
register a single-step event and undeoptimize everything when it is done. This
causes a slow pattern where we continuously deoptimize-undeoptimize everything
for each single-step.

This CL introduces a special handling of single-step undeoptimization. We now
delay the undeoptimization to the next resume (one thread or all threads) or
the end of the debugging session. Indeed, a single-step event registration is
always followed by a resume command.
At the "resume" point, we know if a single-step event is registered and if we
really need to undeoptimize. At the "registration" point, we know we did not
undeoptimized everything so we don't need to deoptimize everything again.
Therefore, in a sequence of single-steps, we only do a full deoptimization for
the first single-step and a full undeoptimization for the last single-step.

We update logs at deoptimization points so we can track more precisely. Note
they are verbose logs that still must be enabled with -verbose:jdwp option.

We also make some improvement inside instrumentation:
* updates Instrumentation::ShouldNotifyMethodEnterExitEvents to comply with its
name.
* compute frame id only once when looking for the corresponding instrumentation
frame.
* compute the OatMethod once in ClassLinker::GetPortableOatCodeFor to avoid
looking for it again.

Bug: 13577964
Change-Id: If6fa198a676b515cd474b8c4d7bf7ef3626f2dc7
bf079fe015e3b2d966e111efc61728b6e6892ec3 01-Apr-2014 Sebastien Hertz <shertz@google.com> Fix crash when debugging exception

Fixes a crash when detaching the debugger during an exception event. The cause
is a concurrent modification of Instrumentation::exception_caught_listeners_
list (consequence of debugger being detached) while we loop over its elements.

Workaround the issue by making a copy of the listeners list.

Bug: 13738672
Change-Id: I56b84c5c8f31d6fbda1ba7cb35caeefc5e7ca60f
3b05e9ba874449dbff65b01b8781001f7d93eea6 25-Mar-2014 Mathieu Chartier <mathieuc@google.com> Add missing debugger root visiting.

Bug: 13634574
Change-Id: I2a76f6c43f1d0ad1922f06deb40a71ff651129fd
661974a5561e5ccdfbac8cb5d8df8b7e6f3483b8 09-Jan-2014 Mathieu Chartier <mathieuc@google.com> Fix valgrind gtests and memory leaks.

All tests pass other than image_test which passes if some bad reads
are disabled (buzbee working on this).

Change-Id: Ifd6b6e3aed0bc867703b6e818353a9f296609422
d889178ec78930538d9d6a66c3df9ee9afaffbb4 02-Mar-2014 Mathieu Chartier <mathieuc@google.com> Guard entrypoint changing by runtime shutdown lock.

There was a race when we changed the allocation entrypoints where a
new thread would be starting (Thread::Init) and initialize to the
wrong entrypoints. Guarding allocation entrypoint changing
with the runtime shutdown lock fixes this race condition since
Thread::Init is only called with the runtime shutdown lock held.

Bug: 13250963

Change-Id: I8eb209c124b6bf17020de874e1b0083f158b8200
563b47cc142e477da244539b1d63070425e7fd78 01-Mar-2014 Hiroshi Yamauchi <yamauchi@google.com> Fix the bug that some compiled code was invoked with -Xint.

Some compiled code (probably static methods) is still being invoked
with -Xint. Added an assert to detect this case.

Bug: 13250375
Change-Id: Iecfe8ef40c6c326962593db78e6e1d9f1c93842e
11d40c250ec86c784cf76b8c31e1cf9285d555dc 19-Feb-2014 Sebastien Hertz <shertz@google.com> Fix deoptimization deadlock

Fixes a deadlock occuring during undeoptimization on debugging session end.

Before disconnecting debugger, we must unregister all requested events. We take
the event list lock to browse all these events. Some of them (as METHOD_EXIT)
may have activated deoptimization so we need to undeoptimize. During this
process, we restore all original entrypoints of every method in the stack and
notify method exit events to the instrumentation listener (see method
InstrumentationLister::MethodExited). In our case, the instrumentation listener
is the debugger. It takes the event list lock (to browse the event list and see
if this event must be posted) but hangs waiting for it. Since it's already
holding the event list lock (which is not recursive), it ends up in a deadlock
situation.

This CL fixes the way we prevent from posting method enter/exit events during
the process of deoptimization/undeoptimization. We now explicitly set a flag
indicating if deoptimization is enabled (by the debugger).

Also removes unused field in InstallStackVisitor class and remove debugger as
listener before disabling deoptimization to ensure it does not receive any
event when disconnecting.

Change-Id: I49a2ae43e86cf29094f4b462bfa754d7740d3e97
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
138dbfc3336e379d74d157086f69a0fbe830089b 04-Dec-2013 Sebastien Hertz <shertz@google.com> Selective deoptimization.

Update the instrumentation to allow selective deoptimization.

Separate instrumentation listener registration from stubs configuration. A
listener is now responsible for configuring the appropriate stubs.
- The method tracing listener installs instrumentation entry/exit stubs or
the interpreter depending on the accuracy of events we want (controlled by
kDeoptimizeForAccurateMethodEntryExitListeners).
- The debugger registers itself as an instrumentation listener but does not
modify methods entrypoints. It only does this on demand when deoptimizing one
method or all the methods.

The selective deoptimization is used for breakpoint only. When a breakpoint is
requested, the debugger deoptimizes this method by setting its entrypoint to
the interpreter stub. As several breakpoints can be set on the same method, we
deoptimize only once. When the last breakpoint on a method is removed, we
reoptimize it by restoring the original entrypoints.

The full deoptimization is used for method entry, method exit and single-step
events. When one of these events is requested, we force eveything to run with
the interpreter (except native and proxy methods). When the last of these
events is removed, we restore all methods entrypoints except those which are
currently deoptimized.

Deoptimizing a method requires all mutator threads be suspended in order to
walk each thread's stack and ensure no code is actually executing while we
modify methods entrypoints. Suspending all the threads requires to not hold
any lock.
In the debugger, we deoptimize/undeoptimize when the JDWP event list changes
(add or remove a breakpoint for instance). During the update, we need to hold
the JDWP event list lock. This means we cannot suspend all the threads at this
time.
In order to deal with these constraints, we support a queue of deoptimization
requests. When an event needs selective/full deoptimization/undeoptimization,
we save its request in the queue. Once we release the JDWP event list lock, we
suspend all the threads, process this queue and finally resume all the threads.
This is done in Dbg::ManageDeoptimization. Note: threads already suspended
before doing this remain suspended so we don't "break" debugger suspensions.

When we deoptimize one method or every method, we need to browse each thread's
stack to install instrumentation exit PC as return PC and save information in
the instrumentation stack frame. Now we can deoptimize multiple times during
the execution of an application, we need to preserve exisiting instrumentation
frames (which is the result of a previous deoptimization). This require to push
new instrumentation frames before existing ones so we don't corrupt the
instrumentation stack frame while walking the stack.

Bug: 11538162
Change-Id: I477142df17edf2dab8ac5d879daacc5c08a67c39
e6da9af8dfe0a3e3fbc2be700554f6478380e7b9 16-Dec-2013 Mathieu Chartier <mathieuc@google.com> Background compaction support.

When the process state changes to a state which does not perceives
jank, we copy from the main free-list backed allocation space to
the bump pointer space and enable the semispace allocator.

When we transition back to foreground, we copy back to a free-list
backed space.

Create a seperate non-moving space which only holds non-movable
objects. This enables us to quickly wipe the current alloc space
(DlMalloc / RosAlloc) when we transition to background.

Added multiple alloc space support to the sticky mark sweep GC.

Added a -XX:BackgroundGC option which lets you specify
which GC to use for background apps. Passing in
-XX:BackgroundGC=SS makes the heap compact the heap for apps which
do not perceive jank.

Results:
Simple background foreground test:
0. Reboot phone, unlock.
1. Open browser, click on home.
2. Open calculator, click on home.
3. Open calendar, click on home.
4. Open camera, click on home.
5. Open clock, click on home.
6. adb shell dumpsys meminfo

PSS Normal ART:
Sample 1:
88468 kB: Dalvik
3188 kB: Dalvik Other
Sample 2:
81125 kB: Dalvik
3080 kB: Dalvik Other

PSS Dalvik:
Total PSS by category:
Sample 1:
81033 kB: Dalvik
27787 kB: Dalvik Other
Sample 2:
81901 kB: Dalvik
28869 kB: Dalvik Other

PSS ART + Background Compaction:
Sample 1:
71014 kB: Dalvik
1412 kB: Dalvik Other
Sample 2:
73859 kB: Dalvik
1400 kB: Dalvik Other

Dalvik other reduction can be explained by less deep allocation
stacks / less live bitmaps / less dirty cards.

TODO improvements: Recycle mem-maps which are unused in the current
state. Not hardcode 64 MB capacity of non movable space (avoid
returning linear alloc nightmares). Figure out ways to deal with low
virtual address memory problems.

Bug: 8981901

Change-Id: Ib235d03f45548ffc08a06b8ae57bf5bada49d6f3
b122a4bbed34ab22b4c1541ee25e5cf22f12a926 20-Nov-2013 Ian Rogers <irogers@google.com> Tidy up memory barriers.

Change-Id: I937ea93e6df1835ecfe2d4bb7d84c24fe7fc097b
cbb2d20bea2861f244da2e2318d8c088300a3710 15-Nov-2013 Mathieu Chartier <mathieuc@google.com> Refactor allocation entrypoints.

Adds support for switching entrypoints during runtime. Enables
addition of new allocators with out requiring significant copy
paste. Slight speedup on ritzperf probably due to more inlining.

TODO: Ensuring that the entire allocation path is inlined so
that the switch statement in the allocation code is optimized
out.

Rosalloc measurements:
4583
4453
4439
4434
4751

After change:
4184
4287
4131
4335
4097

Change-Id: I1352a3cbcdf6dae93921582726324d91312df5c9
51db44a194bafc3810a41164a8b39614f10e79df 19-Nov-2013 Sebastien Hertz <shertz@google.com> Propagate 'this_object' for method unwind event.

Propagates the 'this_object' to InstrumentationListener::MethodUnwind callback.

Change-Id: I12561f1a611b8399b94e669f9b8a6eaaf1a58631
5bfd5c9e75b31afab2cb3676b8dc71e58a7d90df 15-Nov-2013 Sebastien Hertz <shertz@google.com> Fix missing class initialization during instrumentation.

Static methods (except the <clinit>) all point to the resolution trampoline
to handle class initialization. When we enable instrumentation, we update the
entry point to the instrumentation stub. But doing so makes us miss the call
into the trampoline.

This CL fixes this issue by leaving the resolution trampoline. Once a method's
class is initialized, we update all its static methods' entry point. When
instrumentation is enabled, this entry point becomes the instrumentation entry
stub.

This also allows to post method enter events in the right order during static
invokes. First, we get into the trampoline which call the method's class
<clinit> method and post the corresponding "method enter" event. Then we get
into the instrumentation entry stub of the static method being called and post
the corresponding "method enter" event before getting into its code.

Bug: 11686442
Change-Id: I202db921225c8be0b2191074d09b0ba40f9248b2
02b10d6f493a7f15123c01048f05dba9e4567b48 07-Nov-2013 Jeff Hao <jeffhao@google.com> Do not instrument proxy methods.

This fixes issues with traceview on Books.

Bug: 11512992
Change-Id: Id67578af5e404fca51aa99860a3a61a68574ccf8
fa82427c68b09f4aedbee319dc71579afbfc66f5 06-Nov-2013 Ian Rogers <irogers@google.com> Fix oatdump and valgrind.

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

Change-Id: I8ea848ace318552c180e2efa46570288ff1ca62c
ee1997a3b83334985e757f369c09e111b121661b 19-Sep-2013 Sebastien Hertz <shertz@google.com> Improve interpreter handler table management.

We still have two handlers table:
- the "main" table which holds execution handlers of each instruction,
- the "alternative" table which holds handlers supporting instrumentation
before jumping to the corresponding instruction handler from the "main" table.

Instrumentation holds the index of the handler table the interpreter must use.
This index is represented by the InterpreterHandlerTable enum and is stored in
the Instrumentation::interpreter_handler_table_ field.

Interpreter's current handler table update happens:
- on backward branch
- after invoke
- when throwing exception.
In the case of the backward branch and exception, we only update the table if
any thread's flags is set. This allows to only do one test for handling thread
suspension and handler table update.

This CL also removes the local variable "instrumentation". Every handler which
needs it will get it from Runtime::Current()->GetInstrumentation().

Change-Id: Id886ea7ebf3dac1285f0ca701c098aee7ebaab8d
947ff080753c786a74f1cd7aeb09f717bb7074bd 17-Sep-2013 Sebastien Hertz <shertz@google.com> Load shadow frame's this object only upon instrumentation.

We used to load the shadow frame's this object when entering the interpreter
and push it into thread's SIRT to make it visible to garbage collector. But
it is only used by instrumentation listeners.

We now move this load at each place an instrumentation listener is called. This
avoids loading it when instrumentation is disabled. This also allows to remove
the SIRT reference and the push/pop management it implies when entering/exiting
the interpreter.

The performance improvement is 6% in average on our benchmarks suite.

This CL also makes method Instrumentation::ExceptionCaughtEvent const so we can
use a "const instrumentation::Instrumentation*" object in interpreter.

Change-Id: I2caccba9a906f244c8057b24031250f9824cc711
7b6da36ac600178f0cdc60a1c36843c3a4fd300e 11-Sep-2013 Ian Rogers <irogers@google.com> Don't deopt for tracing due to stability.

Change-Id: I49525f950c669a6dab4f7038b10fccb663087acf
816432e297f9d440902fd827ca2e78e8c28f9f6b 07-Sep-2013 Ian Rogers <irogers@google.com> Deopt for method entry/exit when not sampling.

Bug 9968239.
Note, this makes profiling performance horrendously slow. The real fix is to
get the sampling enabled flag to be set to true by frameworks.

Change-Id: I101e524fe5bbff99142015e69177218796ae20da
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
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
468532ea115657709bc32ee498e701a4c71762d4 05-Aug-2013 Ian Rogers <irogers@google.com> Entry point clean up.

Create set of entry points needed for image methods to avoid fix-up at load time:
- interpreter - bridge to interpreter, bridge to compiled code
- jni - dlsym lookup
- quick - resolution and bridge to interpreter
- portable - resolution and bridge to interpreter

Fix JNI work around to use JNI work around argument rewriting code that'd been
accidentally disabled.
Remove abstact method error stub, use interpreter bridge instead.
Consolidate trampoline (previously stub) generation in generic helper.
Simplify trampolines to jump directly into assembly code, keeps stack crawlable.
Dex: replace use of int with ThreadOffset for values that are thread offsets.
Tidy entry point routines between interpreter, jni, quick and portable.

Change-Id: I52a7c2bbb1b7e0ff8a3c3100b774212309d0828e
(cherry picked from commit 848871b4d8481229c32e0d048a9856e5a9a17ef9)
848871b4d8481229c32e0d048a9856e5a9a17ef9 05-Aug-2013 Ian Rogers <irogers@google.com> Entry point clean up.

Create set of entry points needed for image methods to avoid fix-up at load time:
- interpreter - bridge to interpreter, bridge to compiled code
- jni - dlsym lookup
- quick - resolution and bridge to interpreter
- portable - resolution and bridge to interpreter

Fix JNI work around to use JNI work around argument rewriting code that'd been
accidentally disabled.
Remove abstact method error stub, use interpreter bridge instead.
Consolidate trampoline (previously stub) generation in generic helper.
Simplify trampolines to jump directly into assembly code, keeps stack crawlable.
Dex: replace use of int with ThreadOffset for values that are thread offsets.
Tidy entry point routines between interpreter, jni, quick and portable.

Change-Id: I52a7c2bbb1b7e0ff8a3c3100b774212309d0828e
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
166db04e259ca51838c311891598664deeed85ad 26-Jul-2013 Ian Rogers <irogers@google.com> Move assembler out of runtime into compiler/utils.

Other directory layout bits of clean up. There is still work to separate quick
and portable in some files (e.g. argument visitor, proxy..).

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

Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
2d88862f0752a7a0e65145b088f49dabd49d4284 19-Jul-2013 Brian Carlstrom <bdc@google.com> Fixing cpplint readability/casting issues

Change-Id: I6821da0e23737995a9b884a04e9b63fac640cd05
65d15d985a27be01e1d64f473af0e9d8eb19051d 17-Jul-2013 Jeff Hao <jeffhao@google.com> Fixes to instrumentation for debug build and interpreter.

- Stub uninstall will put back the interpreter entry point if Xint
mode is specified.
- Copy method entry and exit listeners before iterating over them
to prevent problems that occur when they are modified during
iteration.
- Corrected checks from WalkStack and AssertPcIsWithinCode to
handle instrumented code since they are used to remove the stubs.

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