OSDN Git Service

android-x86/art.git
9 years agoChange heap transitions + hspace compation to use VLOG(heap)
Mathieu Chartier [Tue, 2 Sep 2014 19:33:25 +0000 (12:33 -0700)]
Change heap transitions + hspace compation to use VLOG(heap)

VLOG(gc) is spammy since it is enabled.

Change-Id: I07d1d40e2f19134f885d6777b60533a9010ae164

9 years agoART: Fix typo
Andreas Gampe [Tue, 2 Sep 2014 17:22:20 +0000 (10:22 -0700)]
ART: Fix typo

Bug: 17327877
Change-Id: I6132a8afb4b69c8d22a01b477f6f324c789ed666

9 years agoART: Fix dex file verifier type-list handling
Andreas Gampe [Fri, 29 Aug 2014 23:07:49 +0000 (16:07 -0700)]
ART: Fix dex file verifier type-list handling

It is rare, but valid, to have an empty type list.

Bug: 17327877
Change-Id: Ib3a8ff3e5ccd8fe7c04b1e97485bf3e6de72aa4d

9 years agoMerge "Add native memory accounting through custom allocator." into lmp-dev
Mathieu Chartier [Sat, 30 Aug 2014 01:17:19 +0000 (01:17 +0000)]
Merge "Add native memory accounting through custom allocator." into lmp-dev

9 years agoAdd native memory accounting through custom allocator.
Mathieu Chartier [Mon, 25 Aug 2014 20:08:22 +0000 (13:08 -0700)]
Add native memory accounting through custom allocator.

Added a custom allocator that lets you pass in a special tag which
specifices where the allocation came from. This is used when
dumping. The performance overhead is low since each allocation only
does a atomic add/sub for each allocation/free.

The measurements are dumped to traces.txt during SIGQUIT.

Example output:
I/art     (27274): AllocatorTagHeap active=120 max=120 total=168
I/art     (27274): AllocatorTagMonitorList active=1572 max=6240 total=11724
I/art     (27274): AllocatorTagClassTable active=185208 max=185208 total=268608
I/art     (27274): AllocatorTagInternTable active=430368 max=430368 total=436080
I/art     (27274): AllocatorTagMaps active=5616 max=6168 total=34392
I/art     (27274): AllocatorTagLOS active=1024 max=1536 total=2044
I/art     (27274): AllocatorTagSafeMap active=0 max=51936 total=533688
I/art     (27274): AllocatorTagLOSMaps active=144 max=1248 total=5760
I/art     (27274): AllocatorTagReferenceTable active=10944 max=11840 total=19136
I/art     (27274): AllocatorTagHeapBitmap active=32 max=40 total=56
I/art     (27274): AllocatorTagHeapBitmapLOS active=8 max=8 total=8
I/art     (27274): AllocatorTagVerifier active=0 max=18844 total=1073156
I/art     (27274): AllocatorTagModUnionCardSet active=5300 max=5920 total=56020
I/art     (27274): AllocatorTagModUnionReferenceArray active=24864 max=24864 total=24864
I/art     (27274): AllocatorTagJNILibrarires active=320 max=320 total=320
I/art     (27274): AllocatorTagOatFile active=1400 max=1400 total=5852

Bug: 16238192

Change-Id: Ibb470ef2e9c9a24563bb46422d46a55799704d82

9 years agoMerge "Fix mips build for nested signal handler" into lmp-dev
Dave Allison [Fri, 29 Aug 2014 18:18:53 +0000 (18:18 +0000)]
Merge "Fix mips build for nested signal handler" into lmp-dev

9 years agoFix mips build for nested signal handler
Dave Allison [Fri, 29 Aug 2014 18:05:17 +0000 (11:05 -0700)]
Fix mips build for nested signal handler

Bug: 17006816

Change-Id: If41c6d7a2f12f1822ca36d9e2f0f22b3ca854098

9 years agoFix segfault if running without image.
Alex Light [Fri, 29 Aug 2014 17:28:25 +0000 (10:28 -0700)]
Fix segfault if running without image.

Bug: 17325091

(cherry picked from commit 7adb7ac3913364de8cc57b8934024dd12e1d3bea)

Change-Id: I343099543ce0abf02219da84d61d9ce2dfc47980

9 years agoMerge "Quick compiler: Fix MIPS build" into lmp-dev
buzbee [Fri, 29 Aug 2014 16:59:46 +0000 (16:59 +0000)]
Merge "Quick compiler: Fix MIPS build" into lmp-dev

9 years agoQuick compiler: Fix MIPS build
buzbee [Thu, 28 Aug 2014 20:48:56 +0000 (13:48 -0700)]
Quick compiler: Fix MIPS build

b/16484538

In debug builds, the Quick compiler frequently runs a sanity checker
over the register pool.  Among other things, it attempts to verify
consistent representation of register pairs.  However, a register's
"wide" flag is meaningful only when the register pair is associated
with a Dalvik wide value (sreg != INVALID_SREG) rather than a temp
wide value.

The MIPS build was tripping over this bad assertion.  Fixed here.

Note related cl/105461

(cherry-picked from commit sha 3a658077af2a931e5d7f6cd22b777c57112c19df)

Change-Id: Id726ff1ea0f5cbcc8dba6fa3aacb3fd4fc043a63

9 years agoAvoid null pointer dereference when sending JDWP packets
Sebastien Hertz [Thu, 28 Aug 2014 16:50:36 +0000 (18:50 +0200)]
Avoid null pointer dereference when sending JDWP packets

Bug: 16218394

(cherry picked from commit 60ed7da4d193e0f90b05c4236af77d3b276c0ea4)

Change-Id: I4882b3b6bb97facb8fca4c7ece65f4c7c96c57fe

9 years agoFix Mac build
Brian Carlstrom [Fri, 29 Aug 2014 05:17:13 +0000 (22:17 -0700)]
Fix Mac build

Bug: 17000769,16875245

(cherry picked from commit debdda0262bfbcb966a89e693d933cc74eb412ac)

Change-Id: I158f090c89587f176813a15e9edad917bd134cd0

9 years agoFix incorect variable name.
Alex Light [Thu, 28 Aug 2014 23:23:48 +0000 (16:23 -0700)]
Fix incorect variable name.

Bug: 16875245
(cherry picked from commit 1291e9bc87edc8fde56434bc66bef0c62d44a8e6)
Change-Id: Idd0f7ac677568a53569308a67f1ad613584949a5

9 years agoChange /dalvik-cache to be owned by root.
Alex Light [Wed, 27 Aug 2014 22:37:23 +0000 (15:37 -0700)]
Change /dalvik-cache to be owned by root.

Also prune the dalvik-cache during startup if we need to generate or
relocate an image.

Bug: 17000769,16875245

(cherry picked from commit 2539613be94f599c1713627f80c7398028d1a6aa)

Change-Id: I29a70215a2207bc4e0db02ab751d32a68edf4b66

9 years agoMerge "Fix issue with Thread.setName hanging after Thread.start" into lmp-dev
Brian Carlstrom [Thu, 28 Aug 2014 22:23:09 +0000 (22:23 +0000)]
Merge "Fix issue with Thread.setName hanging after Thread.start" into lmp-dev

9 years agoMerge "Ensure proxy constructor is in dex cache" into lmp-dev
Brian Carlstrom [Thu, 28 Aug 2014 18:54:15 +0000 (18:54 +0000)]
Merge "Ensure proxy constructor is in dex cache" into lmp-dev

9 years agoMerge "Prevent exception bugs in class linker" into lmp-dev
Mathieu Chartier [Thu, 28 Aug 2014 18:37:29 +0000 (18:37 +0000)]
Merge "Prevent exception bugs in class linker" into lmp-dev

9 years agoEnsure proxy constructor is in dex cache
Sebastien Hertz [Wed, 27 Aug 2014 13:32:56 +0000 (15:32 +0200)]
Ensure proxy constructor is in dex cache

Bug: 17262039

(cherry picked from commit ae94e350f100207359b8345d8d21e78e7cfb44c4)

Change-Id: I1cfc8dac1f63b9012fa098804135be8847b1daee

9 years agoFix issue with Thread.setName hanging after Thread.start
Brian Carlstrom [Thu, 28 Aug 2014 06:43:46 +0000 (23:43 -0700)]
Fix issue with Thread.setName hanging after Thread.start

When suspending a thread by peer the invariant that only attached threads are
suspended must be maintained. Add a ThreadList::Contains check which requires
making this method non-static.
Add some extra thread logging.

Bug: 17302037
Change-Id: I89af9840e398c2ceadeb736c431dfe3be8f3ba06

9 years agoPrevent exception bugs in class linker
Mathieu Chartier [Wed, 27 Aug 2014 22:28:28 +0000 (15:28 -0700)]
Prevent exception bugs in class linker

There were some places that could throw exceptions but still succeed.
This caused the allocation entrypoints to occasionally allocate a
heap object with a pending exception.
Also added some additional AssertNoExceptionPending.

Bug: 17164348

Change-Id: Ic6dd3b0cce9955349176503dd7f6c3da7ab0a6f1

9 years agoMerge "Actually ask the pthread implementation for the stack guard size." into lmp-dev
Elliott Hughes [Thu, 28 Aug 2014 16:50:40 +0000 (16:50 +0000)]
Merge "Actually ask the pthread implementation for the stack guard size." into lmp-dev

9 years agoMerge "Revert "Avoid using NanoTime for compiler and verifier"" into lmp-dev
Ian Rogers [Thu, 28 Aug 2014 16:50:38 +0000 (16:50 +0000)]
Merge "Revert "Avoid using NanoTime for compiler and verifier"" into lmp-dev

9 years agoMerge "Support booting without functioning boot.oat/art patchoat." into lmp-dev
Brian Carlstrom [Wed, 27 Aug 2014 23:40:53 +0000 (23:40 +0000)]
Merge "Support booting without functioning boot.oat/art patchoat." into lmp-dev

9 years agoActually ask the pthread implementation for the stack guard size.
Elliott Hughes [Wed, 27 Aug 2014 18:47:01 +0000 (11:47 -0700)]
Actually ask the pthread implementation for the stack guard size.

Bug: 17111575
Change-Id: I23919b1e8aeff627a65daf57f1109bec60b196cc

9 years agoRevert "Avoid using NanoTime for compiler and verifier"
Ian Rogers [Wed, 27 Aug 2014 21:46:57 +0000 (21:46 +0000)]
Revert "Avoid using NanoTime for compiler and verifier"

This reverts commit c89e6edbdce97c7d199b54bf63aed7ea01ebf1ff.

Change-Id: Id3b89121a19e64bf3c457c39b375f3d3c0fcc579

9 years agoMerge "Avoid using NanoTime for compiler and verifier" into lmp-dev
Mathieu Chartier [Wed, 27 Aug 2014 21:46:42 +0000 (21:46 +0000)]
Merge "Avoid using NanoTime for compiler and verifier" into lmp-dev

9 years agoAvoid using NanoTime for compiler and verifier
Mathieu Chartier [Wed, 27 Aug 2014 21:10:58 +0000 (14:10 -0700)]
Avoid using NanoTime for compiler and verifier

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

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

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

Bug: 16853450

Change-Id: Id996172d8283639fe293ddfc26d01fc1a0beed0b

9 years agoSupport booting without functioning boot.oat/art patchoat.
Alex Light [Sat, 23 Aug 2014 00:49:35 +0000 (17:49 -0700)]
Support booting without functioning boot.oat/art patchoat.

Bug: 17000769

(cherry picked from commit 84d7605f93f1e6e86a16e02017e305c90e93117a)

Change-Id: I89c26a905af12ea288742368c2c038afd57a879a

9 years agoMerge "Handle nested signals" into lmp-dev
Dave Allison [Wed, 27 Aug 2014 19:42:39 +0000 (19:42 +0000)]
Merge "Handle nested signals" into lmp-dev

9 years agoReduce interpret-only compile time.
Mathieu Chartier [Tue, 19 Aug 2014 21:29:46 +0000 (14:29 -0700)]
Reduce interpret-only compile time.

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

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

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

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

Bug: 16853450

(cherry picked from commit 8e219ae27624116b6d23e858fb21e93342f81d66)

Change-Id: I349ffb3f36db8c437137387aa6914dc17d743f09

9 years agoHandle nested signals
Dave Allison [Tue, 26 Aug 2014 18:07:58 +0000 (11:07 -0700)]
Handle nested signals

This allows for signals to be raised inside the ART signal handler.
This can occur when the JavaStackTraceHandler attempts to generate
a stack trace and something goes wrong.

It also fixes an issue where the fault manager was not being
correctly shut down inside the signal chaining code.  In this
case the signal handler was not restored to the original.

Bug: 17006816
Bug: 17133266
Change-Id: I9c25bf4f6921e6a107aefbdf47d2c0db9f41508f

9 years agoMerge "Fix race condition in TransitionCollector." into lmp-dev
Mathieu Chartier [Tue, 26 Aug 2014 18:01:37 +0000 (18:01 +0000)]
Merge "Fix race condition in TransitionCollector." into lmp-dev

9 years agoFix race condition in TransitionCollector.
Mathieu Chartier [Sat, 23 Aug 2014 20:56:03 +0000 (13:56 -0700)]
Fix race condition in TransitionCollector.

There was a minor race condition that could happen if multiple
threads called TransitionCollector at the same time. Starting out
in CMS:

Thread 1: TransitionCollector(SS).
Thread 2: TransitionCollector(CMS) sees that it is already CMS so
has copying_transition == false. But then thread 2 changes to SS.
Thread 1 resumes but incorrectly doesn't check the
disable_moving_gc_count_ possibly resulting in errors if
disable_moving_gc_count_ != 0 due to JNI since we are going from
SS -> CMS and are goign to move objects.

Bug: 17189964

Change-Id: I4f0d002717516b81355d66f26e0e8ebe3958348d

9 years agoART: Reject field accesses to non-reference vregs.
Stephen Kyle [Fri, 22 Aug 2014 14:03:07 +0000 (15:03 +0100)]
ART: Reject field accesses to non-reference vregs.

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

Bug: 17207857
Signed-off-by: Stuart Monteith <stuart.monteith@arm.com>
(cherry picked from commit 695c5982eeddee18c643cc2f94c9d78fa75599ab)

Change-Id: I3790b8687673643bb142549d74f36a3e2978bf13

9 years agoMerge "Map heap maps at a lower address." into lmp-dev
Mathieu Chartier [Tue, 26 Aug 2014 17:15:20 +0000 (17:15 +0000)]
Merge "Map heap maps at a lower address." into lmp-dev

9 years agoMerge "ART: kSuper also has IncompatibleClassChangeError" into lmp-dev
Andreas Gampe [Tue, 26 Aug 2014 17:10:28 +0000 (17:10 +0000)]
Merge "ART: kSuper also has IncompatibleClassChangeError" into lmp-dev

9 years agoMerge "ART: Fix IncompatibleClassChange check for ArtMethod" into lmp-dev
Andreas Gampe [Tue, 26 Aug 2014 17:04:14 +0000 (17:04 +0000)]
Merge "ART: Fix IncompatibleClassChange check for ArtMethod" into lmp-dev

9 years agoMerge "Reduce lock contention when debugging" into lmp-dev
Sebastien Hertz [Tue, 26 Aug 2014 13:43:17 +0000 (13:43 +0000)]
Merge "Reduce lock contention when debugging" into lmp-dev

9 years agoMerge "Quick compiler: fix DCHECK" into lmp-dev
buzbee [Tue, 26 Aug 2014 12:58:44 +0000 (12:58 +0000)]
Merge "Quick compiler: fix DCHECK" into lmp-dev

9 years agoCheckAndClearResolveException should allow LinkageError
Brian Carlstrom [Tue, 26 Aug 2014 06:07:30 +0000 (23:07 -0700)]
CheckAndClearResolveException should allow LinkageError

Bug: 16565964
Change-Id: Ibf236c627519a5cdef9479b7bc21e931d5474abf

9 years agoART: kSuper also has IncompatibleClassChangeError
Andreas Gampe [Tue, 26 Aug 2014 03:55:01 +0000 (20:55 -0700)]
ART: kSuper also has IncompatibleClassChangeError

When resolving methods, kSuper can also have
IncompatibleClassChangeError.

Bug: 17266767
Change-Id: I5fafe03ad578f605825a3d0c89f1254a4a385b76

9 years agoART: Fix IncompatibleClassChange check for ArtMethod
Andreas Gampe [Tue, 26 Aug 2014 03:46:31 +0000 (20:46 -0700)]
ART: Fix IncompatibleClassChange check for ArtMethod

In case of kSuper we should complain sometimes.

Bug: 17265201
Change-Id: Ifad903a750495963c7128296713fbd7c4add71cd

9 years agoMerge "Reduce GC log spam." into lmp-dev
Mathieu Chartier [Tue, 26 Aug 2014 03:30:33 +0000 (03:30 +0000)]
Merge "Reduce GC log spam." into lmp-dev

9 years agoReduce GC log spam.
Mathieu Chartier [Tue, 26 Aug 2014 02:46:57 +0000 (19:46 -0700)]
Reduce GC log spam.

Homogeneous compaction and collector transitions now print to
VLOG(gc) instead of LOG(INFO).

Bug: 17166556
Change-Id: I5d54acf36a9b2763922e6329596a2f191d45535c

9 years agoMap heap maps at a lower address.
Mathieu Chartier [Mon, 25 Aug 2014 23:32:41 +0000 (16:32 -0700)]
Map heap maps at a lower address.

We now map the heap mmaps at a lower address in case the app needs
larger continuous address space.

Bug: 16502380

Change-Id: I2cc11d0c207c0eae8db0c5025a48b11119c5a802

9 years agoQuick compiler: fix DCHECK
buzbee [Mon, 25 Aug 2014 16:34:03 +0000 (09:34 -0700)]
Quick compiler: fix DCHECK

A DCHECK intended to verify the soundness of the mapping between
a wide Dalvik value and a pair of temp registers incorrectly fired
when the temp register pair was associated with a wide temporary
(i.e. - when (SReg() == INVALID_SREG)).

In this particular situation, the wideness flag is meaningful only when
there is an associated valid vreg.  Code rearranged to only perform
the DCHECK and reset the partner's wideness bit when we're dealing with
a live wide value.

b/16484538

Change-Id: I3b8a7bebc5d918c65ea56ae8db0a8a5cd8003386

9 years agoReduce log spam by changing a LOG(INFO) to VLOG(startup)
Alex Light [Thu, 21 Aug 2014 16:45:00 +0000 (09:45 -0700)]
Reduce log spam by changing a LOG(INFO) to VLOG(startup)

Bug: 17166556

(cherry picked from commit b6cabc1345ec307559a6e85141fb69b7caa9413c)

Change-Id: I9975ba07ad8f119a6e367e2770a60040a462149b

9 years agoSupport running without a boot image.
Alex Light [Tue, 19 Aug 2014 21:23:13 +0000 (14:23 -0700)]
Support running without a boot image.

Bug: 17000769

(cherry picked from commit 64ad14dbe2225441fb7734bf6d89358d96692eea)

Change-Id: I6404d5050c8a2f4ee6e70d58532eb25ee9de248e

9 years agoMerge "Fix GC memory overhead accounting." into lmp-dev
Mathieu Chartier [Mon, 25 Aug 2014 17:43:17 +0000 (17:43 +0000)]
Merge "Fix GC memory overhead accounting." into lmp-dev

9 years agoMerge "Add fallback for non moving space being full." into lmp-dev
Mathieu Chartier [Sat, 23 Aug 2014 01:01:19 +0000 (01:01 +0000)]
Merge "Add fallback for non moving space being full." into lmp-dev

9 years agoAdd fallback for non moving space being full.
Mathieu Chartier [Fri, 22 Aug 2014 21:53:04 +0000 (14:53 -0700)]
Add fallback for non moving space being full.

When the non moving space becomes full, we disable moving GC and
make the main space the new non moving space.

Also added a runtime option for changing the non moving space size:
-XX:NonMovingSpaceCapacity.

Bug: 17189964
Change-Id: I04d00d0f457f6c1f5724bf32932b6b6ce4d341b1

9 years agoMerge "Using the correct time for wait_start_ms when lock contention logging is enabl...
Ian Rogers [Fri, 22 Aug 2014 21:48:42 +0000 (21:48 +0000)]
Merge "Using the correct time for wait_start_ms when lock contention logging is enabled" into lmp-dev

9 years agoUsing the correct time for wait_start_ms when lock contention logging is enabled
Xin Guan [Fri, 22 Aug 2014 16:55:37 +0000 (11:55 -0500)]
Using the correct time for wait_start_ms when lock contention logging is enabled

Bug: 17208457
Change-Id: I35555e0acf3b37bb3776a62c64d59ae93403b237

9 years agoFix GC memory overhead accounting.
Mathieu Chartier [Thu, 21 Aug 2014 19:21:48 +0000 (12:21 -0700)]
Fix GC memory overhead accounting.

There was some missing null checks.

Bug: 16238192

Change-Id: Iaf8d752db5f21e76f668c0066a063239ff374eee

9 years agoMerge "ART: Allow uninitialized runtime in oat code" into lmp-dev
Andreas Gampe [Fri, 22 Aug 2014 17:14:12 +0000 (17:14 +0000)]
Merge "ART: Allow uninitialized runtime in oat code" into lmp-dev

9 years agoMerge "Always setup the native bridge library" into lmp-dev
Calin Juravle [Fri, 22 Aug 2014 16:55:31 +0000 (16:55 +0000)]
Merge "Always setup the native bridge library" into lmp-dev

9 years agoMerge "Fix testing wrong variable for non zygote." into lmp-dev
Mathieu Chartier [Fri, 22 Aug 2014 16:48:58 +0000 (16:48 +0000)]
Merge "Fix testing wrong variable for non zygote." into lmp-dev

9 years agoFix testing wrong variable for non zygote.
Mathieu Chartier [Fri, 22 Aug 2014 01:28:20 +0000 (18:28 -0700)]
Fix testing wrong variable for non zygote.

For non zygote we want to only have a single non moving space to
let dex2oat use RosAlloc for all allocations.

Fixed stale low memory logic in parsed options.

Bug: 17189964
Change-Id: I85a565002fd18ae30105df084796521abd60ea12

9 years agoReduce lock contention when debugging
Sebastien Hertz [Tue, 19 Aug 2014 13:33:43 +0000 (15:33 +0200)]
Reduce lock contention when debugging

Uses a ReaderWriterMutex for the breakpoint lock to reduce contention during
debugging session.

Also adds missing thread safety annotations on fields and methods related to
instrumentation and debugging.

Bug: 16814665
Bug: 11667502
Change-Id: I056cdafa91109e0c83806c8d8df75c37ade0a354

9 years agoAlways setup the native bridge library
Calin Juravle [Fri, 22 Aug 2014 11:53:59 +0000 (12:53 +0100)]
Always setup the native bridge library

... even if the string is empty. This will initialize the native bridge
library but mark it as unavailable.

- also, rename native_bridge_library_path to
native_bridge_library_filename to be closer to the actual meaning (it's
just the filename without any path).

Bug: 16404669.
Change-Id: I94628639691459d48d1fbf0841f36b68d51818e7

9 years agoART: Allow uninitialized runtime in oat code
Andreas Gampe [Fri, 22 Aug 2014 06:10:47 +0000 (23:10 -0700)]
ART: Allow uninitialized runtime in oat code

Oatdump does not initialize a runtime. Avoid a segfault.

Bug: 17194559
Change-Id: I1a1bd3fc7762ff4714251617a975e832522fa879

9 years agoFixed wrong field usage in Instrumentation::RemoveListener
Daniel Mihalyi [Thu, 21 Aug 2014 13:57:25 +0000 (15:57 +0200)]
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

9 years agoOptimized instrumentation listener handling
Daniel Mihalyi [Mon, 18 Aug 2014 16:45:31 +0000 (18:45 +0200)]
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

9 years agoMerge "Fix fugu build" into lmp-dev
Dave Allison [Fri, 22 Aug 2014 01:09:18 +0000 (01:09 +0000)]
Merge "Fix fugu build" into lmp-dev

9 years agoFix fugu build
Dave Allison [Fri, 22 Aug 2014 00:22:38 +0000 (17:22 -0700)]
Fix fugu build

Bug: 17188805
Change-Id: Ibbfc759b42ec0f08a1beb35bf52d3ca92b8fe1ea

9 years agoMerge "Make a couple of map checks debug only." into lmp-dev
Brian Carlstrom [Thu, 21 Aug 2014 20:43:54 +0000 (20:43 +0000)]
Merge "Make a couple of map checks debug only." into lmp-dev

9 years agoMake a couple of map checks debug only.
Narayan Kamath [Thu, 21 Aug 2014 16:38:09 +0000 (17:38 +0100)]
Make a couple of map checks debug only.

This cost us close to 80ms in app startup times.

The checks that a reused region was within an already
existent map has been demoted to a debug check.

A couple of other negative checks have been removed
outright because one of them was superflous and the other
wasn't guaranteed to be correct.

bug: 16828525
Change-Id: I00f76de06df0ea4ced40fdcb7825248d4b662045

9 years agoRemove profiler log line
Dave Allison [Thu, 21 Aug 2014 16:45:04 +0000 (09:45 -0700)]
Remove profiler log line

This removes a LOG(INFO) saying that the profile is disabled.

Bug: 17166556
Change-Id: I4ddb4b0f792eb60ed5c927e17d06cff4ae0c073f

9 years agoMerge "Check pending exception result in AllocObjectWithAllocator." into lmp-dev
Mathieu Chartier [Thu, 21 Aug 2014 16:42:31 +0000 (16:42 +0000)]
Merge "Check pending exception result in AllocObjectWithAllocator." into lmp-dev

9 years agoMerge "Fix fault handler to unregister on shutdown" into lmp-dev
Dave Allison [Thu, 21 Aug 2014 16:38:39 +0000 (16:38 +0000)]
Merge "Fix fault handler to unregister on shutdown" into lmp-dev

9 years agoMerge "Add supported architectures to signal test." into lmp-dev
Dave Allison [Thu, 21 Aug 2014 16:38:14 +0000 (16:38 +0000)]
Merge "Add supported architectures to signal test." into lmp-dev

9 years agoCheck pending exception result in AllocObjectWithAllocator.
Mathieu Chartier [Thu, 21 Aug 2014 01:19:23 +0000 (18:19 -0700)]
Check pending exception result in AllocObjectWithAllocator.

Possible previous bug:
Allocation fails due to OOM and the collector transitions.
This caused us to incorrectly retry the allocation with a pending
exception. We now return null if there is a pending exception.

Bug: 17164348
Change-Id: I22eab472afb2fdea6e800963ccb35ec0755ba0e6

9 years agoFix fault handler to unregister on shutdown
Dave Allison [Thu, 21 Aug 2014 00:38:41 +0000 (17:38 -0700)]
Fix fault handler to unregister on shutdown

This fixes a problem with the fault handler where it wasn't
unregistering itself during shutdown of the runtime.

Bug: 17133266
Change-Id: If4758b14ded0fba194897191b1a8d8d7b0b3e6e5

9 years agoAdd supported architectures to signal test.
Dave Allison [Wed, 20 Aug 2014 21:29:39 +0000 (14:29 -0700)]
Add supported architectures to signal test.

This adds ARM, AARCH64, i386 and x86_64 to the supported architectures
in 004-SignalTest

Bug: 16948053
Change-Id: I82b3f053e9340b9e2e8fc04775d03fb0592fa06e

9 years agoAdd null check to CheckVirtualMethod
Mathieu Chartier [Wed, 20 Aug 2014 19:09:38 +0000 (12:09 -0700)]
Add null check to CheckVirtualMethod

There was a runtime SIGSEGV that should have been a check jni
failure.

Also added regression test.

Bug: 16320699
Change-Id: If6c8e73959cefb24e4703f1562cdddb343d86630

9 years agoMerge "Quick compiler: fix Arm64 inline locking code" into lmp-dev
buzbee [Wed, 20 Aug 2014 12:54:11 +0000 (12:54 +0000)]
Merge "Quick compiler: fix Arm64 inline locking code" into lmp-dev

9 years agoQuick compiler: fix Arm64 inline locking code
buzbee [Tue, 19 Aug 2014 23:47:06 +0000 (16:47 -0700)]
Quick compiler: fix Arm64 inline locking code

The Arm64 monitor enter code was incorrectly comparing the
thread ID to zero rather than the lock value to determine if the
inline fast path was doable.  As a result, we ended up always
using the out-of-line case.

This fix delivers a 6% improvement to DeltaBlue.

b/16707253

Change-Id: I499530da84beecf1f3f5c5ebb666e3eb12599ac0

9 years agoMerge "ART: Set default visibility to protected" into lmp-dev
Andreas Gampe [Tue, 19 Aug 2014 19:16:29 +0000 (19:16 +0000)]
Merge "ART: Set default visibility to protected" into lmp-dev

9 years agoCheck for constructor first when installing tracing stubs.
Jeff Hao [Tue, 19 Aug 2014 17:17:36 +0000 (10:17 -0700)]
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

9 years agoMerge "Use homogeneous space compact by default if not low memory." into lmp-dev
Mathieu Chartier [Wed, 20 Aug 2014 23:50:23 +0000 (23:50 +0000)]
Merge "Use homogeneous space compact by default if not low memory." into lmp-dev

9 years agoUse homogeneous space compact by default if not low memory.
Mathieu Chartier [Wed, 20 Aug 2014 21:13:18 +0000 (14:13 -0700)]
Use homogeneous space compact by default if not low memory.

Otherwise we use semispace as the background collector.

Bug: 16401001
Change-Id: I7b20e0888695521604758c98d09f0709fa2158ef

9 years agoMerge "Make apps able to run with a failing patchoat" into lmp-dev
Brian Carlstrom [Tue, 19 Aug 2014 22:30:21 +0000 (22:30 +0000)]
Merge "Make apps able to run with a failing patchoat" into lmp-dev

9 years agoMake apps able to run with a failing patchoat
Alex Light [Thu, 14 Aug 2014 21:16:26 +0000 (14:16 -0700)]
Make apps able to run with a failing patchoat

Bug: 17000769

(cherry picked from commit 9dcc4572949f6a8231a1b4ed859676ba6f411726)

Change-Id: I0a1a4dc7f5d4bb268530840302ecfb1555231e05

9 years agoMerge "Workaround problem reading main stack on intel devices." into lmp-dev
Dave Allison [Tue, 19 Aug 2014 22:08:31 +0000 (22:08 +0000)]
Merge "Workaround problem reading main stack on intel devices." into lmp-dev

9 years agoART: Fix ARM invoke stub, run Generic JNI in jni_compiler_test
Andreas Gampe [Mon, 18 Aug 2014 23:43:12 +0000 (16:43 -0700)]
ART: Fix ARM invoke stub, run Generic JNI in jni_compiler_test

On devices which support it, run all jni compiler tests also with
the Generic JNI infrastructure.

Fix art_quick_invoke_stub for ARM32 to enforce 16B stack alignment.
As the native convention does not require as much, the previous
code would keep it unaligned.

Bug: 17107929

(cherry picked from commit 6e498695b60f1532d2264ec6badb1cd6e10ecaa9)

Change-Id: I1481500ff7c627ab4e5bfbfd7245099a639aa049

9 years agoWorkaround problem reading main stack on intel devices.
Dave Allison [Mon, 18 Aug 2014 22:49:51 +0000 (15:49 -0700)]
Workaround problem reading main stack on intel devices.

This works around a problem where ART can't read the lowest page
of the main stack.  The workaround is to add 4K to the stack
start address on the main stack on Intel.

Please see https://b2.corp.google.com/issues/17111575 for
underlying cause.

Bug: 17031544
Change-Id: Ifc3216e10160bb1eec9d989fd57b10345bc89537

9 years agoMerge "ART: Relax GetInstructionSetFromString" into lmp-dev
Andreas Gampe [Wed, 20 Aug 2014 22:24:11 +0000 (22:24 +0000)]
Merge "ART: Relax GetInstructionSetFromString" into lmp-dev

9 years agoART: Relax GetInstructionSetFromString
Andreas Gampe [Wed, 20 Aug 2014 00:28:06 +0000 (17:28 -0700)]
ART: Relax GetInstructionSetFromString

Do not abort on an unknown instruction set string. Instead return
kNone and let the caller handle this.

Also simplify the patchoat tool to use this.

Bug: 17136416
Change-Id: I24131914bcf91c04ae93179bf809a2907f1f2b7a

9 years agoDisable load/store elimination. DO NOT MERGE
Vladimir Marko [Mon, 18 Aug 2014 10:42:51 +0000 (11:42 +0100)]
Disable load/store elimination. DO NOT MERGE

The optimization has several issues and it has been
effectively disabled by
    https://android-review.googlesource.com/103511
Disable it completely to avoid wasting compilation time.

Bug: 16862804
Change-Id: I42f69ae64170dc44f5fd6455b6a51c9bd3f93672

9 years agoMerge "X86: Fix alias info in GenInlinedIndexOf()." into lmp-dev
Vladimir Marko [Wed, 20 Aug 2014 15:08:59 +0000 (15:08 +0000)]
Merge "X86: Fix alias info in GenInlinedIndexOf()." into lmp-dev

9 years agoX86: Fix alias info in GenInlinedIndexOf().
Vladimir Marko [Tue, 19 Aug 2014 14:00:34 +0000 (15:00 +0100)]
X86: Fix alias info in GenInlinedIndexOf().

For 32-bit X86, GenInlinedIndexOf() pushes and pops EDI. In
one branch it then calls Load32Disp() with adjusted stack
offset. That calculates wrong alias_info for the generated
insn. If left unfixed, this could confuse load hoisting.

Bug: 17128502

(cherry picked from commit 74de63bb1cc275b411cae28a96f9b3a78b939bc2)

Change-Id: I5dc82b7aae9e9655e75843a952b8ebb04269f46b

9 years agoMerge "Fix JDWP event races" into lmp-dev
Sebastien Hertz [Tue, 19 Aug 2014 09:05:47 +0000 (09:05 +0000)]
Merge "Fix JDWP event races" into lmp-dev

9 years agoFix JDWP event races
Sebastien Hertz [Mon, 18 Aug 2014 17:26:39 +0000 (19:26 +0200)]
Fix JDWP event races

Fix a race where the JDWP connection could be closed before the VM_DEATH event
is sent during runtime shutdown.

Fix potential race where we could wait forever for the JDWP thread to establish
connection.

Bug: 16720689

Change-Id: I227e0a15a2fd17d7bfe2a66a35d719d558fcd32d

9 years agoMerge "AttachCurrentThread should only warn on missing thread name if CheckJNI is...
Brian Carlstrom [Tue, 19 Aug 2014 00:42:52 +0000 (00:42 +0000)]
Merge "AttachCurrentThread should only warn on missing thread name if CheckJNI is enabled." into lmp-dev

9 years agoAttachCurrentThread should only warn on missing thread name if CheckJNI is enabled.
Brian Carlstrom [Mon, 18 Aug 2014 22:38:34 +0000 (15:38 -0700)]
AttachCurrentThread should only warn on missing thread name if CheckJNI is enabled.

Bug: 17108693

(cherry picked from commit 3ea69c0abce1b81b3c45033867d49b00e6d6b709)

Change-Id: Ide8158cc3e12e604f4fa344cd881fe6f68476ab7

9 years agoFix heap corruption and verification.
Mathieu Chartier [Mon, 18 Aug 2014 22:02:59 +0000 (15:02 -0700)]
Fix heap corruption and verification.

There was a faulty assumption that space End() was always aligned to
card boundaries. This was true for all spaces other than the image
and resulted in heap corruption when the last object of the image
space contained a reference to an object in another space.

Also fixed an error where we called the pre GC verification post GC.

Bug: 17080623

Change-Id: I041ee564518f53b79c6e8dc2ad782a3152577a4e

9 years agoMerge "ART: Do not recursively abort when visiting locks in a bad state" into lmp-dev
Andreas Gampe [Mon, 18 Aug 2014 05:06:15 +0000 (05:06 +0000)]
Merge "ART: Do not recursively abort when visiting locks in a bad state" into lmp-dev

9 years agoART: Do not recursively abort when visiting locks in a bad state
Andreas Gampe [Sat, 16 Aug 2014 20:41:10 +0000 (13:41 -0700)]
ART: Do not recursively abort when visiting locks in a bad state

This avoids a nested abort in VisitLocks.

Bug: 1708062116382675
Change-Id: Id604976ac9dcac0e319fb25cab4d2cbc98d7ee24

9 years agoART: Avoid expensive class lookup in compiler driver
Andreas Gampe [Sat, 16 Aug 2014 05:35:46 +0000 (22:35 -0700)]
ART: Avoid expensive class lookup in compiler driver

When we are not compiling multidex, avoid an expensive by-descriptor
lookup for classes when deciding whether to skip compilation.

Bug: 17072698
Change-Id: I19bcb2a2928207fcae0badd466cdc52945bd37c4

9 years agoFix bugs in the x86 and arm versions of generic JNI.
Nicolas Geoffray [Wed, 13 Aug 2014 02:40:45 +0000 (03:40 +0100)]
Fix bugs in the x86 and arm versions of generic JNI.

Also fix the run script of 116-nodex2oat to use the non-prebuild
script for target.

Bug: 17000769

(cherry-picked from commit 54accbca0b549b1b1ad3ef09655dad438bc1e104)

Change-Id: I439fcd710fb8bb408f3288ff8fb34fef23890adb