OSDN Git Service

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

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

Bug: 28333278

Change-Id: I37d9740ca912daf37cdf9ff82697bbc5db46177a

8 years agoMerge changes from topic 'reset-native-loader'
Dimitry Ivanov [Mon, 2 May 2016 21:31:49 +0000 (21:31 +0000)]
Merge changes from topic 'reset-native-loader'

* changes:
  Fix check_jni_compiler tests
  Revert "Disable tests after latest nativeloader changes."
  Reset NativeLoader on DestroyJavaVM

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

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

Bug: http://b/28449304
Change-Id: I0ba946fe5fc2817dff73154e3191444106dfcb08

8 years agoRevert "Disable tests after latest nativeloader changes."
Dimitry Ivanov [Mon, 2 May 2016 20:39:39 +0000 (13:39 -0700)]
Revert "Disable tests after latest nativeloader changes."

This reverts commit 7032e780836a464faf5901d9d8d7fedb97f3a739.

Bug: http://b/28449304

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

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

Bug: http://b/28453840
Change-Id: I45e38c45268a741d86ec686266b13fde7d5fb9a2
(cherry picked from commit 9e83422b27faa3f249ec32ad2cbaa34530bd3df1)

8 years agoMerge "Fix profile saver to use base dex location"
Mathieu Chartier [Mon, 2 May 2016 16:30:19 +0000 (16:30 +0000)]
Merge "Fix profile saver to use base dex location"

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

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

Bug: 28463739

(cherry picked from commit 9275af6ec0d71d1a13a97a1d292806b73f755717)

Change-Id: Ie822c2a38fd1316c3ba604b8625c48388f6a8c07

8 years agoMerge "ART: Disambiguate access-checks mode from lock-counting"
Andreas Gampe [Sat, 30 Apr 2016 01:34:33 +0000 (01:34 +0000)]
Merge "ART: Disambiguate access-checks mode from lock-counting"

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

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

Bug: 28351535

(cherry picked from commit f517e283d477dd2ae229ee3f054120c6953895db)

Change-Id: I083032f064d88df8f8f0611ad8b57d1b39cd09fb

8 years agoMerge changes I6942bc86,Ie67e4aa9
Treehugger Robot [Sat, 30 Apr 2016 00:08:08 +0000 (00:08 +0000)]
Merge changes I6942bc86,Ie67e4aa9

* changes:
  ART: Fix Mac build
  ART: Log all monitor operations to systrace

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

Fix Mac build after fc6898769ae1ef91ec3e41c0a273401213cb82cd.

Bug: 28423466

(cherry picked from commit 4cf9adc1ed1bcbfe45c9caf944130aae7e39a4cd)

Change-Id: I6942bc86f1b0819d84bced5499afb0a4d235a39e

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

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

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

Bug: 28423466

(cherry picked from commit fc6898769ae1ef91ec3e41c0a273401213cb82cd)

Change-Id: Ie67e4aa946ec15f8fcf8cb7134c5d3cff0119ab3

8 years agoMerge "Fix google-explicit-constructor warnings."
Chih-hung Hsieh [Fri, 29 Apr 2016 22:57:26 +0000 (22:57 +0000)]
Merge "Fix google-explicit-constructor warnings."

8 years agoMerge "Deduplicate simple roots in hprof."
Treehugger Robot [Fri, 29 Apr 2016 22:50:45 +0000 (22:50 +0000)]
Merge "Deduplicate simple roots in hprof."

8 years agoFix google-explicit-constructor warnings.
Chih-Hung Hsieh [Fri, 29 Apr 2016 21:27:41 +0000 (14:27 -0700)]
Fix google-explicit-constructor warnings.

Bug: 28341362
Change-Id: Ic7e236a7f58c4021a3f8fb4536a6457d262fe62e

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

Bug: 28311991

(cherry picked from commit e792305f5238df71a1928faf142cd35713aa3e47)

Change-Id: Icfb646ff62965daee51f65f46f4911cf0751bf8d

8 years agoMerge "Add contender method for lock contention"
Mathieu Chartier [Fri, 29 Apr 2016 18:24:15 +0000 (18:24 +0000)]
Merge "Add contender method for lock contention"

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

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

Bug: 28223501

(cherry picked from commit 8f26411287cddd983df6f1d00dbc3841767c123d)

Change-Id: Ia130a525c8415defec36b2e23f358d18aac079ad

8 years agoMerge "Correct monitor pool synchronization"
Hans Boehm [Fri, 29 Apr 2016 17:50:25 +0000 (17:50 +0000)]
Merge "Correct monitor pool synchronization"

8 years agoMerge "Remove invoke after inlining."
Treehugger Robot [Fri, 29 Apr 2016 13:57:19 +0000 (13:57 +0000)]
Merge "Remove invoke after inlining."

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

bug:28460178
Change-Id: I0ce00667aab1e02bab9e04a4cea7ee5d278f6a71

8 years agoMerge "Decrease transition weight."
Calin Juravle [Fri, 29 Apr 2016 12:52:59 +0000 (12:52 +0000)]
Merge "Decrease transition weight."

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

bug:27865109

(cherry picked from commit 5a62dd962c831a73c75c0ad5bf1184129eaa942c)

Change-Id: I667e514b76510107f6affd9963e4ec83ee629866

8 years agoMerge changes I96464d76,Id5e77316,Icb42a081,I68afc181,I82094e46
Calin Juravle [Fri, 29 Apr 2016 11:47:50 +0000 (11:47 +0000)]
Merge changes I96464d76,Id5e77316,Icb42a081,I68afc181,I82094e46

* changes:
  Fix how the ProfileSaver thread attaches to the runtime.
  Fix -Xint and -Xusejit interaction
  Add command line option for jit invoke transition weight
  Split profile recording from jit compilation
  Allow the framework to register sensistive threads to the runtime

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

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

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

Bug: 28435649

(cherry picked from commit e55fda1373abad5ace4409453c51aeb0daaf99ef)

Change-Id: I96464d76a275d155a90a1bc3bb99fbb9d914cf20

8 years agoMerge "Re-enable tests disabled because of libnativehelper_compat_libc++."
Roland Levillain [Fri, 29 Apr 2016 10:24:16 +0000 (10:24 +0000)]
Merge "Re-enable tests disabled because of libnativehelper_compat_libc++."

8 years agoMerge "Disable tests after latest nativeloader changes."
Nicolas Geoffray [Fri, 29 Apr 2016 09:48:06 +0000 (09:48 +0000)]
Merge "Disable tests after latest nativeloader changes."

8 years agoDisable tests after latest nativeloader changes.
Nicolas Geoffray [Fri, 29 Apr 2016 09:44:21 +0000 (10:44 +0100)]
Disable tests after latest nativeloader changes.

bug:28449304
Change-Id: I27649e0545898012c1e826a4648210d61fbb4a0d

8 years agoMerge "ART: Add missing EXPORT_PCs to x86/_64 mterp"
Bill Buzbee [Fri, 29 Apr 2016 04:03:49 +0000 (04:03 +0000)]
Merge "ART: Add missing EXPORT_PCs to x86/_64 mterp"

8 years agoMerge "Supply librarySearchPath to PathClassLoader"
Dimitry Ivanov [Fri, 29 Apr 2016 00:44:08 +0000 (00:44 +0000)]
Merge "Supply librarySearchPath to PathClassLoader"

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

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

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

Bug: http://b/28449304
Change-Id: Id5b4273553d783c0f7a964f72ecb2c99f3aeaf6f

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

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

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

Bug: 28249238
Change-Id: I3936509665636c0b77580dda12520a82ee814fa5

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

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

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

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

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

Bug: 28385279
Change-Id: I433155d91702878f6b114480eda1fbf09706f623

8 years agoMerge changes Ia94fc7ac,Iffd25c5f
Mathieu Chartier [Thu, 28 Apr 2016 23:03:05 +0000 (23:03 +0000)]
Merge changes Ia94fc7ac,Iffd25c5f

* changes:
  Revert "Revert "Write conflict tables in image""
  Revert "Write conflict tables in image"

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

Added test.

Bug: 27906566

This reverts commit 8e2478d23e89a7022c93ddc608dcbba7b29b91e6.

(cherry picked from commit cdca476bf3394ce9d97a369e84e701b427009318)

Change-Id: Ia94fc7acc7ae3879921c4e8d0a02b156037ac286

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

Some strange issues on angler.

This reverts commit cda9386add68d94697449c6cb08b356747e55c21.

(cherry picked from commit 8e2478d23e89a7022c93ddc608dcbba7b29b91e6)

Change-Id: Iffd25c5fb732ff72b58c787c107dc33c56f8c8d4

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

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

Bug: 27916886

(cherry picked from commit 6caaa84947d5d207cde511978db327d95226e3ce)

Change-Id: Id5e7731653b322c25329b031561cfe150eb66522

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

Bug: 27865109

(cherry picked from commit 2a894f433d126d6e8694c6235e29e66ef45a31d9)

Change-Id: Icb42a08120aa80b787efe207aa51fd08305cec08

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

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

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

Bug: 27916886

(cherry picked from commit e5de54cfab5f14ba0b8ff25d8d60901c7021943f)

Change-Id: I68afc181d71447895fb12346c1806e99bcab1de2

8 years agoAllow the framework to register sensistive threads to the runtime
Calin Juravle [Fri, 15 Apr 2016 15:16:35 +0000 (16:16 +0100)]
Allow the framework to register sensistive threads to the runtime

Bug: 27865109
Bug: 28065407

(cherry picked from commit 8fff24953c78bd58f3a42ac83b340b90e7e7228a)

Change-Id: I82094e46a2fd12617e091d98831193f9ff56d26b

8 years agoMerge "Update list of libraries needed for ART run-test."
Nicolas Geoffray [Thu, 28 Apr 2016 14:46:52 +0000 (14:46 +0000)]
Merge "Update list of libraries needed for ART run-test."

8 years agoUpdate list of libraries needed for ART run-test.
Nicolas Geoffray [Thu, 28 Apr 2016 14:45:58 +0000 (15:45 +0100)]
Update list of libraries needed for ART run-test.

Change-Id: Icfaabac9db6ea630ef45f483bfb033ba14cb85b6

8 years agoRe-enable tests disabled because of libnativehelper_compat_libc++.
Roland Levillain [Thu, 28 Apr 2016 14:24:31 +0000 (15:24 +0100)]
Re-enable tests disabled because of libnativehelper_compat_libc++.

The loading failure ("dlopen failed: library
"libnativehelper_compat_libc++.so" not found") should have been
fixed; stop ignoring these failures.

Bug: 28082914
Change-Id: I59283b58790142c17f2849898dd4229c54222af4

8 years agoMerge "Add and use public.libraries.buildbot.txt file."
Nicolas Geoffray [Thu, 28 Apr 2016 11:01:28 +0000 (11:01 +0000)]
Merge "Add and use public.libraries.buildbot.txt file."

8 years agoAdd and use public.libraries.buildbot.txt file.
Nicolas Geoffray [Thu, 28 Apr 2016 10:58:03 +0000 (11:58 +0100)]
Add and use public.libraries.buildbot.txt file.

Needed after the latest NativeLoader changes.

Change-Id: Ia80ebe85ccfc702470eebe6daa9d675abcf8014d

8 years agoMerge changes I38cbe315,Ia05cb31f
Mathieu Chartier [Wed, 27 Apr 2016 20:51:10 +0000 (20:51 +0000)]
Merge changes I38cbe315,Ia05cb31f

* changes:
  Write conflict tables in image
  Add support for eagerly calculating conflict tables

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

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

Reduces .art private dirty and PSS.

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

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

Increases image size by ~100K.

Bug: 27906566

(cherry picked from commit cda9386add68d94697449c6cb08b356747e55c21)

Change-Id: I38cbe3150c3eeb385b8cad7cf93614e3980f4162

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

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

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

Bug: 27906566

(cherry picked from commit 49b5cede15d69930a8c156a3aea240164ca7af80)

Change-Id: Ia05cb31f85eacfeabe64a8caf9a0b3029114a749

8 years agoMerge "Initialize native loader on JNI_CreateJavaVM"
Dimitry Ivanov [Wed, 27 Apr 2016 18:24:33 +0000 (18:24 +0000)]
Merge "Initialize native loader on JNI_CreateJavaVM"

8 years agoMerge "Fix string patch target retrieval in OatWriter."
Treehugger Robot [Wed, 27 Apr 2016 16:46:35 +0000 (16:46 +0000)]
Merge "Fix string patch target retrieval in OatWriter."

8 years agoMerge "ART: Disable back edge uses for irreducible loops"
Treehugger Robot [Wed, 27 Apr 2016 15:41:58 +0000 (15:41 +0000)]
Merge "ART: Disable back edge uses for irreducible loops"

8 years agoFix string patch target retrieval in OatWriter.
Vladimir Marko [Wed, 27 Apr 2016 12:54:18 +0000 (13:54 +0100)]
Fix string patch target retrieval in OatWriter.

Use the correct dex cache for retrieving the target string
for const-string inlined across dex files.

This affects only the boot image built in non-debuggable
mode because we do not inline at all in debuggable mode.
No regression test is provided because we do not have the
infrastructure to compile test code into the boot image.

Change-Id: I203419570a22ad78f30a385628ac6b57aea5bec1

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

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

This partially reverts CL I63632e8819ea3644d5c6fdfea00b66128bf22c24.

Bug: 28252747
Bug: 27615840
Bug: 27624868
Change-Id: I7ecdde0ed8a8831f7513b8e43cf7d84599b830a7

8 years agoMerge "ART: add exynos-m1 to a53 #835769 & #843419 erratum exception list"
Vladimir Marko [Wed, 27 Apr 2016 12:49:23 +0000 (12:49 +0000)]
Merge "ART: add exynos-m1 to a53 #835769 & #843419 erratum exception list"

8 years agoMerge "ART: Eliminate unlikely code from hot path in x86 div/rem"
Roland Levillain [Wed, 27 Apr 2016 12:47:45 +0000 (12:47 +0000)]
Merge "ART: Eliminate unlikely code from hot path in x86 div/rem"

8 years agoMerge "Fix test to return expected value."
Nicolas Geoffray [Wed, 27 Apr 2016 12:44:42 +0000 (12:44 +0000)]
Merge "Fix test to return expected value."

8 years agoFix test to return expected value.
Nicolas Geoffray [Wed, 27 Apr 2016 12:43:48 +0000 (13:43 +0100)]
Fix test to return expected value.

bug:28335959
Change-Id: Id4b3fc7b3ea5705530283daffedef17ab0699ae9

8 years agoMerge "Forbid HDeoptimize instructions in OSR methods."
Nicolas Geoffray [Wed, 27 Apr 2016 11:31:23 +0000 (11:31 +0000)]
Merge "Forbid HDeoptimize instructions in OSR methods."

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

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

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

Change-Id: I842bd1c6a919aff48cf6048d2ea51cf2d40f3c1d

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

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

Change-Id: I15087b05769eb8d4f80219064549b0b45884bf7c
Signed-off-by: Junmo Park <junmoz.park@samsung.com>
8 years agoMerge "Work around Jack optimizations in arm64 shifter operand test."
Treehugger Robot [Tue, 26 Apr 2016 17:52:48 +0000 (17:52 +0000)]
Merge "Work around Jack optimizations in arm64 shifter operand test."

8 years agoMerge "Test component type for errors too. With regression test."
Aart Bik [Tue, 26 Apr 2016 17:04:52 +0000 (17:04 +0000)]
Merge "Test component type for errors too. With regression test."

8 years agoWork around Jack optimizations in arm64 shifter operand test.
Vladimir Marko [Tue, 26 Apr 2016 16:55:55 +0000 (17:55 +0100)]
Work around Jack optimizations in arm64 shifter operand test.

And also in the ror test.

Bug: 28392114
Change-Id: I66afb371de57d7742385d5e02daa2797cb8d1b22

8 years agoART: Eliminate unlikely code from hot path in x86 div/rem
Serguei Katkov [Fri, 15 Apr 2016 10:50:25 +0000 (16:50 +0600)]
ART: Eliminate unlikely code from hot path in x86 div/rem

Division and Remainder when numerator is zero is not
usual case so remove the check for this case from hot path.

Change-Id: Ie575af0fedb5045d4ed74292a61a8378f82d39ae
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
8 years agoMerge "Use explicit cast to avoid compilers error"
Roland Levillain [Tue, 26 Apr 2016 10:42:28 +0000 (10:42 +0000)]
Merge "Use explicit cast to avoid compilers error"

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

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

BUG=28358598

Change-Id: I11339a976dc83e0493a99e6bb97f3a058ca3f796

8 years agoMerge "Fix valgrind tests: mark allocated space as defined."
Vladimir Marko [Mon, 25 Apr 2016 20:23:23 +0000 (20:23 +0000)]
Merge "Fix valgrind tests: mark allocated space as defined."

8 years agoFix valgrind tests: mark allocated space as defined.
Vladimir Marko [Mon, 25 Apr 2016 18:40:34 +0000 (19:40 +0100)]
Fix valgrind tests: mark allocated space as defined.

Follow-up to
    https://android-review.googlesource.com/219700

Bug: 28173563
Bug: 28256882
Change-Id: I4e8e8d3202fd01ab48d86b3a6b92302524df66bb

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 agoUse explicit cast to avoid compilers error
Goran Jakovljevic [Mon, 25 Apr 2016 17:14:17 +0000 (19:14 +0200)]
Use explicit cast to avoid compilers error

GCC (mips32 Buildbot) is complaining when passing 'uint16_t'
to std::to_string.

Change-Id: I0df72204947b7a4d445594851f043ec69196dbb7

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