OSDN Git Service

android-x86/art.git
7 years agoMerge cherrypicks of [2481491, 2481800, 2481782, 2481665, 2481547, 2481358, 2481802...
android-build-team Robot [Fri, 30 Jun 2017 04:10:52 +0000 (04:10 +0000)]
Merge cherrypicks of [24814912481800248178224816652481547248135824818022481613248166824816142481594248159524815482481744248149324814942481709] into oc-release

Change-Id: I7dbe587a8e4fec711e67e974a8caf0351bd0c9bf

7 years agoInterpreter: Save and restore object result register.
Nicolas Geoffray [Wed, 28 Jun 2017 13:41:07 +0000 (14:41 +0100)]
Interpreter: Save and restore object result register.

Save and restore object result register when there is a PC listener,
to avoid moving GC issues.

bug: 63088506
bug: 15126502

Test: TBD

(cherry picked from commit ef43805b0e80015645a5fc52e53b93ad178f60e3)

Change-Id: I67c7c23291afba6974a46c382e31ce6a44345b15
(cherry picked from commit 4b4c0f1c002adda5ae02f03d3a3cbad22e23a27e)

7 years agoMerge cherrypicks of [2467803, 2467786, 2467717, 2467598, 2467823, 2467734, 2467671...
android-build-team Robot [Tue, 27 Jun 2017 22:37:38 +0000 (22:37 +0000)]
Merge cherrypicks of [24678032467786246771724675982467823246773424676712467718246759924677532467672246760024677352467841246763824678242467736246775424677372467674] into oc-release

Change-Id: If8a17206ca029906dd71a1412cb92726a0d4e301

7 years agoOnly look for method optimization annotations in the bootstrap class loader.
Roland Levillain [Mon, 26 Jun 2017 17:14:39 +0000 (18:14 +0100)]
Only look for method optimization annotations in the bootstrap class loader.

When checking for an optimization annotation (FastNative or
CriticalNative) on a method, do not resolve the method's annotations'
classes as a side effect -- instead, look them up in the bootstrap
class loader's resolved types. This is to prevent exceptions from being
thrown (during class resolution) in JNI transitions.

This change does not affect annotation lookup rules in the context of
reflection.

(cherry-picked from commit 35e42f0ab3b70203038fe037ee50d39e2d37af9a)

Test: art/test/testrunner/testrunner.py -t 656-annotation-lookup-generic-jni
Bug: 38454151
Bug: 34659969
Change-Id: Ie6b8b30b96a08baa629c449e3803a031515508d1
(cherry picked from commit 2ed6cce6fcfd031b0f9d83111f01b6b48ead1a32)

7 years agoFix the stack at the beginning of the Generic JNI trampoline.
Roland Levillain [Mon, 26 Jun 2017 17:14:39 +0000 (18:14 +0100)]
Fix the stack at the beginning of the Generic JNI trampoline.

Fix up a callee-save frame at the bottom of the stack while we
check for optimization annotations, thus allowing stack walking
until the completion of the JNI frame creation.

Test: art/test/testrunner/testrunner.py -t 656-annotation-lookup-generic-jni
Bug: 38454151
Bug: 34659969
Change-Id: I70dc3d40139198f29457dba5282b45a9d0d09e49
Merged-In: I70dc3d40139198f29457dba5282b45a9d0d09e49
(cherry picked from commit a5385510cf884ee1a44577bf2019093937134a84)

7 years agoMerge cherrypicks of [2461233, 2461302, 2461279, 2461176, 2461341, 2461280, 2461290...
android-build-team Robot [Mon, 26 Jun 2017 20:47:34 +0000 (20:47 +0000)]
Merge cherrypicks of [2461233246130224612792461176246134124612802461290246134224612912461216246121724613042461306246138124613072461234246119524613082461362246123524612182461363246132324613822461345] into oc-release

Change-Id: I15b7b001bbb607686ae6b3e4bdcb496c79751481

7 years agoFix braino when handling branches fallthrough in arm backend.
Nicolas Geoffray [Mon, 26 Jun 2017 08:12:45 +0000 (09:12 +0100)]
Fix braino when handling branches fallthrough in arm backend.

bug: 62210114
Test: 657-branches

(cherry picked from commit 6fda42718a348cfb758d8714e223cab7e855765b)

Change-Id: I0e4f0577bcb1f3960459fe5d35473af191fc6534
(cherry picked from commit 860626e1a3e1314b7d2e828fd61fb25eebc5f081)

7 years agorelease-request-160c4b31-7fa0-4e2b-aabe-85380836a1ce-for-git_oc-release-4129081 snap...
android-build-team Robot [Fri, 23 Jun 2017 07:09:21 +0000 (07:09 +0000)]
release-request-160c4b31-7fa0-4e2b-aabe-85380836a1ce-for-git_oc-release-4129081 snap-temp-L15300000077039010

Change-Id: Ic0b4191115f213c4ab36c96e4a479b1a85824014

7 years agoFix loop optimization in the presence of environment uses.
Nicolas Geoffray [Thu, 22 Jun 2017 10:56:01 +0000 (11:56 +0100)]
Fix loop optimization in the presence of environment uses.

We should not remove instructions that have deoptimize as
users, or that have environment uses in a debuggable setup.

bug: 62536525
bug: 33775412
Test: 656-loop-deopt

(cherry picked from commit 1a0a519c82044ec3e6d3910ff0602b11292de47a)

Change-Id: I213dc85ac644619b041f0fa408e112352efcef2d

7 years agorelease-request-767e2998-9243-43e0-b656-1acb30ac5115-for-git_oc-release-4124637 snap...
android-build-team Robot [Thu, 22 Jun 2017 07:10:15 +0000 (07:10 +0000)]
release-request-767e2998-9243-43e0-b656-1acb30ac5115-for-git_oc-release-4124637 snap-temp-L74200000076595014

Change-Id: I3d9b65d2781bd5a29ade28c48d99739a9753626d

7 years agoMerge "Bump vdex version to regenerate vdex files" into oc-dev
TreeHugger Robot [Thu, 22 Jun 2017 00:20:36 +0000 (00:20 +0000)]
Merge "Bump vdex version to regenerate vdex files" into oc-dev

7 years agoBump vdex version to regenerate vdex files
Shubham Ajmera [Wed, 21 Jun 2017 17:22:15 +0000 (10:22 -0700)]
Bump vdex version to regenerate vdex files

https://googleplex-android-review.git.corp.google.com/#/c/2344736/
fixed the issue for corrupted vdex files, however, we could still be
using the same corrupted vdex files due to the same vdex version.

(cherry-picked from change 71fa64f4a1cf113b0d2ec00d05a168de07302032)
Test: make
Bug: 62515426
Change-Id: Ieaf9b7a07eefaf42810861623d2327a2a38cb8f6

7 years agoCheck that classes are resolved in GetMethodsVisitor
Mathieu Chartier [Wed, 21 Jun 2017 18:48:15 +0000 (11:48 -0700)]
Check that classes are resolved in GetMethodsVisitor

VisitClasses doesn't internally check that classes are resolved. This
caused GetClassesAndMethodsVisitor to occasionally see ArtMethods
that didn't have their declaring class filled in.

The fix is to check that the class is actually resolved.

(cherry picked from commit 4219814f1545db945c1bacf4d38221371993a72d)

Test: test-art-host
Bug: 62585606

Merged-In: I3ed647ae15900c96d2180eb5c799f45393794dda
Change-Id: Id09e9e27cf09a921fbce4c917b8b6ef2daeaabaa

7 years agorelease-request-f4ecf242-5d1c-45e0-8c7c-ede48d1a9e82-for-git_oc-release-4111650 snap...
android-build-team Robot [Sun, 18 Jun 2017 07:17:03 +0000 (07:17 +0000)]
release-request-f4ecf242-5d1c-45e0-8c7c-ede48d1a9e82-for-git_oc-release-4111650 snap-temp-L02200000075283731

Change-Id: Ia10fd0dde8a2e5456c1d5dedb402e8bbd5a514cb

7 years agoFixed bug in relying on precise FP in periodic sequence.
Aart Bik [Thu, 1 Jun 2017 22:45:09 +0000 (15:45 -0700)]
Fixed bug in relying on precise FP in periodic sequence.

Rationale:
FP arithmetic is not always precise, so relying on FP
period sequences to "compute back" precisely is not
valid; when all values in the period are "fetches"
however, the rotation is precise.

Bug found by fuzz testing. With regression test.

Bug: 62196559
Test: test-art-host

(cherry picked from commit 8523ea11a677b78e1fc05915976c04b1ff081451)

Change-Id: Idd90dbece8b65de8c5296b8676377c377f71629c

7 years agoAdd a bounds check when getting indexed items in dexlayout.
Jeff Hao [Thu, 15 Jun 2017 21:04:51 +0000 (14:04 -0700)]
Add a bounds check when getting indexed items in dexlayout.

Will be useful to help diagnose issues caused by a corrupted dex file.

Bug: 62515426
Test: mm test-art-host

(cherry picked from commit 9804e9ee90a3e6da05cbfe602deb29fb79a82f50)

Change-Id: I0ca01a13c7fdcf2c0230331299ce675b955fca4d

7 years agorelease-request-7d12f16b-b4a7-4324-8b59-be2d4e07dcb3-for-git_oc-release-4094438 snap...
android-build-team Robot [Tue, 13 Jun 2017 07:10:13 +0000 (07:10 +0000)]
release-request-7d12f16b-b4a7-4324-8b59-be2d4e07dcb3-for-git_oc-release-4094438 snap-temp-L80000000073561277

Change-Id: Icc9424cc8f9c7291af6b933be1fc331be4687160

7 years agoMerge "Disable checker when testing no-prebuilds" into oc-dev
Calin Juravle [Mon, 12 Jun 2017 15:30:40 +0000 (15:30 +0000)]
Merge "Disable checker when testing no-prebuilds" into oc-dev

7 years agoRemove 'break's to make sure we see all options.
Nicolas Geoffray [Mon, 12 Jun 2017 08:16:30 +0000 (09:16 +0100)]
Remove 'break's to make sure we see all options.

Otherwise, zip-fd will make compiler-filter be ignored and vice-versa.
For example, we now get from OTA:
/system/bin/dex2oat --input-vdex-fd=14 --output-vdex-fd=14 --compiler-filter=verify -j4 --classpath-dir=/data/app/com.google.android.GoogleCamera-TPUvotvLcRVexUZ6bjX2pA== --compiler-filter=speed

Test: build
Bug: 38442248

(cherry picked from commit 8f03c57b701dd95d8cbee3e2a6cc35e8c01ef8c0)

Change-Id: I98cca2fffe8794888810bc7284afbbba45c0abeb

7 years agoDisable checker when testing no-prebuilds
Calin Juravle [Thu, 8 Jun 2017 23:13:26 +0000 (16:13 -0700)]
Disable checker when testing no-prebuilds

By default, the compiler will only quicken (in no prebuild
mode) and will not generate a cfg file.

The checker test are already covered by other modes like:
art-preopt (pic) or art-optimizing (npic).

Also, disable 137-cfi and 629-vdex-speed which require
speed compilation.

Test: testrunner.py --host --no-prebuild

Bug: 38442248

(cherry picked from commit 6c78b37e521f207fb25e6eac0542bea37a6239b5)
(cherry picked from commit 07c6d726c9acfa06252039412e9985706747648a)

Change-Id: I82c1a7bb390007566fbb5fb1e69141b80a991f6d

7 years agorelease-request-011e6329-d82e-4e46-980f-68776b0cd6b9-for-git_oc-release-4080367 snap...
android-build-team Robot [Thu, 8 Jun 2017 10:04:09 +0000 (10:04 +0000)]
release-request-011e6329-d82e-4e46-980f-68776b0cd6b9-for-git_oc-release-4080367 snap-temp-L79900000072116775

Change-Id: I9327179e8a8961ec3a8fa39a695d5fc13cbede96

7 years agoMerge cherrypicks of [2372722, 2371265, 2372622, 2371944, 2372723, 2372703, 2372623...
android-build-team Robot [Wed, 7 Jun 2017 20:14:34 +0000 (20:14 +0000)]
Merge cherrypicks of [2372722237126523726222371944237272323727032372623237222423712662371945] into oc-release

Change-Id: I6d411fd82469319347b23b6354ff7d1e30cc47a7

7 years agoBe less aggressive when inlining.
Nicolas Geoffray [Wed, 7 Jun 2017 12:18:03 +0000 (13:18 +0100)]
Be less aggressive when inlining.

Reduce the threshold for cumulated dex registers, to prevent
long and memory expensive compiles.

bug: 62243120 (3d party app startup)
bug: 36727951 (Camera startup)
bug: 62271612 (compiler allocations)
Test: test.py

(cherry picked from commit f81621ea5a67474e6f2cb0516b606822d5843612)

Change-Id: I25b37e1226af1659934adceb9e3c9e3f12ebd4bd
(cherry picked from commit 8f51b903117e42bf5c274990ec7c74b8281582c0)

7 years agoDon't call EnsureInitialized in the JIT.
Nicolas Geoffray [Wed, 7 Jun 2017 13:09:43 +0000 (14:09 +0100)]
Don't call EnsureInitialized in the JIT.

Calling EnsureInitialized can block due to locking on the class
object, that an application can also do.

Just rely that the compilation request is for a reason.

The compiler aleady knows how to compile methods of classes that
are not initialized.

bug: 62243120
Test: test.py --jit

(cherry picked from commit 23ddfe86788fe1c95b8be6c76f3a127f8f51dd9f)

Change-Id: I21157fd9ab5589f0ec8e18ac321b2ac7177ad9b2
(cherry picked from commit eccc74ed594576816d4521aad1974ddfa54cd6ac)

7 years agoMerge "Be less aggressive when inlining." into oc-dev
Tim Murray [Wed, 7 Jun 2017 19:12:42 +0000 (19:12 +0000)]
Merge "Be less aggressive when inlining." into oc-dev

7 years agoMerge "Don't call EnsureInitialized in the JIT." into oc-dev
Tim Murray [Wed, 7 Jun 2017 19:12:31 +0000 (19:12 +0000)]
Merge "Don't call EnsureInitialized in the JIT." into oc-dev

7 years agoBe less aggressive when inlining.
Nicolas Geoffray [Wed, 7 Jun 2017 12:18:03 +0000 (13:18 +0100)]
Be less aggressive when inlining.

Reduce the threshold for cumulated dex registers, to prevent
long and memory expensive compiles.

bug: 62243120 (3d party app startup)
bug: 36727951 (Camera startup)
bug: 62271612 (compiler allocations)
Test: test.py

(cherry picked from commit f81621ea5a67474e6f2cb0516b606822d5843612)

Change-Id: I25b37e1226af1659934adceb9e3c9e3f12ebd4bd

7 years agoDon't call EnsureInitialized in the JIT.
Nicolas Geoffray [Wed, 7 Jun 2017 13:09:43 +0000 (14:09 +0100)]
Don't call EnsureInitialized in the JIT.

Calling EnsureInitialized can block due to locking on the class
object, that an application can also do.

Just rely that the compilation request is for a reason.

The compiler aleady knows how to compile methods of classes that
are not initialized.

bug: 62243120
Test: test.py --jit

(cherry picked from commit 23ddfe86788fe1c95b8be6c76f3a127f8f51dd9f)

Change-Id: I21157fd9ab5589f0ec8e18ac321b2ac7177ad9b2

7 years agoMerge "Use OatFileAssistant default filter instead of the dex2oat one" into oc-dev
TreeHugger Robot [Wed, 7 Jun 2017 15:15:40 +0000 (15:15 +0000)]
Merge "Use OatFileAssistant default filter instead of the dex2oat one" into oc-dev

7 years agoUse OatFileAssistant default filter instead of the dex2oat one
Calin Juravle [Wed, 7 Jun 2017 01:04:57 +0000 (18:04 -0700)]
Use OatFileAssistant default filter instead of the dex2oat one

Ensure that when OatFileAssistant needs to generate oat files it uses
its default filter (quicken) instead of the one from dex2oat (speed).

Bug: 38442248
Test: m test-art-host

(cherry picked from commit f62422ed7a0a0e0ec70c520192efb79e8360340b)

Change-Id: Ic8ece329ad9ccde6553f4556c63bdb8d28fd9538

7 years agoMerge "release-request-0ddf2eab-ecaa-4014-951f-9236b1e43859-for-git_oc-release-407559...
android-build-team Robot [Wed, 7 Jun 2017 07:57:31 +0000 (07:57 +0000)]
Merge "release-request-0ddf2eab-ecaa-4014-951f-9236b1e43859-for-git_oc-release-4075595 snap-temp-L43000000071370789" into oc-release

7 years agorelease-request-224b654d-e3ad-4f05-a95d-d10d1516b3f6-for-git_oc-release-4075622 snap...
android-build-team Robot [Wed, 7 Jun 2017 07:48:25 +0000 (07:48 +0000)]
release-request-224b654d-e3ad-4f05-a95d-d10d1516b3f6-for-git_oc-release-4075622 snap-temp-L17600000071371496

Change-Id: I119e6c3004cb8563726ec5486ac1f1a4dd61dc7e

7 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

7 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

7 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

7 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

7 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