OSDN Git Service

android-x86/art.git
7 years agoMerge "Store java_lang_Object_ in the flip callback"
Mathieu Chartier [Fri, 21 Apr 2017 16:34:44 +0000 (16:34 +0000)]
Merge "Store java_lang_Object_ in the flip callback"

7 years agoStore java_lang_Object_ in the flip callback
Mathieu Chartier [Fri, 21 Apr 2017 02:28:54 +0000 (19:28 -0700)]
Store java_lang_Object_ in the flip callback

There was a race where the GC thread would not have is_marking =
true, and call
WellKnownClasses::ToClass(WellKnownClasses::java_lang_Object). This
meant that the returned class was maybe in the from-space for the
no image case. The fix was to move this decoding into the flip
callback since this callback is called before flipping any thread
roots.

Bug: 37531237
Bug: 12687968
Test: test-art-host

Change-Id: I9a09249e9c6ea2b3b124e957a9e4b61017869306

7 years agoMerge "Fix verifier crash on abstract final class."
Treehugger Robot [Fri, 21 Apr 2017 14:24:57 +0000 (14:24 +0000)]
Merge "Fix verifier crash on abstract final class."

7 years agoFix verifier crash on abstract final class.
Vladimir Marko [Fri, 21 Apr 2017 12:31:41 +0000 (13:31 +0100)]
Fix verifier crash on abstract final class.

Remove a check for erroneous class. It should not matter to
the verifier whether the class is just resolved, initialized
or resolved erroneous. The check was also inherently racy
and could yield different behavior based on the timing of
the verification.

Test: 161-final-abstract-class
Test: testrunner.py --host
Bug: 37248840
Change-Id: Ic4d964050bbe52e3de4438ada9e75676956cb6b4

7 years agoMerge "Reuse DexCache and ClassLoader handles in inliner."
Treehugger Robot [Fri, 21 Apr 2017 11:17:46 +0000 (11:17 +0000)]
Merge "Reuse DexCache and ClassLoader handles in inliner."

7 years agoReuse DexCache and ClassLoader handles in inliner.
Vladimir Marko [Thu, 20 Apr 2017 18:50:32 +0000 (19:50 +0100)]
Reuse DexCache and ClassLoader handles in inliner.

Measured memory usage with heaptrack for a large app:
  Before:
    bytes allocated in total (ignoring deallocations): 3.14GB
    calls to allocation functions: 8130596
  After:
    bytes allocated in total (ignoring deallocations): 3.12GB
    calls to allocation functions: 7750377

Test: testrunner.py --host
Bug: 34053922
Change-Id: I1ad7aaffccc6527cd4f409ca8fca75bab8d7439a

7 years agoMerge "Handle catch phis in code sinking."
Nicolas Geoffray [Fri, 21 Apr 2017 07:59:53 +0000 (07:59 +0000)]
Merge "Handle catch phis in code sinking."

7 years agoMerge changes If234ff55,I2d83fc46,I5ad78a15
Treehugger Robot [Fri, 21 Apr 2017 00:49:23 +0000 (00:49 +0000)]
Merge changes If234ff55,I2d83fc46,I5ad78a15

* changes:
  Be able to run jvmti-stress on RI
  Do native method bind in jvmti-stress
  Agent libraries need to be searched for JNI functions

7 years agoBe able to run jvmti-stress on RI
Alex Light [Thu, 20 Apr 2017 22:54:25 +0000 (15:54 -0700)]
Be able to run jvmti-stress on RI

This is useful for testing.

When running on RI no class redefinition is performed.

Test: ./test/run-test --dev --jvm --jvmti-stress 001-HelloWorld
Test: ./test/run-test --dev --jvm --jvmti-stress 902
Test: ./test/run-test --dev --jvm --jvmti-stress 986

Change-Id: If234ff553bf136312c5128d03b02b28f4ff94e3d

7 years agoDo native method bind in jvmti-stress
Alex Light [Thu, 20 Apr 2017 20:35:05 +0000 (13:35 -0700)]
Do native method bind in jvmti-stress

Extend the jvmti-stress test suite to intercept the NativeMethodBind
event for every method.

Also fix small issue where we tried to add a local reference to a null
thread in ti_method.cc if we had an event trigger before VMInit.

Test: ./test/testrunner/testrunner.py --host --jvmti-stress -j40
Bug: 37432636

Change-Id: I2d83fc460b18edf035ed7296b8e2b06cff3671e5

7 years agoAgent libraries need to be searched for JNI functions
Alex Light [Thu, 20 Apr 2017 16:15:08 +0000 (09:15 -0700)]
Agent libraries need to be searched for JNI functions

This makes agent libraries the option of last resort for native
method implementations. This will allow one to not need to manually
link all native methods in an agent library.

Bug: 37522517
Bug: 37432636
Test: ./test.py --host -j40
Change-Id: I5ad78a15e7e2799d2a877c5d603342899e2a1bd1

7 years agoMerge "Improve VerifyNoFromSpaceRefsObjectVisitor logging"
Treehugger Robot [Thu, 20 Apr 2017 22:43:05 +0000 (22:43 +0000)]
Merge "Improve VerifyNoFromSpaceRefsObjectVisitor logging"

7 years agoImprove VerifyNoFromSpaceRefsObjectVisitor logging
Mathieu Chartier [Thu, 20 Apr 2017 20:31:39 +0000 (13:31 -0700)]
Improve VerifyNoFromSpaceRefsObjectVisitor logging

Remove read barriers in PrettyTypeOf to prevent recursive failures.

Pass down holder and offset information to
VerifyNoFromSpaceRefsFieldVisitor.

Test: test-art-host
Bug: 37531237
Change-Id: I704ec18ebecfc1ca2982b38f67a2f0788e59dfe9

7 years agoMerge "ARM64: Support MultiplyAccumulate for SIMD."
Aart Bik [Thu, 20 Apr 2017 17:28:00 +0000 (17:28 +0000)]
Merge "ARM64: Support MultiplyAccumulate for SIMD."

7 years agoMerge changes from topic 'partial_tlab'
Mathieu Chartier [Thu, 20 Apr 2017 16:47:51 +0000 (16:47 +0000)]
Merge changes from topic 'partial_tlab'

* changes:
  Fix some gtests
  Use partial TLAB regions

7 years agoHandle catch phis in code sinking.
Nicolas Geoffray [Thu, 20 Apr 2017 14:19:46 +0000 (15:19 +0100)]
Handle catch phis in code sinking.

When the user of an instruction we want to sink is a catch
phi, we should not look at predecessors (which don't map 1-1
for catch phis), but can only look at its dominator.

bug:37247890
Test: 647-sinking-catch
Change-Id: Ib64bd6f95d3ef45c394137e76819fa8d7d3d960a

7 years agoMerge "Add descriptor validation to ClassLinker::FindClass()."
Treehugger Robot [Thu, 20 Apr 2017 15:16:44 +0000 (15:16 +0000)]
Merge "Add descriptor validation to ClassLinker::FindClass()."

7 years agoAdd descriptor validation to ClassLinker::FindClass().
Vladimir Marko [Thu, 20 Apr 2017 10:26:03 +0000 (11:26 +0100)]
Add descriptor validation to ClassLinker::FindClass().

And add tests for odd signatures passed to JNI GetFieldID().
Previously, passing the signature "java/lang/String" instead
of "Ljava/lang/String;" would call the class loader with the
dot name java.lang.String and the class loader would find
that class only to fail the DescriptorEquals() check back
in ClassLinker::FindClass().

Test: 647-jni-get-field-id
Bug: 33577836
Bug: 37156832
Change-Id: I6612a272ec24b0d54b728fd35003e9c24a7e2e95

7 years agoMerge "Fix fault_handler with heap poisoning."
Nicolas Geoffray [Thu, 20 Apr 2017 12:32:48 +0000 (12:32 +0000)]
Merge "Fix fault_handler with heap poisoning."

7 years agoFix fault_handler with heap poisoning.
Nicolas Geoffray [Thu, 20 Apr 2017 11:50:13 +0000 (12:50 +0100)]
Fix fault_handler with heap poisoning.

test: test-art-host
Change-Id: Ifeb3d5ff4cfdcb703d5874bca90c9c1438d86f08

7 years agoMerge "Vdex: Workaround arrays with erroneous component type."
Treehugger Robot [Thu, 20 Apr 2017 11:01:32 +0000 (11:01 +0000)]
Merge "Vdex: Workaround arrays with erroneous component type."

7 years agoVdex: Workaround arrays with erroneous component type.
Nicolas Geoffray [Wed, 19 Apr 2017 12:50:34 +0000 (13:50 +0100)]
Vdex: Workaround arrays with erroneous component type.

The assignability DCHECK is only reliable when classes are not
erroneous. For arrays whose component type could be erroneous,
the verifier can join types even if they're not assignable.

bug:33770646
Test: verifier_deps_test
Change-Id: I4ec1b12b2e2c7d5b57b51a64aea381f951a38dcd

7 years agoFix some gtests
Mathieu Chartier [Thu, 20 Apr 2017 06:54:33 +0000 (23:54 -0700)]
Fix some gtests

Forgot to retest.

Test: test-art-host-gtest

Change-Id: I72b07c3872079452a3a01db4fbd2c4ee0060f294

7 years agoUse partial TLAB regions
Mathieu Chartier [Wed, 19 Apr 2017 00:46:23 +0000 (17:46 -0700)]
Use partial TLAB regions

Instead of having 256K TLAB regions, have 256K TLABs split into
16K regions. This fixes pathological cases with multithreaded
allocation that caused many GCs since each thread reserving
256K would often bump the counter past the GC start threshold. Now
threads only bump the counter every 16K.

System wide results (average of 5 samples on N6P):
Total GC time 60s after starting shell: 45s -> 24s
Average .Heap PSS 60s after starting shell: 57900k -> 58682k

BinaryTrees gets around 5% slower, numbers are noisy.

Boot time: 13.302 -> 12.899 (average of 100 runs)

Bug: 35872915
Bug: 36216292

Test: test-art-host

(cherry picked from commit bf48003fa32d2845f2213c0ba31af6677715662d)

Change-Id: I5ab22420124eeadc0a53519c70112274101dfb39

7 years agoMerge "base: make SafeCopy work on older Linux kernels."
Treehugger Robot [Thu, 20 Apr 2017 03:04:32 +0000 (03:04 +0000)]
Merge "base: make SafeCopy work on older Linux kernels."

7 years agobase: make SafeCopy work on older Linux kernels.
Josh Gao [Wed, 19 Apr 2017 22:44:20 +0000 (15:44 -0700)]
base: make SafeCopy work on older Linux kernels.

process_vm_readv is documented to not split transfer across a single
iovec element, but this appears to not be the case for the newer
kernels we have on our workstations.

Split up transfers across page boundaries, to avoid this. This has the
side effect of limiting the maximum size of a transfer, but 64 pages
ought to be enough for anybody.

Test: safe_copy_test on 3.13.0-101-generic (failing before)
Test: safe_copy_test on 4.4.0-66-generic (still passing)
Change-Id: I6a6dbf0cd2aeaa7eab39f6d41285d46ebd760e30

7 years agoARM64: Support MultiplyAccumulate for SIMD.
Artem Serov [Mon, 10 Apr 2017 16:41:46 +0000 (17:41 +0100)]
ARM64: Support MultiplyAccumulate for SIMD.

Test: test-art-host, test-art-target.

Change-Id: I06af8415e15352d09d176cae828163cbe99ae7a7

7 years agoMerge "Remove obsolete rules to build runtests"
Colin Cross [Wed, 19 Apr 2017 22:54:19 +0000 (22:54 +0000)]
Merge "Remove obsolete rules to build runtests"

7 years agoMerge changes from topic 'art_run_test_912_cts_refactor'
Treehugger Robot [Wed, 19 Apr 2017 22:52:57 +0000 (22:52 +0000)]
Merge changes from topic 'art_run_test_912_cts_refactor'

* changes:
  ART: Refactor run-test 912 (3/3)
  ART: Refactor run-test 912 (2/3)
  ART: Refactor run-test 912 (1/3)

7 years agoART: Refactor run-test 912 (3/3)
Andreas Gampe [Wed, 19 Apr 2017 20:45:25 +0000 (13:45 -0700)]
ART: Refactor run-test 912 (3/3)

Add run-test Main.

Bug: 32072923
Test: m
Test: art/test/testrunner/testrunner.py -b --host -t 912
Change-Id: I4a4bbe587937d9b87eab77af1a5f05fd4df7f0d4

7 years agoART: Refactor run-test 912 (2/3)
Andreas Gampe [Wed, 19 Apr 2017 20:43:43 +0000 (13:43 -0700)]
ART: Refactor run-test 912 (2/3)

Move the refactored run-test into place.

Bug: 32072923
Test: m
Change-Id: I170cd1465a3afce3f48a9cbad864eaa5d9fdaacc

7 years agoART: Refactor run-test 912 (1/3)
Andreas Gampe [Wed, 19 Apr 2017 20:37:48 +0000 (13:37 -0700)]
ART: Refactor run-test 912 (1/3)

Refactor the test for CTS. Break out the ART-specific part. Move
the rest into the regular layout. Move class events to their own
thread, and report them on the Java side. Use InMemoryDexClassLoader
for classloaders to avoid explicit files.

Bug: 32072923
Test: none
Change-Id: I80e27cc9c21646bbecd1de1a246f583a0d388e05

7 years agoMerge "fault_handler: hopefully fix darwin build."
Josh Gao [Wed, 19 Apr 2017 20:22:45 +0000 (20:22 +0000)]
Merge "fault_handler: hopefully fix darwin build."

7 years agofault_handler: hopefully fix darwin build.
Josh Gao [Wed, 19 Apr 2017 20:20:19 +0000 (13:20 -0700)]
fault_handler: hopefully fix darwin build.

Test: none
Change-Id: I08adf266c6287a289d213a0b1fa854f223fec72d

7 years agoMerge "Revert "Add dexdiag_test""
David Sehr [Wed, 19 Apr 2017 20:00:50 +0000 (20:00 +0000)]
Merge "Revert "Add dexdiag_test""

7 years agoMerge changes Ie3d5e176,Ic1fbb885,I10bafcff
Treehugger Robot [Wed, 19 Apr 2017 19:57:35 +0000 (19:57 +0000)]
Merge changes Ie3d5e176,Ic1fbb885,I10bafcff

* changes:
  fault_handler: use SafeCopy to verify the validity of ArtMethod.
  fault_handler: use SafeCopy to decode x86 instruction length.
  base: add SafeCopy.

7 years agoRevert "Add dexdiag_test"
David Sehr [Wed, 19 Apr 2017 19:44:08 +0000 (19:44 +0000)]
Revert "Add dexdiag_test"

This reverts commit 2120ad43acc0ab0fa74c151069948ef9698c009f.

Change-Id: Icdb42e47eb2f099cbfbd302477ad6614bb8524f1

7 years agoMerge "Implement can_generate_native_method_bind capability"
Treehugger Robot [Wed, 19 Apr 2017 19:31:06 +0000 (19:31 +0000)]
Merge "Implement can_generate_native_method_bind capability"

7 years agoMerge "Implement halving add idiom (with checker tests)."
Treehugger Robot [Wed, 19 Apr 2017 19:19:00 +0000 (19:19 +0000)]
Merge "Implement halving add idiom (with checker tests)."

7 years agoMerge "MIPS64: java.lang.System.arraycopy() for copying char[] to char[]."
Treehugger Robot [Wed, 19 Apr 2017 18:15:58 +0000 (18:15 +0000)]
Merge "MIPS64: java.lang.System.arraycopy() for copying char[] to char[]."

7 years agoMerge "Fix CHA test failures under some configurations."
Mingyao Yang [Wed, 19 Apr 2017 17:59:32 +0000 (17:59 +0000)]
Merge "Fix CHA test failures under some configurations."

7 years agofault_handler: use SafeCopy to verify the validity of ArtMethod.
Josh Gao [Tue, 18 Apr 2017 03:10:29 +0000 (20:10 -0700)]
fault_handler: use SafeCopy to verify the validity of ArtMethod.

Reimplement ArtMethod::GetDeclaringClassUnchecked and VerifyClassClass
in terms of SafeCopy, to be able to safely verify the validity of
putative ArtMethods in FaultManager::IsInGeneratedCode.

Bug: http://b/30836730
Test: m test-art-host
Change-Id: Ie3d5e176ea569cedcefd320e2480a1e1e496a53a

7 years agoImplement halving add idiom (with checker tests).
Aart Bik [Thu, 13 Apr 2017 00:09:20 +0000 (17:09 -0700)]
Implement halving add idiom (with checker tests).

Rationale:
First of several idioms that map to very efficient SIMD instructions.
Note that the is-zero-ext and is-sign-ext are general-purpose utilities
that will be widely used in the vectorizer to detect low precision
idioms, so expect that code to be shared with many CLs to come.

Test: test-art-host, test-art-target
Change-Id: If7dc2926c72a2e4b5cea15c44ef68cf5503e9be9

7 years agoMerge "Allow dex2oat to handle relative paths."
Treehugger Robot [Wed, 19 Apr 2017 17:13:11 +0000 (17:13 +0000)]
Merge "Allow dex2oat to handle relative paths."

7 years agoImplement can_generate_native_method_bind capability
Alex Light [Tue, 18 Apr 2017 22:20:38 +0000 (15:20 -0700)]
Implement can_generate_native_method_bind capability

This capability lets one observe and even replace the implementations
of native methods when they are bound.

Test: ./test.py --host -j40

Bug: 37432636
Change-Id: I2432a8e4da1a677e8011ce495296f4ab9f42eb3e

7 years agoMerge "Add dexdiag_test"
David Sehr [Wed, 19 Apr 2017 16:37:46 +0000 (16:37 +0000)]
Merge "Add dexdiag_test"

7 years agoMerge "ART: Refactor run-test 924"
Treehugger Robot [Wed, 19 Apr 2017 16:14:17 +0000 (16:14 +0000)]
Merge "ART: Refactor run-test 924"

7 years agoMerge "ART: Filter more thread roots"
Treehugger Robot [Wed, 19 Apr 2017 16:13:40 +0000 (16:13 +0000)]
Merge "ART: Filter more thread roots"

7 years agoMerge "Record class status after verification."
Nicolas Geoffray [Wed, 19 Apr 2017 12:31:42 +0000 (12:31 +0000)]
Merge "Record class status after verification."

7 years agoMerge "ARM64: Heap poisoning for link-time Baker CC read barrier thunks."
Vladimir Marko [Wed, 19 Apr 2017 11:32:49 +0000 (11:32 +0000)]
Merge "ARM64: Heap poisoning for link-time Baker CC read barrier thunks."

7 years agoMerge "Follow-up to 70d60275cc2860bde50e5f9c5b151e94f745ae14"
Treehugger Robot [Wed, 19 Apr 2017 10:13:12 +0000 (10:13 +0000)]
Merge "Follow-up to 70d60275cc2860bde50e5f9c5b151e94f745ae14"

7 years agoARM64: Heap poisoning for link-time Baker CC read barrier thunks.
Vladimir Marko [Tue, 18 Apr 2017 12:55:13 +0000 (13:55 +0100)]
ARM64: Heap poisoning for link-time Baker CC read barrier thunks.

And fix running out of scratch registers for HArraySet
with large constant index and a reference to poison.

Test: Nexus 6P boots with heap poisoning enabled.
Test: testrunner.py --target with heap poisoning enabled on Nexus 6P.
Bug: 29516974
Bug: 30126666
Bug: 36141117
Change-Id: Ifb38f4a0e23a2963468772f34f294febfc340b8c

7 years agoMerge "Reduce timeout of JDWP tests"
Sebastien Hertz [Wed, 19 Apr 2017 09:26:54 +0000 (09:26 +0000)]
Merge "Reduce timeout of JDWP tests"

7 years agoReduce timeout of JDWP tests
Sebastien Hertz [Mon, 27 Mar 2017 09:35:54 +0000 (11:35 +0200)]
Reduce timeout of JDWP tests

This CL sets the timeout of JDWP tests to 10s (instead of the default
timeout of 60s).

This should save up time for continuous testing (~ 3min on host).
Indeed, some tests do wait until the timeout to detect that no reply
(or no event) has been received.

Test: art/tools/run-jdwp-tests.sh --mode=host --variant=X64
Change-Id: Id03c8a1d629e6da551cf8eb405cc79754a363fe0

7 years agoMerge "Revert "Invoke dex2oat explictly before dalvikvm""
Nicolas Geoffray [Wed, 19 Apr 2017 09:01:46 +0000 (09:01 +0000)]
Merge "Revert "Invoke dex2oat explictly before dalvikvm""

7 years agoRevert "Invoke dex2oat explictly before dalvikvm"
Nicolas Geoffray [Wed, 19 Apr 2017 09:01:29 +0000 (09:01 +0000)]
Revert "Invoke dex2oat explictly before dalvikvm"

Fails on device with:
07-13 04:35:49.410 24424 24424 F dex2oat : instruction_set_features.cc:58] static std::unique_ptr<const InstructionSetFeatures> art::InstructionSetFeatures::FromVariant(art::InstructionSet, const std::string &, std::string *) unimplemented None

Bug: 36824842

This reverts commit 4806f7afc92b1812cefaab291235d01773732400.

Change-Id: I34a23fb69b0284e6d70ec0a54d5ada9e107ffeb7

7 years agoRecord class status after verification.
Nicolas Geoffray [Wed, 19 Apr 2017 08:36:24 +0000 (09:36 +0100)]
Record class status after verification.

The class status was recorded when doing vdex verification, or
any compilation (quickening or optimizing), but not when only doing
verification.

bug:37446669
Test:compiler_driver_test
Change-Id: Id027c7a9776ed651de570a0f3417c969c8cff9cd

7 years agoFollow-up to 70d60275cc2860bde50e5f9c5b151e94f745ae14
Sebastien Hertz [Tue, 18 Apr 2017 16:28:51 +0000 (18:28 +0200)]
Follow-up to 70d60275cc2860bde50e5f9c5b151e94f745ae14

Test: make -j build-art-host
Change-Id: Id6e81518041bd64dec537ff3da2fa049d39b27d0

7 years agoMerge "Always check result of Thread::ModifySuspendCount"
Sebastien Hertz [Wed, 19 Apr 2017 07:23:36 +0000 (07:23 +0000)]
Merge "Always check result of Thread::ModifySuspendCount"

7 years agoMerge "Call mirror::CallSite::VisitRoots"
Mathieu Chartier [Wed, 19 Apr 2017 02:41:02 +0000 (02:41 +0000)]
Merge "Call mirror::CallSite::VisitRoots"

7 years agoAllow dex2oat to handle relative paths.
Jeff Hao [Thu, 6 Apr 2017 00:05:46 +0000 (17:05 -0700)]
Allow dex2oat to handle relative paths.

During installation at compile time, the PackageManager is passing
shared libraries to dex2oat with -classpath. For split apps, we want the
splits to have the proper dependencies, and are now passing previous
parts of the split apk as shared libraries as we compile them all. These
apks are staged in a temp dir during compilation, so we pass a relative
path for them instead.

Since PackageManager can now pass relative paths to dex2oat as shared
libraries, dex2oat has an added --classpath-dir switch to specify the
directory to use for relative class paths. At runtime when checking
shared libraries, we use oat file functionality to resolve relative paths
to determine if the paths match.

Bug: 34169257
Test: cts-tradefed run singleCommand cts -d --module
CtsAppSecurityHostTestCases -t android.appsecurity.cts.SplitTests

Merged-In: I9667f0069c8d12e94598f8a78888d3855d870824
(cherry-picked from commit f79ac83a8c18b0bd81aafc9c8823f6bed35d8847)

Change-Id: I8e4703fdd4bfeb94f982e93abb7eb0cd71060fce

7 years agoCall mirror::CallSite::VisitRoots
Mathieu Chartier [Tue, 18 Apr 2017 23:14:19 +0000 (16:14 -0700)]
Call mirror::CallSite::VisitRoots

Needed to visit CallSite static class root.

Test: test/run-test --no-patchoat --relocate --host --64 --interpreter --gdb 952

Bug: 33191717

Change-Id: I1fad3df8ad810c5c7905afadfa25cdc0901ef035

7 years agoMerge "Invoke dex2oat explictly before dalvikvm"
Calin Juravle [Tue, 18 Apr 2017 23:20:16 +0000 (23:20 +0000)]
Merge "Invoke dex2oat explictly before dalvikvm"

7 years agoART: Refactor run-test 924
Andreas Gampe [Wed, 12 Apr 2017 15:42:16 +0000 (08:42 -0700)]
ART: Refactor run-test 924

Move testing to a dedicated thread to have a known thread name.
Change event reporting to be Java-side. Use Java-side thread list
(from Thread.getAllStackTraces) as comparison for minimal expected
set of threads.

Bug: 32072923
Test: art/test/testrunner/testrunner.py -b --host -t 924
Change-Id: I238ffc202e42eea8d1788137715188d3dfbcc8fb

7 years agoAdd dexdiag_test
David Sehr [Fri, 14 Apr 2017 22:26:09 +0000 (15:26 -0700)]
Add dexdiag_test

Tests that dexdiag runs on the current process and returns with a
non-error status for a variety of command line options.

Bug: 35800981
Test: make test-art-target-gtest-dexdiag_test
Change-Id: Ib6f21a99ddec270cf8026a6123b028fe4b3fb840

7 years agoMerge "Fix obsolete method change check."
Treehugger Robot [Tue, 18 Apr 2017 22:42:58 +0000 (22:42 +0000)]
Merge "Fix obsolete method change check."

7 years agoInvoke dex2oat explictly before dalvikvm
Calin Juravle [Wed, 12 Apr 2017 02:04:28 +0000 (19:04 -0700)]
Invoke dex2oat explictly before dalvikvm

The goal is to stop relying on dex2oat being run when dex files are
loaded.

Test: ./out/host/linux-x86/bin/art --profile -Ximage:$PWD/out/host/linux-x86/framework/core.art -Xusejit:true -Xcompiler-option --compiler-filter=speed -Xcompiler-option --compiler-backend=Optimizing -verbose:oat -Djava.library.path=$PWD/out/x86_64/host/linux-x86/lib64 -cp $PWD/generated/benchmarks.dex benchmarks.ExoPlayerBench.java.ExoPlayerBench

Bug: 36824842
Change-Id: I9f4a1384cdc91502edea08402ee984c57ff8c37d

7 years agofault_handler: use SafeCopy to decode x86 instruction length.
Josh Gao [Tue, 18 Apr 2017 18:18:56 +0000 (11:18 -0700)]
fault_handler: use SafeCopy to decode x86 instruction length.

Prevent a crash in the x86 fault handler when pc points to garbage and
we try to figure out its instruction length.

Bug: http://b/30836730
Test: m test-art-host
Change-Id: Ic1fbb8856e30140f0e1ebc9caccf9559e88ff137

7 years agobase: add SafeCopy.
Josh Gao [Tue, 18 Apr 2017 01:31:26 +0000 (18:31 -0700)]
base: add SafeCopy.

Add a function that uses process_vm_readv on Linux to safely
dereference pointers without the risk of segfault.

Bug: http://b/30836730
Test: safe_copy_test on host
Change-Id: I10bafcffe2172e17b00f65455d1dd6a08aa631d7

7 years agoART: Filter more thread roots
Andreas Gampe [Tue, 18 Apr 2017 20:59:09 +0000 (13:59 -0700)]
ART: Filter more thread roots

Also filter interface classes that may be held by the JIT.

Bug: 31385354
Test: art/test/testrunner/testrunner.py --host -b -t 913
Change-Id: I129ab8c28e398d779d9d43b03358aa54a9a14c8c

7 years agoFix obsolete method change check.
Alex Light [Tue, 18 Apr 2017 20:03:31 +0000 (13:03 -0700)]
Fix obsolete method change check.

We were incorrectly checking for changes in the obsolete-method map.
This could cause issues if a class was redefined multiple times.

Bug: 37475600

Test: ./test.py --host -j40
Test: cts-tradefed run cts-dev --module CtsJvmtiRedefineClassesHostTestCases

Change-Id: Icf39d5154c0e48461405b700bf1fa20830195fc1

7 years agoMerge "Make ART build/test configurations use the CC collector by default."
Treehugger Robot [Tue, 18 Apr 2017 18:25:01 +0000 (18:25 +0000)]
Merge "Make ART build/test configurations use the CC collector by default."

7 years agoMerge "Differentiate between native alloc and normal background GC"
Mathieu Chartier [Tue, 18 Apr 2017 18:24:00 +0000 (18:24 +0000)]
Merge "Differentiate between native alloc and normal background GC"

7 years agoMerge "ART: Make less lock-level noise on abort"
Treehugger Robot [Tue, 18 Apr 2017 18:21:41 +0000 (18:21 +0000)]
Merge "ART: Make less lock-level noise on abort"

7 years agoDifferentiate between native alloc and normal background GC
Mathieu Chartier [Mon, 17 Apr 2017 22:24:43 +0000 (15:24 -0700)]
Differentiate between native alloc and normal background GC

Added a new GC cause kGcCauseForNativeAllocBackground.

Bug: 35872915

Test: test-art-host

Change-Id: I94e17f8bd53af29f2862b9910bd8abd2df97e229

7 years agoMerge "Use correct type for GetValueFromShadowFrame"
Mathieu Chartier [Tue, 18 Apr 2017 17:14:00 +0000 (17:14 +0000)]
Merge "Use correct type for GetValueFromShadowFrame"

7 years agoMerge "Use WARN_UNUSED consistently in ART."
Roland Levillain [Tue, 18 Apr 2017 17:06:25 +0000 (17:06 +0000)]
Merge "Use WARN_UNUSED consistently in ART."

7 years agoUse correct type for GetValueFromShadowFrame
Mathieu Chartier [Tue, 18 Apr 2017 03:12:29 +0000 (20:12 -0700)]
Use correct type for GetValueFromShadowFrame

The field type is not necessarily the input type for boxed
primitives. If the field type is < 32 bits, it means there will be
partial object pointer in the JValue. If a conversion check is
later needed in GetUnboxedTypeAndValue, it will crash. The fix is
to use the PTypes.

Bug: 37446461
Test: test-art-host
Change-Id: I0c4b405f0c13910523b98a87ef12b9f302a5e241

7 years agoMerge "JDWP: fix Dbg::ResumeThread"
Sebastien Hertz [Tue, 18 Apr 2017 16:11:55 +0000 (16:11 +0000)]
Merge "JDWP: fix Dbg::ResumeThread"

7 years agoAlways check result of Thread::ModifySuspendCount
Sebastien Hertz [Fri, 14 Apr 2017 13:05:12 +0000 (15:05 +0200)]
Always check result of Thread::ModifySuspendCount

Ensures that we never ignore the result of ModifySuspendCount so that
we can react if the suspend count is not updated as expected.

This CL does the following:
* Adds __attribute__((warn_unused_result)) on the method to raise an
  error at compilation time if the result is ignored.
* Wraps calls with DCHECK where the result used to be ignored.

Bug: 27385848
Test: make -j test-art-host
Test: art/tools/run-jdwp-tests.sh --mode=host --variant=X64
Change-Id: I2d0e1ab7158c70ec8076c8bae6e4b814aee75af6

7 years agoMerge "ART: Call ThreadGroup.add in Thread::FinishStartup"
Treehugger Robot [Tue, 18 Apr 2017 15:12:58 +0000 (15:12 +0000)]
Merge "ART: Call ThreadGroup.add in Thread::FinishStartup"

7 years agoMerge "Fix ARM64 SystemArrayCopy intrinsic with large constant dest position."
Roland Levillain [Tue, 18 Apr 2017 12:37:10 +0000 (12:37 +0000)]
Merge "Fix ARM64 SystemArrayCopy intrinsic with large constant dest position."

7 years agoMerge "Revert "Disable 160-read-barrier-stress temporarily""
Vladimir Marko [Tue, 18 Apr 2017 12:06:55 +0000 (12:06 +0000)]
Merge "Revert "Disable 160-read-barrier-stress temporarily""

7 years agoMerge "Fix Arena allocation tracking."
Treehugger Robot [Tue, 18 Apr 2017 11:29:25 +0000 (11:29 +0000)]
Merge "Fix Arena allocation tracking."

7 years agoUse WARN_UNUSED consistently in ART.
Roland Levillain [Tue, 18 Apr 2017 11:01:58 +0000 (12:01 +0100)]
Use WARN_UNUSED consistently in ART.

Test: mmma art
Change-Id: I776840725f56258c45edfcfd165da61ab653f0b5

7 years agoFix ARM64 SystemArrayCopy intrinsic with large constant dest position.
Roland Levillain [Thu, 13 Apr 2017 18:34:30 +0000 (19:34 +0100)]
Fix ARM64 SystemArrayCopy intrinsic with large constant dest position.

Make sure we do not deplete the whole VIXL scratch register pool, so
that VIXL can still use IP0 as a temporary when emitting
macro-instructions.

Test: art/test/testrunner/testrunner.py --optimizing --target --64
Bug: 37256530
Change-Id: I5da22e552297fad87db5763e2dab60ae6a7a43af

7 years agoRevert "Disable 160-read-barrier-stress temporarily"
Vladimir Marko [Tue, 18 Apr 2017 09:47:12 +0000 (09:47 +0000)]
Revert "Disable 160-read-barrier-stress temporarily"

And reduce the number of fields in class ManyFields from
10000 to 5000 to reduce memory pressure on Jack. Split
the ManyFields class in a simple hierarchy to keep files
under 64KiB and allow compilation with javac.

Test: testrunner.py --host -j 48
Test: run-test --host --jvm 160-read-barrier-stress
Bug: 37335480

This reverts commit 101074999bd339c276eeaaf0538930d90a96657e.

Change-Id: I52217fd2c9d00a5b045a7faa6e4dc1438c7f93b1

7 years agoART: Make less lock-level noise on abort
Andreas Gampe [Tue, 18 Apr 2017 04:40:28 +0000 (21:40 -0700)]
ART: Make less lock-level noise on abort

The lock-level violations with the abort lock aren't really all
that interesting.

Test: m test-art-host
Change-Id: I8a5fc687009db914ec8f60d86068d87e71f8a894

7 years agoART: Call ThreadGroup.add in Thread::FinishStartup
Andreas Gampe [Tue, 18 Apr 2017 03:19:14 +0000 (20:19 -0700)]
ART: Call ThreadGroup.add in Thread::FinishStartup

ART should add the main thread to the main ThreadGroup. Behavior
of the Thread constructor changed.

Bug: 37444210
Test: art/test/testrunner/testrunner.py -b --host -t 051
Test: m test-art-host
Test: m build-art-host && art/tools/run-libcore-tests.sh --mode=host
Change-Id: I92cf2f9a6c5c3fdf385eb7925addc38b64fa4d98

7 years agoMerge "sigchain: switch from __thread to pthread_setspecific."
Treehugger Robot [Tue, 18 Apr 2017 00:58:38 +0000 (00:58 +0000)]
Merge "sigchain: switch from __thread to pthread_setspecific."

7 years agosigchain: switch from __thread to pthread_setspecific.
Josh Gao [Mon, 17 Apr 2017 22:58:36 +0000 (15:58 -0700)]
sigchain: switch from __thread to pthread_setspecific.

__thread is implemented via emutls on Android, which will result in the
thread local variable being allocated again and leaked if it gets used
after it has been destructed already (e.g. by a later destructor
calling sigprocmask, or triggering a signal handler).

Switch to pthread_setspecific, which doesn't suffer from this problem.

Bug: http://b/36871013
Test: ran dalvikvm on a class that spins creating threads
Change-Id: Ie5deab453be387490ba30a0010e12f60d736c8ad

7 years agoMerge "Enable some redefinition run-tests in CTS"
Treehugger Robot [Mon, 17 Apr 2017 21:45:18 +0000 (21:45 +0000)]
Merge "Enable some redefinition run-tests in CTS"

7 years agoMerge "ART: Change run-test 913 array testing"
Treehugger Robot [Mon, 17 Apr 2017 21:42:46 +0000 (21:42 +0000)]
Merge "ART: Change run-test 913 array testing"

7 years agoMerge "Disable read barrier thunks for heap poisoning"
Treehugger Robot [Mon, 17 Apr 2017 21:35:48 +0000 (21:35 +0000)]
Merge "Disable read barrier thunks for heap poisoning"

7 years agoMerge "Print runtime isa when invoking 'dalvikvm --showversion'"
Calin Juravle [Mon, 17 Apr 2017 21:26:47 +0000 (21:26 +0000)]
Merge "Print runtime isa when invoking 'dalvikvm --showversion'"

7 years agoEnable some redefinition run-tests in CTS
Alex Light [Fri, 14 Apr 2017 23:20:53 +0000 (16:20 -0700)]
Enable some redefinition run-tests in CTS

We added the tests to run-test-jvmti-java-library
target and made some small changes to tests to
ensure that everything works without linking to
libart.so.

Bug: 32072923
Test: ./test.py --host -j40
Change-Id: I8fdad180c77b125c22c043cd61305cee79801cc7

7 years agoART: Change run-test 913 array testing
Andreas Gampe [Mon, 17 Apr 2017 19:46:36 +0000 (12:46 -0700)]
ART: Change run-test 913 array testing

Use an explicit array in the test. Ignore all arrays that are
untagged.

Bug: 32072923
Bug: 36727422
Test: m
Test: art/test.py --host -r -t 913
Change-Id: Idf7bc03ae81e3e645935c8809bf59636cfa3784a

7 years agoDisable read barrier thunks for heap poisoning
Mathieu Chartier [Mon, 17 Apr 2017 19:50:45 +0000 (12:50 -0700)]
Disable read barrier thunks for heap poisoning

Logic to unpoison is not yet implemented, this causes SIGSEGVs in
various places.

Bug: 29516974
Bug: 30126666
Bug: 36141117

Test: ./test/testrunner/testrunner.py -j4 --optimizing --debuggable --ndebuggable --target --verbose
Change-Id: I8317a142d07af36090d5f05ce46100dfa07c17e7

7 years agoMerge "Use standard loading code in many tests"
Treehugger Robot [Mon, 17 Apr 2017 18:59:40 +0000 (18:59 +0000)]
Merge "Use standard loading code in many tests"

7 years agoMerge "Remove native code from test 944 for CTS"
Treehugger Robot [Mon, 17 Apr 2017 17:19:05 +0000 (17:19 +0000)]
Merge "Remove native code from test 944 for CTS"