OSDN Git Service

android-x86/art.git
8 years agomerge in mnc-mr1-release history after reset to mnc-dr-dev marshmallow-x86 android-x86-6.0-r1 android-x86-6.0-r2 android-x86-6.0-r3
The Android Automerger [Thu, 29 Oct 2015 08:00:16 +0000 (01:00 -0700)]
merge in mnc-mr1-release history after reset to mnc-dr-dev

8 years ago[WIP] ART: Write-protect TLS
Andreas Gampe [Tue, 27 Oct 2015 03:47:28 +0000 (20:47 -0700)]
[WIP] ART: Write-protect TLS

Change-Id: I6762a3a30d01bd6eb8bb25f23f390c91147fe9b4

8 years agoFix in reference type propagation
Calin Juravle [Fri, 16 Oct 2015 15:28:46 +0000 (16:28 +0100)]
Fix in reference type propagation

We miss updating the type of objects if their nullability gets updated
first.

Bug: 25008765
(cherry picked from commit 83853392e26b2aa48328bb90c9f9c57b32c280dc)

Change-Id: I81aa759d96008251d74f941494abe74aa4b52bdc

8 years agoParse runtime compiler options for JIT
Mathieu Chartier [Fri, 16 Oct 2015 01:19:01 +0000 (18:19 -0700)]
Parse runtime compiler options for JIT

For the case where the CppDefines do not match the device the JIT is
running on.

Sample logcat output to prove it works:
JIT instruction set variant krait
JIT instruction set features default

Bug: 24982714

(cherry picked from commit 085fc87e7ea42989a4a00cacb0c9c3a6d2590af6)

Change-Id: I1f4991a5d7cdc6101d1b0ecbcb39fb26dd20180a

8 years agoART: Add missing GetInterfaceMethodIfProxy
Andreas Gampe [Wed, 9 Sep 2015 00:42:59 +0000 (17:42 -0700)]
ART: Add missing GetInterfaceMethodIfProxy

Add missing uses of GetInterfaceMethodIfProxy in reflection code.

Add a test case for a JNI call to a proxy method.

Bug: https://code.google.com/p/android-developer-preview/issues/detail?id=2973
Bug: 23886441

(cherry picked from commit e80673245c0433a71a4930e460be5dc0920885b2)

Change-Id: I5b66b64b5561fcee15d0314707d67e8abc02ce5b

8 years agoART: Decrease dex2oat watchdog timeout
Andreas Gampe [Mon, 14 Sep 2015 22:34:38 +0000 (15:34 -0700)]
ART: Decrease dex2oat watchdog timeout

Keep the dex2oat watchdog timeout lower than the package manager
timeout, so that dex2oat kills itself before the system server
watchdog kills the system because of the long installation.

Bug: 23629410

(cherry picked from commit 540138ae55ac1909606a436d7f52e20146c56657)

Change-Id: I425b19ab305cfaa43f6bddc3a892be892acaf513

8 years agoDO NOT MERGE Add locking to prevent races between setting class methods and marking
Mathieu Chartier [Thu, 8 Oct 2015 22:17:15 +0000 (15:17 -0700)]
DO NOT MERGE Add locking to prevent races between setting class methods and marking

There was a race condition between VisitNativeRoots and threads which were
updating the lengths and pointers of the direct or virtual methods of classes.

For example:
The thread doing VisitNativeRoots could see a null pointer with a non 0 length if
another thread had changed the length but not the pointer.

The fix is already in master, do not merge.

Bug: 24270063
Change-Id: Id7280b9507b95703820aedb6c5fee49966dabe27

8 years agoMerge "ART: Do not abort on exception in CreatePeer" into mnc-dr-dev
Andreas Gampe [Thu, 8 Oct 2015 18:11:58 +0000 (18:11 +0000)]
Merge "ART: Do not abort on exception in CreatePeer" into mnc-dr-dev

8 years agoMerge "ART: Clean up less in dex2oat" into mnc-dr-dev
Andreas Gampe [Thu, 8 Oct 2015 18:09:23 +0000 (18:09 +0000)]
Merge "ART: Clean up less in dex2oat" into mnc-dr-dev

8 years agoART: Do not abort on exception in CreatePeer
Andreas Gampe [Thu, 1 Oct 2015 23:47:26 +0000 (16:47 -0700)]
ART: Do not abort on exception in CreatePeer

Different parts of CreatePeer may throw an exception, especially
the Thread constructor. Do not abort in such a case, but return
and report a failure to attach/create a thread.

Bug: 24200698
Change-Id: I06f2c997f0451c71f791d1f12bea6f8ee65e8ab2

8 years agoRevert "Fix another source of undeterministic inlining." DO NOT MERGE
Brian Carlstrom [Tue, 29 Sep 2015 00:47:53 +0000 (17:47 -0700)]
Revert "Fix another source of undeterministic inlining." DO NOT MERGE

This reverts commit bd7eef17de5f3d25f411702f9f260a96455b4cf7.

Bug: 24467386
Bug: 20037935
Change-Id: I04d1d0ffc67661370e4c17911d3b2b105d053bc1

8 years agoART: Clean up less in dex2oat
Andreas Gampe [Thu, 17 Sep 2015 21:03:21 +0000 (14:03 -0700)]
ART: Clean up less in dex2oat

In non-debug builds, clean up even less. We already did not shut
down the runtime. Also skipping the compiler driver and the
verification results removes all major points of destructor
performance.

Tested with a common large app on Nexus 9. Time between dex2oat timing
message and executable exit (log from immediately-after log echo)
[w/o swap, w/ swap].
Before:  2.409s / 48.774s
After:   0.132s /  0.188s

Bug: 24199200
Change-Id: I5d8c17f8e28796545cfbb3887c07c92905f9b48d
(cherry picked from commit 3f30e1219dd76f78bb9b6504e696a04a3dfae564)

8 years agoART: Weaken size check in hprof
Andreas Gampe [Sat, 29 Aug 2015 01:15:27 +0000 (18:15 -0700)]
ART: Weaken size check in hprof

Dumping the heap is a two-phase process. In the first phase, all
objects are visited to fill the header tables. In the second phase,
the tables are written out and the heap is visited again to write
the object records.

Deleting global references doesn't require the mutator lock. So it
is possible to delete a global ref in-between the first and the
second phase. This leads to a smaller set of object records. The
result is still safe, as the object's class etc. is still in the
header tables, and the object won't be deleted, so will still be
dumped by itself.

Bug: 23521263
Change-Id: I019c29b13ceb9f13e362c742662f1546d52c37a0

8 years agoART: Relax verifier aput checking
Andreas Gampe [Fri, 14 Aug 2015 21:07:43 +0000 (14:07 -0700)]
ART: Relax verifier aput checking

When checking on a null array, the cases of aput and aput-wide are
shared between integral and floating point types. Be careful to not
reject a valid program.

Bug: 21867457
Bug: 23201502

(cherry picked from commit 4bf4c78a6e8b7da7cf306e1dd17ff5a55d0c6c98)

Change-Id: I6c54a389c06e40a2dae00995aa16ff08a089e512

8 years agoART: Change UninitializedThis tracking in the verifier
Andreas Gampe [Wed, 12 Aug 2015 17:48:12 +0000 (10:48 -0700)]
ART: Change UninitializedThis tracking in the verifier

Only relying on register types is error-prone. For example, we may
inadvertently reject correct code when the constructor terminates
abnormally.

Bug: 20843113

(cherry picked from commit f10b6e109bfb595b6752d1b59db680694ac1684d)
(cherry picked from commit af31802e5b74f5b9b8d3aadbaaf48cfde14ff7d1)

Change-Id: I8826cd167780df25a6166740f183d216483fa550

8 years ago[MIPS] Avoid using odd numbered fp registers
Goran Jakovljevic [Tue, 28 Jul 2015 12:26:12 +0000 (14:26 +0200)]
[MIPS] Avoid using odd numbered fp registers

Don't use odd numbered fp registers for single precision data on
MIPS32r6 (64-bit FPU).

Bug: 23050326
Change-Id: I35cc19df091149773411e2336b01c170929376bc
(cherry picked from commit fc8156a3df88e259c892d50bf23f7c4f11531844)

8 years agoART: Fix Quick's DCE+GVN
Serguei Katkov [Mon, 10 Aug 2015 06:59:02 +0000 (12:59 +0600)]
ART: Fix Quick's DCE+GVN

DCE_GVN does not take into account the following case:
  mov a, b
  ...
  mov c, b
when optimization tries to replace a with c it must ensure that
for all uses of a there is no new definition of c before use.
Otherwise that use will incorrectly substituted with new c instead
of original b.

Bug: 23102860
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
(cherry picked from commit 2f2f17399f6bdfc5ec94a875152c31ef79620520)

Change-Id: I1f08c99cedbe4fd1b96cad11f17d60ab551c7cf7

8 years agoART: Change UnresolvedMergedType merge
Andreas Gampe [Tue, 11 Aug 2015 00:15:32 +0000 (17:15 -0700)]
ART: Change UnresolvedMergedType merge

Change to use IsUnresolvedTypes.

Bug: 22881413
Change-Id: Ic27b97b475b28a5bdf994ea5178767e0efb0e752

8 years agoART: Change UnresolvedMergedType internal representation
Andreas Gampe [Fri, 7 Aug 2015 15:29:13 +0000 (08:29 -0700)]
ART: Change UnresolvedMergedType internal representation

Squashed cherry-picks:
067f1ed7816cf4eb5d6258ca31b387ddb2073ab7
750f7c2827318f6d07620f2ef0321218ea4d8670
2f90b3415aadc2587d26c767c6bfb235797119a8
2ea7b70b2347969f3735bd0ec1b462bd6d2ff1bd

Bug: 22881413

8 years agoFix a bug in the register allocator around pair allocation.
Nicolas Geoffray [Sat, 8 Aug 2015 01:13:03 +0000 (18:13 -0700)]
Fix a bug in the register allocator around pair allocation.

We may get hints that do not work with the current implementation
of register pairs, which forces the allocation of (low + 1)
for the high register. For example, if the hint is EBX, we will
allocate ESP for the high register.

bug:23043730

(cherry picked from commit f29758111e71a7d14f3e52d78773561a5d59961f)

Change-Id: Ib395e36616017a87d3055218d72417f4e9ff6501

8 years agoTighten default inlining settings when using the space filter.
Roland Levillain [Fri, 7 Aug 2015 11:22:28 +0000 (12:22 +0100)]
Tighten default inlining settings when using the space filter.

(cherry picked from commit a215b95d03cfe713018a245553b74d7eeee813df
and amended)

Bug: 21868508
Change-Id: Ic83813a966cef18e59447083926bf033aa587154

8 years agoART: Fix the simplifier for add/sub
Serguei Katkov [Wed, 5 Aug 2015 11:03:30 +0000 (17:03 +0600)]
ART: Fix the simplifier for add/sub

Instruction simplifier for add/sub should not proceed with floats
because that might cause the incorrect behavior with signed zero.

Bug: 23001681

Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
(cherry picked from commit 115b53f609e74672fa93eea1845bb17340d5112a)

Change-Id: I9928724c4158b3961e32e376b9203fe01ba2e442

8 years agoART: x86_64 RoundDouble/Float intrinsics should initialize out value.
Pavel Vyssotski [Fri, 31 Jul 2015 07:03:17 +0000 (13:03 +0600)]
ART: x86_64 RoundDouble/Float intrinsics should initialize out value.

x86_64 RoundDouble intrinsic should initialize output register for the case of
"inPlusPointFive >= maxLong" as expected. The same for the RoundFloat intrinsic.
Fixed also the out register type in CreateSSE41FPToIntLocations provoking
a DCHECK failure.

Signed-off-by: Pavel Vyssotski <pavel.n.vyssotski@intel.com>
(cherry picked from commit 9ca257196b46fd7629bce0b338580e571e4113a8)

Bug: 22973442
Change-Id: If974e79d33311587d0b541a01ca8a4c9c11b9468

8 years agoDon't dump stack when deleting an invalid local ref
Mathieu Chartier [Thu, 30 Jul 2015 18:41:04 +0000 (11:41 -0700)]
Don't dump stack when deleting an invalid local ref

Bug: 21724724
Change-Id: Ifa99df9ee9f3265038a0c0f7944e834e42c498d4

8 years agoAllow for fine tuning the inliner.
Calin Juravle [Wed, 29 Jul 2015 14:58:48 +0000 (15:58 +0100)]
Allow for fine tuning the inliner.

Bug: 21868508

(cherry picked and squashed from commits
ec74835a7e4f2660250a2f3f9508cbbe5269e49a and
0941b9d48a9a8c6d80a1af7a0d0fc9f80fe2b9a1)

Change-Id: I1750e6bea20321d04680132281a6c2924531c5ae

8 years agoHDeoptimize should hold values live in env.
Mingyao Yang [Wed, 22 Jul 2015 22:56:34 +0000 (15:56 -0700)]
HDeoptimize should hold values live in env.

Values that are not live in compiled code anymore may still be needed in
interpreter, due to code motion, etc.

(cherry-picked from commit 718493c6c3c8e380663cb8a94e57ce160a6c473f)

Bug: 22665511
Change-Id: I8b85833c5c462f8fe36f86d6026a51b07563995a

8 years agoBugfix: Java char is 16 bits, can not be treated as boolean.
Fredrik Roubert [Mon, 27 Jul 2015 22:14:08 +0000 (00:14 +0200)]
Bugfix: Java char is 16 bits, can not be treated as boolean.

Using SetFieldBooleanVolatile() and SetFieldBoolean() happens to work
for char values that only use the lower 8 bits, but is a mistake that
was introduced by the "Add AccessibleObject and Field to mirror" commit:

https://android.googlesource.com/platform/art/+/daaf326

(cherry picked from commit 3152c82b0d33e5fb0a4aa964ea58451c72734444)

Bug:22772717

Change-Id: Iec02ba3084c992ea239ecef688d7d29c7e21ae16

8 years agoMerge "ART: Change the stack dump format to be in line with debuggerd" into mnc-dev
Andreas Gampe [Fri, 24 Jul 2015 21:24:38 +0000 (21:24 +0000)]
Merge "ART: Change the stack dump format to be in line with debuggerd" into mnc-dev

8 years agoART: Change the stack dump format to be in line with debuggerd
Andreas Gampe [Thu, 23 Jul 2015 21:37:18 +0000 (14:37 -0700)]
ART: Change the stack dump format to be in line with debuggerd

Make offsets 16 digits on 64-bit platforms.

Add the ability to provide the build fingerprint, and print it in
the traces output.

Bug: 22693991
Change-Id: Ibd3d3b3bd65dce84acfb97a487807d6f280a9508

8 years agoART: Fix Quick/Optimizing suspend check assumption mismatch.
Vladimir Marko [Wed, 22 Jul 2015 16:50:37 +0000 (17:50 +0100)]
ART: Fix Quick/Optimizing suspend check assumption mismatch.

Quick's SuspendCheckElimination (SCE) expects that every
method contains a suspend check and it eliminates suspend
checks in loops containing an invoke. Optimizing eliminates
the suspend check from leaf methods, so the combination of
a Quick-compiled loop calling an Optimizing-compiled leaf
method can lead to missing suspend checks and potentially
leading to ANRs.

Enable Quick's kLeafOptimization flag to remove suspend
checks from leaf methods and disable Quick's SCE. This
aligns the suspend check placement for the two backends
and avoids the broken combination.

Currently, all methods containing a try-catch are compiled
with Quick, so it's relatively easy to create a regression
test. However, this test will not be valid when Optimizing
starts supporting try-catch.

Bug: 22657404

(cherry picked from commit d29e8487ff1774b6eb5f0e18d854415c1ee8f6b0)

Change-Id: I733c38bf68bfc2c618f2f2e6b59f8b0e015d7be1

8 years agoMerge "Don't check code pointer for proxies in ArtMethod::GetQuickFrameInfo" into...
Mathieu Chartier [Tue, 21 Jul 2015 20:34:45 +0000 (20:34 +0000)]
Merge "Don't check code pointer for proxies in ArtMethod::GetQuickFrameInfo" into mnc-dev

8 years agoDon't check code pointer for proxies in ArtMethod::GetQuickFrameInfo
Mathieu Chartier [Sat, 18 Jul 2015 02:53:47 +0000 (19:53 -0700)]
Don't check code pointer for proxies in ArtMethod::GetQuickFrameInfo

(cherry picked from commit 7c0fe5e99d1d150b3072a3ae4cd0f0362fe32834)

Bug: 22541058

Change-Id: Id084a69ccd9835147ec71df6bb759e0f1b5e6fbf

8 years agoGet non proxy method for StackDumpVisitor
Mathieu Chartier [Sat, 18 Jul 2015 01:46:32 +0000 (18:46 -0700)]
Get non proxy method for StackDumpVisitor

Fixes failing DCHECK.

(cherry picked from commit ef76c3fa57ddf3f7ca32e118f599da8cb4eb1560)

Bug: 22553459
Change-Id: I6fe1012f9a5f8d29cb98bf25e3a279da51c5e1c0

8 years agoReduce space filter threshold to 128.
Nicolas Geoffray [Fri, 17 Jul 2015 10:11:09 +0000 (11:11 +0100)]
Reduce space filter threshold to 128.

In order to get closer to our code increase limit.

Bug:21868508

(cherry picked from commit 432bf3d525dd0736c91238d69e29b4db6a2f7b80)

Change-Id: Iab19fe99a8a869b0fb841bac317016e4a3dc00e2

8 years agoMerge "ART: Boolean simplifier fix" into mnc-dev
Nicolas Geoffray [Fri, 17 Jul 2015 08:54:20 +0000 (08:54 +0000)]
Merge "ART: Boolean simplifier fix" into mnc-dev

8 years agoART: Boolean simplifier fix
Serguei Katkov [Wed, 15 Jul 2015 09:32:09 +0000 (15:32 +0600)]
ART: Boolean simplifier fix

Boolean simplifier should not remove condition instruction
if it has side effects.

(cherry picked from commit 108ceb48edea654c544b483c302212e43d79a472)

Change-Id: I00dd595da1bba0f027f5c8647035e9fd8ba62ee1

8 years agoART: DCE should know that array-length can throw NPE
Serguei Katkov [Tue, 14 Jul 2015 13:04:48 +0000 (19:04 +0600)]
ART: DCE should know that array-length can throw NPE

array-length can throw NPE so it should be taking into account.

Bug: 22521944
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
(cherry picked from commit b016c6dd3c30b04104a0a43dc294ce93e5f63874)

Change-Id: I6232430a02f9e6d156ad2aae0eb5a630118c0e79

8 years agoMerge "Fix cfi information for x86." into mnc-dev
Christopher Ferris [Mon, 13 Jul 2015 20:19:56 +0000 (20:19 +0000)]
Merge "Fix cfi information for x86." into mnc-dev

8 years agoFix cfi information for x86.
Christopher Ferris [Mon, 13 Jul 2015 19:21:00 +0000 (12:21 -0700)]
Fix cfi information for x86.

With this change, I can now enable debug malloc fully.

Bug: 19071092
Change-Id: Iabfb18505feffb480504a8bbfbac60dd219ed48a

8 years agoRe-enable run-test 449-checker-bce on MIPS64.
Roland Levillain [Mon, 13 Jul 2015 12:33:04 +0000 (13:33 +0100)]
Re-enable run-test 449-checker-bce on MIPS64.

(cherry picked from commit c3f73f788a2f46e4007433bd3ed3dce64e2f5f33)

Bug: 21555893
Change-Id: I92e11637cc1f8f694e4d4138512cbcf47e22a249

8 years agoMerge "Initialize pDeoptimize quick entry pointer for Mips." into mnc-dev
Roland Levillain [Mon, 13 Jul 2015 12:32:04 +0000 (12:32 +0000)]
Merge "Initialize pDeoptimize quick entry pointer for Mips." into mnc-dev

8 years agoInitialize pDeoptimize quick entry pointer for Mips.
Douglas Leung [Mon, 13 Jul 2015 09:55:45 +0000 (10:55 +0100)]
Initialize pDeoptimize quick entry pointer for Mips.

This fixes art test 449-checker-bce.

(cherry picked from commit 2e8bf554574516e0e6a9b10ccd9f13bf56189795)

Bug: 21555893
Change-Id: I9a87c430168ea35984289b0b4a417aa0c659b6d5

8 years agoMerge "Return an invalid StackMap when none can be found." into mnc-dev
Nicolas Geoffray [Mon, 13 Jul 2015 09:27:05 +0000 (09:27 +0000)]
Merge "Return an invalid StackMap when none can be found." into mnc-dev

8 years agoReturn an invalid StackMap when none can be found.
Nicolas Geoffray [Fri, 10 Jul 2015 09:56:40 +0000 (10:56 +0100)]
Return an invalid StackMap when none can be found.

bug:22389275

Partial cherry-pick of:
https://android-review.googlesource.com/#/c/151853
(commit e12997fbce8e22431be58cac9db2535f7b4a7ac3)

Change-Id: Ia30b817be1b50d97243ba32967eeee359ed679c4

8 years agoFix proxy handling in FindDeclaredVirtualMethod
Mathieu Chartier [Sat, 11 Jul 2015 01:26:41 +0000 (18:26 -0700)]
Fix proxy handling in FindDeclaredVirtualMethod

Added missing GetInterfaceMethodIfProxy and test.

Fixed formatting.

Bug: 22411819
https://code.google.com/p/android-developer-preview/issues/detail?id=2635

(cherry picked from commit 72156e28fd6bc72ac965b29446f8801b2e82f2fd)

Change-Id: I3eece9c72091bb9d0262aacf0a75ec6908b5f4d2

8 years agoART: Change merges with Undefined to Undefined
Andreas Gampe [Thu, 9 Jul 2015 18:30:14 +0000 (11:30 -0700)]
ART: Change merges with Undefined to Undefined

The result of a merge with an Undefined type should be Undefined.
Conflicts are allowed to be copied around, but Undefined registers
should not be touched at all, except to be written into.

Add a success test case (the register isn't used) and a fail test
case (the register is tried to be copied).

Bug: 22331663
Bug: 22371999

(cherry picked from commit 97a1ff353f254b6e46c7501fe3f0e3254c2517b4)

Change-Id: I9697ce31c1d2ab5aee0433dcf1253bcca79c2983

8 years agoART: Fix test
Andreas Gampe [Thu, 9 Jul 2015 18:01:07 +0000 (11:01 -0700)]
ART: Fix test

Fixes a breakage from 38536287f61c9c0fc3bab8c1950cf8c74881482a. Ensure
that v4 is not undefined when an exception may be thrown (at the
new-instance).

Bug: 22331663
Bug: 22371999

(cherry picked from commit 7135ff0fdfd02796d40e7ef3c7527ff127512bd3)

Change-Id: Ice36ddda5ca92ea32fa88523dd616d4f2a61027e

8 years agoMerge "ART: Improve the symbolize script" into mnc-dev
Andreas Gampe [Thu, 9 Jul 2015 21:44:01 +0000 (21:44 +0000)]
Merge "ART: Improve the symbolize script" into mnc-dev

8 years agoART: Improve the symbolize script
Andreas Gampe [Thu, 9 Jul 2015 21:39:56 +0000 (14:39 -0700)]
ART: Improve the symbolize script

Allow a list of files to pull. This improves turnaround time when
tracking down perf hotspots.

Bug: 21760614
Change-Id: I824e875053940d59eb00f9d796ef402632905c39

8 years agoSupport compiling run-tests with jack
Sebastien Hertz [Tue, 24 Feb 2015 16:39:50 +0000 (17:39 +0100)]
Support compiling run-tests with jack

This CL adds support to compile run-test source files with jack. When
a test needs to rely on class files, we use jill to convert them to a
jack library.

We need to pass the full classpath to jack containing at least core
classes (like java.lang.Object). This means the Android tree must
have been compiled with jack first so we find all the necessary
classes.jack files.

Some tests still rely on dex files generated with the old toolchain.
We keep building them this way for the moment and will update them
later, when they get ready for Jack.

Also updates a few tests dealing with garbage collection to avoid a
situation where a reference can be retained by a local DEX register.

Bug: 19467889

(cherry picked from commit 19ac0276208f0afef6ba8a4ab34b74a59b8d11d7)

Change-Id: Ia5a989b83430ffe8298a869a1da970b756721bb0

8 years agoART: Allow to set and copy conflicts in the verifier
Andreas Gampe [Thu, 9 Jul 2015 00:22:57 +0000 (17:22 -0700)]
ART: Allow to set and copy conflicts in the verifier

As long as conflicts are not actively being used, it is OK to set
them in a register line or copy them around.

Bug: 22331663

(cherry picked from commit 38536287f61c9c0fc3bab8c1950cf8c74881482a)

Change-Id: I61999e2d9c92f9bdedcb0a5dea54df3c5bb130ca

8 years agoART: Avoid soft- after hard-fail in verifier
Andreas Gampe [Tue, 7 Jul 2015 00:20:18 +0000 (17:20 -0700)]
ART: Avoid soft- after hard-fail in verifier

Follow-up to 414000ec4d728b5c85f8c6dee4f867fecde59b01.

Bug: 21886894
Bug: 22245124

(cherry picked from commit 890da29d279c44923f9271450b8a4423b1267655)

Change-Id: I3728187bd8526cdf84f95b123e6fad5d6c5a8b3c

8 years agoMerge "ART: Release inputs in Long.reverse intrinsic in x86" into mnc-dev
Andreas Gampe [Wed, 8 Jul 2015 20:12:25 +0000 (20:12 +0000)]
Merge "ART: Release inputs in Long.reverse intrinsic in x86" into mnc-dev

8 years agoART: Release inputs in Long.reverse intrinsic in x86
Andreas Gampe [Tue, 7 Jul 2015 20:25:58 +0000 (13:25 -0700)]
ART: Release inputs in Long.reverse intrinsic in x86

In the worst case we are using two temps each for input and output.
Then we do not have a temp left over for the swap operations. The
input is dead, however, after the first swap. So try to release it
(a no-op if it isn't actually a temp).

Bug: 22324327

(cherry picked from commit 575422fa5be7389bdaff5e2d25dd87b1d2d4de85)

Change-Id: I1fc50159afdad14160e34abeaf4670958171d6b2

8 years agoART: Fix opsize in LoadArgDirect
Andreas Gampe [Mon, 6 Jul 2015 21:00:39 +0000 (14:00 -0700)]
ART: Fix opsize in LoadArgDirect

If the destination register is a reference, use kReference for the
op size.

Bug: 22244733

(cherry picked from commit 185a5586c8b796e770e9b4b7ac2befa8ccdaca7e)

Change-Id: Idf52f2ee4c65b5dc41cb66257d95281dc6f32255

8 years agoAdd implicit null pointer and stack overflow checks for Mips.
Douglas Leung [Thu, 2 Jul 2015 23:42:08 +0000 (16:42 -0700)]
Add implicit null pointer and stack overflow checks for Mips.

(cherry picked from commit 22bb5a2ebc1e2724179faf4660b2735dcb185f21)

Bug: 21555893
Change-Id: I2a995be128a5603d08753c14956dd8c8240ac63c

8 years agoDo not create a HBoundType when the instruction is non-null.
Nicolas Geoffray [Thu, 2 Jul 2015 14:48:27 +0000 (15:48 +0100)]
Do not create a HBoundType when the instruction is non-null.

We don't need to refine the type after a null check, if the
instruction is known non null or null. As a side effect, this
avoids replacing HLoadClass instructions with HBoundType instructions.

bug:22116987

Change-Id: I565ae95db5a64faec30e026674636e398e0bf445

8 years agoMerge "ART: Symbolize all oat files in /data folder." into mnc-dev
Andreas Gampe [Wed, 1 Jul 2015 17:50:21 +0000 (17:50 +0000)]
Merge "ART: Symbolize all oat files in /data folder." into mnc-dev

8 years agoMerge "ART: Fix data loss when symbolizing oat files." into mnc-dev
Andreas Gampe [Wed, 1 Jul 2015 17:50:07 +0000 (17:50 +0000)]
Merge "ART: Fix data loss when symbolizing oat files." into mnc-dev

8 years agoART: Symbolize all oat files in /data folder.
Zheng Xu [Tue, 21 Apr 2015 09:35:25 +0000 (17:35 +0800)]
ART: Symbolize all oat files in /data folder.

Now we store oat files not only in /data/dalvik-cache, but also in
other places. This patch tries to pull all oat files from device
/data folder.

Bug: 21760614

(cherry picked from commit 468bcf63207420f18c0c8a8621aa2d774393c155)

Change-Id: Icf81cf28c29da2e248e4fbd84f5920f46ddc4cd6

8 years agoART: Fix data loss when symbolizing oat files.
Zheng Xu [Fri, 19 Jun 2015 06:12:45 +0000 (14:12 +0800)]
ART: Fix data loss when symbolizing oat files.

Bug: 21760614

(cherry picked from commit 98088c424efd45ea3c172d4bc16e191f26a007cc)

Change-Id: I1b40b8ee313a4d187439d969d083d12fb3997cda

8 years agoMerge "Do not replace a live phi with a dead phi." into mnc-dev
Nicolas Geoffray [Wed, 1 Jul 2015 11:36:37 +0000 (11:36 +0000)]
Merge "Do not replace a live phi with a dead phi." into mnc-dev

8 years agoMerge "Revert "Revert "Do not update the type of something we already know.""" into...
Nicolas Geoffray [Wed, 1 Jul 2015 08:54:33 +0000 (08:54 +0000)]
Merge "Revert "Revert "Do not update the type of something we already know.""" into mnc-dev

8 years agoART: Remove bad FindSymbol call
Andreas Gampe [Tue, 30 Jun 2015 18:23:44 +0000 (11:23 -0700)]
ART: Remove bad FindSymbol call

The removed call is superfluous under normal operation and harmful
when running a native-bridged library.

Bug: 22194296
Bug: https://code.google.com/p/android-developer-preview/issues/detail?id=2367

(cherry picked from commit 8fec90b421732b3eb278555f57aaf48fda4fa4ba)

Change-Id: I3eb8f435a6a974a3e87a370b254ba8752f2a59b3

8 years agoMerge "ART: Unlink target oat file before compiling" into mnc-dev
Andreas Gampe [Tue, 30 Jun 2015 16:01:09 +0000 (16:01 +0000)]
Merge "ART: Unlink target oat file before compiling" into mnc-dev

8 years agoART: Unlink target oat file before compiling
Andreas Gampe [Sat, 27 Jun 2015 01:58:42 +0000 (18:58 -0700)]
ART: Unlink target oat file before compiling

Dex2oat must create a new file (new inode) when writing to a target
given by name, as the existing file may be in use. So unlink any
existing file first.

Bug: 22047255
Change-Id: Ief942c71564076e39c1e8340d5c4c55286f75896

8 years agoDo not replace a live phi with a dead phi.
Nicolas Geoffray [Mon, 29 Jun 2015 13:34:46 +0000 (14:34 +0100)]
Do not replace a live phi with a dead phi.

A dead phi is not properly typed. Therefore, always use the live phi
equivalent instead.

bug:21865466

(cherry picked from commit 4230e1895b915a22363452823b0e51eabe92cb60)

Change-Id: If9a3313fc953c2eb4be85b625676e48112fcb1f6

8 years agoRevert "Revert "Do not update the type of something we already know.""
Nicolas Geoffray [Mon, 29 Jun 2015 12:43:54 +0000 (13:43 +0100)]
Revert "Revert "Do not update the type of something we already know.""

This reverts commit 63107a804ce17db9789051e1fe310d99d1dae1cb.

bug:22116987

(cherry picked from commit f9a199571417b5a5a62d94d05a064077e14dd2c4)

Change-Id: Ia516f2cbce6d22df37f3a0854abdd0b54d3ea72d

8 years agoART: Fix CFI annotation for art_quick_aput_obj
Mathieu Chartier [Sat, 27 Jun 2015 22:42:27 +0000 (15:42 -0700)]
ART: Fix CFI annotation for art_quick_aput_obj

Fix the CFI state after an early return.

Bug: 22014525

(cherry picked from commit 2738639bcd30b908d825725169b7497ed047debb)

Change-Id: I56b9ba8cf8c47d70a642f064e59c7e04a476dd2f

8 years agoMerge "MIPS: Initial version of optimizing compiler for MIPS64R6." into mnc-dev
Roland Levillain [Mon, 29 Jun 2015 08:18:30 +0000 (08:18 +0000)]
Merge "MIPS: Initial version of optimizing compiler for MIPS64R6." into mnc-dev

8 years agoQuick: Disable GVN, DCE and LVN for type conflicts.
Vladimir Marko [Sat, 27 Jun 2015 12:32:11 +0000 (13:32 +0100)]
Quick: Disable GVN, DCE and LVN for type conflicts.

(cherry picked from commit f7e7327d7a873d21aaae01471f46a4d64d65433b)

Bug: 22136903
Change-Id: I657d4b5e623696e1264c2c6c9ad4e7fd466d759c

8 years agoART: Fix invalid access and DCHECK in verifier
Andreas Gampe [Sat, 27 Jun 2015 00:33:47 +0000 (17:33 -0700)]
ART: Fix invalid access and DCHECK in verifier

If we get a throwing failure when setting types from the signature,
the work instruction index is still invalid. Do not try to copy the
line then.

As a throwing failure might happen in the above instance, but the
flow analysis expects to have a cleared failure flag before processing
each instruction, clear the flag.

Bug: 21645819
Bug: 22080519
Change-Id: I224c4dad98fa5bb50e62210f0ee30c0dd020e3a6

8 years agoMerge "Require mutator lock for DeleteLocalRef" into mnc-dev
Mathieu Chartier [Fri, 26 Jun 2015 20:57:03 +0000 (20:57 +0000)]
Merge "Require mutator lock for DeleteLocalRef" into mnc-dev

8 years agoRequire mutator lock for DeleteLocalRef
Mathieu Chartier [Fri, 26 Jun 2015 17:47:08 +0000 (10:47 -0700)]
Require mutator lock for DeleteLocalRef

There was a race condition where suspended threads could call
DeleteLocalRef while the GC was marking their roots. This could
cause the GC to attempt to mark a null object.

(cherry picked from commit dd06afecd67fc6a60856436ab150a4d1b9a8ad29)

Bug: 22119403

Change-Id: I962c717bb87b2acb2a4710a2d7ab16793e031401

8 years agoART: Fix streaming tracing issues
Andreas Gampe [Tue, 23 Jun 2015 05:53:45 +0000 (22:53 -0700)]
ART: Fix streaming tracing issues

Fix a lock ordering issue in streaming-mode tracing.

Fix a moving-GC issue in streaming-mode tracing. DexCache
objects are not good keys for a map.

Expose streaming mode for testing in run-tests.

Bug: 21760614
Change-Id: Idcd0575684ee3cc0cec3f81b4fdd0d5988c11e8c

8 years agoART: Bail out immediately on try/catch
David Brazdil [Fri, 26 Jun 2015 15:58:14 +0000 (16:58 +0100)]
ART: Bail out immediately on try/catch

Optimizing builds the graph even if it knows it will delegate to
Quick. This patch moves the decision at the beginning of the
TryCompile function to save a little bit of compile time.

Bug: 22115561
Change-Id: I18b5a686e10592080ea3c49d53a0dd81aa3b3010

8 years agoMIPS: Initial version of optimizing compiler for MIPS64R6.
Roland Levillain [Fri, 26 Jun 2015 15:12:18 +0000 (16:12 +0100)]
MIPS: Initial version of optimizing compiler for MIPS64R6.

(cherry picked from commit 4dda3376b71209fae07f5c3c8ac3eb4b54207aa8)
(amended for mnc-dev)

Bug: 21555893
Change-Id: I874dc356eee6ab061a32f8f3df5f8ac3a4ab7dcf
Signed-off-by: Alexey Frunze <Alexey.Frunze@imgtec.com>
Signed-off-by: Douglas Leung <douglas.leung@imgtec.com>
8 years agoMerge "ART: Fix kEverything compiler filter" into mnc-dev
Andreas Gampe [Fri, 26 Jun 2015 03:16:10 +0000 (03:16 +0000)]
Merge "ART: Fix kEverything compiler filter" into mnc-dev

8 years agoART: Only print stripped dex2oat command line
Andreas Gampe [Tue, 19 May 2015 06:22:54 +0000 (23:22 -0700)]
ART: Only print stripped dex2oat command line

To curb logcat noise, strip many dex2oat parameters from the
logcat printout.

Bug: 20501758

(cherry picked from commit 046c706707ea0f16c804136e237ac7cbfdc897a1)

Change-Id: Ifc367f91f593916e0773af1ca950c798f129889f

8 years agoART: Fix kEverything compiler filter
buzbee [Thu, 25 Jun 2015 22:53:45 +0000 (15:53 -0700)]
ART: Fix kEverything compiler filter

Previously the kEverything filter failed to compile class
initializers. Now it will.

Bug: 19576257

(cherry picked from commit c83329952b4a313e747c8835a73699e2cae5a6e2)

Change-Id: I189d2b5b379aee112c4e95f8d3e6c32abab6ed41

8 years agoART: Reset runtime_throw_failure flag
Andreas Gampe [Thu, 25 Jun 2015 17:26:40 +0000 (10:26 -0700)]
ART: Reset runtime_throw_failure flag

The flag is instruction-specific. It transports the info from Fail
to the main loop. It must be cleared after each iteration.

Introduce a second flag to store whether we saw such a failure at
all.

Update test expectations.

Bug: 22080519

(cherry picked from commit d12e782bcee03ecb6dec41aa9673ef53b638dcea)

Change-Id: I32be914819946233babaa4cb7343844d97b61ba5

8 years agoART: Set methods to preverified in verify-none
Andreas Gampe [Wed, 24 Jun 2015 23:25:33 +0000 (16:25 -0700)]
ART: Set methods to preverified in verify-none

Actually mark all methods to be verified, so that the interpreter
doesn't do access checks. Speedup is about 2x on a Nexus 6 when booting
in verify-none mode.

Bug: 22040916

(cherry picked from commit 1c284f2abdfe1b0ed87d5216021e69146f10b116)

Change-Id: I2d6c8df2a68eae6e358da2639d980cb8bfcc1560

8 years agoMerge "Do not try to compile resource-only dex files." into mnc-dev
Richard Uhler [Thu, 25 Jun 2015 15:21:12 +0000 (15:21 +0000)]
Merge "Do not try to compile resource-only dex files." into mnc-dev

8 years agoHard-fail get-/put-object to a non-reference field.
Vladimir Marko [Tue, 23 Jun 2015 16:45:21 +0000 (17:45 +0100)]
Hard-fail get-/put-object to a non-reference field.

Bug: 21886894

(cherry picked from commit 414000ec4d728b5c85f8c6dee4f867fecde59b01)

Change-Id: Iafc32f0e45d26f3aaa2d521b98353e7cede16c6f

8 years agoOnly do some checks when compiling against the core image.
Nicolas Geoffray [Thu, 25 Jun 2015 09:01:47 +0000 (10:01 +0100)]
Only do some checks when compiling against the core image.

This will avoid false negatives when running dex2oatd on apks.

bug:21865473

(cherry picked from commit 335005e2b3a179f26b7a8ae64ca60a1406b669bd)

Change-Id: Iac6dbe30c9d576077a0384b88696f79937d89471

8 years ago[MIPS64] JNI Compiler: Sign-extend int function arguments
Lazar Trsic [Wed, 24 Jun 2015 14:30:21 +0000 (16:30 +0200)]
[MIPS64] JNI Compiler: Sign-extend int function arguments

MIPS n64 ABI differs from arm64. Arguments smaller than the 8B stack
slot need to be sign-extended.

Use combination (lw,sd), instead of (lw,sw) for 4B values.

Change fixes software keyboard crash on mips64.

Bug: 21555893

(cherry picked from commit f652d605753f1387e7797461b47116c5dcdf928d)

Change-Id: I7574d37f6039e9e8c9e0047254be71d28d4c829a

8 years agoMerge "ART: Fix arm32 instrumentation exit stub" into mnc-dev
Andreas Gampe [Thu, 25 Jun 2015 04:12:06 +0000 (04:12 +0000)]
Merge "ART: Fix arm32 instrumentation exit stub" into mnc-dev

8 years agoFix force copy
Mathieu Chartier [Thu, 25 Jun 2015 00:04:17 +0000 (17:04 -0700)]
Fix force copy

We now correctly pass the returned pointer back onto the release functions.

Bug: 22056708
Change-Id: I1a7300d3a4522a3c81b432ec742ae1c0bd00b51e

(cherry picked from commit b735bd9c04aa291d0a1bdc2c0a094a1a75ad0596)

8 years agoART: Fix arm32 instrumentation exit stub
Andreas Gampe [Wed, 24 Jun 2015 06:28:59 +0000 (23:28 -0700)]
ART: Fix arm32 instrumentation exit stub

Properly store, pass and restore floating point result.

Bug: 22047833
Change-Id: If5d9efbe63334c9b6353f76ce6e4fe519602482a

8 years agoMerge "Fix imt conflict trampoline for mips64" into mnc-dev
Mathieu Chartier [Wed, 24 Jun 2015 20:25:25 +0000 (20:25 +0000)]
Merge "Fix imt conflict trampoline for mips64" into mnc-dev

8 years agoFix imt conflict trampoline for mips64
Mathieu Chartier [Wed, 24 Jun 2015 20:11:06 +0000 (13:11 -0700)]
Fix imt conflict trampoline for mips64

Changed lwu to ld

Bug: 21815962
Change-Id: I137e871d9c00f83cd5efc9d3a87fa05e84dc5d23

8 years agoIncrease alt signal stack to 32K on host.
Christopher Ferris [Wed, 24 Jun 2015 16:37:39 +0000 (09:37 -0700)]
Increase alt signal stack to 32K on host.

On host, when there is a crash, the code tries to do an unwind
from the signal handler. Under some conditions this can require
a stack larger than 16K, so increase this value to 32K.

The symptom of this is that you get an empty backtrace running
art tests when there is a crash.

Bug: 21949571
(cherry picked from commit e34c71ce21dbc9fac3427df887e90e1311b6fa8e)

Change-Id: Ib1105a3470064d98843bd46f32d4fadb1d20e416

8 years agoMerge "Adding optimizing compiler test case for String.<init>." into mnc-dev
Jeff Hao [Wed, 24 Jun 2015 17:05:42 +0000 (17:05 +0000)]
Merge "Adding optimizing compiler test case for String.<init>." into mnc-dev

8 years agoUse a flag from the verifier to know if we should compile.
Nicolas Geoffray [Wed, 24 Jun 2015 14:53:03 +0000 (15:53 +0100)]
Use a flag from the verifier to know if we should compile.

Only used for the lack of bottom type in the aget-object case
for now. Could be used for more.

bug:21865466

(cherry picked from commit 4824c27988c8eeb302791624bb3ce1d557b0db6c)

Change-Id: I2bb7fe1d4737bd92c1076b5193607d74d8761ee7

8 years agoBCE: don't assume a bounds check always gets a HArrayLength.
Nicolas Geoffray [Wed, 24 Jun 2015 13:57:44 +0000 (14:57 +0100)]
BCE: don't assume a bounds check always gets a HArrayLength.

Deoptimizations may change it to a HPhi.

bug:22056703

(cherry picked from commit 8df886b9214802ad689316a1dedb00a6d102555c)

Change-Id: I8afcf88e3a12dbe4d87101e6a7cefb8b81e2bb96

8 years agoDo not try to compile resource-only dex files.
Richard Uhler [Wed, 24 Jun 2015 15:44:19 +0000 (08:44 -0700)]
Do not try to compile resource-only dex files.

This changes behavior in the case where we are asked to load a dex
file that does not exist or has no classes.dex entry.

Previously we would run dex2oat, which would log an error message and
fail. Now we skip running dex2oat, we report the DexOptStatus as
kNoDexOptNeeded, and we do not try to fall back to the missing
original dex files.

Bug: 21722039
Change-Id: I90b1f4165138daac57bb9d7a354319005652c593

8 years agoFix codegen_test after DCE fix.
Nicolas Geoffray [Wed, 24 Jun 2015 13:25:09 +0000 (14:25 +0100)]
Fix codegen_test after DCE fix.

(cherry picked from commit ea80942c39cb5e9bc3e38a388583d1646c1e2a3f)

bug:22031382

Change-Id: If410045779adb9e7e611af22c988232b5bf9a902

8 years agoRecompute dominator tree after DCE.
Nicolas Geoffray [Wed, 24 Jun 2015 11:20:24 +0000 (12:20 +0100)]
Recompute dominator tree after DCE.

bug:22031382

(cherry picked from commit 1f82ecc6a0c9f88d03d6d1a6d95eeb8707bd06c1)

Change-Id: I9a74edb185cb806045903dfe9695d9cc1a02e86b

8 years agoBCE: Narrow instead of unconditionnaly overwrite the range.
Nicolas Geoffray [Wed, 24 Jun 2015 09:38:27 +0000 (10:38 +0100)]
BCE: Narrow instead of unconditionnaly overwrite the range.

bug:21862741

(cherry picked from commit a09ff9c11f07863ac57e6120a824f0d20dfaa284)

Change-Id: Ia8e903e09a7f9c2b8ef7cf3522f73f154534b81f

8 years agoFix another case of un-verified dead code.
Nicolas Geoffray [Wed, 24 Jun 2015 11:41:20 +0000 (12:41 +0100)]
Fix another case of un-verified dead code.

bug:22042796
https://code.google.com/p/android/issues/detail?id=178008

(cherry picked from commit 1efcc22cd1895c48adccbe49270d8e8583c2b12d)

Change-Id: I5c0d783e842da39cd3dcbb2f18ccf784e797a64f