OSDN Git Service

android-x86/art.git
8 years agoCall prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY) if app is debuggable.
Oleksiy Vyalov [Tue, 21 Jun 2016 23:21:37 +0000 (16:21 -0700)]
Call prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY) if app is debuggable.

Enabled Yama security may prevent non-privileged debugger from
attaching to the app. However, if app is marked is debuggable
then it should acceptable to allow debugger with arbitrary pid
to connect the app.

Bug: 29549463

Change-Id: I50c79dbca272dc473e489cc61471628e2fdc4a03

8 years agoART: Use null for the BootClassLoader in LoadLibrary
Andreas Gampe [Fri, 17 Jun 2016 19:46:14 +0000 (12:46 -0700)]
ART: Use null for the BootClassLoader in LoadLibrary

We must translate the fake BootClassLoader object to the internally
used null when loading libraries.

Bug: 29449194
Change-Id: I823d34e209149b5b96529a423c60a1d77bf8e9d1

8 years agoART: Turn off unattached thread dumping
Andreas Gampe [Mon, 13 Jun 2016 23:15:33 +0000 (16:15 -0700)]
ART: Turn off unattached thread dumping

May be responsible for lack of ANR dumps in some situations.

Bug: 29248079
Change-Id: Ib742c063b1d77216eddfbf4392d17d024e028bf8

8 years agoRemove too aggressive DCHECKs.
Nicolas Geoffray [Fri, 10 Jun 2016 15:06:34 +0000 (16:06 +0100)]
Remove too aggressive DCHECKs.

A class can move from a state greater or equal than resolved
to erroneous concurrently to the verifier or the compiler.

bug:29239283
Change-Id: I89f3fe1c1d9556c6c99b8e005b3ec02de7f01b85

8 years agoMerge "Fix dex file leak in oat file manager" into nyc-dev
Mathieu Chartier [Fri, 10 Jun 2016 16:38:49 +0000 (16:38 +0000)]
Merge "Fix dex file leak in oat file manager" into nyc-dev

8 years agoMerge "ART: Fix swap usage determination in dex2oat" into nyc-dev
TreeHugger Robot [Fri, 10 Jun 2016 01:41:13 +0000 (01:41 +0000)]
Merge "ART: Fix swap usage determination in dex2oat" into nyc-dev

8 years agoFix dex file leak in oat file manager
Mathieu Chartier [Thu, 9 Jun 2016 23:18:04 +0000 (16:18 -0700)]
Fix dex file leak in oat file manager

Simplified ownership by having a vector of unique pointers own
all newly opened dex files.

Bug: 29246280
Change-Id: I1ffcfef35c14c732e15e83ce4674034eddfc136b

8 years agoART: Fix swap usage determination in dex2oat
Andreas Gampe [Thu, 9 Jun 2016 01:18:47 +0000 (18:18 -0700)]
ART: Fix swap usage determination in dex2oat

The decision needs to be postponed until we have access to the
dex files.

Bug: 27878043
Change-Id: I55833c6ea827ec7a322711bd182fc723d1727f08

8 years agoMerge "Fix FOUR_ARG_DOWNCALL assembly stubs on arm and x86." into nyc-dev
Nicolas Geoffray [Thu, 9 Jun 2016 12:11:27 +0000 (12:11 +0000)]
Merge "Fix FOUR_ARG_DOWNCALL assembly stubs on arm and x86." into nyc-dev

8 years agoFix FOUR_ARG_DOWNCALL assembly stubs on arm and x86.
Nicolas Geoffray [Wed, 8 Jun 2016 17:01:22 +0000 (18:01 +0100)]
Fix FOUR_ARG_DOWNCALL assembly stubs on arm and x86.

They were creating a stack that the runtime did not understand.

bug:28348339

(cherry picked from commit 0f838aa279a296b5f14c231065bb2f96b02d9caf)

Change-Id: Iecaa274512b42ad76fccb48c11a0076d0292c240

8 years agoMerge "Revert "Revert "Fix ArtMethod::GetInvokeType for static methods on interfaces...
Nicolas Geoffray [Wed, 8 Jun 2016 07:44:14 +0000 (07:44 +0000)]
Merge "Revert "Revert "Fix ArtMethod::GetInvokeType for static methods on interfaces.""" into nyc-dev

8 years agoWrap certain exception types when loading an erroneous class.
Jeff Hao [Mon, 6 Jun 2016 18:09:20 +0000 (11:09 -0700)]
Wrap certain exception types when loading an erroneous class.

Bug: 28787733
Change-Id: I22e1e4339a95706a0fb9c1474b360e9bde232539

8 years agoRevert "Revert "Fix ArtMethod::GetInvokeType for static methods on interfaces.""
Nicolas Geoffray [Tue, 7 Jun 2016 14:14:37 +0000 (14:14 +0000)]
Revert "Revert "Fix ArtMethod::GetInvokeType for static methods on interfaces.""

bug:29089267
bug:27521545

We were hitting a compiler DCHECK that a class would never require to
do access checks on itself. The reason was that the compiler driver
was not trying to resolve a type, but instead relied on the verifier
for pre-populating the dex cache. However, the verifier doesn't
necessarily run in JIT mode.

This reverts commit 12abcbd950bd0ff4528e2e0d27ca5e881c7b0467.

(cherry picked from commit 3aaf9645639ff56fbfe49a981242cbda01d6796e)

Change-Id: I2f0de6e4f00f336dc61b2378054fb6d27a7298d0

8 years agoART: ArrayGet hoisting restriction added.
Anton Shamin [Mon, 16 May 2016 10:44:13 +0000 (16:44 +0600)]
ART: ArrayGet hoisting restriction added.

Currently if we hoist ArrayGet from loop there is no guarantee
that insn will be executed at runtime. Because of that we could
face issues like crashes in generated code.

This patch introduces restriction for ArrayGet hoisting. We say
that ArrayGet execution is guaranteed at least one time if its bb
dominates all exit blocks.

Signed-off-by: Anton Shamin <anton.shamin@intel.com>
(cherry picked from commit f89381fed12faf96c45a83a989ae2fff82c05f3b)

BUG=29145171

Change-Id: Ia5664dedb1543d78a7b4038801b8372572f069f6

8 years agoMerge "Enable profman pretty printing" into nyc-dev
David Sehr [Mon, 6 Jun 2016 20:16:10 +0000 (20:16 +0000)]
Merge "Enable profman pretty printing" into nyc-dev

8 years agoRevert "Revert "Hold dex caches live in class table""
Mathieu Chartier [Sat, 4 Jun 2016 00:47:32 +0000 (17:47 -0700)]
Revert "Revert "Hold dex caches live in class table""

Bug: 29083330

This reverts commit f102faf1bcbdb2149e3e7bf27b1819f621b7894b.

Change-Id: Ibc6d260247b3113beec7d33552061512a36c9ce8

8 years agoEnable profman pretty printing
David Sehr [Thu, 2 Jun 2016 17:46:19 +0000 (10:46 -0700)]
Enable profman pretty printing

Bug: 28748264
Change-Id: I4dc366aa710c9ef05aa5d1b164d558232fe57a3d

8 years agoRevert "Hold dex caches live in class table"
Brian Carlstrom [Sat, 4 Jun 2016 00:22:32 +0000 (00:22 +0000)]
Revert "Hold dex caches live in class table"

This reverts commit d6d49e56c2b7b11f474acb80cb02bb1fe9b7861e.

Bug: 29083330
Change-Id: Ie209b27897b8079f2d13fd0837fe5f83a7e61afc

8 years agoHold dex caches live in class table
Mathieu Chartier [Thu, 2 Jun 2016 18:48:30 +0000 (11:48 -0700)]
Hold dex caches live in class table

Prevents temporary dex caches being unloaded for the same dex file.
Usually this is OK, but if someone resolved a string in that dex
cache, it could leave stale pointers in BSS. Also it can use extra
memory in linear alloc if we allocate dex cache arrays multiple
times.

Bug: 29083330

(cherry picked from commit f284d448e3edd428b6ade473d0993028638b2064)

Change-Id: Ie1b0b0cf835a998e19227cbb90014011a6cd40c4

8 years agoDelay dex-to-dex compilation until Optimizing is done.
Vladimir Marko [Wed, 1 Jun 2016 17:38:43 +0000 (18:38 +0100)]
Delay dex-to-dex compilation until Optimizing is done.

This fixes a race between inlining in the Optimizing
backend and dex-to-dex quickening where the Optimizing can
read the non-quickened opcode and then the quickened field
index or vtable index and look up the wrong field or method.
Even if we such tearing of the dex instruction does not
happen, the possible reordering of dex-to-dex and Optimizing
compilation makes the final oat file non-deterministic.

Also, remove VerificationResults::RemoveVerifiedMethod() as
we have only the Optimizing backend now and as such it was
dead code and would have interfered with this change.

Bug: 29043547
Bug: 29089975

(cherry picked from commit 492a7fa6df3b197a24099a50f5abf624164f3842)

Change-Id: I1337b772dc69318393845a790e5f6d38aa3de60f

8 years agoFix ArtMethod::GetInvokeType for static methods on interfaces.
Nicolas Geoffray [Thu, 2 Jun 2016 14:55:48 +0000 (15:55 +0100)]
Fix ArtMethod::GetInvokeType for static methods on interfaces.

And avoid calling ResolveMethod in the JIT, since it already
knows that method.

bug:29089267
bug:27521545

Change-Id: I5c5dae385804f1d2062defca459f69c26cdb4fef

8 years agoFix a bug in reference type propagation.
Nicolas Geoffray [Wed, 1 Jun 2016 15:30:20 +0000 (16:30 +0100)]
Fix a bug in reference type propagation.

The upper bound of a bound type is always exact, so we should
not use it for setting the type of the bound type.

bug:28730986

(cherry picked from commit a90d489ab101891bbac7276b8748125e6b4fa0c2)

Change-Id: Ia3e9f88a274730be39e5c9b147204eec2a145de2

8 years agoMerge "Don't do any I/O when starting the profile saver" into nyc-dev
Calin Juravle [Thu, 2 Jun 2016 10:10:35 +0000 (10:10 +0000)]
Merge "Don't do any I/O when starting the profile saver" into nyc-dev

8 years agoMerge "Fix race with host_dlopen_handles_" into nyc-dev
Mathieu Chartier [Wed, 1 Jun 2016 22:38:10 +0000 (22:38 +0000)]
Merge "Fix race with host_dlopen_handles_" into nyc-dev

8 years agoFix race with host_dlopen_handles_
Mathieu Chartier [Wed, 1 Jun 2016 17:48:19 +0000 (10:48 -0700)]
Fix race with host_dlopen_handles_

Thread 1 opens an already opened oat file.
Thread 2 dlcloses the oat file and removes it from
host_dlopen_handles_.
Thread 1 checks that it is not already in host_dlopen_handles_ and
proceeds to return the oat file. The problem now is that the BSS is
not cleared since it is the same oat file that was opened earlier.

The fix is to just hold the lock for dlopen / dlclose. This only
affects contention on host.

Bug: 28992179
Bug: 28990799
Bug: 28826195

(cherry picked from commit c7d3f4b8c294f36209ea2c129f9714a36ae1ec6b)

Change-Id: Ib462720fab26427d8ca0c6323080604878edb8b5

8 years agoInitial profman support for verbose dump
David Sehr [Tue, 24 May 2016 21:52:31 +0000 (14:52 -0700)]
Initial profman support for verbose dump

Bug: 28748264
Change-Id: Ibc59e7f31afa4646fcf048eececb87437dd83de9

8 years agoMerge "Relax annotation visibility so runtime includes build." into nyc-dev
TreeHugger Robot [Sat, 28 May 2016 01:15:50 +0000 (01:15 +0000)]
Merge "Relax annotation visibility so runtime includes build." into nyc-dev

8 years agoRelax annotation visibility so runtime includes build.
Jeff Hao [Fri, 27 May 2016 01:39:17 +0000 (18:39 -0700)]
Relax annotation visibility so runtime includes build.

Previous behavior in M and earlier would allow annotations marked
VISIBILITY_BUILD to be visible to the runtime when they should not
have been. When targeting older sdks, revert to this behavior.

Bug: 28826610
Change-Id: I95e10da899ed11107ca78c62dd2e263808008310

8 years agoMerge "Don't use dlopen on host for already loaded oat files." into nyc-dev
Richard Uhler [Fri, 27 May 2016 20:50:15 +0000 (20:50 +0000)]
Merge "Don't use dlopen on host for already loaded oat files." into nyc-dev

8 years agoDon't use dlopen on host for already loaded oat files.
Richard Uhler [Tue, 24 May 2016 22:04:22 +0000 (15:04 -0700)]
Don't use dlopen on host for already loaded oat files.

Because the behavior of dlopen on the host is different then the
target in that case, and it causes tests to fail.

Bug: 28826195

(cherry picked from commit a206c745dbb64b14f05c87891d425475c2f6d63a)

Change-Id: I29b04be07b4d26dc1ac5e6f35550745eb15e6728

8 years agoMerge "Remove duplicate libcore failures expectations." into nyc-dev
Narayan Kamath [Fri, 27 May 2016 11:14:56 +0000 (11:14 +0000)]
Merge "Remove duplicate libcore failures expectations." into nyc-dev

8 years agoDon't use JACK alpha anymore.
Nicolas Geoffray [Thu, 14 Apr 2016 12:32:01 +0000 (13:32 +0100)]
Don't use JACK alpha anymore.

(cherry picked from commit 99e6d2d9b2585f605e02041f351b494f82f82121)

Bug: 28977632
Change-Id: Id37d90446be5d63cb0cf0131e34b562147e88335

8 years agoRemove duplicate libcore failures expectations.
Roland Levillain [Thu, 26 May 2016 16:38:46 +0000 (17:38 +0100)]
Remove duplicate libcore failures expectations.

Some jsr166 entries were already listed in
libcore/expectations/knownfailures.txt.

Bug: 28977632
Change-Id: I35788008262bac6f10d96f53e8e8f21e2364f091

8 years agoDon't do any I/O when starting the profile saver
Calin Juravle [Wed, 25 May 2016 15:45:16 +0000 (16:45 +0100)]
Don't do any I/O when starting the profile saver

The profile saver is started when the application is launched. During
the start we used to prepare the paths and transform them to canonical
paths to make sure we do the foreign dex checks on the actual paths.

Postpone the canonical path transformation to a later point to make sure
the impact is minimal.

Bug: 28785119
Bug: 28625993
Change-Id: I1aa378cdefde6ed6dc708762392db0f3a3158812

8 years agoMerge "Fix OatWriter to update the header checksum correctly." into nyc-dev
Vladimir Marko [Thu, 26 May 2016 11:35:24 +0000 (11:35 +0000)]
Merge "Fix OatWriter to update the header checksum correctly." into nyc-dev

8 years agoMerge "Prune class path classes from profile" into nyc-dev
Mathieu Chartier [Thu, 26 May 2016 01:38:14 +0000 (01:38 +0000)]
Merge "Prune class path classes from profile" into nyc-dev

8 years agoPrune class path classes from profile
Mathieu Chartier [Wed, 25 May 2016 22:05:59 +0000 (15:05 -0700)]
Prune class path classes from profile

Fixes a theoretical case where classes not in the app, but in the in
the class path could have been included in the image. The dex caches
for these classes are not properly handled and need to be pruned.
Not including the classes in the image classes makes sure the that
class linker automatically prunes them and frees the dex cache with
the explicit garbage collection.

Bug: 28452385
Change-Id: Ia44813863b5f1c79367049838021a64cc3842fc9

8 years agoMerge "Fix profile saver reference point when calculating the sleep time" into nyc-dev
TreeHugger Robot [Wed, 25 May 2016 21:35:45 +0000 (21:35 +0000)]
Merge "Fix profile saver reference point when calculating the sleep time" into nyc-dev

8 years agoMerge changes Idf64b96b,Ie717089d into nyc-dev
Richard Uhler [Wed, 25 May 2016 19:18:07 +0000 (19:18 +0000)]
Merge changes Idf64b96b,Ie717089d into nyc-dev

* changes:
  Base isDexOptNeeded result on OatFileAssistant::IsUpToDate.
  Only compile dex files if they are not up to date.

8 years agoFix profile saver reference point when calculating the sleep time
Calin Juravle [Wed, 25 May 2016 17:09:53 +0000 (18:09 +0100)]
Fix profile saver reference point when calculating the sleep time

It is wrong to use last_time_ns_saver_woke_up_ as a reference. We should
use sleep_start.

Bug: 28953776
Change-Id: I88ab36c18b3b7b6e310bcdc6c59cadedc4cc9260

8 years agoFix OatWriter to update the header checksum correctly.
Vladimir Marko [Wed, 25 May 2016 11:49:49 +0000 (12:49 +0100)]
Fix OatWriter to update the header checksum correctly.

Make sure we update the checksum with dex file data, type
lookup tables and thunks produced by the relative patcher.

Bug: 28874264
Change-Id: I5b83237132ccb784acea6c195d0ed909ee33b99a

8 years agoMerge "Remove bogus DCHECK." into nyc-dev
TreeHugger Robot [Wed, 25 May 2016 16:51:24 +0000 (16:51 +0000)]
Merge "Remove bogus DCHECK." into nyc-dev

8 years agoRemove bogus DCHECK.
Nicolas Geoffray [Wed, 25 May 2016 13:52:37 +0000 (14:52 +0100)]
Remove bogus DCHECK.

bug:28771056

(cherry picked from commit 0950abe82f86a9943feb7719876ec291c6581037)

Change-Id: I8c5b737c0882ecb8d67d8f799356f30afe3dd87b

8 years agoAvoid long sleep in ProfileSaver
Brian Carlstrom [Wed, 25 May 2016 02:45:30 +0000 (19:45 -0700)]
Avoid long sleep in ProfileSaver

This was due to subtracting a >20s number of nanos from the constant for 20s.

Bug: 28880120
Change-Id: Ia30b80661f869843484cbac029008530128bd300

8 years agoFix broken DCHECK
Mathieu Chartier [Wed, 25 May 2016 00:41:21 +0000 (17:41 -0700)]
Fix broken DCHECK

Dex cache may now contain references into boot image. Only check
classes that are actually in the application image.

Bug: 28295348

Change-Id: I9d92137c99a53924b13182ded6afabdeb441437d

8 years agoMerge "Add methods with samples during launch to profile" into nyc-dev
Mathieu Chartier [Tue, 24 May 2016 23:30:03 +0000 (23:30 +0000)]
Merge "Add methods with samples during launch to profile" into nyc-dev

8 years agoMerge "Fix an assert during jdwp debugging." into nyc-dev
Mingyao Yang [Tue, 24 May 2016 23:09:36 +0000 (23:09 +0000)]
Merge "Fix an assert during jdwp debugging." into nyc-dev

8 years agoMerge "Revert "Revert "Move rewritten StringFactory call results into dex registers...
Mingyao Yang [Tue, 24 May 2016 23:09:23 +0000 (23:09 +0000)]
Merge "Revert "Revert "Move rewritten StringFactory call results into dex registers for deopt""" into nyc-dev

8 years agoBase isDexOptNeeded result on OatFileAssistant::IsUpToDate.
Richard Uhler [Tue, 24 May 2016 22:42:37 +0000 (15:42 -0700)]
Base isDexOptNeeded result on OatFileAssistant::IsUpToDate.

So that it is consistent with when ART will try to run dex2oat.

Bug: 28826195
Change-Id: Idf64b96bf9a6f4ee67dd1af78e6177e078a3c593

8 years agoOnly compile dex files if they are not up to date.
Richard Uhler [Tue, 17 May 2016 17:34:52 +0000 (10:34 -0700)]
Only compile dex files if they are not up to date.

Instead of trying to compile them all the time, and relying on file
permissions to keep us from overwriting up-to-date dex files with
different compiler filters.

Bug: 27641809
Bug: 28639246
Bug: 28826195
Change-Id: Ie717089d58517427b6f9a522b48146761c57a1a9

8 years agoAdd methods with samples during launch to profile
Mathieu Chartier [Wed, 18 May 2016 15:51:52 +0000 (08:51 -0700)]
Add methods with samples during launch to profile

For the snapshot taken after application launch we look at all of
the methods with one or more samples.

Launch time:
books: 1933ms -> 1457ms (33% speedup).
plus: 1361ms -> 1260ms (8% speedup)
music: 3085ms -> 2963ms (4% speedup)
maps: 1583ms -> 1390ms (14% speedup)

Oat sizes:
books: 10871424 -> 13365888 (+23%)
plus: 17715624 -> 19493288 (+13%)
music: 17076864 -> 18289280 (+7%)
maps: 32264832 -> 35787392 (+12%)

Bug: 28750506

Change-Id: I3a955dc74b41a96911254ac5087de77bea2267c7

8 years agoMerge "Fix bug in verifier: soft fail was hiding hard fail." into nyc-dev
Aart Bik [Tue, 24 May 2016 19:51:37 +0000 (19:51 +0000)]
Merge "Fix bug in verifier: soft fail was hiding hard fail." into nyc-dev

8 years agoMerge "Don't update checksum if data ptr is null." into nyc-dev
TreeHugger Robot [Tue, 24 May 2016 19:44:05 +0000 (19:44 +0000)]
Merge "Don't update checksum if data ptr is null." into nyc-dev

8 years agoMerge "Put boot class loader classes and strings in dex cache of app images." into...
TreeHugger Robot [Tue, 24 May 2016 18:26:18 +0000 (18:26 +0000)]
Merge "Put boot class loader classes and strings in dex cache of app images." into nyc-dev

8 years agoDon't update checksum if data ptr is null.
Jeff Hao [Tue, 24 May 2016 02:17:04 +0000 (19:17 -0700)]
Don't update checksum if data ptr is null.

Passing a nullptr to adler32 resets it to its initial value.

Bug: 28874264
Change-Id: I863fa4d489618c1c6fa579cc89fb050f4cd23760

8 years agoFix bug in verifier: soft fail was hiding hard fail.
Aart Bik [Mon, 23 May 2016 21:58:49 +0000 (14:58 -0700)]
Fix bug in verifier: soft fail was hiding hard fail.

Rationale:
Dexfuzzing found a situation where a soft fail (modifying
a final field) was hiding a hard fail (type error on that
field), which caused a crash in the compiler later on.
Also added a crash-before/pass-after regression test,
so we don't add the return by accident later.

BUG=28908555

(cherry picked from commit c2bc26513ea7c5e2dd9f3b102fb23fd207e4ce63)

Change-Id: Ie79c4afa28cddbca4dfb78e5c75da6644612c15c

8 years agoRevert "Revert "Move rewritten StringFactory call results into dex registers for...
Mingyao Yang [Thu, 19 May 2016 17:48:40 +0000 (10:48 -0700)]
Revert "Revert "Move rewritten StringFactory call results into dex registers for deopt""

Potential gc points can make the result value stale. We now set the result value
to null proactively once it's moved to shadow frame registers. IsStringInit()
is written in a way that does string comparison instead of requiring method
resolution so that it doesn't have a gc point. Also we don't cache the callee
method during frame unwinding since the method may be rewritten already.

(cherry picked from commit ffedec510c07cf0f77d0cce51940838f2e630514)

Bug: 28555675

Change-Id: Ic51511a4a0fc84a852d8d907f91e7835f49ac478

8 years agoMerge "Compile JNI stubs for verify-profile and interpret-only." into nyc-dev
Vladimir Marko [Tue, 24 May 2016 15:40:04 +0000 (15:40 +0000)]
Merge "Compile JNI stubs for verify-profile and interpret-only." into nyc-dev

8 years agoMerge "Remove no-op call to android_update_LD_LIBRARY_PATH" into nyc-dev
Dimitry Ivanov [Tue, 24 May 2016 15:35:58 +0000 (15:35 +0000)]
Merge "Remove no-op call to android_update_LD_LIBRARY_PATH" into nyc-dev

8 years agoEnforce class definition ordering rules in v37 Dex files.
Roland Levillain [Wed, 18 May 2016 10:41:33 +0000 (11:41 +0100)]
Enforce class definition ordering rules in v37 Dex files.

These new checks also reject classes extending or
implementing themselves directly or transitively within
a single Dex file.

(cherry picked from commit 621b5eab8eed7746925bca489114d706ad455572)

Bug: 28812524
Bug: 28797012
Bug: 28685551
Bug: 27682580

Change-Id: I51c43f8b4b6a7abaade63682411e61f21767f5d4

8 years agoPut boot class loader classes and strings in dex cache of app images.
Nicolas Geoffray [Tue, 26 Apr 2016 17:30:31 +0000 (18:30 +0100)]
Put boot class loader classes and strings in dex cache of app images.

The reason for b/28295348 was that an ArtMethod of the boot image was
in the app image dex cache, but the declaring class of that
boot image method was not.

Since objects of boot images don't need fixups, the comparisons for
FixupStrings and FixupResolvedTypes was always false for them.

bug:28295348

Change-Id: Ida6d42c902692914c302b7fe3d003f73710de6e1

8 years agoRemove no-op call to android_update_LD_LIBRARY_PATH
Dimitry Ivanov [Tue, 24 May 2016 00:16:55 +0000 (17:16 -0700)]
Remove no-op call to android_update_LD_LIBRARY_PATH

With linker-namespaces enabled for all target sdk versions
the call to android_update_LD_LIBRARY_PATH is no longer needed.

Bug: http://b/26040253
Bug: http://b/27702070
Change-Id: I77c27c10a435e223824e1b69f727d0bc37a26306

8 years agoMerge "Fix oat_writer to use WriteData which updates checksum." into nyc-dev
Jeff Hao [Mon, 23 May 2016 23:18:09 +0000 (23:18 +0000)]
Merge "Fix oat_writer to use WriteData which updates checksum." into nyc-dev

8 years agoFix oat_writer to use WriteData which updates checksum.
Jeff Hao [Mon, 23 May 2016 21:30:44 +0000 (14:30 -0700)]
Fix oat_writer to use WriteData which updates checksum.

OatWriter was using WriteFully in some places instead.

Bug: 28874264
Change-Id: Ibaea4536a7838f49feb98efe9c00a976fb5b2453

8 years agoCompile JNI stubs for verify-profile and interpret-only.
Vladimir Marko [Mon, 23 May 2016 14:32:42 +0000 (15:32 +0100)]
Compile JNI stubs for verify-profile and interpret-only.

This is the intended behavior to have a good JNI transition
performance.

Bug: 28902384
Change-Id: Iedb2ca343d66cf422ef2dc0527639e81d6ba8960

8 years agoDo not set property jpda.settings.syncPort in JDWP tests.
Roland Levillain [Fri, 20 May 2016 17:16:54 +0000 (18:16 +0100)]
Do not set property jpda.settings.syncPort in JDWP tests.

Let the OS choose the port automatically.

(cherry picked from commit 7235dd15e47d6f4b5e92400269cc206e01c514da)

Bug: 28869570
Change-Id: I79775f9e72f7f8d0f9ec3d68c6f0bdb057ca13ff

8 years agoMerge "Only fill methods with 0xFE on debug builds" into nyc-dev
Mathieu Chartier [Fri, 20 May 2016 23:20:00 +0000 (23:20 +0000)]
Merge "Only fill methods with 0xFE on debug builds" into nyc-dev

8 years agoOnly fill methods with 0xFE on debug builds
Mathieu Chartier [Thu, 19 May 2016 17:13:04 +0000 (10:13 -0700)]
Only fill methods with 0xFE on debug builds

The GC scans classes without holding any locks, we can not fill
the methods if it is running. Added a GC critical section to address
this. Fixes random crash when scanning classes' methods.

Only for debug builds to not hurt performance.

Bug: 28699001
Change-Id: If96155eaf3fc0e6df31f57dcf32fbd4063b09345

8 years agoMerge "ART: Check whether an oat file exists before opening" into nyc-dev
Andreas Gampe [Thu, 19 May 2016 22:35:45 +0000 (22:35 +0000)]
Merge "ART: Check whether an oat file exists before opening" into nyc-dev

8 years agoMerge "Do not allow OSR jump while debugging is active." into nyc-dev
Aart Bik [Thu, 19 May 2016 22:34:19 +0000 (22:34 +0000)]
Merge "Do not allow OSR jump while debugging is active." into nyc-dev

8 years agoDo not allow OSR jump while debugging is active.
Aart Bik [Wed, 18 May 2016 22:44:07 +0000 (15:44 -0700)]
Do not allow OSR jump while debugging is active.

Rationale:
This prevents dangerous transitions between interpreter
and osr compiled code while e.g. single stepping through
a method that is becoming hot.

BUG=28672961

(cherry picked from commit 29bdaeef925f35eed68f3e52d04416daa0a62317)

Change-Id: I7647710dbe794a1b3320a9666d3e3be85fc40ccd

8 years agoMerge "Add missing check for IsShuttingDown in profile saver" into nyc-dev
TreeHugger Robot [Thu, 19 May 2016 18:52:34 +0000 (18:52 +0000)]
Merge "Add missing check for IsShuttingDown in profile saver" into nyc-dev

8 years agoAdd missing check for IsShuttingDown in profile saver
Calin Juravle [Wed, 18 May 2016 22:49:36 +0000 (15:49 -0700)]
Add missing check for IsShuttingDown in profile saver

Bug: 28814718
Change-Id: I709fc30147047c7a420cd6ff2f0c3b57c54c2021

8 years agoMerge "Fix profile saver initial wait" into nyc-dev
Mathieu Chartier [Thu, 19 May 2016 17:04:35 +0000 (17:04 +0000)]
Merge "Fix profile saver initial wait" into nyc-dev

8 years agoMerge "Revert "Move rewritten StringFactory call results into dex registers for deopt...
TreeHugger Robot [Thu, 19 May 2016 14:30:18 +0000 (14:30 +0000)]
Merge "Revert "Move rewritten StringFactory call results into dex registers for deopt"" into nyc-dev

8 years agoRevert "Move rewritten StringFactory call results into dex registers for deopt"
Roland Levillain [Thu, 19 May 2016 13:00:55 +0000 (13:00 +0000)]
Revert "Move rewritten StringFactory call results into dex registers for deopt"

This reverts commit 0ea451b4d74e8ddc28ea5ce87ef6d21113a3cdd5.

597-deopt-new-string is failing.

Bug: 28846692
Bug: 28555675
Change-Id: I8274e5ae1d065dedc562132882b39e7f3fe5baf4

8 years agoART: Fix Mac build
Andreas Gampe [Thu, 19 May 2016 04:27:00 +0000 (21:27 -0700)]
ART: Fix Mac build

Follow-up to 9821cceebf077cb747aed543582b3d740a03ea7f.

Bug: 28801010
Change-Id: I0bbdf83d64ea81e56824aa19bfae3baa341a2b73

8 years agoART: Check whether an oat file exists before opening
Andreas Gampe [Thu, 19 May 2016 04:10:42 +0000 (21:10 -0700)]
ART: Check whether an oat file exists before opening

The two-stage process of dlopen and our own loader is expensive.
Considering that the OatFileAssistant needs to check two locations,
one of which is unlikely to have a file for the common case of apps
installed in data, do a file existence check before attempting to
load the file.

Remove an unused variable.

Saves about 0.25ms on a N6P.

Bug: 28801010
Change-Id: I0aff9c276c0f539723f8a92663f14ce72160c44d

8 years agoMerge "ART: Optimize PreSetup pass for oat-file open" into nyc-dev
TreeHugger Robot [Thu, 19 May 2016 03:51:04 +0000 (03:51 +0000)]
Merge "ART: Optimize PreSetup pass for oat-file open" into nyc-dev

8 years agoFix profile saver initial wait
Mathieu Chartier [Thu, 19 May 2016 02:51:23 +0000 (19:51 -0700)]
Fix profile saver initial wait

Was using TimedWait for the initial wait, but this can return
early if the process receives any interrupt (due to futex). The
solution is to use a wait loop. If the wait returned early, not
enough classes were including in the profile. This negatively
affected application launch times in some scenarios.

Sample wait times before the change:
Waited 2.002s
Waited 97.808ms
Waited 182.676ms
Waited 2.000s
Waited 1.678s

Bug: 27688727

Change-Id: Ia84878e1278d70b4cc239374a2107d0f111dbdc5

8 years agoART: Optimize PreSetup pass for oat-file open
Andreas Gampe [Wed, 18 May 2016 20:09:54 +0000 (13:09 -0700)]
ART: Optimize PreSetup pass for oat-file open

The PreSetup pass for opening an oatfile with dlopen parses all
shared objects and tries to retrieve the corresponding mem map
(so as to have a fake MemMap to reserve the space for any scanning
operations and so on). Optimistically optimize this pass by counting
the number of shared objects before the dlopen, and skipping as
many afterwards.

This saves about half a millisecond on an N6P.

Bug: 28801010
Change-Id: I70156f9875e89c5af3c9e36e8f01c5662e3f736e

8 years agoMove rewritten StringFactory call results into dex registers for deopt
Mingyao Yang [Mon, 16 May 2016 18:01:49 +0000 (11:01 -0700)]
Move rewritten StringFactory call results into dex registers for deopt

Bug: 28555675

(cherry picked from commit 8ca33bf04060fadd5b35fa93fa56547c62fe52e7)

Change-Id: I9236df283f2e83ca5dcde01f73dc0522d745cd59

8 years agoMerge "Catch classes inheriting from themselves in the class linker." into nyc-dev
Roland Levillain [Wed, 18 May 2016 14:48:45 +0000 (14:48 +0000)]
Merge "Catch classes inheriting from themselves in the class linker." into nyc-dev

8 years agoCatch classes inheriting from themselves in the class linker.
Roland Levillain [Wed, 18 May 2016 11:25:38 +0000 (12:25 +0100)]
Catch classes inheriting from themselves in the class linker.

Bug: 28685551
Bug: 27682580
Bug: 28830038

Change-Id: If568013bf3c82c1df9b282522712d9af5ca5945d

8 years agoFix an assert during jdwp debugging.
Mingyao Yang [Tue, 10 May 2016 21:30:41 +0000 (14:30 -0700)]
Fix an assert during jdwp debugging.

When debugger attaches, we patch entry points of methods in framework code.
During that process, it's possible that some method's declaring class isn't
resolved yet. We need to relax one assert for that case.

Bug: 28630805

(cherry picked from commit 3fd448a8b7903b00fceaed5853306e2d7eb31c72)

Change-Id: I59fd488ad75417a64b52321677ffcac6ccdc5ce1

8 years agoART: Fix systrace monitor logging
Andreas Gampe [Tue, 17 May 2016 17:13:10 +0000 (10:13 -0700)]
ART: Fix systrace monitor logging

Thinlock unlocking was incorrectly unconditionally ending a block.

Bug: 28423466
Change-Id: Ifaebd9e959041e157e292d4cba05675a37e9c700

8 years agoMerge "Revert "Reject classes inheriting from themselves directly or transitively...
TreeHugger Robot [Tue, 17 May 2016 01:46:56 +0000 (01:46 +0000)]
Merge "Revert "Reject classes inheriting from themselves directly or transitively."" into nyc-dev

8 years agoMerge "Visit IMT of all classes during image writing" into nyc-dev
Mathieu Chartier [Tue, 17 May 2016 01:21:19 +0000 (01:21 +0000)]
Merge "Visit IMT of all classes during image writing" into nyc-dev

8 years agoRevert "Reject classes inheriting from themselves directly or transitively."
Nicolas Geoffray [Tue, 17 May 2016 00:12:11 +0000 (00:12 +0000)]
Revert "Reject classes inheriting from themselves directly or transitively."

Bug: 28685551
Bug: 27682580
Bug: 28797012

This reverts commit 9de98ef4ad4311e85d124099b0b36ab81171ea20.

Change-Id: Ic4a21194ad602f4897f088a66672f3dd9f30f607

8 years agoVisit IMT of all classes during image writing
Mathieu Chartier [Mon, 16 May 2016 21:58:01 +0000 (14:58 -0700)]
Visit IMT of all classes during image writing

We still need to visit the IMT for classes that does not have any
methods. It is required to visit the IMT of every class to assign
image offsets for the conflict table methods.

Added regression test.

Bug: 28707801
Change-Id: I1cd21f20e1e3c606ecfe8cbabe1045cadd86f268

8 years agoMerge "Fix assert failure in interpreter after deoptimization." into nyc-dev
Mingyao Yang [Mon, 16 May 2016 23:15:03 +0000 (23:15 +0000)]
Merge "Fix assert failure in interpreter after deoptimization." into nyc-dev

8 years agoAdjust ProfileSaver strategy
Calin Juravle [Fri, 29 Apr 2016 15:44:11 +0000 (16:44 +0100)]
Adjust ProfileSaver strategy

Change to a notification based strategy (instead of polling):
- the JIT notifies the ProfileSaver everytime it attempts a compilation
or generate (in a task) a ProfileInfo object for the method
- once a certain number of hot methods notification are received,
ProfileSaver wakes up the thread to do the analysis
- a wake up does not equal to I/O since the during processing we might
realized that's actually not enough new data.
- ProfileSaver throtles the request and ensures it doesn't do the
processing more often than kMinSavePeriodNs.

The new strategy avoids waking the thread unnecessary during extended
idle periods when we don't JIT.

Bug: 26815940

Change-Id: I24cb15daead5c5a5395ae6f5f79549e39e2f3011

8 years agoMerge "Make quick frames of proxy methods visited if they're constructors." into...
Jeff Hao [Mon, 16 May 2016 17:15:20 +0000 (17:15 +0000)]
Merge "Make quick frames of proxy methods visited if they're constructors." into nyc-dev

8 years agoReject classes inheriting from themselves directly or transitively.
Roland Levillain [Thu, 12 May 2016 15:12:47 +0000 (16:12 +0100)]
Reject classes inheriting from themselves directly or transitively.

Also enforce class definition ordering with respect to super
classes within a Dex file.

(cherry picked from commit 498bb81f8725e2cf8f5ce1aa6b49ab5a9c5bb4c9)

Bug: 28685551
Bug: 27682580
Change-Id: If3eba782538eb4328d4b8a542236632379e7c050

8 years agoMake quick frames of proxy methods visited if they're constructors.
Jeff Hao [Fri, 13 May 2016 21:46:28 +0000 (14:46 -0700)]
Make quick frames of proxy methods visited if they're constructors.

Also adds a test case for getting annotations during moving GC.

Bug: 28510922
Change-Id: Ic9b849cd16321da3a3a609182dcdea08782496f9

8 years agoEnsure that java.lang.reflect.Field is initialized
Przemyslaw Szczepaniak [Thu, 12 May 2016 13:55:48 +0000 (14:55 +0100)]
Ensure that java.lang.reflect.Field is initialized

Recent change in libcore (a move of clinit code
to register function for java.net.InetAddress
class) was triggering a failure in 119-noimage-patchoat
test. Failure was occurring when the test was running
without the image. This was caused by the
java.lang.reflect.Field not being initialized when
running InetAddress.<clinit>, which is a side effect
of calling JNIEnv->GetMethodId inside the libcore JNI_OnLoad.

This changes makes sure that this class is initialized
when we're running without image.

Bug: 28153851
Bug: 27265238
Change-Id: I8aeb5eb312a163c452c40b851112544a8340e488
(cherry picked from commit a2b147eaf72c5af23302a382620360b4cac28934)

8 years agoFix oatdump crash on arm64/arm code.
Aart Bik [Wed, 11 May 2016 17:30:47 +0000 (10:30 -0700)]
Fix oatdump crash on arm64/arm code.
Also adds 16 bit literal information.

Rationale:
When "run-away" instructions are disassembled, the literal
addresses may go out of range, causing oatdump to crash.
This CL guards memory access against the full memory range
allocated to assembly instructions and data (it is possible
but not really necessary to refine this a bit). Out of range
arguments are now displayed as (?) to denote the issue, which
is a lot nicer than crashing.

BUG=28670871

(cherry picked from commit d3059e77818a058513ed92557160bdb6d5102b67)

Change-Id: I322bbdf83509e253430c40428a05c0ad16b81354

8 years agoMerge "Don't expect permission to open foreign dex use marks." into nyc-dev
Richard Uhler [Thu, 12 May 2016 15:12:28 +0000 (15:12 +0000)]
Merge "Don't expect permission to open foreign dex use marks." into nyc-dev

8 years agoMerge "Fix another case of live_in at irreducible loop entry." into nyc-dev
TreeHugger Robot [Thu, 12 May 2016 07:57:02 +0000 (07:57 +0000)]
Merge "Fix another case of live_in at irreducible loop entry." into nyc-dev

8 years agoMerge "Prevent ArtMethod clearing race" into nyc-dev
Mathieu Chartier [Wed, 11 May 2016 22:15:39 +0000 (22:15 +0000)]
Merge "Prevent ArtMethod clearing race" into nyc-dev