OSDN Git Service

android-x86/art.git
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 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 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 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 "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 "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 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 "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

7 years agoART: Fix test 912
Andreas Gampe [Thu, 4 May 2017 05:28:43 +0000 (22:28 -0700)]
ART: Fix test 912

Pass a descripter instead of a name.

Partial revert of commit 31c88580deb129f99f6b9835c6e21cb86a875f88.

(cherry picked from commit a164ec5b3811ba29a9fd83df9f318f07973224ce)

Bug: 36344364
Test: art/test/testrunner/testrunner.py -b --host --jit --no-prebuild --no-dex2oat -t 912
Test: art/test/testrunner/testrunner.py -b --host -t 912
Change-Id: I94085445bbc37f4b932dd4477763f114accbbc3c

7 years agoAllow stripped APK to be compiled with a vdex.
Nicolas Geoffray [Tue, 25 Apr 2017 16:36:51 +0000 (17:36 +0100)]
Allow stripped APK to be compiled with a vdex.

bug: 37558732
Test: oat_file_assistant_test
Test: "adb shell cmd package compile" of a stripped /system apk

(cherry picked from commit 08e9eed8f609c0917b27e15a6bfb5a05d8cb3e2b)

Change-Id: I26afa07936ef8270eda91349ce8d2f742c3b0caf

7 years agoMerge "Update knownfailures.json." into oc-dev
Nicolas Geoffray [Thu, 4 May 2017 08:36:29 +0000 (08:36 +0000)]
Merge "Update knownfailures.json." into oc-dev

7 years agoMerge "runtime: Properly unload partially loaded image spaces" into oc-dev
TreeHugger Robot [Wed, 3 May 2017 23:11:44 +0000 (23:11 +0000)]
Merge "runtime: Properly unload partially loaded image spaces" into oc-dev

7 years agoFixed bug due to not updating TC information
Aart Bik [Wed, 3 May 2017 21:29:20 +0000 (14:29 -0700)]
Fixed bug due to not updating TC information
(with regression test)

Bug: 37768917
Test: test-art-target, test-art-host

(cherry picked from commit e22445fba0e5747ea787429ac64577a9a62aded3)

Change-Id: I505106ef7ab8eed1e37067b39d6ef657ee234292

7 years agoMerge "Increase profile saver minimum save period to 40 seconds" into oc-dev
Calin Juravle [Wed, 3 May 2017 18:41:49 +0000 (18:41 +0000)]
Merge "Increase profile saver minimum save period to 40 seconds" into oc-dev

7 years agoMerge "inliner: Do not assume that the outermost_graph has an art method" into oc-dev
Calin Juravle [Wed, 3 May 2017 18:24:14 +0000 (18:24 +0000)]
Merge "inliner: Do not assume that the outermost_graph has an art method" into oc-dev

7 years agoruntime: Properly unload partially loaded image spaces
Igor Murashkin [Tue, 2 May 2017 22:58:02 +0000 (15:58 -0700)]
runtime: Properly unload partially loaded image spaces

When one of the (non-app) image space successfully loads,
it sets up runtime callee-save methods.

If it is later unloaded, callee-save methods are now pointing to memory
that is no longer valid (viewed as all 0s in the debugger).

Runtime::Init skips creating its own runtime methods if it already sees
that the runtime methods were set to non-null, thus dangling runtime
methods.

This crash would nominally manifest itself in unwinding the first time, or as a DCHECK
failure in the interpreter bridge invocation during aborting if debugging was enabled.

To get into this state:
* Fill up the /data partition (but perhaps leave a little bit of room
for one image, but not all images)
* Reboot the device or run zygote manually.

(cherry picked from commit 8275fbaccc012072948a16f537844a552db9be84)

Test: adb shell dd if=/dev/zero of=/data/local/tmp/tempFiller.deleteMe bs=1024 count=50g ; adb reboot
Bug: 36033084
Change-Id: I728c1058b003fcf5e98dc2746d53e44b688c4605

7 years agoinliner: Do not assume that the outermost_graph has an art method
Calin Juravle [Sat, 29 Apr 2017 02:58:01 +0000 (19:58 -0700)]
inliner: Do not assume that the outermost_graph has an art method

The outermost method may be in an unresolved class. If that's the case
do not assume anything about the referrer in HLoadClass.

Test: m test-art-host
Bug: 37588888

(cherry picked from commit 07f01dfa26e97f48662b6ef40fdc0926cecd7664)

Change-Id: If9974195a0b5d026c1eb16477f9cd95e83c911ec

7 years agoIncrease profile saver minimum save period to 40 seconds
Calin Juravle [Mon, 1 May 2017 22:14:44 +0000 (15:14 -0700)]
Increase profile saver minimum save period to 40 seconds

We save much more data with the addition of inline caches. Balance
amount of data with save period: save more but less often.
This relies on the assumptions that the number of apps being killed
in less than 40 seconds is actually small.

The 40 seconds number is pulled mostly out of thin air. Some
experiments show that we don't necessarily lose data when increasing
the period. I only looked at file sizes and the number of profile writes
to verify that we get a comparable amount of information between 20 and
40 seconds. (I did not do a delta on the profile content).

The test scenario was:
- clear all profiles
- boot the device and let it settle for 2 minutes
- open maps and navigate to a destination, search for restaurants
- open gmail and send an email
- open playstore and inspect the top charts
- open youtube and play a video
- open docs and write in a document
- all app interaction are kept below 40 seconds
- wait 1 minute to settle any pending saves
- take a bug report and look at profile stats

With 20 seconds: 43 profile writes, summing 1605610 bytes.
With 40 seconds: 35 profile writes, summing 1243217 bytes.

There is the obvious trade-off that apps being killed in less than
40 seconds will not get profiles.

Bug: 36281963
Test: m test-art-host
      manual device tests to verify the profile gets saved

(cherry picked from commit 806843aa293d45d88edeccd49eb5d281ff7d844f)

Change-Id: I8108c8fe41616fb14c710f8f015c50ff332d1e6b

7 years agoUpdate knownfailures.json.
Nicolas Geoffray [Wed, 3 May 2017 14:43:49 +0000 (15:43 +0100)]
Update knownfailures.json.

Extracted from:
https://googleplex-android-review.git.corp.google.com/#/c/2194222/

To avoid the merge conflict.

bug: 37558732
Test: run-test with speed-profile
Change-Id: Ieeae28f2c95870c655055075c4ab2207e58ae335

7 years agoMerge "Make vdex and dexlayout compatible." into oc-dev
TreeHugger Robot [Wed, 3 May 2017 11:56:22 +0000 (11:56 +0000)]
Merge "Make vdex and dexlayout compatible." into oc-dev

7 years agoMake vdex and dexlayout compatible.
Nicolas Geoffray [Fri, 21 Apr 2017 16:16:44 +0000 (17:16 +0100)]
Make vdex and dexlayout compatible.

Unquicken the vdex before dexlayout, to keep the dex integrity.

bug: 37558732
Test: run-test with speed-profile

(cherry picked from commit 4e868fa7b8c47600695ff92deeb373674956a67d)

Change-Id: I57ddabb79ff49d01df80bed4e3e53ba8fdb5346e

7 years agoART: Additional verifier flags for invoke-custom
Orion Hodson [Tue, 2 May 2017 11:25:45 +0000 (12:25 +0100)]
ART: Additional verifier flags for invoke-custom

Updates verifier flags for invoke-custom instructions and adds
static_asserts to enforce at build time.

Bug: 37766116
Test: m

(cherry picked from commit d81047086eb3ac5f34314c0c56b4bd602b9e853d)

Change-Id: I5ade3250f5df877e012d2f291ad8e27169b10d49

7 years agoMerge "If a profile is passed, we should always pass output-vdex and input-vdex....
Nicolas Geoffray [Wed, 3 May 2017 08:04:28 +0000 (08:04 +0000)]
Merge "If a profile is passed, we should always pass output-vdex and input-vdex." into oc-dev

7 years agoMerge "Rename and obsolete compiler filter names." into oc-dev
Nicolas Geoffray [Wed, 3 May 2017 08:04:28 +0000 (08:04 +0000)]
Merge "Rename and obsolete compiler filter names." into oc-dev

7 years agoBug fix on shift that exceeds "lane width".
Aart Bik [Mon, 1 May 2017 23:50:45 +0000 (16:50 -0700)]
Bug fix on shift that exceeds "lane width".

Rationale:
ARM is a bit less forgiving on shifting more than
the lane width of the SIMD instruction (rejecting
such cases is no loss, since it yields 0 anyway
and should be optimized differently).

Bug: 37776122
Test: test-art-target, test-art-host

(cherry picked from commit 65ffd8ef044465c47d4f97ab2556310f9ee30a01)

Change-Id: If65148eb0e8e705f48778549b7e31b8077cd233b

7 years agoMerge "Allow same-length integral type mixing in SIMD." into oc-dev
Aart Bik [Wed, 3 May 2017 03:04:25 +0000 (03:04 +0000)]
Merge "Allow same-length integral type mixing in SIMD." into oc-dev

7 years agoAllow same-length integral type mixing in SIMD.
Aart Bik [Mon, 1 May 2017 21:49:18 +0000 (14:49 -0700)]
Allow same-length integral type mixing in SIMD.

Rationale:
Just like the incoming sequential code, the SIMD
code allows for some type matching, as long as
it is integral and same length.

Bug: 37764324
Test: test-art-target, test-art-host
Change-Id: Ide1c5403e0f3b8c5372e8ac6dd282d8211ca8f1b

7 years agoFix length of descriptor field when reading debug info.
Jeff Hao [Tue, 2 May 2017 00:29:35 +0000 (17:29 -0700)]
Fix length of descriptor field when reading debug info.

TypeIndex is a 16-bit value, and storing kDexNoIndex (0xFFFFFFFF) caused
a failure in a dcheck on the bounds of the value.

Bug: 37287051
Test: mm -j31 test-art-host-gtest-dex_file_test

(cherry-picked from commit c12253611eea875d9e3299bac596be4224f7db00)

Change-Id: If5ae2b624886177d66b3a33ccd75509496deab40

7 years agoMerge "Fix unquickening in the presence of duplicate methods." into oc-dev
TreeHugger Robot [Tue, 2 May 2017 14:50:25 +0000 (14:50 +0000)]
Merge "Fix unquickening in the presence of duplicate methods." into oc-dev

7 years agoMerge "ART: Support for SourceDebugExtension" into oc-dev
Orion Hodson [Tue, 2 May 2017 11:57:29 +0000 (11:57 +0000)]
Merge "ART: Support for SourceDebugExtension" into oc-dev

7 years agoIf a profile is passed, we should always pass output-vdex and input-vdex.
Nicolas Geoffray [Thu, 27 Apr 2017 20:45:35 +0000 (21:45 +0100)]
If a profile is passed, we should always pass output-vdex and input-vdex.

Passing only input-vdex means the vdex will be updated in place, which
is not something we do with a profile in production.

Test: 629-vdex

(cherry picked from commit fbc4f118aff7c284f0d9d2ca209166b7ff79e542)

Change-Id: Ie7afabe7e017476fe5347781f304043db2555462

7 years agoRename and obsolete compiler filter names.
Nicolas Geoffray [Fri, 21 Apr 2017 12:08:25 +0000 (13:08 +0100)]
Rename and obsolete compiler filter names.

ART side of the change.

bug:34715556
Test: test-art-host, jdwp, libcore

(cherry picked from commit 49cda06d5bf003f588ba7839bbf89d606237dfa7)

Change-Id: I85126e5035f0f6fc15aa84d41af5f1d6e25a5f55

7 years agoMerge "Allow dexlayout to handle duplicate code items." into oc-dev
TreeHugger Robot [Mon, 1 May 2017 22:22:24 +0000 (22:22 +0000)]
Merge "Allow dexlayout to handle duplicate code items." into oc-dev

7 years agoMerge "Add basic heap corruption detection ConcurrentCopying::Copy" into oc-dev
TreeHugger Robot [Mon, 1 May 2017 22:13:08 +0000 (22:13 +0000)]
Merge "Add basic heap corruption detection ConcurrentCopying::Copy" into oc-dev

7 years agoAllow dexlayout to handle duplicate code items.
Jeff Hao [Wed, 26 Apr 2017 19:09:06 +0000 (12:09 -0700)]
Allow dexlayout to handle duplicate code items.

Dexlayout now checks to see if a code item already exists at a
particular offset before trying to construct a new one. If so, the
existing one is returned instead.

Bug: 37287151
Test: mm test-art-host-gtest-dexlayout_test
Change-Id: Iea21df01033e127de011568e1fe66224e260e202
(cherry-picked from commit d212d5b4dcd8ebee9858d863062d7f827ea3a9ea)

7 years agoAdd basic heap corruption detection ConcurrentCopying::Copy
Mathieu Chartier [Sat, 29 Apr 2017 01:58:59 +0000 (18:58 -0700)]
Add basic heap corruption detection ConcurrentCopying::Copy

Detect objects that have a null class. This also detects objects that
are not in the from-space allocated area since this area is zero
initialized.

Test: test-art-host

Bug: 37683299
Bug: 12687968
Bug: 37187694
Change-Id: Ib7b9a1913a582692ce05791104c181b75e0f7bcb

7 years agoLayout codeitems based on profile data
Shubham Ajmera [Mon, 3 Apr 2017 17:04:28 +0000 (10:04 -0700)]
Layout codeitems based on profile data

Bug: 35800981
Bug: 37287151 (TL triaged bug dependent on this)
Test: ./art/test/testrunner/testrunner.py --host -t 638-c
Change-Id: I7beef8aae2d085333e0c2bfc0706c7f42f8e5f5f

(cherry-picked from commit 36a282b8714071d9f16c98c316efa4304fd8d36a)

7 years agoMerge "oat_file_manager: Avoid global collision check." into oc-dev
Calin Juravle [Mon, 1 May 2017 18:03:02 +0000 (18:03 +0000)]
Merge "oat_file_manager: Avoid global collision check." into oc-dev

7 years agooat_file_manager: Avoid global collision check.
Narayan Kamath [Fri, 28 Apr 2017 09:19:29 +0000 (10:19 +0100)]
oat_file_manager: Avoid global collision check.

Avoid the global collision check in case we encounter a classloader
that we don't recognize. This seems overly conservative. Instead, trust
that the classloader does the right thing.

Bug: 36480683
Bug: 37777332

Test: make test-art-host
Test: manual testing

(cherry picked from commit 04aa213e96c1095e8d1e07cbc426d009777de241)

Change-Id: I45ca1a12c14ba303bd27e9463e612f7c73c778ec

7 years agoFix unquickening in the presence of duplicate methods.
Nicolas Geoffray [Thu, 27 Apr 2017 15:08:50 +0000 (16:08 +0100)]
Fix unquickening in the presence of duplicate methods.

The code item may have already been unquicken.

bug: 36059948
Test: 649-vdex-duplicate-method

(cherry picked from commit 095d6a6be5228ad734568892b820eaf18e549365)

Change-Id: If922c2c5f04d38449a11e0cfc1d81b2a09f2885b

7 years agoART: Support for SourceDebugExtension
Orion Hodson [Mon, 24 Apr 2017 13:53:19 +0000 (14:53 +0100)]
ART: Support for SourceDebugExtension

Adds support for reading SourceDebugExtension class annotation from DEX files.

Bug: 30109642
Test: art/tools/run-jdwp-tests.sh --mode=device --test org.apache.harmony.jpda.tests.jdwp.ReferenceType.SourceDebugExtensionTest

(cherry picked from commit 77d8a1c3572afb38542cb5a2b3516674a182ce48)

Change-Id: I94952a769a6cd0dd85a58cfb1bb65ec0d1bf4e60

7 years agoMerge "Only log a few types of GC causes for the blocking cases" into oc-dev
Mathieu Chartier [Fri, 28 Apr 2017 00:09:42 +0000 (00:09 +0000)]
Merge "Only log a few types of GC causes for the blocking cases" into oc-dev

7 years agoMerge changes from topic 'cp-cts' into oc-dev
TreeHugger Robot [Thu, 27 Apr 2017 20:20:19 +0000 (20:20 +0000)]
Merge changes from topic 'cp-cts' into oc-dev

* changes:
  Ignore an additional thread in test 911
  Add more cts tests
  Remove unneeded shims and jni binding code

7 years agoIgnore an additional thread in test 911
Alex Light [Tue, 25 Apr 2017 21:23:04 +0000 (14:23 -0700)]
Ignore an additional thread in test 911

This was causing failures in cts

Bug: 37579245
Test: ./test/testrunner/testrunner.py --host -j40
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest911HostTestCases
Change-Id: Iee5c1874de225b98016994e046378268fb68e2fb
(cherry picked from commit 3cf6a70e7e1a6a1436bd22a3d36123a799bb681a)
Merged-In: Iaeba26b9554dee5cba6ef04e91d4a2664c7e94d0

7 years agoAdd more cts tests
Alex Light [Mon, 24 Apr 2017 17:15:56 +0000 (10:15 -0700)]
Add more cts tests

Adds cts versions of test 985 and 986

Bug: 32072923
Test: ./test.py --host -j40
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest985HostTestCases
Test: cts-tradefed run cts-dev --module CtsJvmtiRunTest986HostTestCases

Change-Id: Iaef9ce87aea435fa44e006d1cc5f183697008789
(cherry picked from commit ec0885ea570b93b563d04d337a11488e112693ec)
Merged-In: Iaeba26b9554dee5cba6ef04e91d4a2664c7e94d0

7 years agoRemove unneeded shims and jni binding code
Alex Light [Thu, 20 Apr 2017 23:55:25 +0000 (16:55 -0700)]
Remove unneeded shims and jni binding code

Bug: 37522517
Test: ./test/testrunner/testrunner.py --host -j40
Change-Id: I8670ab1bbf4b906c47d4edb2ad7349f9505da94a
(cherry picked from commit 21b0c29e6a7e5a9d2d31db27aea2fa8615d56f3b)
Merged-In: Iaeba26b9554dee5cba6ef04e91d4a2664c7e94d0

7 years agoMerge changes I4542b483,I63e97d5b into oc-dev
Roland Levillain [Thu, 27 Apr 2017 11:32:48 +0000 (11:32 +0000)]
Merge changes I4542b483,I63e97d5b into oc-dev

* changes:
  Remove ART run-test 648-many-direct-methods.
  Handle classes with a huge number of direct methods.

7 years agoRemove ART run-test 648-many-direct-methods.
Roland Levillain [Thu, 27 Apr 2017 09:31:44 +0000 (10:31 +0100)]
Remove ART run-test 648-many-direct-methods.

This test is stressing dex2oatd and fails on too many configurations;
remove it for now.

(cherry picked from commit eed8ca45960379e55956cb60e32fcbf5be999e54)

Test: Rely on automated testing.
Bug: b/33650497
Change-Id: I4542b4833d46cb312763c112570e7751702134cd

7 years agoMerge "ART: Add method verifier check for call site id" into oc-dev
TreeHugger Robot [Thu, 27 Apr 2017 03:43:26 +0000 (03:43 +0000)]
Merge "ART: Add method verifier check for call site id" into oc-dev

7 years agoMerge changes I075fcb10,I8f31e5f3,I863ca8d4 into oc-dev
Andreas Gampe [Wed, 26 Apr 2017 21:44:59 +0000 (21:44 +0000)]
Merge changes I075fcb10,I8f31e5f3,I863ca8d4 into oc-dev

* changes:
  ART: More header cleanup - method_verifier.h
  ART: More header cleanup - mem_map.h
  ART: More header cleanup - CC

7 years agoART: Add method verifier check for call site id
Orion Hodson [Fri, 21 Apr 2017 14:24:10 +0000 (15:24 +0100)]
ART: Add method verifier check for call site id

(cherry picked from 3a842f5adcbdeb3fd3db4206006a784ccabfc865)

Bug: 37248626
Test: dex2oat on bug data
Change-Id: I11fbf3b9402406ed0031f47a90a8ab38360a52bb

7 years agoOnly log a few types of GC causes for the blocking cases
Mathieu Chartier [Tue, 25 Apr 2017 23:31:20 +0000 (16:31 -0700)]
Only log a few types of GC causes for the blocking cases

There are various types like debugger and GetObjectsAllocated that
can cause spam if we log all the blocking calls. In practice, these
are only used from tools and should not cause jank.

Bug: 37275712
Test: test-art-host
Change-Id: I3a6854d37a6e83c91e9cc8bcb76103e2498bc3b6

7 years agoART: More header cleanup - method_verifier.h
Andreas Gampe [Mon, 24 Apr 2017 20:19:09 +0000 (13:19 -0700)]
ART: More header cleanup - method_verifier.h

Move enumerations to own header. Move the compiler interface (of what
the compiler can tolerate) into its own header. Replace or remove
method_verifier.h where possible.

Test: mmma art
Change-Id: I075fcb10b02b6c1c760daad31cb18eaa42067b6d
(cherry picked from commit 6d7abbd2324f544c6b6da42bb6b9b531df0ce3cd)

7 years agoART: More header cleanup - mem_map.h
Andreas Gampe [Mon, 24 Apr 2017 14:58:06 +0000 (07:58 -0700)]
ART: More header cleanup - mem_map.h

Move MemMap maps_ into cc file and move allocator include. Remove
other unused includes. Force clients to import sys/mman.h if they
need it. Try to lower dependencies on ART by using libbase helpers
more.

Test: mmma art
Change-Id: I8f31e5f371789b3d72e12af377181fee2ac9a611
(cherry picked from commit 0dfc315a096bf5678cb5182771e3fdcca8ea4433)

7 years agoART: More header cleanup - CC
Andreas Gampe [Mon, 24 Apr 2017 20:22:18 +0000 (13:22 -0700)]
ART: More header cleanup - CC

Forward-declare AtomicStack in CC. Use stack_reference in atomic_stack.h.

Test: mmma art
Change-Id: I863ca8d4a8dfd5e83279fd68ea0e1a94c3c5df6d
(cherry picked from commit 291ce17ada5a126be99f0fc069a028d2100bcf9e)

7 years agoImprove deterministic boot image compilation with CC collector.
Roland Levillain [Thu, 20 Apr 2017 16:35:32 +0000 (17:35 +0100)]
Improve deterministic boot image compilation with CC collector.

Allow deterministic compilation with the read barrier configuration.

(cherry picked from commit b81e9e90ee60e602286899fc3fa0048c2fcb1c30)

Test: Compare boot.art produced by different builds of the same tree.
Bug: 37442966
Change-Id: I6cc0d0d7fdfe4f954765764d9f7f3778b7307028

7 years agoHandle classes with a huge number of direct methods.
Roland Levillain [Mon, 24 Apr 2017 15:27:43 +0000 (16:27 +0100)]
Handle classes with a huge number of direct methods.

Make sure that fields Class::copied_methods_offset_ and
Class::virtual_method_offset_ are correctly interpreted as unsigned
16-bit integers.

(cherry picked from commit 6680e3394aeb2b89300e459dc4dacfbac4c5847e)

Test: art/test/testrunner/testrunner.py -j4 -t 648-many-direct-methods
Bug: 33650497
Change-Id: I63e97d5b7e08d58252ff4831b63c4035ecc55979

7 years agoMerge "Merge internal master oc-dev" into oc-dev
David Sehr [Tue, 25 Apr 2017 16:29:33 +0000 (16:29 +0000)]
Merge "Merge internal master oc-dev" into oc-dev

7 years agoMerge "Ignore the optimized location passed to DexFile.loadDex()" into oc-dev
Calin Juravle [Mon, 24 Apr 2017 22:00:37 +0000 (22:00 +0000)]
Merge "Ignore the optimized location passed to DexFile.loadDex()" into oc-dev

7 years agoMerge internal master oc-dev
David Sehr [Mon, 24 Apr 2017 15:59:08 +0000 (08:59 -0700)]
Merge internal master oc-dev

Fixes for O release, including CC code size issue, JVMTI, ART
vectorization, the borg scanner, secondary dex files, and others.

Bug: 29516974
Bug: 30126666
Bug: 36141117
Bug: 30773047
Bug: 30933338
Test: make -j 40 test-art-host; art/test.py -j 8 --target
Change-Id: I77ea4e19dfa45bdf843f16f74154bf8655c258d8

7 years agoLower profiler saver thread priority.
Nicolas Geoffray [Fri, 21 Apr 2017 13:30:18 +0000 (14:30 +0100)]
Lower profiler saver thread priority.

Spotted while looking at bug reports. Doesn't hurt, and better
be safe than sorry.

bug:37446669
bug:36631902
test:manual, looking at bugreports

(cherry picked from commit 23caed84eba735b2615f5962b5161f6dc9e8bd4e)

Change-Id: I47723e368f3a7d863a9ed2e85c223e6e242508d5

7 years agoMerge "ART: Fix missing include" am: a2dfb0f481 am: 1711753241 am: cfde347c47
Andreas Gampe [Sat, 22 Apr 2017 03:06:44 +0000 (03:06 +0000)]
Merge "ART: Fix missing include" am: a2dfb0f481 am: 1711753241 am: cfde347c47
am: 0d6eea29c1

Change-Id: If1238f081fb3bae5649f59f2d865340544c8749a

7 years agoMerge "ART: Fix missing include" am: a2dfb0f481 am: 1711753241
Andreas Gampe [Sat, 22 Apr 2017 03:03:46 +0000 (03:03 +0000)]
Merge "ART: Fix missing include" am: a2dfb0f481 am: 1711753241
am: cfde347c47

Change-Id: Ib5a457c37bfcb38a931db1ba4ca773bfe33deac9

7 years agoMerge "ART: Fix missing include" am: a2dfb0f481
Andreas Gampe [Sat, 22 Apr 2017 03:00:14 +0000 (03:00 +0000)]
Merge "ART: Fix missing include" am: a2dfb0f481
am: 1711753241

Change-Id: If7f70afee5f91c18cf7589fd858d2a09fd0368df

7 years agoMerge "ART: Fix missing include"
Andreas Gampe [Sat, 22 Apr 2017 02:56:13 +0000 (02:56 +0000)]
Merge "ART: Fix missing include"
am: a2dfb0f481

Change-Id: Ib6fc34ea42d0865a854194bd2b7203e5ba8ed89d

7 years agoMerge "ART: Fix missing include"
Andreas Gampe [Sat, 22 Apr 2017 02:47:13 +0000 (02:47 +0000)]
Merge "ART: Fix missing include"

7 years agoART: Fix missing include
Andreas Gampe [Sat, 22 Apr 2017 02:11:15 +0000 (19:11 -0700)]
ART: Fix missing include

Add required headers.

Bug: 37187694
Test: mmma art
Change-Id: I0f39498453973ed9bfbad97965f2dff215caea98