OSDN Git Service

android-x86/art.git
6 years agorelease-request-0ddf2eab-ecaa-4014-951f-9236b1e43859-for-git_oc-release-4075595 snap...
android-build-team Robot [Wed, 7 Jun 2017 07:44:51 +0000 (07:44 +0000)]
release-request-0ddf2eab-ecaa-4014-951f-9236b1e43859-for-git_oc-release-4075595 snap-temp-L43000000071370789

Change-Id: I50202c8b0dc954cdfe8d953b49bcc84be7397b84

6 years agoMerge "Relax an assert in AssertPcIsWithinQuickCode()" into oc-dev
Mingyao Yang [Tue, 6 Jun 2017 22:26:41 +0000 (22:26 +0000)]
Merge "Relax an assert in AssertPcIsWithinQuickCode()" into oc-dev

6 years agoCombine madvise for clearing region space
Mathieu Chartier [Tue, 6 Jun 2017 00:23:44 +0000 (17:23 -0700)]
Combine madvise for clearing region space

Reduce how many madvise calls there are so that the mmap semaphore
has less contention.

Reduces the number of madvice calls from clearing regions when doing
few random camera gestures by ~80%.

Test: test-art-host
Bug: 62194020

Change-Id: I49987a371c5724e6993cfc74e385a03b624352c9

6 years agoRelax an assert in AssertPcIsWithinQuickCode()
Mingyao Yang [Tue, 23 May 2017 21:21:07 +0000 (14:21 -0700)]
Relax an assert in AssertPcIsWithinQuickCode()

Skip the case when pc is jitted code.

Bug: 36467228
Test: m -j20 test-art-host-run-test
Test: test/run-test --host --prebuild --jit --no-relocate --runtime-option -Xcheck:jni --no-image --64 597-deopt-new-string

(Cherry pick from commit 88ca8ba34bbf9d355035330572cc1c3624de022c)

Change-Id: Ie9c325e2eaf7c81f1769abacc2d2615b1c1c97cb

6 years agorelease-request-777c0f47-a42e-446a-b45c-0bb1aaa9612e-for-git_oc-release-4066915 snap...
android-build-team Robot [Sun, 4 Jun 2017 07:13:49 +0000 (07:13 +0000)]
release-request-777c0f47-a42e-446a-b45c-0bb1aaa9612e-for-git_oc-release-4066915 snap-temp-L92300000070444114

Change-Id: I4d363dd5b611e28975216b2f5d0e3a1eab5827f1

7 years agoMerge "Move to release CAS for updating object fields" into oc-dev
Mathieu Chartier [Fri, 2 Jun 2017 16:38:13 +0000 (16:38 +0000)]
Merge "Move to release CAS for updating object fields" into oc-dev

7 years agoMerge "Revert "Change thread suspend timeout to be fatal for non-debug"" into oc-dev
Mathieu Chartier [Fri, 2 Jun 2017 04:01:40 +0000 (04:01 +0000)]
Merge "Revert "Change thread suspend timeout to be fatal for non-debug"" into oc-dev

7 years agoMerge "sigchain: properly block signal when we forward." into oc-dev
TreeHugger Robot [Fri, 2 Jun 2017 02:33:24 +0000 (02:33 +0000)]
Merge "sigchain: properly block signal when we forward." into oc-dev

7 years agoRevert "Change thread suspend timeout to be fatal for non-debug"
Mathieu Chartier [Fri, 2 Jun 2017 01:45:10 +0000 (18:45 -0700)]
Revert "Change thread suspend timeout to be fatal for non-debug"

For overloaded systems, 10s might not be enough. Infinite seconds
will be though.

Bug: 37221387

Test: test-art-host

This reverts commit d69f82e155118654d989f0b436c019fb6d517341.

Change-Id: I8ac0e13e6bdae1845803682215e1794d892de8e5

7 years agoHandle gracefully profiles with invalid classes or methods
Calin Juravle [Fri, 26 May 2017 23:40:45 +0000 (16:40 -0700)]
Handle gracefully profiles with invalid classes or methods

Bug: 38410980
Test: m test-art-host-run-test-707

(cherry picked from commit 08556886a16ff2bb9fc3f184ac699de21c0369cd)

Merged-In: Id28aa1eb333f0f4843722d091c6c7a877c0c78f6
Change-Id: I64f8e3baa7860571e3dc249ce218d4a0eb59d84d

7 years agoMove to release CAS for updating object fields
Mathieu Chartier [Thu, 1 Jun 2017 18:26:50 +0000 (11:26 -0700)]
Move to release CAS for updating object fields

Relaxed cas is not sufficient to make sure threads that read the
field will see the copied contents of objects.

Bug: 37187694
Bug: 62240510

Test: test-art-host

Change-Id: I1239817e2b63e0e43ac3ae3148b73487408b378b

7 years agosigchain: properly block signal when we forward.
Josh Gao [Thu, 1 Jun 2017 03:24:51 +0000 (20:24 -0700)]
sigchain: properly block signal when we forward.

The previous code incorrectly chose to unblock the received signal when
SA_NODEFER was passed, instead of blocking the signal when SA_NODEFER
was not passed.

Bug: http://b/38305752
Bug: http://b/62189102
Bug: http://b/62202711
Test: m test-art-host
Merged-In: I2a7176b2a9fc7cdd0193face46f6d14a617ca814
Change-Id: I2a7176b2a9fc7cdd0193face46f6d14a617ca814
(cherry picked from commit 04de4fe1a9999c9a2dea724d70efd91a87d8f9b0)

7 years agorelease-request-49d3fda6-f7aa-4b8d-aeeb-eed9adb96e3c-for-git_oc-release-4053943 snap...
android-build-team Robot [Wed, 31 May 2017 07:12:19 +0000 (07:12 +0000)]
release-request-49d3fda6-f7aa-4b8d-aeeb-eed9adb96e3c-for-git_oc-release-4053943 snap-temp-L63500000069017893

Change-Id: I3de5abbf531e06d93202e575b7a4c9d145685a79

7 years agoMerge "Flush data cache after updating the JIT table." into oc-dev
TreeHugger Robot [Tue, 30 May 2017 10:21:14 +0000 (10:21 +0000)]
Merge "Flush data cache after updating the JIT table." into oc-dev

7 years agorelease-request-fca2b5ac-03eb-4055-a549-b4fc2b292b64-for-git_oc-release-4049993 snap...
android-build-team Robot [Sun, 28 May 2017 07:21:43 +0000 (07:21 +0000)]
release-request-fca2b5ac-03eb-4055-a549-b4fc2b292b64-for-git_oc-release-4049993 snap-temp-L04900000068539456

Change-Id: Ib53d28287bad06e43823cc0b3c924cb449eec7c3

7 years agoUse arena allocation for profiles
Calin Juravle [Fri, 19 May 2017 23:47:53 +0000 (16:47 -0700)]
Use arena allocation for profiles

By using our arena allocator we can madvise the memory used during
profile processing right way. jemalloc may defer the release based on
unpredictable native allocation.

The other advantage of arenas is a much simpler way to measure the
memory needed by profiles.

Test: m test-art-host
Test: manual inspection with meminfo and heaptrack
Bug: 37711886

(cherry picked from commit cc3171ab3af35b4e4ad5671d7425aa8a6bfcc5f3)

This change also squashes 2 fixes on the orginal submit.
(cherry picked from commit 798ba16bda747d74a27b7a748d3bb5deb2ccbf68)
(cherry picked from commit e6f87cc95e5351f3872a4c50e18915a282578ff8)

(partial cherry picked from commit
55232f13e4a34ab36c13f337642b57f9def00da8 to fix dexdiag formating and
please the bot)

Merged-In: I2066b6654438474c10b17d5d92538a6095748684
Change-Id: I91741229a807c777631ef324fc3f397c9a0c18e3

Bug: 37711886

7 years agoMerge "Do not deopt when using AOT inline caches" into oc-dev
Calin Juravle [Fri, 26 May 2017 16:14:28 +0000 (16:14 +0000)]
Merge "Do not deopt when using AOT inline caches" into oc-dev

7 years agoMerge "Record inline caches only for the strictly hot methods" into oc-dev
Calin Juravle [Fri, 26 May 2017 16:14:14 +0000 (16:14 +0000)]
Merge "Record inline caches only for the strictly hot methods" into oc-dev

7 years agoFlush data cache after updating the JIT table.
Nicolas Geoffray [Thu, 25 May 2017 11:54:31 +0000 (12:54 +0100)]
Flush data cache after updating the JIT table.

Otherwise, other cores could see an incomplete table when executing
the new code.

bug: 37949368
Test: test.py --jit

(cherry picked from commit 352b17af5263b27cad7a1dbf2351f9cb71d6af58)

Change-Id: Ib1e4d2386477cb537b5921bb395e4bcd0ff760b7

7 years agoDo not deopt when using AOT inline caches
Calin Juravle [Tue, 23 May 2017 21:24:55 +0000 (14:24 -0700)]
Do not deopt when using AOT inline caches

Generating a deopt does not ensure that we will actually capture the new
types; and the danger is that we could be stuck in a loop with "forever"
deoptimizations. For example, if the method never becomes hot again, the
inline cache will not be updated and the AOT code will keep
deoptimizing.

This is a compromise because we will most likely never update the inline
cache (unless there's another reason to deopt). So we might be stuck
with a sub-optimal inline cache. As a TODO, we could be smarter when
capturing inline caches to mitigate this. (e.g. by having different
thresholds for new and old methods).

Delete test 644 which was testing a regression involving deopts which is
no longer applicable.

Bug: 38412648
Test: m test-art-host

(cherry picked from commit af44e6c5ca0169bc19c6263288a7d889b37db549)

Merged-In: Ib57f9c35ddbc95646aa352ab017e8b59d9466595
Change-Id: I307826bbdc3f994ea12a66243a31f148995f348b

7 years agoRecord inline caches only for the strictly hot methods
Calin Juravle [Thu, 18 May 2017 17:15:52 +0000 (10:15 -0700)]
Record inline caches only for the strictly hot methods

Warm methods might have incomplete inline caches which could cause
unnecessary deoptimizations.

Test: m test-art-host
Bug: 38426301
Bug: 38412648

(cherry picked from commit a39fd980000d10ee0b3a49555cc8bcbbfacde943)

Change-Id: I12e2c068663e8bb948dcd7ba89d0c1d4c9118153

7 years agoRecord types when the interpreter executes intrinsics.
Nicolas Geoffray [Wed, 24 May 2017 14:59:18 +0000 (15:59 +0100)]
Record types when the interpreter executes intrinsics.

Otherwise, we could keep on deopting, as the JIT compiler wouldn't
see those types when doing inlining decisions.

bug: 37655083
Test: 652-deopt-intrinsic

(cherry picked from commit b9bec2e3846f3f500ca1354c849a81dfbb095b6b)

Change-Id: I8918626f78255ab2f6f2fd2f51017fb9fa7d4f99

7 years agorelease-request-33b11ddd-d658-45bf-bdb2-acceb024fe39-for-git_oc-release-4042766 snap...
android-build-team Robot [Thu, 25 May 2017 07:16:37 +0000 (07:16 +0000)]
release-request-33b11ddd-d658-45bf-bdb2-acceb024fe39-for-git_oc-release-4042766 snap-temp-L87400000067730042

Change-Id: I3133b665b93b4b18f4c4caaaf5fcfc4d3d7cf570

7 years agoUse HeapGrowthMultiplier for native allocaitons
Mathieu Chartier [Wed, 24 May 2017 19:01:04 +0000 (12:01 -0700)]
Use HeapGrowthMultiplier for native allocaitons

Reduces the amount of native allocation GCs for foreground apps.
For camera: The number of native allocations GCs goes from 4 to 2,
improving launch time by 25ms (average of 25 runs on pixel).

The multiplier is 1 for low ram devices, so this should not increase
RAM on devices where it matters.

Bug: 36727951
Test: test-art-host

Change-Id: I0b9e090d9d85bcb2fcd24f221988e99b91ec5977

7 years agoMerge cherrypicks of [2297119, 2297050, 2297018, 2297140] into oc-release
android-build-team Robot [Mon, 22 May 2017 23:38:49 +0000 (23:38 +0000)]
Merge cherrypicks of [2297119229705022970182297140] into oc-release

Change-Id: Ie47fcda2263633a6df6b005e461d15b2f76dfe6f

7 years agoGo to suspended before waiting for GC to complete.
Mathieu Chartier [Fri, 19 May 2017 20:05:06 +0000 (13:05 -0700)]
Go to suspended before waiting for GC to complete.

We are not allowed to wait on the GC complete lock while holding the
mutator lock.

Bug: 38449715
Bug: 38350590

Test: test-art-host

(cherry picked from commit b93d5b1f39fb0651dfe2f165ad1431c962f5a78e)

Change-Id: Ib5b6d99b82f0c4a999bfcbbb1f5271da41a51040
(cherry picked from commit 5dc8a08723afa5373abf6ccfc7c0fd57eb7a2936)

7 years agorelease-request-c72e46fd-06a9-4104-bad3-f7ba8aeb3e1d-for-git_oc-release-4029917 snap...
android-build-team Robot [Sun, 21 May 2017 07:12:55 +0000 (07:12 +0000)]
release-request-c72e46fd-06a9-4104-bad3-f7ba8aeb3e1d-for-git_oc-release-4029917 snap-temp-L38800000066299680

Change-Id: I9b5163209ed3f5ab8249aab1fee5c543b6cc27b3

7 years agoGo to suspended before waiting for GC to complete.
Mathieu Chartier [Fri, 19 May 2017 20:05:06 +0000 (13:05 -0700)]
Go to suspended before waiting for GC to complete.

We are not allowed to wait on the GC complete lock while holding the
mutator lock.

Bug: 38449715
Bug: 38350590

Test: test-art-host

(cherry picked from commit b93d5b1f39fb0651dfe2f165ad1431c962f5a78e)

Change-Id: Ib5b6d99b82f0c4a999bfcbbb1f5271da41a51040

7 years agoMerge "Also return vdex file from DexFile.getDexFileOutputPath" into oc-dev
Calin Juravle [Fri, 19 May 2017 16:56:37 +0000 (16:56 +0000)]
Merge "Also return vdex file from DexFile.getDexFileOutputPath" into oc-dev

7 years agoMerge "Send holder to Mark in ConcurrentCopying::Process for GC verification" into...
Mathieu Chartier [Thu, 18 May 2017 23:15:05 +0000 (23:15 +0000)]
Merge "Send holder to Mark in ConcurrentCopying::Process for GC verification" into oc-dev

7 years agoMerge "Use GC critical section for profile saver" into oc-dev
Mathieu Chartier [Thu, 18 May 2017 23:11:31 +0000 (23:11 +0000)]
Merge "Use GC critical section for profile saver" into oc-dev

7 years agoAlso return vdex file from DexFile.getDexFileOutputPath
Calin Juravle [Tue, 16 May 2017 01:18:39 +0000 (18:18 -0700)]
Also return vdex file from DexFile.getDexFileOutputPath

Test: m test-art-host
      device boots
Bug: 33168521

(cherry picked from commit 367b9d8694b28896f681f00195cf4980536fe3f3)

Change-Id: I3307e9aa60331b2c78efc6a33632dce12d8b38b7

7 years agoSend holder to Mark in ConcurrentCopying::Process for GC verification
Mathieu Chartier [Thu, 18 May 2017 17:01:07 +0000 (10:01 -0700)]
Send holder to Mark in ConcurrentCopying::Process for GC verification

Aims to log more when heap corruption is detected.

Test: test-art-host-gtest-verification_test
Test: test-art-host

Bug: 38409177
Bug: 37187694

(cherry picked from commit 4ce0c765cf7bcaba4da4990b7b9c1f115ec25198)

Change-Id: I8907923ce67c6040ea467b4e3ae00a4b607f8c7c

7 years agoUse GC critical section for profile saver
Mathieu Chartier [Wed, 17 May 2017 20:14:10 +0000 (13:14 -0700)]
Use GC critical section for profile saver

Since visit classes uses DecodeWeakGlobal, it may block on decoding
weak globals. This can cause deadlocks since it will be blocked while
holding the classlinker classes lock.

Using a GC critical section ensures that the GC is not running while
we visit the classes for the profile saver.

I didn't put the logic in the VisitClasses call since some of the
callers already have no thread suspension checks that would fail from
this.

Bug: 38350590
Test: test-art-host ART_TEST_JIT=true

(cherry picked from commit 39100372d5131b3327e5af076a949da9eb6f7a33)

Change-Id: I1b8350638ce0a0486b2672100e582dc3a049b0fd

7 years agoMerge "Fix ProfileSaver logging" into oc-dev
Nicolas Geoffray [Thu, 18 May 2017 13:27:49 +0000 (13:27 +0000)]
Merge "Fix ProfileSaver logging" into oc-dev

7 years agoMerge "Revert "Revert "Use IsMarked instead of Mark for profiling info.""" into oc-dev
Nicolas Geoffray [Thu, 18 May 2017 13:00:38 +0000 (13:00 +0000)]
Merge "Revert "Revert "Use IsMarked instead of Mark for profiling info.""" into oc-dev

7 years agorelease-request-60f55d52-4657-4714-89dc-b6443475d767-for-git_oc-release-4022373 snap...
android-build-team Robot [Thu, 18 May 2017 07:14:12 +0000 (07:14 +0000)]
release-request-60f55d52-4657-4714-89dc-b6443475d767-for-git_oc-release-4022373 snap-temp-L45500000065414617

Change-Id: I42201fff3f019509c3c9278d76755edfccd0df49

7 years agoFix ProfileSaver logging
Calin Juravle [Thu, 18 May 2017 05:02:07 +0000 (22:02 -0700)]
Fix ProfileSaver logging

The LOG(ERROR) should have been a LOG(WARNING) and because the
run-test captures the errors, test 595 is failing.

Test: m test-art-host-run-test-595-profile-saving
Bug: 37711886
Change-Id: I69fa46d763e8e5f59c0f6a9778f725ee559eff6a

7 years agoMerge "Do not cache profiles in the ProfileSaver." into oc-dev
Calin Juravle [Wed, 17 May 2017 21:00:11 +0000 (21:00 +0000)]
Merge "Do not cache profiles in the ProfileSaver." into oc-dev

7 years agorelease-request-6c498b17-9310-412b-ad36-3dcf25ffef73-for-git_oc-release-4017086 snap...
android-build-team Robot [Wed, 17 May 2017 07:16:26 +0000 (07:16 +0000)]
release-request-6c498b17-9310-412b-ad36-3dcf25ffef73-for-git_oc-release-4017086 snap-temp-L16500000064871237

Change-Id: I3640eb075e7872886322dd51433e5b679cf1593b

7 years agosigchain: limit use of SetHandlingSignal.
Josh Gao [Thu, 4 May 2017 20:55:28 +0000 (13:55 -0700)]
sigchain: limit use of SetHandlingSignal.

The native bridge and user signal handlers are able to not return to
our signal handler, leaving the HandlingSignal flag set to true for the
rest of the lifetime of the thread. Fix this by only using
SetHandlingSignal for handlers that we know will return (i.e. the ART
fault handler).

This effectively reverts commit 90444558, which means sigprocmask's
behavior is back to filtering out claimed signals when inside a user
signal handler.

Include an update to test/115-native-bridge from Zhenhua Wang, to make
sure we keep handling signals when a signal handler longjmps away
instead of returning.

Bug: http://b/37988407
Test: m test-art-host
Test: m test-art-target
Change-Id: Ia7159ddfa38f1f055e5cd6089c849a208d335752
(cherry picked from commit 6b2018f4b847a60f39c86d67e1cae8a00ce977bc)

7 years agosigchain: always call InitializeSignalChain on startup.
Josh Gao [Thu, 27 Apr 2017 02:09:47 +0000 (19:09 -0700)]
sigchain: always call InitializeSignalChain on startup.

Processes that link against libsigchain because they might want to
dynamically load libart.so (e.g. surfaceflinger) might never explicitly
call InitializeSignalChain. In this scenario, the lazy initialization
that occurs when sigprocmask is called can happen at unexpected times,
such as from pthread_exit, leading to deadlocks or crashes.

Add __attribute__((constructor)) to InitializeSignalChain to have it be
automatically called upon process start. Keep the existing calls to it
in the wrapper functions in order to sidestep problems around static
initialization order.

Bug: https://issuetracker.google.com/37119593
Test: run-test 004-SignalTest
Test: m test-art-host
Test: m test-art-target
Change-Id: I7906c1f625ccca0350ea9310140a3f43a657be4c
(cherry picked from commit fd4d0d3eb9b5c7fe2fa1df97d9c0763900b2be52)

7 years agoAdd test for getError() of NativeBridge.
Yanbing Jiang [Tue, 17 Jan 2017 05:23:43 +0000 (13:23 +0800)]
Add test for getError() of NativeBridge.

NativeBridge v3 introduced getError() of which the functionality
is same as dlerror(). This patch forces the routine of ART to
NativeBridge to execute getError() on ART host test by loading
invalid library from Java.

Test: make test-art-host-run-test-115-native-bridge
Change-Id: Iba389c22b6587176cbfe57d42af49041560c5b00
Signed-off-by: Zhenhua WANG <zhenhua.wang@intel.com>
(cherry picked from commit 2abb686ddbf7c8fe54f2c1cb41ab90d7c8b04c7a)

7 years agoDo not cache profiles in the ProfileSaver.
Calin Juravle [Sat, 13 May 2017 02:18:47 +0000 (19:18 -0700)]
Do not cache profiles in the ProfileSaver.

Profiles with a lot of inline caches have a large memory
footprint. Do not cache them in the saver anymore.

The cache was useful to avoid doing unnecessary IO but it
takes too much memory now. Disable it until we update the
profile format to take less space.

This trades off IO for memory. As an effect we will do one extra
read to detect if we have enough new information worth saving. The
saving period has been increased to 40secs (from 20) in a previous
CL which also helps to balance the IO.

Test: m test-art-host-gtest
      manual inspection with meminfo
Bug: 37711886

(cherry picked from commit ea220658bf6ff920c5a6c658e4643da09560d278)

Change-Id: Iddf93b2f07faf4c897ac43931f41aa1e8c2a6bc4

7 years agoMerge "ART: Fix iterator invalidation" into oc-dev
TreeHugger Robot [Tue, 16 May 2017 20:21:21 +0000 (20:21 +0000)]
Merge "ART: Fix iterator invalidation" into oc-dev

7 years agoMerge "Fix determinism for app images" into oc-dev
Mathieu Chartier [Tue, 16 May 2017 19:53:12 +0000 (19:53 +0000)]
Merge "Fix determinism for app images" into oc-dev

7 years agoFix determinism for app images
Mathieu Chartier [Fri, 12 May 2017 23:07:28 +0000 (16:07 -0700)]
Fix determinism for app images

Clear the dalvik.system.DexFile cookie to make the long array
unreachable before the GC.

Test: test-art-host
Test: Ran 10x: mma -j40 && shasum $OUT/system/framework/oat/arm64/services.* && rm $OUT/system/framework/oat/arm64/services.* && rm $OUT/obj/JAVA_LIBRARIES/services_intermediates/oat/arm64/*

Bug: 34090128

(cherry picked from commit 3738e98cb8833b24e998ec3b6906bf58850741c3)

Change-Id: I5a872de3e907461803a77254902d78ff6e657b43

7 years agoART: Fix iterator invalidation
Andreas Gampe [Tue, 16 May 2017 02:26:38 +0000 (19:26 -0700)]
ART: Fix iterator invalidation

Erasing an item of a map invalidates the iterator.

(cherry picked from commit 39e673811d73ac09a822d9ee0082bba5d8e8cbad)

Bug: 38324641
Test: m test-art-host
Change-Id: I9f7499eb4a4b49e4fcd6c99d170d9b681adfd9b0

7 years agoRevert "Revert "Use IsMarked instead of Mark for profiling info.""
Nicolas Geoffray [Thu, 11 May 2017 11:48:28 +0000 (11:48 +0000)]
Revert "Revert "Use IsMarked instead of Mark for profiling info.""

Bug in the original change was that we were infitely looping on the
same inline cache entry, expecting null when it was actually an old
pointer to a GC'ed class object.

bug: 37693252
Test: test.py --jit

This reverts commit 3afefba4b5558f5f726338485c1f6ddc7f107719.

(cherry picked from commit 13056a1720aca64945541812a3c7602acfe4a937)

Change-Id: Ia637d4a7db4394964d1de5c92370921c98a103fa

7 years agorelease-request-951b3a8b-6c0c-4d2e-8af4-1c3f7e209f66-for-git_oc-release-4006899 snap...
android-build-team Robot [Sun, 14 May 2017 07:18:31 +0000 (07:18 +0000)]
release-request-951b3a8b-6c0c-4d2e-8af4-1c3f7e209f66-for-git_oc-release-4006899 snap-temp-L39600000063784275

Change-Id: Idf3aaabef15fa4bccfdaf9700687dfb698c84791

7 years agoMerge "Clear odex/vdex/art file before running run-test" into oc-dev
Calin Juravle [Sat, 13 May 2017 01:47:42 +0000 (01:47 +0000)]
Merge "Clear odex/vdex/art file before running run-test" into oc-dev

7 years agoMerge "Use a sentinel when clearing JIT table entries." into oc-dev
TreeHugger Robot [Fri, 12 May 2017 09:52:48 +0000 (09:52 +0000)]
Merge "Use a sentinel when clearing JIT table entries." into oc-dev

7 years agoClear odex/vdex/art file before running run-test
Calin Juravle [Thu, 11 May 2017 07:36:53 +0000 (00:36 -0700)]
Clear odex/vdex/art file before running run-test

This allows individual tests to call the RUN script
multiple times.

Test: ./test/testrunner/testrunner.py [--host|--target] [--no-prebuild]
Bug: 38213479

(cherry picked from commit 24bd3f9d63c81f448b7fe1854742fda0343a2297)

Change-Id: I9243b448f3601dec02615699a5bca7dd7472de53

7 years agoMerge changes I93c26ff3,I0dc1a141,I3a140ce0 into oc-dev
TreeHugger Robot [Thu, 11 May 2017 15:28:50 +0000 (15:28 +0000)]
Merge changes I93c26ff3,I0dc1a141,I3a140ce0 into oc-dev

* changes:
  ART: Add IterateThroughHeapExt
  ART: Refactor IterateThroughHeap
  ART: Add Heap JVMTI extension API

7 years agoUse a sentinel when clearing JIT table entries.
Nicolas Geoffray [Wed, 10 May 2017 14:09:35 +0000 (15:09 +0100)]
Use a sentinel when clearing JIT table entries.

This can help diagnosing crashes we see.

bug: 38128052
bug: 37949368
Test: test.py --jit

(cherry picked from commit 6ca115b5fa185a2cc162a453f425efd87d8f38bd)

Change-Id: Ib048f72cef7acfdb15f515c63a2ff0ac8e3744ce

7 years agoMerge "Handle safe mode in PackageManager." into oc-dev
Nicolas Geoffray [Thu, 11 May 2017 09:43:44 +0000 (09:43 +0000)]
Merge "Handle safe mode in PackageManager." into oc-dev

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Thu, 11 May 2017 07:07:11 +0000 (00:07 -0700)]
merge in oc-release history after reset to oc-dev

7 years agoART: Add IterateThroughHeapExt
Andreas Gampe [Wed, 10 May 2017 00:14:58 +0000 (17:14 -0700)]
ART: Add IterateThroughHeapExt

Add another heap extension. This is the same as IterateThroughHeap,
but delivers an additional parameter to the callback that is the
heap id.

(cherry picked from commit 2eb25e4513778c568919f99a053a79df3a5bbe17)

Bug: 37283268
Test: m test-art-host
Change-Id: I93c26ff3afe4205f00f2e4ed871384f862886746

7 years agoART: Refactor IterateThroughHeap
Andreas Gampe [Tue, 9 May 2017 23:04:20 +0000 (16:04 -0700)]
ART: Refactor IterateThroughHeap

Factor out callback. In preparation for extension API.

(cherry picked from commit f787fd3bc5476f73edb1722b4f6a09d52f69cd12)

Bug: 37283268
Test: m test-art-host
Change-Id: I0dc1a141afe43a415be9326bed24bd835dbbdc8c

7 years agoART: Add Heap JVMTI extension API
Andreas Gampe [Thu, 4 May 2017 04:40:26 +0000 (21:40 -0700)]
ART: Add Heap JVMTI extension API

Add extension API for Android heaps. Add a function that returns
the heap id for a tag (implying an object). Add a function that
returns the heap name for a given heap id.

Add tests.

(cherry picked from commit d73aba4f0c95914cc51144b0b609d9293e5341cf)

Bug: 37283268
Test: m test-art-host
Test: art/test/testrunner/testrunner.py -b --host -t 913
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest913HostTestCases
Change-Id: I3a140ce00a33507c9ac3263d0badd10f3daf558c

7 years agoMerge "ART: Fix GetErrorName." into oc-dev
TreeHugger Robot [Wed, 10 May 2017 20:11:43 +0000 (20:11 +0000)]
Merge "ART: Fix GetErrorName." into oc-dev

7 years agoMerge "Fix page accounting for multidex" into oc-dev
David Sehr [Wed, 10 May 2017 19:46:32 +0000 (19:46 +0000)]
Merge "Fix page accounting for multidex" into oc-dev

7 years agoART: Fix GetErrorName.
Andreas Gampe [Mon, 8 May 2017 21:50:47 +0000 (14:50 -0700)]
ART: Fix GetErrorName.

Add missing case for JVMTI_ERROR_THREAD_SUSPENDED. Also return
JVMTI_ERROR_ILLEGAL_ARGUMENT for unspecified inputs.

Refactor the code
* Remove the switch default case for case checking
* Use a lambda to unify the return code. This saves 4K of so size.

Add a test.

(cherry picked from commit 95c466dd3348a875e42f8d5b85bd7eaddfb43cb9)

Bug: 38133825
Test: m
Test: art/test/testrunner/testrunner.py -b --host -t 901
Change-Id: If46b276b8abcd8b7b8ebbac1106f6b840761b997

7 years agoMerge "Fix braino in enum use." into oc-dev
TreeHugger Robot [Wed, 10 May 2017 16:07:49 +0000 (16:07 +0000)]
Merge "Fix braino in enum use." into oc-dev

7 years agoMerge "ART: Fix null dereference for JSR45" into oc-dev
TreeHugger Robot [Wed, 10 May 2017 15:35:54 +0000 (15:35 +0000)]
Merge "ART: Fix null dereference for JSR45" into oc-dev

7 years agoMerge "Honor --force-determinism for vdex." into oc-dev
Nicolas Geoffray [Wed, 10 May 2017 14:05:15 +0000 (14:05 +0000)]
Merge "Honor --force-determinism for vdex." into oc-dev

7 years agoFix braino in enum use.
Nicolas Geoffray [Wed, 10 May 2017 11:04:49 +0000 (12:04 +0100)]
Fix braino in enum use.

bug:37655083
Test: jdwp

(cherry picked from commit 81cc43e7d3c4dcd197b3d3a0fa9d1a3be9413367)

Change-Id: I566cc66efc6e1377c53650bfca9e4ffa2ffcb533

7 years agoMerge "Add runtime reasons for deopt." into oc-dev
Nicolas Geoffray [Wed, 10 May 2017 13:53:35 +0000 (13:53 +0000)]
Merge "Add runtime reasons for deopt." into oc-dev

7 years agoART: Fix null dereference for JSR45
Orion Hodson [Tue, 9 May 2017 08:51:35 +0000 (09:51 +0100)]
ART: Fix null dereference for JSR45

Avoid dereferencing DEX cache pointer if it is null. Arrays and
primitive types do not have DEX cache's installed.

Test: art/tools/run-jdwp-tests.sh --mode=host
Bug: 38126955

(Cherry pick from commit cf7127b4a368ed26eaf257286173d5337f67a0a7)

Change-Id: Ie9219c688d009d28d090a75913af86d5d3ee7df6

7 years agoHonor --force-determinism for vdex.
Nicolas Geoffray [Fri, 28 Apr 2017 13:56:39 +0000 (14:56 +0100)]
Honor --force-determinism for vdex.

b/37442966
Test: build

(cherry picked from commit 46847395470e414cd2aa1c6ea13e9a3d08e2b46b)

Change-Id: I6b72b9d0d69f42a4f1ca46403647a172bb2c6e84

7 years agoMerge "Don't use free list LOS for --force-determinism." into oc-dev
TreeHugger Robot [Wed, 10 May 2017 12:00:31 +0000 (12:00 +0000)]
Merge "Don't use free list LOS for --force-determinism." into oc-dev

7 years agoHandle safe mode in PackageManager.
Nicolas Geoffray [Wed, 3 May 2017 12:08:36 +0000 (13:08 +0100)]
Handle safe mode in PackageManager.

ART side of the change.

bug:37929796
Test: manual OTA with a safemode app.

(cherry picked from commit 741d426f2eda2ea1f1a8d7dfce1cd741a6737cc6)

Change-Id: Ibdcd10392697188eb9cc7e572fc6224722db2987

7 years agoAdd runtime reasons for deopt.
Nicolas Geoffray [Mon, 8 May 2017 08:34:26 +0000 (09:34 +0100)]
Add runtime reasons for deopt.

Currently to help investigate. Also:
1) Log when deoptimization happens (which method and what reason)
2) Trace when deoptimization happens (to make it visible in systrace)

bug:37655083
Test: test-art-host test-art-target

(cherry picked from commit 4e92c3ce7ef354620a785553bbada554fca83a67)

Change-Id: I992398a1038ab61ea0e5106af6b6ad0a3305312e

7 years agoMerge "Be defensive in dex2oat when updating the vdex in-place." into oc-dev
Nicolas Geoffray [Wed, 10 May 2017 10:47:49 +0000 (10:47 +0000)]
Merge "Be defensive in dex2oat when updating the vdex in-place." into oc-dev

7 years agoBe defensive in dex2oat when updating the vdex in-place.
Nicolas Geoffray [Tue, 9 May 2017 12:23:34 +0000 (13:23 +0100)]
Be defensive in dex2oat when updating the vdex in-place.

Invalidate the vdex header before doing any writing, in case
dex2oat gets killed in the middle.

bug: 38113240
Test: test.py --speed-profile
Test: test.py 629-vdex

(cherry picked from commit 36930eca8cd6ed2bb78da0c1d013db6a92d80670)

Change-Id: I95c1f0a7b56646a9fbd0e0264ef698a44d79c474

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Wed, 10 May 2017 07:07:14 +0000 (00:07 -0700)]
merge in oc-release history after reset to oc-dev

7 years agoFix page accounting for multidex
David Sehr [Tue, 9 May 2017 22:41:09 +0000 (15:41 -0700)]
Fix page accounting for multidex

Dexdiag was using the offset into the mapping rather than into the dex
file for determining the types of pages.  This resulted in multidex
files having incorrect accounting.

Bug: 38181622
Test: make test-art-target-gtest-dexdiag_test
Change-Id: I00a4e21db5f57f75642a17e8edaa9c73b8b529b6

7 years agoLower flock LOG(FATAL) to LOG(WARNING)
Alex Light [Mon, 8 May 2017 17:18:47 +0000 (10:18 -0700)]
Lower flock LOG(FATAL) to LOG(WARNING)

Failing to unlock a file should not be a fatal error.

The lock will usually be cleared right after this anyway by the file
being closed. Even if it isn't though this should not cause deadlocks
since most places either don't retry if they don't get the lock the
first time or are separate binaries (such as dex2oat) that are run
with external timeouts.

Bug: 36369345
Test: ./test.py --host -j40
Change-Id: Icd783c038de3c263805e8de1bbc35b2ee8918340
(cherry picked from commit 9c48ee5bac5ef0d0af9c1ab079452c954affa019)

7 years agoMerge "Bump oat version after compiler filter name changes." into oc-dev
Nicolas Geoffray [Tue, 9 May 2017 08:17:02 +0000 (08:17 +0000)]
Merge "Bump oat version after compiler filter name changes." into oc-dev

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Tue, 9 May 2017 07:07:16 +0000 (00:07 -0700)]
merge in oc-release history after reset to oc-dev

7 years agoMerge "Do not fsync profiles on close" into oc-dev
TreeHugger Robot [Tue, 9 May 2017 02:20:16 +0000 (02:20 +0000)]
Merge "Do not fsync profiles on close" into oc-dev

7 years agoDo not fsync profiles on close
Calin Juravle [Fri, 28 Apr 2017 02:30:16 +0000 (19:30 -0700)]
Do not fsync profiles on close

There's no need to fsync profile data right away. We get
many chances to write it again in case something goes
wrong. We can rely on a simple close(), no sync, and let
the kernel decide when to write to disk. This should
improve the I/O behavior of saving profiles.

Bug: 36817443
Test: m test-art-host-gtest

(cherry picked from commit df674c45091d01f504bf1bb7d241678ecd449ae0)

Change-Id: Idf503beccf912e26f31abbcf66087afb9a8fe138

7 years agoResolve the tracked locations in profile saver
Calin Juravle [Sat, 6 May 2017 00:27:23 +0000 (17:27 -0700)]
Resolve the tracked locations in profile saver

The profile saver takes the dex locations it has to track as they are.
On the buildbot the locations are symlinked, but the dex file may be
compiled with an absolute path. This may cause a mismatch and cause the
dex file to not be profiled (test 595-profile-saving will fail).

Note that this is a valid use case in production as well. It may happen
for secondary dex files which can be loaded via symlinks.

Test: test/run-test --output-path /tmp/link --always-clean --host --prebuild --interpreter --no-relocate --runtime-option -Xcheck:jni --no-image --64 595-profile-saving
       test/run-test  --output-path /tmp/link --always-clean --host
--no-prebuild --jit --no-relocate --runtime-option -Xcheck:jni
--runtime-option -verbose:profiler --64  595-profile-saving

Bug: 36605597

(cherry picked from commit 8b5d9b614ad9f13e2cb62d4956252677cd71add1)

Change-Id: I43866c6cf7ce6f33ac4386bb4fe07b88bb35e793

7 years agoDon't use free list LOS for --force-determinism.
Nicolas Geoffray [Wed, 3 May 2017 14:04:55 +0000 (15:04 +0100)]
Don't use free list LOS for --force-determinism.

If the maximum capacity is too large, we can fail mapping the memory
required for it. See:
https://android-build.googleplex.com/builds/pending/P4254206/aosp_arm64-eng/latest)

So instead just disable the LOS.

Also fix concurrent collector assuming there is always a LOS.

Test: build
bug: 37442966

(cherry picked from commit 7acddd83065bc8b12ade9528a84e6fcadda21250)

Change-Id: Iec9f8139806a99af16212906315ab906ee2c9b3f

7 years agoBump oat version after compiler filter name changes.
Nicolas Geoffray [Fri, 5 May 2017 09:27:58 +0000 (10:27 +0100)]
Bump oat version after compiler filter name changes.

bug:37988580
Test: build

(cherry picked from commit f977691961b5a49a074a535fcb29a5ad4a318974)

Change-Id: If52e569b6403a8b3f2e31d472b6d11ab42d13763

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Sun, 7 May 2017 07:07:22 +0000 (00:07 -0700)]
merge in oc-release history after reset to oc-dev

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Sat, 6 May 2017 02:28:59 +0000 (19:28 -0700)]
merge in oc-release history after reset to oc-dev

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Sat, 6 May 2017 01:43:56 +0000 (18:43 -0700)]
merge in oc-release history after reset to oc-dev

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Sat, 6 May 2017 01:17:30 +0000 (18:17 -0700)]
merge in oc-release history after reset to oc-dev

7 years agoMerge "Revert "Revert "Ensure dex file are extracted and verified at load time""...
Calin Juravle [Fri, 5 May 2017 22:46:18 +0000 (22:46 +0000)]
Merge "Revert "Revert "Ensure dex file are extracted and verified at load time""" into oc-dev

7 years agoMerge "Check static field initial value types match in dex file verifier." into oc-dev
TreeHugger Robot [Fri, 5 May 2017 22:17:08 +0000 (22:17 +0000)]
Merge "Check static field initial value types match in dex file verifier." into oc-dev

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Fri, 5 May 2017 20:48:08 +0000 (13:48 -0700)]
merge in oc-release history after reset to oc-dev

7 years agoCheck static field initial value types match in dex file verifier.
Jeff Hao [Thu, 4 May 2017 21:12:56 +0000 (14:12 -0700)]
Check static field initial value types match in dex file verifier.

Can cause segmentation faults in the gc if object and primitive types
are mixed.

Bug: 34115871
Test: mm test-art-host-gtest-dex_file_verifier_test

(cherry-picked from commit 326c1a28c3e5d9e7ea1b39d60608eab5481e38b6)

Change-Id: Ie61c4b16deb5693f03abfa1a7ba0f4523e307eb3

7 years agoAdd dexlayout support for call sites and method handles.
Jeff Hao [Fri, 28 Apr 2017 01:00:38 +0000 (18:00 -0700)]
Add dexlayout support for call sites and method handles.

Tested that it works with Orion's test dex files. Can generate output
files that match the test input files.

Unit tests to follow.

Bug: 37732062
Test: mm test-art-host

(cherry-picked from commit 5daee90642aa44ac67e7e0c200204c86fa5425a8)

Change-Id: I834a1558506e99de17010d74dc5e8d83835f7f96

7 years agoRevert "Revert "Ensure dex file are extracted and verified at load time""
Calin Juravle [Thu, 4 May 2017 01:57:17 +0000 (01:57 +0000)]
Revert "Revert "Ensure dex file are extracted and verified at load time""

The issue was caused by running device-gtests as root (which will always
have full write access everywhere).

For now, disable the tests that rely on file permissions when running as
root.

Test: m test-art-target-gtest-oat_file_assistant_test
Bug: 36605597
Bug: 36824842

This reverts commit 9bfc6bb1f44797aec19a151e47c0902ef2516095.

(cherry picked from commit 357c66dcc20ce15108ecf05f5ecf69a80b383dab)

Change-Id: I73820b8ff9d78af8d9bcb232c8345a07c5788539

7 years agoMerge "ART: Fix test 912" into oc-dev
TreeHugger Robot [Fri, 5 May 2017 15:49:54 +0000 (15:49 +0000)]
Merge "ART: Fix test 912" into oc-dev

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Fri, 5 May 2017 15:22:53 +0000 (08:22 -0700)]
merge in oc-release history after reset to oc-dev

7 years agomerge in oc-release history after reset to oc-dev
gitbuildkicker [Fri, 5 May 2017 14:21:35 +0000 (07:21 -0700)]
merge in oc-release history after reset to oc-dev

7 years agoMerge "Allow stripped APK to be compiled with a vdex." into oc-dev
Nicolas Geoffray [Fri, 5 May 2017 08:09:06 +0000 (08:09 +0000)]
Merge "Allow stripped APK to be compiled with a vdex." into oc-dev

7 years agoMerge "Fixed bug due to not updating TC information (with regression test)" into...
Aart Bik [Thu, 4 May 2017 15:58:40 +0000 (15:58 +0000)]
Merge "Fixed bug due to not updating TC information (with regression test)" into oc-dev