OSDN Git Service

android-x86/art.git
8 years agoMerge "Relax the DCHECK in load store elimination." into nyc-dev
TreeHugger Robot [Tue, 10 May 2016 09:25:18 +0000 (09:25 +0000)]
Merge "Relax the DCHECK in load store elimination." into nyc-dev

8 years agoRelax the DCHECK in load store elimination.
Nicolas Geoffray [Wed, 4 May 2016 13:00:12 +0000 (14:00 +0100)]
Relax the DCHECK in load store elimination.

The DCHECK was too strong, as we could come from a field or array
get on null, instead of null directly.

bug:27831001

(cherry picked from commit 65fef30952bb92acec7ed36f7f431d93f7ce88b3)

Change-Id: Ia3ba1235e95408d66349a02fc438df9c2cf9e255

8 years agoWorkaround invokesuper underspecified behavior.
Aart Bik [Tue, 5 Apr 2016 00:28:59 +0000 (17:28 -0700)]
Workaround invokesuper underspecified behavior.

The verifier allows invokesuper on a class unrelated
to the referring class. However, the runtime uses the vtable of
the super class of the referring class to lookup the ArtMethod.
Since the receiver has no relation to the referring class, this lead
to either jumping to a wrong method, or "luckily" throw a
NoSuchMethodError if the vtable index is out of bounds of the super
class of the referring class.

This changes the runtime behavior to always throw NoSuchMethodError
when hitting such invokesuper.

Also, we make the verifier consistent with the runtime by treating
such calls unresolved.

bug=27627004

(cherry picked from commit f663e341c550d1aa6f8f587d0ae0dbf7d254ff55)

Change-Id: Ibec5a1e3a3320c474e1e0e5634a9ef62ea734cdf

8 years agoMerge "Hold a ClassLoader reference in NativeAllocationRegistry." into nyc-dev
Richard Uhler [Mon, 9 May 2016 15:50:29 +0000 (15:50 +0000)]
Merge "Hold a ClassLoader reference in NativeAllocationRegistry." into nyc-dev

8 years agoMerge "Fix braino when parsing invoke transition weight." into nyc-dev
TreeHugger Robot [Mon, 9 May 2016 09:15:46 +0000 (09:15 +0000)]
Merge "Fix braino when parsing invoke transition weight." into nyc-dev

8 years agoFix braino when parsing invoke transition weight.
Nicolas Geoffray [Fri, 6 May 2016 15:52:36 +0000 (16:52 +0100)]
Fix braino when parsing invoke transition weight.

bug:27865109
Change-Id: I73e2763216b5596f601c456076c3b01c1dd000da

8 years agoFix test for verification of clinit method
Alex Light [Sat, 7 May 2016 00:36:36 +0000 (17:36 -0700)]
Fix test for verification of clinit method

Bug: 28605638
Change-Id: Idbf2d59c20b7dda1efb9aa61bce2cefbe2c0040a
(cherry picked from commit 0ed0521a7f55b2efef8e71d0802893aa1d5b83e2)

8 years agoMerge "Make <clinit> verification stronger for v37+." into nyc-dev
TreeHugger Robot [Fri, 6 May 2016 23:38:12 +0000 (23:38 +0000)]
Merge "Make <clinit> verification stronger for v37+." into nyc-dev

8 years agoMerge "Fix libart tests on target" into nyc-dev
TreeHugger Robot [Fri, 6 May 2016 21:57:11 +0000 (21:57 +0000)]
Merge "Fix libart tests on target" into nyc-dev

8 years agoMake <clinit> verification stronger for v37+.
Alex Light [Fri, 6 May 2016 17:39:06 +0000 (10:39 -0700)]
Make <clinit> verification stronger for v37+.

Preserve the verification behavior of M for v35 dex files. v37+ get
stronger behavior

Bug: 28605638
Change-Id: If1ff4abcc61e0945f924fe4e10e173c03b4cd1a9
(cherry picked from commit f0ecae7730b6c0145e0176cc619bdfba48201105)

8 years agoFix libart tests on target
Dimitry Ivanov [Fri, 6 May 2016 00:24:28 +0000 (17:24 -0700)]
Fix libart tests on target

1. Add libart/d.so to the list of additional public libraries
2. Fix java.library.path to include /system/lib(64)? for tests
   run by dalvikvm

Bug: http://b/28449304
Change-Id: I11f2dc22e445389160d6f7ed6743bb9664cf3745
(cherry picked from commit 90d48f28af67ab44d755363bf92d57a1b3e72a29)

8 years agoRemove a common subexpression from profman output
David Sehr [Fri, 6 May 2016 19:29:35 +0000 (12:29 -0700)]
Remove a common subexpression from profman output

Change-Id: I12fa4a36f4e9d980a720bb52c6b736ffc91a6700

8 years agoStop populating irreducible loop at header
David Brazdil [Thu, 5 May 2016 10:27:03 +0000 (11:27 +0100)]
Stop populating irreducible loop at header

Recent CL modified the (previously exponential) algorithm for
populating irreducible loops so as to not visit blocks multiple times.
However, the new condition for an early exit did not take into account
that it is not necessary to visit predecessors of the loop header.

The algorithm remains correct but does unnecessary work.

Bug: 27856014
Change-Id: If72f8be82e79838f0dd9678082a3bbaabb51e43b
(cherry picked from commit 5a620590e5cf6d6817693edffd661371555de88b)

8 years agoAdd braces per the coding convention
David Sehr [Thu, 5 May 2016 20:39:43 +0000 (13:39 -0700)]
Add braces per the coding convention

Bug: 28599906
Change-Id: Ie2cb4f6865b7756ceaf65c400a4090fc9423232a

8 years agoLimit profman log spam with time threshold
David Sehr [Thu, 5 May 2016 16:02:38 +0000 (09:02 -0700)]
Limit profman log spam with time threshold

Bug: 28599906
Change-Id: Ibe1001da94c7916761c8f3b4b5dbacd8cf3809a7

8 years agoMerge "Revert "(dl)Close native libraries on unload"" into nyc-dev
Nicolas Geoffray [Thu, 5 May 2016 08:03:20 +0000 (08:03 +0000)]
Merge "Revert "(dl)Close native libraries on unload"" into nyc-dev

8 years agoRevert "(dl)Close native libraries on unload"
Nicolas Geoffray [Thu, 5 May 2016 08:02:57 +0000 (08:02 +0000)]
Revert "(dl)Close native libraries on unload"

Failures on test 136.

Bug: http://b/28406866

This reverts commit 35f01195c4cf6e3c6fbb8b51f5a41b26132b4bdd.

Change-Id: I0c581e6f1aeb61285d3b132dbd9508e611ee4258

8 years agoMerge "(dl)Close native libraries on unload" into nyc-dev
Dimitry Ivanov [Wed, 4 May 2016 22:22:06 +0000 (22:22 +0000)]
Merge "(dl)Close native libraries on unload" into nyc-dev

8 years agoMerge "Do not look at dead phis during SsaRedundantPhiElimination." into nyc-dev
TreeHugger Robot [Wed, 4 May 2016 14:34:57 +0000 (14:34 +0000)]
Merge "Do not look at dead phis during SsaRedundantPhiElimination." into nyc-dev

8 years agoDo not look at dead phis during SsaRedundantPhiElimination.
Nicolas Geoffray [Wed, 4 May 2016 11:05:56 +0000 (12:05 +0100)]
Do not look at dead phis during SsaRedundantPhiElimination.

Otherwise, we may replace a dead loop phi with its incoming input.
This broke an assumption during liveness analysis in the presence
of irreducible loops.

bug:28256552

(cherry picked from commit 05b3fa02ed8ef62841a92cd96526ba3a06bf1f63)

Change-Id: I297c8fbd9a2414dd852aa932595f7b42d8f1a584

8 years agoMerge "Check if a class is verified before visiting profiling info." into nyc-dev
TreeHugger Robot [Wed, 4 May 2016 12:17:15 +0000 (12:17 +0000)]
Merge "Check if a class is verified before visiting profiling info." into nyc-dev

8 years agoCheck if a class is verified before visiting profiling info.
Nicolas Geoffray [Wed, 4 May 2016 08:51:24 +0000 (09:51 +0100)]
Check if a class is verified before visiting profiling info.

The call to IsNative expects non-retired classes, and we know
we don't have any profiling info for non-verified classes anyway.

bug:28542527

(cherry picked from commit 022dd86f9c1fd63dfd7e052a876289387393a78f)

Change-Id: I247ce08b6996bdae526a5e106dacdbb7b70504af

8 years agoMerge "Put a handle on the String object." into nyc-dev
TreeHugger Robot [Wed, 4 May 2016 10:22:00 +0000 (10:22 +0000)]
Merge "Put a handle on the String object." into nyc-dev

8 years agoPut a handle on the String object.
Nicolas Geoffray [Tue, 3 May 2016 13:04:02 +0000 (14:04 +0100)]
Put a handle on the String object.

Otherwise, a GC could occur in the loop below, and the String
be moved (note that there was already one for the Class object to
protect for that same problem).

bug:27561834

(cherry picked from commit a96f316f6f0526c91c6c102a267df6b1e4df39da)

Change-Id: I89c093dd67982abb3502975097a337c7e3816360

8 years agoMerge "ART: Dump more OatDexFile data in oatdump" into nyc-dev
TreeHugger Robot [Tue, 3 May 2016 23:53:52 +0000 (23:53 +0000)]
Merge "ART: Dump more OatDexFile data in oatdump" into nyc-dev

8 years ago(dl)Close native libraries on unload
Dimitry Ivanov [Tue, 3 May 2016 22:05:41 +0000 (15:05 -0700)]
(dl)Close native libraries on unload

Dlclose native libraries when VM unloads a classloader. This
change is made to avoid leakage of adress space and RSS for
mapped but unreachable native libraries.

Bug: http://b/28406866
Change-Id: Iccaa87210908872c2013506d8a310955c1e3d888

8 years agoFix vtable corruption.
Alex Light [Tue, 3 May 2016 01:51:34 +0000 (18:51 -0700)]
Fix vtable corruption.

Due to failing to keep track of superclass implementations of
interface methods we could end up in situations where methods were
placed onto a class's vtable multiple times. This could cause virtual
and interface dispatches on subclasses to fail by causing corruption
of the subclass's vtable and iftable.

Bug: 28333278

(cherry picked from commit d6c2bfaff8850a9a02ee9b75cf8c96eadd8d5c69)

Change-Id: I37d9740ca912daf37cdf9ff82697bbc5db46177a

8 years agoHold a ClassLoader reference in NativeAllocationRegistry.
Richard Uhler [Tue, 3 May 2016 20:05:50 +0000 (13:05 -0700)]
Hold a ClassLoader reference in NativeAllocationRegistry.

So that the native library isn't unloaded before we have a chance to
call the freeFunction.

Bug: 28406866
Change-Id: Iafe4fdc68482b68a4b14d10880fa15dcbb65adf2

8 years agoART: Dump more OatDexFile data in oatdump
Andreas Gampe [Sat, 30 Apr 2016 00:52:07 +0000 (17:52 -0700)]
ART: Dump more OatDexFile data in oatdump

Add some stats about the enclosed dex file and type table when
dumping an oat file.

Bug: 28251566
Change-Id: I80c14e85d68cd1e3e4c64b7b9d86059d5ac8a6ad

8 years agoMerge "DexFile: Add an API to query oat file status." into nyc-dev
Narayan Kamath [Tue, 3 May 2016 11:31:00 +0000 (11:31 +0000)]
Merge "DexFile: Add an API to query oat file status." into nyc-dev

8 years agoDexFile: Add an API to query oat file status.
Narayan Kamath [Mon, 2 May 2016 12:14:48 +0000 (13:14 +0100)]
DexFile: Add an API to query oat file status.

Adds DexFile.getDexFileStatus(path), which returns an opaque,
human-readable string representation of the oat file status. This
representation isn't guaranteed to be stable and can change from
release to release.

bug: 27494108

Change-Id: I5fc42225ae65eb19dcd0c619a40cf674b34fc49c

8 years agoFix check_jni_compiler tests
Dimitry Ivanov [Fri, 29 Apr 2016 18:14:25 +0000 (11:14 -0700)]
Fix check_jni_compiler tests

Test needs to initialize nativeloader on runtime->Start(),
and reset it when runtime is stopped.

Bug: http://b/28449304
Change-Id: I0ba946fe5fc2817dff73154e3191444106dfcb08
(cherry picked from commit 5edb063fc050bad66fe4ae41c93f6d08b0ccccfe)

8 years agoSupply librarySearchPath to PathClassLoader
Dimitry Ivanov [Thu, 28 Apr 2016 23:29:22 +0000 (16:29 -0700)]
Supply librarySearchPath to PathClassLoader

PathClassLoader needs librarySearchPath in order to
be able to find native libraries.

The java.library.path property is no longer implicitly
applied to all basedexclassloaders, and needs to be
passed explicitly.

Bug: http://b/28449304
Change-Id: Id5b4273553d783c0f7a964f72ecb2c99f3aeaf6f
(cherry picked from commit 3a79b6389df39928823a7a8e862c2f647a1cd164)

8 years agoMerge "Reset NativeLoader on DestroyJavaVM" into nyc-dev
Dimitry Ivanov [Mon, 2 May 2016 21:20:00 +0000 (21:20 +0000)]
Merge "Reset NativeLoader on DestroyJavaVM" into nyc-dev

8 years agoReset NativeLoader on DestroyJavaVM
Dimitry Ivanov [Fri, 29 Apr 2016 23:02:38 +0000 (16:02 -0700)]
Reset NativeLoader on DestroyJavaVM

Native loader keeps vector of weak references
to classloader. ResetNativeLoader instructs
it to clear this vector once JavaVM is
destroyed.

Bug: http://b/28453840
Change-Id: I45e38c45268a741d86ec686266b13fde7d5fb9a2

8 years agoMerge "Fix profile saver to use base dex location" into nyc-dev
Mathieu Chartier [Sat, 30 Apr 2016 01:52:04 +0000 (01:52 +0000)]
Merge "Fix profile saver to use base dex location" into nyc-dev

8 years agoMerge "Correct monitor pool synchronization" into nyc-dev
Hans Boehm [Sat, 30 Apr 2016 00:37:45 +0000 (00:37 +0000)]
Merge "Correct monitor pool synchronization" into nyc-dev

8 years agoMerge "ART: Disambiguate access-checks mode from lock-counting" into nyc-dev
Andreas Gampe [Fri, 29 Apr 2016 23:13:53 +0000 (23:13 +0000)]
Merge "ART: Disambiguate access-checks mode from lock-counting" into nyc-dev

8 years agoMerge "ART: Fix Mac build" into nyc-dev
Andreas Gampe [Fri, 29 Apr 2016 23:04:50 +0000 (23:04 +0000)]
Merge "ART: Fix Mac build" into nyc-dev

8 years agoART: Fix Mac build
Andreas Gampe [Fri, 29 Apr 2016 22:04:49 +0000 (15:04 -0700)]
ART: Fix Mac build

Fix Mac build after fc6898769ae1ef91ec3e41c0a273401213cb82cd.

Bug: 28423466
Change-Id: I6942bc86f1b0819d84bced5499afb0a4d235a39e

8 years agoMerge "Add ability to see if a dex file is backed by an oat file." into nyc-dev
Jeff Hao [Fri, 29 Apr 2016 21:07:48 +0000 (21:07 +0000)]
Merge "Add ability to see if a dex file is backed by an oat file." into nyc-dev

8 years agoFix profile saver to use base dex location
Mathieu Chartier [Fri, 29 Apr 2016 19:03:56 +0000 (12:03 -0700)]
Fix profile saver to use base dex location

Previously we were using the dex location. This only matches the
base location for the main dex file, and resulted in only the
main dex file to have classes recorded.

Bug: 28463739

Change-Id: I0117352150c7244dd048338dbb677abdd4554eb0

8 years agoCorrect monitor pool synchronization
Hans Boehm [Wed, 27 Apr 2016 22:04:24 +0000 (15:04 -0700)]
Correct monitor pool synchronization

The previous implementation allowed a thread looking up a monitor
to see an uninitialized monitor_chunks_ list if the list had
just been resized. The obvious small fix would be to replace the
relaxed load in LookupMonitor with an acquire load. But the
extra fence (on ARM) may involve an appreciable performance hit.

This instead redesigns the data structure to avoid the race in
LookupMonitor, along with the need to use atomics there at all. The
down side is a little more address arithmetic in LookupMonitor(),
a mild decrease in the limit on the total number of monitors, and
use of one extra page, since we now always reserve space for the
first page worth of monitor chunk pointers.

To me, the new algorithm feels cleaner and easier to reason about.

Although this problem was externally reported, it seems unlikely
that it was responsible for frequent failures. It could only
be triggered when the monitor chunk list was resized, which should
be quite rare.

Bug: 28385279
Change-Id: I433155d91702878f6b114480eda1fbf09706f623
(cherry picked from commit a319f4dbeea00701a0d12dc39b7bf0a5323f6b2a)

8 years agoMerge "Deduplicate simple roots in hprof." into nyc-dev
Richard Uhler [Fri, 29 Apr 2016 19:51:13 +0000 (19:51 +0000)]
Merge "Deduplicate simple roots in hprof." into nyc-dev

8 years agoMerge "ART: Log all monitor operations to systrace" into nyc-dev
TreeHugger Robot [Fri, 29 Apr 2016 18:37:18 +0000 (18:37 +0000)]
Merge "ART: Log all monitor operations to systrace" into nyc-dev

8 years agoMerge "Add null checks to weak DexCache references" into nyc-dev
Brian Carlstrom [Fri, 29 Apr 2016 18:02:58 +0000 (18:02 +0000)]
Merge "Add null checks to weak DexCache references" into nyc-dev

8 years agoMerge "ART: Add missing EXPORT_PCs to x86/_64 mterp" into nyc-dev
Bill Buzbee [Fri, 29 Apr 2016 17:37:28 +0000 (17:37 +0000)]
Merge "ART: Add missing EXPORT_PCs to x86/_64 mterp" into nyc-dev

8 years agoAdd null checks to weak DexCache references
Brian Carlstrom [Fri, 29 Apr 2016 17:28:34 +0000 (10:28 -0700)]
Add null checks to weak DexCache references

Bug: 28452385
Change-Id: I88243af47b8e091c360927d1bdb867770f092475

8 years agoMerge "Add contender method for lock contention" into nyc-dev
Mathieu Chartier [Fri, 29 Apr 2016 17:24:42 +0000 (17:24 +0000)]
Merge "Add contender method for lock contention" into nyc-dev

8 years agoAdd contender method for lock contention
Mathieu Chartier [Fri, 29 Apr 2016 00:21:08 +0000 (17:21 -0700)]
Add contender method for lock contention

Now prints the method that is attempting to acquire the lock.

Bug: 28223501
Change-Id: I47c4261d14d8767a873594594b7675a176b71d70

8 years agoART: Log all monitor operations to systrace
Andreas Gampe [Tue, 26 Apr 2016 03:08:55 +0000 (20:08 -0700)]
ART: Log all monitor operations to systrace

Add a VLOG option ("-verbose:systrace-locks") to log all monitor
operations to systrace. This requires non-fastpath thread
entrypoints, and ATRACE tags for locking and unlocking.

Do a bit of cleanup to the entrypoint initialization to share
common setup.

Bug: 28423466
Change-Id: Ie67e4aa946ec15f8fcf8cb7134c5d3cff0119ab3

8 years agoART: Add missing EXPORT_PCs to x86/_64 mterp
buzbee [Thu, 28 Apr 2016 23:08:44 +0000 (16:08 -0700)]
ART: Add missing EXPORT_PCs to x86/_64 mterp

Any time there is a possiblity that execution flow will leave
the mterp environment and transition either to an alternate
interpreter or compiled code, we need to export the cached copy of
the current Dalvik PC.  One path out related to on-stack-replacement
was missed in both x86 and x86_64 versions of mterp (other targets
are OK).

Note that there is an outstanding feature request to add support
to catch missing EXPORT_PCs (Bug: 26572899), though as envisioned
it would not have caught this one.

Bug: 28249238

(cherry picked from commit 963758dbfbbbc95bbfa82d5e02258d9fd481a459)

Change-Id: I3936509665636c0b77580dda12520a82ee814fa5

8 years agoRemove invoke after inlining.
Nicolas Geoffray [Fri, 29 Apr 2016 12:56:01 +0000 (13:56 +0100)]
Remove invoke after inlining.

bug:28460178

(cherry picked from commit 1be7cbd532a41981019f1e89c8ecf404bc9af809)

Change-Id: I9a84af048600a4653af284a9b171c2ba4c4dcca5

8 years agoMerge "Fix how the ProfileSaver thread attaches to the runtime." into nyc-dev
Calin Juravle [Fri, 29 Apr 2016 11:15:33 +0000 (11:15 +0000)]
Merge "Fix how the ProfileSaver thread attaches to the runtime." into nyc-dev

8 years agoFix how the ProfileSaver thread attaches to the runtime.
Calin Juravle [Thu, 28 Apr 2016 11:59:33 +0000 (12:59 +0100)]
Fix how the ProfileSaver thread attaches to the runtime.

If the runtime is shutting down we can't attach new threads. In this
case it is expected that Runtime::Attach returns nullptr.

Also, lower the serverity of the log to warning so that it does not
show up in the run-tests.

Bug: 28435649
Change-Id: I208bcd6f0f7e35ae6471e263dee00d3ab68b3b8f

8 years agoART: Disambiguate access-checks mode from lock-counting
Andreas Gampe [Thu, 28 Apr 2016 21:56:54 +0000 (14:56 -0700)]
ART: Disambiguate access-checks mode from lock-counting

Lock-counting (when structural locking verification failed) is a
special sub-mode of access-checks and must be disambiguated, because
we currently use access-checks mode class-wide when at least one
method soft-fails, but do not stop the compiler/JIT to compile
the "working" methods. So we may end up in the access-checks
interpreter for a working method through deopt without knowing
which locks are already held.

Bug: 28351535
Change-Id: I083032f064d88df8f8f0611ad8b57d1b39cd09fb

8 years agoRevert "Revert "Write conflict tables in image""
Mathieu Chartier [Thu, 28 Apr 2016 16:44:54 +0000 (09:44 -0700)]
Revert "Revert "Write conflict tables in image""

Added test.

Bug: 27906566

This reverts commit 8e2478d23e89a7022c93ddc608dcbba7b29b91e6.

Change-Id: I0894f5f7cd11af29ed9d0345b51f527fc8a41d19

8 years agoAdd ability to see if a dex file is backed by an oat file.
Jeff Hao [Fri, 22 Apr 2016 21:00:06 +0000 (14:00 -0700)]
Add ability to see if a dex file is backed by an oat file.

Native support for new DexFile.isBackedByOatFile.

Part of a multi-project change.

Bug: 26880306

(cherry-picked from commit 93a66cc779898d46c620e5d9c8bc71e2a71f6610)

Change-Id: I15e8ec44a216b13e494affd2fd3ff5f66fa79597

8 years agoMerge "Fix -Xint and -Xusejit interaction" into nyc-dev
Calin Juravle [Thu, 28 Apr 2016 15:32:33 +0000 (15:32 +0000)]
Merge "Fix -Xint and -Xusejit interaction" into nyc-dev

8 years agoMerge "ART: add exynos-m1 to a53 #835769 & #843419 erratum exception list" into nyc-dev
Vladimir Marko [Thu, 28 Apr 2016 15:20:32 +0000 (15:20 +0000)]
Merge "ART: add exynos-m1 to a53 #835769 & #843419 erratum exception list" into nyc-dev

8 years agoMerge "Decrease transition weight." into nyc-dev
TreeHugger Robot [Thu, 28 Apr 2016 14:20:59 +0000 (14:20 +0000)]
Merge "Decrease transition weight." into nyc-dev

8 years agoFix -Xint and -Xusejit interaction
Calin Juravle [Wed, 27 Apr 2016 17:50:45 +0000 (18:50 +0100)]
Fix -Xint and -Xusejit interaction

- don't allow interpret and jit compilation at the same time
- make sure we -Xsaveprofileinfo works with -Xint.

Bug: 27916886
Change-Id: Icab85e5b6f576f82374d5f88145cc81595afce37

8 years agoART: add exynos-m1 to a53 #835769 & #843419 erratum exception list
Junmo Park [Wed, 27 Apr 2016 07:51:50 +0000 (16:51 +0900)]
ART: add exynos-m1 to a53 #835769 & #843419 erratum exception list

Exynos-M1 is custom-designed 64-bit ARM CPU and does not need this A53
erratum handling.

Bug: 28412250
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
(cherry picked from commit 2bd7d2d6d92daa796ee33e70bb788d3dae1f2fc9)

Change-Id: Id460e4e98baafeed1cf3540cec754b30044cda11

8 years agoDecrease transition weight.
Nicolas Geoffray [Thu, 28 Apr 2016 12:56:04 +0000 (13:56 +0100)]
Decrease transition weight.

bug:27865109
Change-Id: I551040e61f36fc675c0f5d1c3907c690112a84be

8 years agoForbid HDeoptimize instructions in OSR methods.
Nicolas Geoffray [Fri, 22 Apr 2016 12:16:14 +0000 (13:16 +0100)]
Forbid HDeoptimize instructions in OSR methods.

Otherwise dominated instructions will assume something that
isn't necessarily correct if coming from the interpreter.

bug:28335959
bug:28249238
bug:28348878
bug:28080135

Contains fix from https://android-review.googlesource.com/#/c/220661/.

(cherry picked from commit 93a18c5d4160f632ecdb92af099574e9c7098c49)

Change-Id: I86c3f9340077caa0a3e3db896e0519e7d38d91a0

8 years agoMerge "ART: Disable back edge uses for irreducible loops" into nyc-dev
David Brazdil [Thu, 28 Apr 2016 08:23:15 +0000 (08:23 +0000)]
Merge "ART: Disable back edge uses for irreducible loops" into nyc-dev

8 years agoMerge "Initialize native loader on JNI_CreateJavaVM" into nyc-dev
Dimitry Ivanov [Wed, 27 Apr 2016 23:37:10 +0000 (23:37 +0000)]
Merge "Initialize native loader on JNI_CreateJavaVM" into nyc-dev

8 years agoMerge "Revert "Write conflict tables in image"" into nyc-dev
Mathieu Chartier [Wed, 27 Apr 2016 21:20:06 +0000 (21:20 +0000)]
Merge "Revert "Write conflict tables in image"" into nyc-dev

8 years agoRevert "Write conflict tables in image"
Mathieu Chartier [Wed, 27 Apr 2016 21:03:42 +0000 (21:03 +0000)]
Revert "Write conflict tables in image"

Some strange issues on angler.

This reverts commit cda9386add68d94697449c6cb08b356747e55c21.

Change-Id: Iba3a8bac6ce40ee16d83163823356951fecb6787

8 years agoInitialize native loader on JNI_CreateJavaVM
Dimitry Ivanov [Thu, 21 Apr 2016 23:01:24 +0000 (16:01 -0700)]
Initialize native loader on JNI_CreateJavaVM

We need to initialize native loader in order to
be able to use JNI from any VM, be it dalvikvm
or VM started by zygote.

Bug: http://b/28082914
Bug: http://b/28320913
Change-Id: Ice9a33a736d7c6ec3af9a5a0fb25a378ad9d2c59
(cherry picked from commit 041169f7ca703d560a819e7a568170731d4ecdd6)

8 years agoMerge "Support to pass <uses-library> option through to dex2oat." into nyc-dev
Jeff Hao [Wed, 27 Apr 2016 19:54:02 +0000 (19:54 +0000)]
Merge "Support to pass <uses-library> option through to dex2oat." into nyc-dev

8 years agoMerge "Write conflict tables in image" into nyc-dev
Mathieu Chartier [Wed, 27 Apr 2016 18:29:20 +0000 (18:29 +0000)]
Merge "Write conflict tables in image" into nyc-dev

8 years agoSupport to pass <uses-library> option through to dex2oat.
Jeff Hao [Wed, 27 Apr 2016 18:07:41 +0000 (11:07 -0700)]
Support to pass <uses-library> option through to dex2oat.

This change takes an app's shared libraries specified by <uses-library>
and passes it through to dex2oat to be used during compilation.

Part of a multi-project change.

Includes fix from a6d46161aea07ebd1cbd6ab78b2b323f940e9c1e

Bug: 26880306

(cherry-picked from commit 26e8a2f150cd7f7195a10650ab8a5b6fa5014bc8)

Change-Id: I6bfc13693dbb835ca52fed2d03ec5346d43ec5d9

8 years agoWrite conflict tables in image
Mathieu Chartier [Thu, 14 Apr 2016 17:49:19 +0000 (10:49 -0700)]
Write conflict tables in image

Add image sections for runtime methods and conflict tables. This
makes it that we do not need to fake up a length prefixed array
for runtime methods.

Reduces .art private dirty and PSS.

System wide .art PSS goes from 32.5MB to 30.5MB after system boot.

Business card .art private dirty goes from 588K to 504K.

Increases image size by ~100K.

Bug: 27906566

Change-Id: I38cbe3150c3eeb385b8cad7cf93614e3980f4162

8 years agoART: Disable back edge uses for irreducible loops
David Brazdil [Wed, 27 Apr 2016 14:33:22 +0000 (15:33 +0100)]
ART: Disable back edge uses for irreducible loops

Algorithm adding back edge uses in liveness analysis makes assumptions
about the linear order which are not met in the presence of irreducible
loops. Disable back edges uses when the graph contains them.

This partially reverts CL I63632e8819ea3644d5c6fdfea00b66128bf22c24.

Bug: 28252747
Bug: 27615840
Bug: 27624868
Change-Id: I7ecdde0ed8a8831f7513b8e43cf7d84599b830a7
(cherry picked from commit 07b35109c64fc449a14723b259df17806fd0b16e)

8 years agoAdd command line option for jit invoke transition weight
Calin Juravle [Wed, 27 Apr 2016 13:14:58 +0000 (14:14 +0100)]
Add command line option for jit invoke transition weight

Bug: 27865109
Change-Id: If5eb53714e2c92397ad3e45bc0b4facb84329bc2

8 years agoSplit profile recording from jit compilation
Calin Juravle [Wed, 20 Apr 2016 13:22:09 +0000 (14:22 +0100)]
Split profile recording from jit compilation

We still use ProfileInfo objects to record profile information. That
gives us the flexibility to add the inline caches in the future and the
convenience of the already implemented GC.

If UseJIT is false and SaveProfilingInfo true, we will only record the
ProfileInfo and never launch compilation tasks.

Bug: 27916886
Change-Id: I6e4768dc5d58f2f85f947b276b4244aa11ce3fca

8 years agoMerge "Thumb2: Reduce memory used for fixup dependencies." into nyc-dev
Vladimir Marko [Wed, 27 Apr 2016 09:04:21 +0000 (09:04 +0000)]
Merge "Thumb2: Reduce memory used for fixup dependencies." into nyc-dev

8 years agoDeduplicate simple roots in hprof.
Richard Uhler [Tue, 26 Apr 2016 20:28:59 +0000 (13:28 -0700)]
Deduplicate simple roots in hprof.

Bug: 28311991
Change-Id: Id5ee7d7753016fafdec0c8f5cda5b1b052fa9ad1

8 years agoMerge "Test component type for errors too. With regression test." into nyc-dev
Aart Bik [Tue, 26 Apr 2016 19:55:48 +0000 (19:55 +0000)]
Merge "Test component type for errors too. With regression test." into nyc-dev

8 years agoTest component type for errors too.
Aart Bik [Mon, 25 Apr 2016 19:51:37 +0000 (12:51 -0700)]
Test component type for errors too.
With regression test.

Rationale:
Moved erroneous check in convenience method, so we
put all the same logic in one place. When testing
for erroneous T[], check both the array type
as well at the component type T for errors
(it is possible T[] is not marked erroneous
even though T is eventually).

BUG=28358598

(cherry picked from commit f417ff44d1eb111854d7a213f106912b3dd9e3d4)

Change-Id: Ieba66aa4b55d8e7ebddf200239c7e4095dfd4678

8 years agoThumb2: Reduce memory used for fixup dependencies.
Vladimir Marko [Mon, 25 Apr 2016 12:43:50 +0000 (12:43 +0000)]
Thumb2: Reduce memory used for fixup dependencies.

Mark fixups for far backward branches as 32-bit from the
beginning and ignore their dependencies since they cannot
be expanded anymore. This reduces the memory used by the
fixup_dependents_ when compiling methods with a lot of
slow paths.

Bug: 28256882

This is a cherry-pick of the fixed revert-revert
    Revert "Revert "Thumb2: Reduce memory used for fixup dependencies.""
    (cherry picked from commit a64f249add4a0a9e93aa6f246045ca79f5916dcd)

Change-Id: I9ca766b73d9f5a1da5dc10ad070145ac88fbcd53

8 years agoReduce memory lost by ArenaAllocator for large allocations.
Vladimir Marko [Fri, 22 Apr 2016 17:07:13 +0000 (18:07 +0100)]
Reduce memory lost by ArenaAllocator for large allocations.

When allocating from a new arena, check if the old arena has
more remaining space than the new one after the current
allocation. If so, keep using the old arena to reduce the
amount of "lost" arena memory. This can happen when we try
to allocate more than half the default arena size. If the
allocation exceeds the default arena size, it's very likely
to happen even though the ArenaPool could still provide some
much larger previously allocated arena.

Also avoid artithmetic overflow when checking if the
request can be satisfied from the current arena.
And abort immediately if calloc() fails.

Bug: 28173563
Bug: 28256882

In addition to the initial CL
    (cherry picked from commit 3e0e7173c0cdfc57dba39fe781e30d187d50fa9c)
this contains a squashed subsequent fix
    Fix valgrind tests: mark allocated space as defined.
    (cherry picked from commit 3f84f2cb3cadc25d75e1e3e2c1bc26c1a671f336)

Change-Id: Id80d5601874e8e28d930c0dd47a51c73c4810094

8 years agoMerge "ART: Change x86 from modify_ldt to set_thread_data" into nyc-dev
Andreas Gampe [Tue, 26 Apr 2016 00:32:38 +0000 (00:32 +0000)]
Merge "ART: Change x86 from modify_ldt to set_thread_data" into nyc-dev

8 years agoMerge "Make a fake libart for misbehaving apps." into nyc-dev
TreeHugger Robot [Mon, 25 Apr 2016 21:53:29 +0000 (21:53 +0000)]
Merge "Make a fake libart for misbehaving apps." into nyc-dev

8 years agoMake sure the referring class is in the dex cache.
Nicolas Geoffray [Mon, 25 Apr 2016 13:58:06 +0000 (14:58 +0100)]
Make sure the referring class is in the dex cache.

The method CanAccessResolvedMethod expects the referring class
in the dex file is already in the dex cache, which is true during AOT,
but not necessarilly during JIT.

bug:28295348

(cherry picked from commit 393fdb8b4822d80bbbd6347b088e28c03a72289e)

Change-Id: I9665d377070278639eb4b5a6eeced85d656e6cb6

8 years agoART: Fix ROR Checker test
David Brazdil [Mon, 25 Apr 2016 16:47:43 +0000 (17:47 +0100)]
ART: Fix ROR Checker test

Recent update of Jack started encoding "x << -2" as "x << 30". Update
the corresponding Checker test to accept both values.

Bug: 28244190
Change-Id: I65833afa416a7eb8fa05d381cff547a58dcc0bea
(cherry picked from commit 22c1f543ed75114d8ee5219598ba766e7dc674c0)

8 years agoART: Change x86 from modify_ldt to set_thread_data
Andreas Gampe [Tue, 16 Feb 2016 23:58:20 +0000 (15:58 -0800)]
ART: Change x86 from modify_ldt to set_thread_data

Do not use modify_ldt, so it can be deprecated.

Bug: 27199066
Change-Id: Ib5fb40d4f720b697d786c5c971638fd57681d308
(cherry picked from commit 8a2c62c62b3398afbac00b1cb8772ae5b53b62a3)

8 years agoAdd flag to ArtMethod to skip compilation.
Nicolas Geoffray [Wed, 20 Apr 2016 15:27:53 +0000 (16:27 +0100)]
Add flag to ArtMethod to skip compilation.

To ensure even the JIT will not try to compile methods with
soft failures a runtime_throw.

bug:28293819
bug:28313047

(cherry picked from commit 250a378d5a2152662e0fa820f2b38f794ddd3596)

Change-Id: Ic6d019bc2dd24e35e1377a6c3f8530348c1049df

8 years agoMerge "ART: Naive NullCheck elimination in InstructionBuilder" into nyc-dev
David Brazdil [Mon, 25 Apr 2016 08:22:00 +0000 (08:22 +0000)]
Merge "ART: Naive NullCheck elimination in InstructionBuilder" into nyc-dev

8 years agoMerge "Add support for eagerly calculating conflict tables" into nyc-dev
Mathieu Chartier [Fri, 22 Apr 2016 20:34:17 +0000 (20:34 +0000)]
Merge "Add support for eagerly calculating conflict tables" into nyc-dev

8 years agoAdd support for eagerly calculating conflict tables
Mathieu Chartier [Thu, 14 Apr 2016 17:49:19 +0000 (10:49 -0700)]
Add support for eagerly calculating conflict tables

Will be used to put them in the image by having the compiler eagerly
calculate them.

Enabled for debug builds (non compiler). Support for having conflict
tables written in the image will come in the next CL.

Bug: 27906566

Change-Id: I03d1671a4b49317aaab5a741bbeaed7957cd6229

8 years agoMerge "ART: Disable unstarted runtime pow test for valgrind" into nyc-dev
TreeHugger Robot [Fri, 22 Apr 2016 19:32:44 +0000 (19:32 +0000)]
Merge "ART: Disable unstarted runtime pow test for valgrind" into nyc-dev

8 years agoMerge "ART: Slightly change InitializeClass flow" into nyc-dev
TreeHugger Robot [Fri, 22 Apr 2016 18:36:16 +0000 (18:36 +0000)]
Merge "ART: Slightly change InitializeClass flow" into nyc-dev

8 years agoART: Disable unstarted runtime pow test for valgrind
Andreas Gampe [Fri, 22 Apr 2016 00:23:31 +0000 (17:23 -0700)]
ART: Disable unstarted runtime pow test for valgrind

Valgrind seems to give the wrong result. Disable test for now.

Bug: 27265238

(cherry picked from commit b6795157fd010375ca646ea95e972b616b4aeeaf)

Change-Id: I2b136abc107b53d89b70ccb20dd378a7b704d077

8 years agoART: Naive NullCheck elimination in InstructionBuilder
David Brazdil [Fri, 22 Apr 2016 15:57:00 +0000 (16:57 +0100)]
ART: Naive NullCheck elimination in InstructionBuilder

Save a little bit of memory by not generating trivially redundant
HNullCheck instructions. This patch builds on the fact that the
InstructionBuilder now directly generates SSA form and looks at the
input of the NullCheck. For obvious cases, such as NewInstance/Array
or `this`, the NullCheck generation is completely avoided.

Bug: 28173563
Change-Id: I1fdf3b096c7a939f7b8586c02a2a6b44dfa43443
(cherry picked from commit c120bbe26fe116d3c9d8322f44bb9e330e07f745)

8 years agoART: Slightly change InitializeClass flow
Andreas Gampe [Thu, 21 Apr 2016 19:21:55 +0000 (12:21 -0700)]
ART: Slightly change InitializeClass flow

Since 884f3b83ed6b2a378535ac6b2be57d6b2e22de09, verification isn't
run completely under a class' lock. This means it is possible to
race from unverified to initialized in InitializeClass. So check
the class state after VerifyClass, and handle new success and
failure cases.

Bug: 28254258
Change-Id: I22a6121477e409987281bc81c28b6c942f1bd319

8 years agoMerge "Make dex file loading failure more explicit about failure." into nyc-dev
TreeHugger Robot [Thu, 21 Apr 2016 23:14:05 +0000 (23:14 +0000)]
Merge "Make dex file loading failure more explicit about failure." into nyc-dev

8 years agoMerge "Fix interaction between instrumentation and jit lock." into nyc-dev
TreeHugger Robot [Thu, 21 Apr 2016 22:16:57 +0000 (22:16 +0000)]
Merge "Fix interaction between instrumentation and jit lock." into nyc-dev

8 years agoMake dex file loading failure more explicit about failure.
Alex Light [Wed, 20 Apr 2016 21:26:34 +0000 (14:26 -0700)]
Make dex file loading failure more explicit about failure.

We make sure that if we fail to load a dex file due to having an
unsupported dex version number we will say so explicitly in the
exceptions.

Bug: 28269864
Change-Id: I3c61d088cd0d04cf2a02246e69a4161180e3f2d8
(cherry picked from commit 3045b66613404fa973aafc8c2aae3728e9c12d9a)