OSDN Git Service

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

8 years agoMerge "Make sure the referring class is in the dex cache."
Treehugger Robot [Mon, 25 Apr 2016 17:43:47 +0000 (17:43 +0000)]
Merge "Make sure the referring class is in the dex cache."

8 years agoMerge "Revert "Revert "Thumb2: Reduce memory used for fixup dependencies."""
Vladimir Marko [Mon, 25 Apr 2016 17:05:29 +0000 (17:05 +0000)]
Merge "Revert "Revert "Thumb2: Reduce memory used for fixup dependencies."""

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
Change-Id: I58739903f0dff3867b920a7444f53b99ecf86e85

8 years agoMerge "ART: Fix ROR Checker test"
David Brazdil [Mon, 25 Apr 2016 16:55:38 +0000 (16:55 +0000)]
Merge "ART: Fix ROR Checker test"

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

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

Fix: Correctly ignore dependencies of the non-expandable
fixups rather than non-expandable dependents of any fixups.

Bug: 28343425
Bug: 28256882

This reverts commit d89e2418f2c6d9897fee219f8df9c20ca93c80db.

Change-Id: I7161fbfd094ce1ddc097826b53c894a7377a2b9d

8 years agoMerge "Reduce memory lost by ArenaAllocator for large allocations."
Vladimir Marko [Mon, 25 Apr 2016 13:50:13 +0000 (13:50 +0000)]
Merge "Reduce memory lost by ArenaAllocator for large allocations."

8 years agoMerge "Refactor use of __ANDROID__ macro"
Roland Levillain [Mon, 25 Apr 2016 13:03:01 +0000 (13:03 +0000)]
Merge "Refactor use of __ANDROID__ macro"

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
Change-Id: I1b4bda5d3f32ecd95fbd11addd1f0ca6dcc33e45

8 years agoMerge "Take into account the change in classes when analysing profiles"
Calin Juravle [Mon, 25 Apr 2016 12:44:09 +0000 (12:44 +0000)]
Merge "Take into account the change in classes when analysing profiles"

8 years agoTake into account the change in classes when analysing profiles
Calin Juravle [Tue, 29 Mar 2016 19:33:33 +0000 (20:33 +0100)]
Take into account the change in classes when analysing profiles

Bug: 27894914

(cherry picked from commit e02348caea14a203a2ed7a6c859e1515c6c6778f)

Change-Id: I02834424803a9368374f32507e0b637fbfa5d7a6

8 years agoMerge changes Ie36c4b4a,Ia9968b95,I2c19de14,I99388dee,I072c4e41, ...
Calin Juravle [Mon, 25 Apr 2016 11:09:33 +0000 (11:09 +0000)]
Merge changes Ie36c4b4a,Ia9968b95,I2c19de14,I99388dee,I072c4e41, ...

* changes:
  ProfileSaver: query profiling_infos instead of the code_map
  Fix comparison in profile saver
  Fix tracking foreign dex files
  Skip profiling if the dex file is fully compiled
  Fix profile save MaxBaxBackoff time
  Fix and tune ProfileSaver
  Do not profile fully compiled oat files.
  Discard corrupted or out of date profiles
  Extend profman to be able to dump profile content.
  Update and improve profiles format
  Improve ProfileSaver to cache data and do minimal I/O
  Improve resolved classes saving strategy
  Add ProfileSaver stats and dump them during SigQuit
  Don't be so agressive in quering the code cache for new methods

8 years agoMerge "Add flag to ArtMethod to skip compilation."
Treehugger Robot [Mon, 25 Apr 2016 08:30:32 +0000 (08:30 +0000)]
Merge "Add flag to ArtMethod to skip compilation."

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

Change-Id: Ie3fd71ded0b77de8dab1c3c825b867cb321b8873

8 years agoMerge "Revert "Thumb2: Reduce memory used for fixup dependencies.""
Treehugger Robot [Sun, 24 Apr 2016 06:05:28 +0000 (06:05 +0000)]
Merge "Revert "Thumb2: Reduce memory used for fixup dependencies.""

8 years agoRevert "Thumb2: Reduce memory used for fixup dependencies."
Guang Zhu [Sun, 24 Apr 2016 05:17:17 +0000 (05:17 +0000)]
Revert "Thumb2: Reduce memory used for fixup dependencies."

Bug: 28343425

This reverts commit 1f2ce44db2613a1e60a66c3c454834b72e994f57.

Change-Id: I39edb37fb6fa4e84ac3fd0e11650fbb92d05ffcb

8 years agoMerge "ART: Slightly change InitializeClass flow"
Treehugger Robot [Sat, 23 Apr 2016 02:17:01 +0000 (02:17 +0000)]
Merge "ART: Slightly change InitializeClass flow"

8 years agoMerge "Revert "Assembly RegionTLAB allocation fast path for x86_64""
Treehugger Robot [Fri, 22 Apr 2016 19:51:36 +0000 (19:51 +0000)]
Merge "Revert "Assembly RegionTLAB allocation fast path for x86_64""

8 years agoRevert "Assembly RegionTLAB allocation fast path for x86_64"
Hiroshi Yamauchi [Fri, 22 Apr 2016 19:09:16 +0000 (19:09 +0000)]
Revert "Assembly RegionTLAB allocation fast path for x86_64"

This reverts commit 9a966cbbf195a1a4c24ff651f8056b64ffa7f715.

The mac build breaks.

Change-Id: I045ece805d42050a14e67f0c8cb3d6f3755d79f4

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

(cherry picked from commit fc49fa05c51a26ba1b185401cdba95cea1b67b39)

Change-Id: I22a6121477e409987281bc81c28b6c942f1bd319

8 years agoMerge "MIPS64: Implement bitCount intrinsics."
Aart Bik [Fri, 22 Apr 2016 18:26:21 +0000 (18:26 +0000)]
Merge "MIPS64: Implement bitCount intrinsics."

8 years agoMerge "Update to perflib-25.0.0 to improve processing performance."
Richard Uhler [Fri, 22 Apr 2016 18:10:48 +0000 (18:10 +0000)]
Merge "Update to perflib-25.0.0 to improve processing performance."

8 years agoMerge "Assembly RegionTLAB allocation fast path for x86_64"
Hiroshi Yamauchi [Fri, 22 Apr 2016 17:51:40 +0000 (17:51 +0000)]
Merge "Assembly RegionTLAB allocation fast path for x86_64"

8 years agoMerge "ART: Naive NullCheck elimination in InstructionBuilder"
David Brazdil [Fri, 22 Apr 2016 16:52:18 +0000 (16:52 +0000)]
Merge "ART: Naive NullCheck elimination in InstructionBuilder"

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

8 years agoProfileSaver: query profiling_infos instead of the code_map
Calin Juravle [Tue, 19 Apr 2016 15:33:46 +0000 (16:33 +0100)]
ProfileSaver: query profiling_infos instead of the code_map

This is the first step in being able to record profiles without jit
being active.

Bug: 27916886

(cherry picked from commit e2d066d0337b7c81d47e4806e6025b70d83fcd56)

Change-Id: Ie36c4b4a11d3b6e5de959121a1acea22a9e25121

8 years agoFix comparison in profile saver
Calin Juravle [Tue, 19 Apr 2016 17:17:41 +0000 (18:17 +0100)]
Fix comparison in profile saver

Bug: 27893309

(cherry picked from commit d19dc4688b5b93f149d45435deb0a67217464e37)

Change-Id: Ia9968b95dcc0d2c7c209be3ba4f65b6a8adfe688

8 years agoFix tracking foreign dex files
Calin Juravle [Mon, 18 Apr 2016 17:59:22 +0000 (18:59 +0100)]
Fix tracking foreign dex files

Apps which share the same VM will have different application data
directories. We used to store only the first one registered and miss
subsequent registrations.

Bug: 28012567

(cherry picked from commit 20ae79370a14c17dfb037914995d6430774fe492)

Change-Id: I2c19de1406b38a376995f1524014cb8a1daa9d82

8 years agoSkip profiling if the dex file is fully compiled
Calin Juravle [Mon, 18 Apr 2016 15:38:27 +0000 (16:38 +0100)]
Skip profiling if the dex file is fully compiled

The OatFile does not store the original dex location that was used to
compile the file. So in order to get the oat file for a given code path
we need to iterate over the inner oat dex files and check against them.

Also, we used to pass the unfiltered code_paths set to the saver which
would make the filtering useless. This fixes the parameter passing as
well.

Bug: 27893309

(cherry picked from commit 7506423b2b9ea13fc5fa9711ab0106977876a5a2)

Change-Id: I99388dee40f2d0e70f970b3f5c6a4171a7e97c0e

8 years agoFix profile save MaxBaxBackoff time
Calin Juravle [Thu, 31 Mar 2016 14:29:54 +0000 (15:29 +0100)]
Fix profile save MaxBaxBackoff time

Bug: 27914456
Bug: 27937568

(cherry picked from commit 28530daffc05fe376dbd0df3b1b44257bce5a16f)

Change-Id: I072c4e41a5c0fc7941808109ec2f6fdd49130793

8 years agoFix and tune ProfileSaver
Calin Juravle [Wed, 30 Mar 2016 17:18:58 +0000 (18:18 +0100)]
Fix and tune ProfileSaver

- the statement to mark the profile saved was not guarded by the right
condition.
- increase the backoff to 2x and maximum period time to 10 minutes.

As part of this change also
- fix typos
- remove uneeded warning
- add more VLOGs for easier debuging in the future

Bug: 27914456

(cherry picked from commit 0cdaa6cdbeadceaee3a1acc641e7cc2548e125d9)

Change-Id: I76ddc6ced897bb91cfbd2a0cb6614bdeeafb9ee9

8 years agoDo not profile fully compiled oat files.
Calin Juravle [Fri, 25 Mar 2016 17:17:09 +0000 (17:17 +0000)]
Do not profile fully compiled oat files.

- don't waste a thread if we're not gonna use the profiles.
- don't put foreign dex use markers since they will be ignored.

Bug: 26080105

(cherry picked from commit 6044fa747867413912d0de3049dc570c769d3cf8)

Change-Id: I3fca435ed59f9969ff3b17e2462e2b2c647e04c9

8 years agoDiscard corrupted or out of date profiles
Calin Juravle [Thu, 24 Mar 2016 20:33:22 +0000 (20:33 +0000)]
Discard corrupted or out of date profiles

Until now we bailed out if the previous profile contained invalid data.
This CLs forces the save and clears any data in a profile that has the
wrong version or contains bad data.

Bug: 27081617

(cherry picked from commit fe297a96bc6d3da11579709add9b4568730d2b4f)

Change-Id: I9184e0483ea0a869d7aa92630acd6fa04a9d2e03

8 years agoExtend profman to be able to dump profile content.
Calin Juravle [Thu, 24 Mar 2016 16:16:34 +0000 (16:16 +0000)]
Extend profman to be able to dump profile content.

With the move to binary format it gets harder to debug profiles. This
adds a simple dumping mechanism to make profiles human readable.

Bug: 27600652

(cherry picked from commit 54196728c25421e72d0009cac4c3145a0da18a58)

Change-Id: I73148fe9e24f30089e9f0fb383e9f6f6c61a46e5

8 years agoUpdate and improve profiles format
Calin Juravle [Mon, 21 Mar 2016 14:37:55 +0000 (14:37 +0000)]
Update and improve profiles format

- add profile version in the header
- change the profile format to a binary format (saves more than 50% of
space)
- improve error handling during parsing
- improve corner cases handling (all methods/classes in the
file)
- improve error reporting

Bug: 27600652
Bug: 27081617

(cherry picked from commit b8697b15145834c9861bebfb03daa745ecbe53e8)

Change-Id: Ia0a30e839eb11ada212bede34e4a2d556674219d

8 years agoImprove ProfileSaver to cache data and do minimal I/O
Calin Juravle [Fri, 18 Mar 2016 16:23:40 +0000 (16:23 +0000)]
Improve ProfileSaver to cache data and do minimal I/O

This CLs introducing caching to further optimize the I/O performed by
the ProfileSaver. The cache stats are also recorded.

Resolved classes are captured and cached after 2 seconds but written
later during application lifetime.

Methods are also cached and the write got smarter to avoid
reading/writing them if it's not needed.

On non scientific experiments the size of the cache reaches just a few
hundreds uint16_t values kept in set, so its impact is minimal.

In terms of how much data we write. In the same non scientific
experiments this reduces the total bytes written by at least 2-3x. In
the first few minutes of after the boot gmscore writes ~3KB (down from
9kb) and quicksearchlauncher writes ~20KB (down from 40KB).

Bug: 27600652

(cherry picked from commit 85f7bf3bbfa17d65ff77e3e826b5f7aff45838a9)

Change-Id: I6ecb04ce81b281d1c1538060dbbaeeeb08906775

8 years agoImprove resolved classes saving strategy
Calin Juravle [Thu, 17 Mar 2016 17:07:52 +0000 (17:07 +0000)]
Improve resolved classes saving strategy

If we already have a non empty profile file it means that we already
saved once the resolved classes. So there's no need to hurry up and
start the profile saver eagerly after 2s.

Bug: 27600652

(cherry picked from commit c15e566b36170237f01ccefc12129c1578a02140)

Change-Id: Iecc730c25eab779efccbbde66432dbbc61192e8a

8 years agoAdd ProfileSaver stats and dump them during SigQuit
Calin Juravle [Wed, 9 Mar 2016 15:37:48 +0000 (15:37 +0000)]
Add ProfileSaver stats and dump them during SigQuit

Bug: 27516906

(cherry picked from commit c19c1c2e1def1f4f5ab5fd9e71b1a6f76d42988f)

Change-Id: I7d2b1091c3523805ef0f87df42feed1098678aad

8 years agoDon't be so agressive in quering the code cache for new methods
Calin Juravle [Mon, 14 Mar 2016 17:32:49 +0000 (17:32 +0000)]
Don't be so agressive in quering the code cache for new methods

Interim fix for apps which JIT a lot and trigger a lot of I/O because of
profile data (e.g. gmscore).

This reduces the amount of data re-written to disk by a few order of
magnitude. (e.g. 43k instead of 3.5MB)

Proper fix which will make the writing smarter is coming.

Bug:27600652

(cherry picked from commit 815759a8194fc94c9d9e6e081c99bee38792ba91)

Change-Id: I28c14369ba6728acb42d4de7cb65df39791fb2a1

8 years agoMerge "Thumb2: Reduce memory used for fixup dependencies."
Vladimir Marko [Fri, 22 Apr 2016 14:41:04 +0000 (14:41 +0000)]
Merge "Thumb2: Reduce memory used for fixup dependencies."

8 years agoThumb2: Reduce memory used for fixup dependencies.
Vladimir Marko [Fri, 22 Apr 2016 11:16:29 +0000 (12:16 +0100)]
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
Change-Id: I0b7155ed8970b69703fa9c4666d9c4961e425721

8 years agoRefactor use of __ANDROID__ macro
Bilyan Borisov [Mon, 4 Apr 2016 15:27:32 +0000 (16:27 +0100)]
Refactor use of __ANDROID__ macro

We use the __ANDROID__ macro, which is provided by the toolchain, in
numerous places. This patch refactors the usage of this by defining a
new macro, ART_TARGET_ANDROID, that is being passed during build to
ART_TARGET_CFLAGS in Android.common_build.mk on the same line as
ART_TARGET. The codebase currently assumes that the existence of the
__ANDROID__ macro implies that we are compiling art for an android
target device. This is because, currently, target builds are compiled
with target toolchains that provide the macro, while host toolchains
do not.  With this change this assumption is still preserved. However,
in a future patch we will add the ability to compile art for a linux
target, and in that case the ART_TARGET_ANDROID macro won't be passed
anymore.

Change-Id:  I1f3a811aa735c87087d812da27fc6b08f01bad51

8 years agoMerge "Avoid redundant Long allocation before unboxing"
Tobias Thierer [Fri, 22 Apr 2016 10:05:19 +0000 (10:05 +0000)]
Merge "Avoid redundant Long allocation before unboxing"

8 years agoMerge "ART: Disable unstarted runtime pow test for valgrind"
Treehugger Robot [Fri, 22 Apr 2016 00:59:59 +0000 (00:59 +0000)]
Merge "ART: Disable unstarted runtime pow test for valgrind"

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.

Change-Id: I2b136abc107b53d89b70ccb20dd378a7b704d077

8 years agoMIPS64: Implement bitCount intrinsics.
Chris Larsen [Thu, 21 Apr 2016 23:00:36 +0000 (16:00 -0700)]
MIPS64: Implement bitCount intrinsics.

- int java.lang.Integer.bitCount(int)
- int java.lang.Long.bitCount(long)

Change-Id: If2390beeb5b900e8680ead1927e0455b35f1948a

8 years agoMerge "Make dex file loading failure more explicit about failure."
Alex Light [Thu, 21 Apr 2016 21:35:00 +0000 (21:35 +0000)]
Merge "Make dex file loading failure more explicit about failure."

8 years agoMerge "Revert "Revert "Assembly TLAB and RegionTLAB allocation fast path for x86"""
Hiroshi Yamauchi [Thu, 21 Apr 2016 19:49:06 +0000 (19:49 +0000)]
Merge "Revert "Revert "Assembly TLAB and RegionTLAB allocation fast path for x86"""

8 years agoMerge "X86/X86_64: Switch to locked add from mfence"
Aart Bik [Thu, 21 Apr 2016 19:36:23 +0000 (19:36 +0000)]
Merge "X86/X86_64: Switch to locked add from mfence"

8 years agoMerge "Fix heap check."
Mathieu Chartier [Thu, 21 Apr 2016 19:14:07 +0000 (19:14 +0000)]
Merge "Fix heap check."

8 years agoFix heap check.
Mathieu Chartier [Thu, 21 Apr 2016 17:23:16 +0000 (10:23 -0700)]
Fix heap check.

Previously, we only checked the image we were patching. This did not
work if the referent was in another image. Fixed the DCHECK to check
all the boot images.

Bug: 28286961

(cherry picked from commit 488849c584337a1aae8413a1d1e0fad8043bf672)

Change-Id: If2e8e48b500935d0969e8673816d28218888bd13

8 years agoMerge "ART: Address late comments on a GVN memory-saving CL"
David Brazdil [Thu, 21 Apr 2016 14:58:40 +0000 (14:58 +0000)]
Merge "ART: Address late comments on a GVN memory-saving CL"

8 years agoART: Address late comments on a GVN memory-saving CL
David Brazdil [Thu, 21 Apr 2016 13:00:15 +0000 (14:00 +0100)]
ART: Address late comments on a GVN memory-saving CL

Added extra comments and removed redundant code as requested.

Bug: 28173563
Bug: 28287086

Change-Id: If6aff68c4c30427a86a27ffba5df1ae135edd294

8 years agoMerge "Thumb2: Fix disassembly of the b.w offset."
Vladimir Marko [Thu, 21 Apr 2016 14:40:22 +0000 (14:40 +0000)]
Merge "Thumb2: Fix disassembly of the b.w offset."

8 years agoThumb2: Fix disassembly of the b.w offset.
Vladimir Marko [Thu, 21 Apr 2016 13:52:03 +0000 (14:52 +0100)]
Thumb2: Fix disassembly of the b.w offset.

Bug: 28311085
Change-Id: If729af888be65e1f24362b9c4ed79f124446024d

8 years agoAvoid redundant Long allocation before unboxing
Tobias Thierer [Thu, 21 Apr 2016 13:45:43 +0000 (14:45 +0100)]
Avoid redundant Long allocation before unboxing

long x = Long.valueOf(s) --> Long.parseLong()

Bug: 28289401
Change-Id: I0a6766d44a522b6dd5c7afc5e81ebe135103315e

8 years agoMerge "Reduce memory usage in GVN"
David Brazdil [Thu, 21 Apr 2016 11:15:43 +0000 (11:15 +0000)]
Merge "Reduce memory usage in GVN"

8 years agoReduce memory usage in GVN
David Brazdil [Wed, 20 Apr 2016 13:24:12 +0000 (14:24 +0100)]
Reduce memory usage in GVN

Implement recycling of ValueSet data structures which the GVN
algorithm will not access any more.

Savings depend on the shape of the graph, but can be as high as 93%.
Peak memory usage for GSA drops from 32MB to 26MB, compile times seem
unaffected.

Bug: 28173563
Bug: 28287086

Change-Id: If227177449bc90ad24fa68c37b0c2615924af1ed

8 years agoRevert "Revert "Assembly TLAB and RegionTLAB allocation fast path for x86""
Sang, Chunlei [Thu, 21 Apr 2016 02:22:02 +0000 (10:22 +0800)]
Revert "Revert "Assembly TLAB and RegionTLAB allocation fast path for x86""

This reverts commit 0cd1bf7a68bf39867b8d229a6afeb6b2c66b7acd.

Change-Id: I79cae41c110343bbc1537063e1140484f2769ca2

8 years agoMerge "Revert "Assembly TLAB and RegionTLAB allocation fast path for x86""
Hiroshi Yamauchi [Thu, 21 Apr 2016 00:42:14 +0000 (00:42 +0000)]
Merge "Revert "Assembly TLAB and RegionTLAB allocation fast path for x86""

8 years agoRevert "Assembly TLAB and RegionTLAB allocation fast path for x86"
Hiroshi Yamauchi [Wed, 20 Apr 2016 23:51:25 +0000 (23:51 +0000)]
Revert "Assembly TLAB and RegionTLAB allocation fast path for x86"

This reverts commit 84ed7d06d5585611a067491243ab560fe5260cae.

This breaks the mac build.

Change-Id: I90ea0872073135c8ff2089e05b8b16985ef95773

8 years agoMerge "Assembly TLAB and RegionTLAB allocation fast path for x86"
Hiroshi Yamauchi [Wed, 20 Apr 2016 23:14:16 +0000 (23:14 +0000)]
Merge "Assembly TLAB and RegionTLAB allocation fast path for x86"

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

8 years agoMerge "ART: Change x86 from modify_ldt to set_thread_data"
Andreas Gampe [Wed, 20 Apr 2016 21:26:53 +0000 (21:26 +0000)]
Merge "ART: Change x86 from modify_ldt to set_thread_data"

8 years agoMerge changes I0360a078,I3e267519
Treehugger Robot [Wed, 20 Apr 2016 19:47:50 +0000 (19:47 +0000)]
Merge changes I0360a078,I3e267519

* changes:
  ART: Add Math cutouts
  ART: Add some reflection cutouts

8 years agoMerge "Fix HInstruction::ReplaceInput(), allow no-op."
Vladimir Marko [Wed, 20 Apr 2016 18:42:26 +0000 (18:42 +0000)]
Merge "Fix HInstruction::ReplaceInput(), allow no-op."

8 years agoFix HInstruction::ReplaceInput(), allow no-op.
Vladimir Marko [Wed, 20 Apr 2016 17:45:25 +0000 (18:45 +0100)]
Fix HInstruction::ReplaceInput(), allow no-op.

Allow HInstruction::ReplaceInput() to be called with
a `replacement` being the same as the old input and
do nothing in that case.

This is a follow-up to
    https://android-review.googlesource.com/216923
where I erroneously assumed that it never happens.

Also adhere to the standard C++ std::forward_list<>
semantics in the single-element overload of
`IntrusiveForwardList<>::splice_after()`.

Bug: 28173563
Change-Id: I5cea14c212b1083f90ffe6b5b53324ad663d57d8

8 years agoMerge "Do less work holding thread list lock"
Mathieu Chartier [Wed, 20 Apr 2016 18:22:24 +0000 (18:22 +0000)]
Merge "Do less work holding thread list lock"

8 years agoMerge changes Ic40833d3,I8f286987
Hiroshi Yamauchi [Wed, 20 Apr 2016 17:37:38 +0000 (17:37 +0000)]
Merge changes Ic40833d3,I8f286987

* changes:
  Revert "Disable JDWP tests with read barriers."
  Fix a deadlock between debugger and GC.

8 years agoART: Add Math cutouts
Andreas Gampe [Tue, 19 Apr 2016 03:51:13 +0000 (20:51 -0700)]
ART: Add Math cutouts

Add sin, cos and pow to unstarted runtime. Add tests for some
very specific values that are seen.

Allows to compile-time initialize:
* android.graphics.drawable.RippleForeground
* android.widget.EdgeEffect

Bug: 27265238

(cherry picked from commit 8c5889a3bdefd7dc84494ec824d495913f2362a9)

Change-Id: I0360a078e7dc9d2a176ec1cf2d8dbb242da1c83e

8 years agoART: Add some reflection cutouts
Andreas Gampe [Tue, 19 Apr 2016 00:07:30 +0000 (17:07 -0700)]
ART: Add some reflection cutouts

Add Class.getInnerClassFlags and Method.invoke to unstarted runtime.

Allows to compile-time initialize:
* android.net.NetworkInfo
* android.net.wifi.WifiInfo

Bug: 27265238

(cherry picked from commit b3ffbe32b78c18739736fc998d65430b46c510e5)

Change-Id: I3e267519acf14b08c687f1e831e2027d37158767

8 years agoDo less work holding thread list lock
Mathieu Chartier [Tue, 19 Apr 2016 20:46:03 +0000 (13:46 -0700)]
Do less work holding thread list lock

Avoid doing stuff that requires access java heap like PrettyMethod.
Fixes lock violation.

Bug: 28268478

(cherry picked from commit dee19e3caaeb5666055842d656dc0516b901f30c)

Change-Id: Ie090879690df7a6db15a9c8b7e82f3809450d653

8 years agoMerge "Fix RTP to hold mutator lock while using raw mirror pointers."
Vladimir Marko [Wed, 20 Apr 2016 14:43:54 +0000 (14:43 +0000)]
Merge "Fix RTP to hold mutator lock while using raw mirror pointers."

8 years agoMerge "Thumb2: Fix EmitJumpTables() to extend buffer only if needed."
Vladimir Marko [Wed, 20 Apr 2016 14:36:50 +0000 (14:36 +0000)]
Merge "Thumb2: Fix EmitJumpTables() to extend buffer only if needed."

8 years agoFix RTP to hold mutator lock while using raw mirror pointers.
Vladimir Marko [Wed, 20 Apr 2016 14:06:31 +0000 (15:06 +0100)]
Fix RTP to hold mutator lock while using raw mirror pointers.

ReferenceTypePropagation::RTPVisitor::SetClassAsTypeInfo()
is taking a raw mirror::Class* parameter, so it must be
marked with SHARED_REQUIRES(Locks::mutator_lock_). The
omission of this annotation allowed
    https://android-review.googlesource.com/216926
to compile despite using GC-unsafe raw mirror pointers in
UpdateFieldAccessTypeInfo(). This led to test failures in
the debug-GC mode.

Change-Id: I2a743070c642e7a611480e5d495af44f0945e43f

8 years agoThumb2: Fix EmitJumpTables() to extend buffer only if needed.
Vladimir Marko [Wed, 20 Apr 2016 13:39:47 +0000 (14:39 +0100)]
Thumb2: Fix EmitJumpTables() to extend buffer only if needed.

Bug: 28256882
Change-Id: I15227535c0fcb73c04b0b05160852c4b1bebee49

8 years agoMerge "Reuse HUseListNode<>s when replacing instruction or input."
Vladimir Marko [Wed, 20 Apr 2016 11:52:24 +0000 (11:52 +0000)]
Merge "Reuse HUseListNode<>s when replacing instruction or input."

8 years agoMerge "Fix reference_type_propagation_test."
Vladimir Marko [Wed, 20 Apr 2016 10:27:15 +0000 (10:27 +0000)]
Merge "Fix reference_type_propagation_test."

8 years agoFix reference_type_propagation_test.
Vladimir Marko [Wed, 20 Apr 2016 10:22:16 +0000 (11:22 +0100)]
Fix reference_type_propagation_test.

Bug: 28210356
Change-Id: I472bbdc48d3959a374d4bf21a921ca57007a96f0

8 years agoMerge "Revert "Increase timeout for the 570-checker-osr test from 20s to 60s.""
Vladimir Marko [Wed, 20 Apr 2016 09:06:47 +0000 (09:06 +0000)]
Merge "Revert "Increase timeout for the 570-checker-osr test from 20s to 60s.""

8 years agoRevert "Increase timeout for the 570-checker-osr test from 20s to 60s."
Vladimir Marko [Wed, 20 Apr 2016 09:06:08 +0000 (09:06 +0000)]
Revert "Increase timeout for the 570-checker-osr test from 20s to 60s."

The timeout was an actual test failure, fixed by
    https://android-review.googlesource.com/217041

Bug: 28210356

This reverts commit d676227d8fcef3c3d34f1a7a44141b4f5f2e8519.

Change-Id: If69e09f3650f87cd4e6e22bb28a7b807be3094e1

8 years agoMerge "Revert "Revert "Use dex cache from compilation unit in RTP."""
Vladimir Marko [Wed, 20 Apr 2016 09:00:49 +0000 (09:00 +0000)]
Merge "Revert "Revert "Use dex cache from compilation unit in RTP."""

8 years agoMerge "ART: Remove Security initialization cutout"
Andreas Gampe [Wed, 20 Apr 2016 04:39:14 +0000 (04:39 +0000)]
Merge "ART: Remove Security initialization cutout"

8 years agoAssembly RegionTLAB allocation fast path for x86_64
Sang, Chunlei [Wed, 20 Apr 2016 02:08:25 +0000 (10:08 +0800)]
Assembly RegionTLAB allocation fast path for x86_64

Change-Id: If8ad7f8ac79cbc143939b96271ab9b7c2eddee75

8 years agoAssembly TLAB and RegionTLAB allocation fast path for x86
Sang, Chunlei [Wed, 20 Apr 2016 00:40:18 +0000 (08:40 +0800)]
Assembly TLAB and RegionTLAB allocation fast path for x86

Change-Id: I63471cb1d7be5e5bb42faf782a0ebae46a9094ec

8 years agoART: Remove Security initialization cutout
Andreas Gampe [Sat, 16 Apr 2016 04:21:38 +0000 (21:21 -0700)]
ART: Remove Security initialization cutout

Change c94eeebc7cf3e577eed3ea380401007aea642bf3 introduced general
support for getResourceAsStream. Remove the specialized cutout.

Bug: 27265238

(cherry picked from commit 0f9b07f9781a064cbd59afbce3a03e8ae07a3117)

Change-Id: I3aad0053199809e11de4eed8ee6aac53346d3d22

8 years agoMerge "Do not use EXPECT_DEATH in unit test, fails on device."
Aart Bik [Tue, 19 Apr 2016 23:12:46 +0000 (23:12 +0000)]
Merge "Do not use EXPECT_DEATH in unit test, fails on device."

8 years agoDo not use EXPECT_DEATH in unit test, fails on device.
Aart Bik [Tue, 19 Apr 2016 22:07:23 +0000 (15:07 -0700)]
Do not use EXPECT_DEATH in unit test, fails on device.

Change-Id: I77ff843edb416fae72e7bbf66a6151405dab81b0

8 years agoReuse HUseListNode<>s when replacing instruction or input.
Vladimir Marko [Tue, 19 Apr 2016 13:36:35 +0000 (14:36 +0100)]
Reuse HUseListNode<>s when replacing instruction or input.

Compiling the Nexus 5 boot image with the 64-bit dex2oat
on host this CL reduces the memory used for compiling the
most hungry method, BatteryStats.dumpLocked(), by ~5.6MiB:

Before:
  MEM: used: 44393040, allocated: 45361248, lost: 968208
  Number of arenas allocated: 319,
  Number of allocations: 815492, avg size: 54
  ...
  UseListNode    10308480
  ...
After:
  MEM: used: 38554536, allocated: 39463008, lost: 908472
  Number of arenas allocated: 274,
  Number of allocations: 572221, avg size: 67
  ...
  UseListNode     4469976
  ...

With 32-bit dex2oat, the UseListNode would be 2/3 of the
values for 64-bit dex2oat (both before and after).

Bug: 28173563
Change-Id: Ia4fabe03568f0e0dbf2cdf2b031863602aea3530

8 years agoMerge "Use iterators "before" the use node in HUserRecord<>."
Vladimir Marko [Tue, 19 Apr 2016 18:26:22 +0000 (18:26 +0000)]
Merge "Use iterators "before" the use node in HUserRecord<>."

8 years agoRevert "Revert "Use dex cache from compilation unit in RTP.""
Vladimir Marko [Tue, 19 Apr 2016 14:12:13 +0000 (14:12 +0000)]
Revert "Revert "Use dex cache from compilation unit in RTP.""

The exposed issue has been fixed by
    https://android-review.googlesource.com/215877

Bug:28210356

This reverts commit 34d9b04d8d0006967486c0ad1b221e7b632652af.

Change-Id: I5288c923e45d9ef3190dabb89738350a1212a60d

8 years agoRevert "Disable JDWP tests with read barriers."
Hiroshi Yamauchi [Tue, 19 Apr 2016 18:23:15 +0000 (11:23 -0700)]
Revert "Disable JDWP tests with read barriers."

This reverts commit f2a5c9c5669664ad008ed48f511e8f101d4bc299.

Bug: 25800335

8 years agoFix a deadlock between debugger and GC.
Hiroshi Yamauchi [Tue, 19 Apr 2016 18:14:06 +0000 (11:14 -0700)]
Fix a deadlock between debugger and GC.

Avoid a deadlock between GC and debugger's SuspendAllForDebugger where
GC gets suspended during GC.

Fix the jdwp tests with the CC collector, but the deadlock is NOT
specific to the CC collector.

Bug: 25800335
Bug: 12687968
Change-Id: I8f2869872bce4692d943020072e35ebf5a4e68a5

8 years agoMerge "Fix a DCHECK failure in Arm64RelativePatcher with read barrier."
Hiroshi Yamauchi [Tue, 19 Apr 2016 17:44:07 +0000 (17:44 +0000)]
Merge "Fix a DCHECK failure in Arm64RelativePatcher with read barrier."

8 years agoMerge "Fix 570-checker-osr test for non-debuggable mode."
Vladimir Marko [Tue, 19 Apr 2016 17:35:18 +0000 (17:35 +0000)]
Merge "Fix 570-checker-osr test for non-debuggable mode."

8 years agoUse iterators "before" the use node in HUserRecord<>.
Vladimir Marko [Tue, 29 Mar 2016 11:21:58 +0000 (12:21 +0100)]
Use iterators "before" the use node in HUserRecord<>.

Create a new template class IntrusiveForwardList<> that
mimicks std::forward_list<> except that all allocations
are handled externally. This is essentially the same as
boost::intrusive::slist<> but since we're not using Boost
we have to reinvent the wheel.

Use the new container to replace the HUseList and use the
iterators to "before" use nodes in HUserRecord<> to avoid
the extra pointer to the previous node which was used
exclusively for removing nodes from the list. This reduces
the size of the HUseListNode by 25%, 32B to 24B in 64-bit
compiler, 16B to 12B in 32-bit compiler. This translates
directly to overall memory savings for the 64-bit compiler
but due to rounding up of the arena allocations to 8B, we
do not get any improvement in the 32-bit compiler.

Compiling the Nexus 5 boot image with the 64-bit dex2oat
on host this CL reduces the memory used for compiling the
most hungry method, BatteryStats.dumpLocked(), by ~3.3MiB:

Before:
  MEM: used: 47829200, allocated: 48769120, lost: 939920
  Number of arenas allocated: 345,
  Number of allocations: 815492, avg size: 58
  ...
  UseListNode    13744640
  ...
After:
  MEM: used: 44393040, allocated: 45361248, lost: 968208
  Number of arenas allocated: 319,
  Number of allocations: 815492, avg size: 54
  ...
  UseListNode    10308480
  ...

Note that while we do not ship the 64-bit dex2oat to the
device, the JIT compilation for 64-bit processes is using
the 64-bit libart-compiler.

Bug: 28173563
Change-Id: I985eabd4816f845372d8aaa825a1489cf9569208

8 years agoFix 570-checker-osr test for non-debuggable mode.
Vladimir Marko [Tue, 19 Apr 2016 16:26:54 +0000 (17:26 +0100)]
Fix 570-checker-osr test for non-debuggable mode.

For non-debuggable mode, we need to create profiling info.

Bug: 28210356
Change-Id: I3c2e1f7a7b447d44ca12382fe5f5a93e3dc83cab

8 years agoUpdate to perflib-25.0.0 to improve processing performance.
Richard Uhler [Tue, 15 Dec 2015 17:15:00 +0000 (09:15 -0800)]
Update to perflib-25.0.0 to improve processing performance.

Bug: 24542836
Change-Id: I800dedd50c535df99a5cc38cd9da32fc33a35997

8 years agoMerge "Avoid constructing types with errors."
Aart Bik [Tue, 19 Apr 2016 16:21:46 +0000 (16:21 +0000)]
Merge "Avoid constructing types with errors."