History log of /art/runtime/common_runtime_test.h
Revision Date Author Comments
91c911690868a1a109ec6d52666def5682b026e1 15-Jan-2016 Mathieu Chartier <mathieuc@google.com> Add value parameterized test support for runtime tests

Usage is demonstrated in type_lookup_table_test.

Bug: 10245322

Change-Id: Ife6eb1ed57cb12edecce9ef101215ff15ae032e1
c7d4a5889085de271130c1ebeb83f96881195124 30-Sep-2015 Andreas Gampe <agampe@google.com> ART: Use non-stripped core jars in gtests

To support emulators and other preopted device configurations, use
a special core-libart and core-oj version that will never be stripped.

Bug: 24535627
Change-Id: Ie632bc382bbc753e9c100039f2ecc4ac1f2ab249
a00f012660e9a4baa34c0ab96042f7146e9a6017 17-Dec-2015 Andreas Gampe <agampe@google.com> ART: Refactor CommonRuntimeTest::SetUp

Factor out finishing up the runtime. This code will execute the
interpreter to initialize important classes etc., which is not
necessary for testing RuntimeMethod sizes and trampoline entrypoints,
in fact it may violate pointer-size invariants.

Also add InstructionSet parsing tests to the ParsedOptions test.

Change-Id: I75cd00c6d358e1bc962c8f1845244f6400c1cd6c
0d5a281c671444bfa75d63caf1427a8c0e6e1177 13-Nov-2015 Roland Levillain <rpl@google.com> x86/x86-64 read barrier support for concurrent GC in Optimizing.

This first implementation uses slow paths to instrument heap
reference loads and GC root loads for the concurrent copying
collector, respectively calling the artReadBarrierSlow and
artReadBarrierForRootSlow (new) runtime entry points.

Notes:
- This implementation does not instrument HInvokeVirtual
nor HInvokeInterface instructions (for class reference
loads), as the corresponding read barriers are not stricly
required with the current concurrent copying collector.
- Intrinsics which may eventually call (on slow path) are
disabled when read barriers are enabled, as the current
slow path infrastructure does not support this case.
- When read barriers are enabled, the code generated for a
HArraySet instruction always go into the array set slow
path for object arrays (delegating the operation to the
runtime), as we are lacking a mechanism to keep a
temporary register live accross a runtime call (needed for
the instrumentation of type checking code, which requires
two successive read barriers).

Bug: 12687968
Change-Id: I14cd6107233c326389120336f93955b28ffbb329
5b8e6e36e96d6d1921dd356fa46191d1e6a18082 30-Sep-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix for gtest missing core classes, attempt 2

common_runtime_test loads both core-libart and
core-oj

Change-Id: I8a4d5750b99aed2e500cad89b841a57fe9c1ca69
be26f77dac06fb02b0cc80914b740662bf8d0b26 30-Sep-2015 Narayan Kamath <narayan@google.com> Revert "Fix for gtest missing core classes."

This reverts commit fa5480de6eca7f43b147c696bdb2936dc48d75d7.

Change-Id: Ifa9851f4f90af6093ed0bca852c55b3026fcd554
136781e23244f9a42ba08de7035c675cfd4d108b 30-Sep-2015 Przemyslaw Szczepaniak <pszczepaniak@google.com> Fix for gtest missing core classes.

common_runtime_test loads both core-libart and
core-oj

Change-Id: I5b814e4dcf9f6162c47b4eb5e7890a32e59c2cef
90443477f9a0061581c420775ce3b7eeae7468bc 17-Jul-2015 Mathieu Chartier <mathieuc@google.com> Move to newer clang annotations

Also enable -Wthread-safety-negative.

Changes:
Switch to capabilities and negative capabilities.

Future work:
Use capabilities to implement uninterruptible annotations to work
with AssertNoThreadSuspension.

Bug: 20072211

Change-Id: I42fcbe0300d98a831c89d1eff3ecd5a7e99ebf33
4d02711ea578dbb789abb30cbaf12f9926e13d81 01-Jul-2015 Roland Levillain <rpl@google.com> Implement heap poisoning in ART's Optimizing compiler.

- Instrument ARM, ARM64, x86 and x86-64 code generators.
- Note: To turn heap poisoning on in Optimizing, set the
environment variable `ART_HEAP_POISONING' to "true"
before compiling ART.

Bug: 12687968
Change-Id: Ib3120b38cf805a8a50207a314b9ccc90c8d93740
bfa5eb6e8d15ea73a36f8df449630f285a91e995 30-May-2015 Hiroshi Yamauchi <yamauchi@google.com> Add heap poisoning support to the entrypoints.

In preparation for full compiler/managed-code support.

Enable stub_test with heap poisoning.

Bug: 12687968
Change-Id: I79fc54ce6386c0a1eb9621759bb4cc23bc393a75
d90957fbe6f41c66d5494ae5db1f60d2434d4c84 01-May-2015 Douglas Leung <douglas.leung@imgtec.com> ART: Fix mips64 jni bugs.

For mips64, 32-bits loads can be zero extended or sign extended to
64-bits. The extension type must match the data type to be loaded.

Also re-enable mips64 generic jni testing.

Change-Id: I9cabaf80b4fde63d9868fccd74593b36d1c324e8
3e52aa4d406fe802dabee2a2e7ba8764cc13aaaa 12-Apr-2015 David Srbecky <dsrbecky@google.com> Move GetAndroidToolsDir to common location.

Move the code which looks for the prebuilts directory
to CommonRuntimeTest and add test for it.

Change-Id: Id804de31c466656957fdd4b6a470f80a00477aed
bb9c6b1c55e9e2308b4f5892a398a8837231fdbd 29-Mar-2015 Andreas Gampe <agampe@google.com> ART: Refactor callbacks_ in common_runtime_test

The callback is now important for some runtime checks, and just
resetting callbacks_ is not correct anymore.

Change-Id: I2cb806f1916fd5ea190911a833ce460be557a428
81c6f8db12b203878a7d72444ead2bc7cf5c47ad 26-Mar-2015 Andreas Gampe <agampe@google.com> ART: PathClassLoader for compiler

Use an actual PathClassLoader when compiling apps, instead of a
side structure and cutout.

This CL sets up a minimal object 'cluster' that recreates the Java
side of a regular ClassLoader such that the Class-Linker will
recognize it and use the internal native fast-path.

This CL removes the now unnecessary compile-time-classpath and
replaces it with a single 'compiling-the-boot-image' flag in the
compiler callbacks.

Note: This functionality is *only* intended for the compiler, as
the objects have not been completely initialized.

Bug: 19781184

Change-Id: I7f36af12dd7852d21281110a25c119e8c0669c1d
66d874d96d5699bb090c59f47a5a528956ca053e 15-Jan-2015 Richard Uhler <ruhler@google.com> Create OatFileAssistant class for assisting with oat files.

The oat file assistant is used for determining whether dex2oat or
patchoat is needed, for running dex2oat or patchoat as needed to make
an oat file up to date, and to load dex files associated with a given
dex location.

The introduction of the OatFileAssistant class is meant to clean up and
consolidate code related to the management of oat files that was
duplicated and spread across dalvik_system_DexFile.cc and
class_linker.cc.

Bug: 11301553
Change-Id: I0c16027b9bae4570c2c50faa9c14f581c0cbafb8
aaebaa0121be3b9d9f13630585304482cbcaeb4b 26-Jan-2015 Igor Murashkin <iam@google.com> art: Refactor RuntimeOptions/ParsedOptions

Refactor the RuntimeOptions to be a
type-safe map (VariantMap, see runtime_options.h) and the ParsedOptions
to delegate the parsing to CmdlineParser (see cmdline/cmdline_parser.h).

This is the start of a command line parsing refactor, and may include
more in the future (dex2oat, patchoat, etc).

For more details of the command line parsing generator usage see cmdline/README.md

Change-Id: Ic67c6bca5e1f33bf2ec60e2e3ff8c366bab91563
fbef44de596d298dc6430f482dffc933a046dd28 23-Dec-2014 Richard Uhler <ruhler@google.com> Use unique_ptr to track ownership of dex files.

Bug: 18809837
Change-Id: Ie571eae8fc19ee9207390cff5c7e2a38071b126a
c275259449ec57987e52d3ab1eda3272b994488f 02-Jan-2015 Richard Uhler <ruhler@google.com> Remove back-door bootclasspath option from Runtime

The 'bootclasspath' option allowed users of the Runtime to load their
own boot class path DexFiles and pass them directly to the Runtime as
an option. This obscures the fact that the Runtime must take ownership
of the boot class path DexFiles.

This change removes the use of the bootclasspath option by dex2oat and
the common runtime tests. For dex2oat, we use the existing
-Xbootclasspath option instead, and introduce a new
-Xbootclasspath-locations option to override the dex locations for the
loaded boot class path dex files. For the common runtime tests, we
simply use -Xbootclasspath.

Bug: 18809837
Change-Id: Idfcd4885390bf0f3dc350993756dd337220def73
e21dc3db191df04c100620965bee4617b3b24397 09-Dec-2014 Andreas Gampe <agampe@google.com> ART: Swap-space in the compiler

Introduce a swap-space and corresponding allocator to transparently
switch native allocations to memory backed by a file.

Bug: 18596910

(cherry picked from commit 62746d8d9c4400e4764f162b22bfb1a32be287a9)

Change-Id: I131448f3907115054a592af73db86d2b9257ea33
62746d8d9c4400e4764f162b22bfb1a32be287a9 09-Dec-2014 Andreas Gampe <agampe@google.com> ART: Swap-space in the compiler

Introduce a swap-space and corresponding allocator to transparently
switch native allocations to memory backed by a file.

Bug: 18596910
Change-Id: I131448f3907115054a592af73db86d2b9257ea33
3774335b08076117d6950cd472cdd59a167470b5 13-Nov-2014 Igor Murashkin <iam@google.com> Add a new imgdiag tool to diff boot.art/core.art against a process

Analyze the dirty memory pages of a running process per-object,
this allows is to to fine-tune the dirty object binning algorithm in
image writer.

Also:
* Factor out oatdump command line parsing code into cmdline.h
* Factor out common build rules for building variations of binaries
* Add a gtest for imgdiag

Bug: 17611661
Change-Id: I3ac852a0d223af66f6d59ae5dbc3df101475e3d0
956af0f0cb05422e38c1d22cbef309d16b8a1a12 11-Dec-2014 Elliott Hughes <enh@google.com> Remove portable.

Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
6a3c1fcb4ba42ad4d5d142c17a3712a6ddd3866f 31-Oct-2014 Ian Rogers <irogers@google.com> Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.

Fix associated errors about unused paramenters and implict sign conversions.
For sign conversion this was largely in the area of enums, so add ostream
operators for the effected enums and fix tools/generate-operator-out.py.
Tidy arena allocation code and arena allocated data types, rather than fixing
new and delete operators.
Remove dead code.

Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
ee5618be0076ac359ab59af1c2ba945d85b2986e 15-Aug-2014 Jeff Hao <jeffhao@google.com> resolved conflicts for merge of 549c9b17 to lmp-dev-plus-aosp

Change-Id: Icea7763c830aeefa02d6a86c960c4b41148d397b
ebee8de725d5fa83483642786b19ea453d865762 13-Aug-2014 Nicolas Geoffray <ngeoffray@google.com> Fix bugs in the x86 and arm versions of generic JNI.

Also fix the run script of 116-nodex2oat to use the non-prebuild
script for target.

Bug: 17000769

(cherry-picked from commit 54accbca0b549b1b1ad3ef09655dad438bc1e104)

Change-Id: I439fcd710fb8bb408f3288ff8fb34fef23890adb
95b4c65da93500cdbdcaa3e01010771ef3f466f1 15-Aug-2014 Jeff Hao <jeffhao@google.com> Prevent stubs from being installed in java.lang.reflect.Proxy.<init>.

This CL is a better fix for proxy tracing and undoes the changes in
https://android-review.googlesource.com/#/c/103025/

Bug: 16386215

(cherry picked from commit db8a664e0b68c7c4d36270cd21dce8de1912d7f9)

Change-Id: Ic9e0ea2af7cb2da5d90c56aa009de92dba14cc47
4bf8d11df5dccc1b276cd9c40a98e8a14d79a9c8 25-Jul-2014 Jeff Hao <jeffhao@google.com> Fix proxy tracing and enable tests that now work with tracing.

Also updates proxy_test to generate an image for GetQuickOatCodeFor.

Bug: 16386215

(cherry picked from commit f0a3f09c3d54646166a55c05a6b39c7dd504129c)

Change-Id: I138edbad9e1646db8590f2b1b73f2788d9710e68
db8a664e0b68c7c4d36270cd21dce8de1912d7f9 15-Aug-2014 Jeff Hao <jeffhao@google.com> Prevent stubs from being installed in java.lang.reflect.Proxy.<init>.

This CL is a better fix for proxy tracing and undoes the changes in
https://android-review.googlesource.com/#/c/103025/

Change-Id: Ie82bb49f07774bd08a6720ddbe5b1f8ee9363acf
54accbca0b549b1b1ad3ef09655dad438bc1e104 13-Aug-2014 Nicolas Geoffray <ngeoffray@google.com> Fix bugs in the x86 and arm versions of generic JNI.

Also fix the run script of 116-nodex2oat to use the non-prebuild
script for target.

Bug: 17000769

Change-Id: I439fcd710fb8bb408f3288ff8fb34fef23890adb
f896965072343a2d6ad64d46a61112b10b3645dd 06-Aug-2014 Andreas Gampe <agampe@google.com> ART: Remove test files after test

The unix_file tests should remove files and directories when they
are done testing.

Bug: 16505797

(cherry picked from commit 7747c8de402f64e3009ca3bcccebddbb70f617ee)

Change-Id: I9c3c8f1a80ec0d37628a742193267e182c25b0cd
68d8b42ddec39ec0174162d90d4abaa004d1983e 17-Jul-2014 Ian Rogers <irogers@google.com> Wire up check JNI force copy mode.

Increase check JNI checks.
Break apart jni_internal.h in to jni_env_ext.h and java_vm_ext.h.
Fix the abuse of ScopedObjectAccess/annotalysis by ScopedCheck in the case
of VM routines.
Make class loader override and shared library class loader JNI global
references rather than mirror pointers.
Clean-ups to native bridge.

Change-Id: If7c6110b5aade7a402bfb67534af86a7b2cdeb55
7747c8de402f64e3009ca3bcccebddbb70f617ee 06-Aug-2014 Andreas Gampe <agampe@google.com> ART: Remove test files after test

The unix_file tests should remove files and directories when they
are done testing.

Bug: 16505797
Change-Id: Iff6856f64ee42ee9818b4ac23a6de3fe7eec6eae
f0a3f09c3d54646166a55c05a6b39c7dd504129c 25-Jul-2014 Jeff Hao <jeffhao@google.com> Fix proxy tracing and enable tests that now work with tracing.

Also updates proxy_test to generate an image for GetQuickOatCodeFor.

Bug: 16386215
Change-Id: Ie7daad3d73ea7b60187bc1e7037ade0df8277107
a59dd80f9f48cb750d329d4d4af2d99d72b484d1 03-Jul-2014 Alex Light <allight@google.com> Runtime can now be set to require relocation

Add a pair of runtime flags -Xrelocate and -Xnorelocate that can force
the runtime to require that all files that are run are relocated, to
prevent attacks based on the known art base address.

Add support for running patchoat on oat files compiled without an image.

Change run-test to have new --prebuild and --relocate flags.

Bug: 15358152

Change-Id: I91166c62dd1ab80e5cbcb7883a2cd0d56afca32d
e63db27db913f1a88e2095a1ee8239b2bb9124e8 16-Jul-2014 Ian Rogers <irogers@google.com> Break apart header files.

Create libart-gtest for common runtime and compiler gtest routines.
Rename CompilerCallbacksImpl that is quick compiler specific.
Rename trace clock source constants to not use the overloaded profiler term.

Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933
4e99b3d8955131f3fc71aa113f0fa71f0092cb6f 24-Jun-2014 Sebastien Hertz <shertz@google.com> Add missing class initialization during compilation and tests

Adds missing class initialization during compilation and tests, especially
java.lang.Class. Otherwise, we'd be able to execute code while the referring
class is not initialized or initializing.

Also adds mirror::Class::AssertInitializedOrInitializingInThread method to
check class initialization when entering the interpreter: the called method's
declaring class must either be initialized or be initializing by the current
thread (other threads must be waiting for the class initialization to complete
holding its lock). Note we only do this check in debug build.

Bump oat version to force compilation.

Bug: 15899971
Change-Id: I9a4edd3739a3ca4cf1c4929dcbb44cdf7a1ca1fe
5ced67270d178df0ddd78abe2af2235de905d6f0 10-Jul-2014 Elliott Hughes <enh@google.com> Use the icu4c headers from the new location.

Change-Id: I6ca56e8f9909bf3644a5f79f2d705547ddba6d03
86f5662a9374ee03bcd2b440a67f1e90eaac70c0 26-Jun-2014 Andreas Gampe <agampe@google.com> ART: Use ANDROID_HOST_OUT for ANDROID_ROOT in Runtime tests

On the host, if ANDROID_ROOT is not set, first try ANDROID_HOST_OUT.
This will ensure that builds with OUT_DIR_COMMON_BASE will run the
gtests correctly, as icu will use ANDROID_ROOT to look for a file.

Change-Id: I8988901be32249c1c79f96b36947a647df5de041
833a48501d560c9fa7fc78ef619888138c2d374f 22-May-2014 Andreas Gampe <agampe@google.com> ART: Native support for multidex

Native support for zip files with multiple classesX.dex.

Works by explicitly looking for those files in ascending order. As
these files have no file system representation for themselves,
introduce synthetic dex locations: the name of the originating file
plus a colon plus the name of the dex file, e.g., test.jar:classes2.dex.

Opening a zip dex file will return all dex files in this way. This
keeps the changes to dex2oat minimal.

To hide multidex/synthetic names from the Java layer, let the handle
of dalvik.system.DexFile refer to a vector of DexFile objects. When
opening a location, test possible synthetic names and add them to the
vector. Thus, the original multidex jar in the classpath will be
associated with all embedded dex files.

Change-Id: I0de107e1369cbc94416c544aca3b17525c9eac8b
afd9acc30bdd11cdd12d8209eb994cb371c65e33 17-Jun-2014 Ian Rogers <irogers@google.com> Multilib ART host.

Build ART for the host as a multilib project with dalvikvm32 and dalvikvm64
running as 32 or 64-bit repsectfully. Note, currently multilib host builds
are not the default, you make the so by setting BUILD_HOST_64bit=1.
Extend tests to execute in both 32 and 64-bit modes. By default both 32 and
64-bit tests are run, add 32 or 64 to the end of a test name to run it in
purely that flavor.
Given the extra spam, modify oat tests to only generate console output when
the test fails.
Change the test harness so that common commands are run when a test should be
skipped, when it passes or when it fails. Use these commands to generate a
summary of passing, skipped and failing tests. Tests will be skipped if they
are known to be broken or if a test has already failed. Setting the variable
TEST_ART_KEEP_GOING=true will force working tests not to be skipped.
In this change all tests running on the optimizing compiler are marked broken
due to breakages running them in a multilib environment.
Break apart Android.common.mk into its constituent parts, along with other
pieces of reorganization.

Stylistic nit, we refer to make rule targets as targets thereby overloading
the term target. While consistent with make's terminology, its confusing with
the Android notion of target. I've switched to just calling targets rules to
avoid confusion in host tests.

Change-Id: I5190fc3de46800a949fbb06b3f4c258ca89ccde9
700a402244a1a423da4f3ba8032459f4b65fa18f 20-May-2014 Ian Rogers <irogers@google.com> Now we have a proper C++ library, use std::unique_ptr.

Also remove the Android.libcxx.mk and other bits of stlport compatibility
mechanics.

Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
0e12bdc49744eb6d5c29b9611a8dbe10bac4cd53 15-May-2014 Brian Carlstrom <bdc@google.com> Add ISA directory to image and odex pathnames.

Bug: 14882223
Bug: 14694978
Change-Id: Ic1b5ae836b8e91ea461dcd4f3da8e38dc3bec00f
507dfdd147c97bfbadebfd63584d094b6a4e7b47 16-May-2014 Ian Rogers <irogers@google.com> Compatibility layer to transition from UniquePtr to std::unique_ptr.

Use ART_WITH_STLPORT (enabled for the target) to cause the use of UniquePtr,
for the host switch to std::unique_ptr. For now the type remains called
UniquePtr.
Make dalvik compile with clang on the host, move its build to C++11.

Change-Id: I5ba8d2757904bc089ed62047ea03de3c0853fb12
b40c6a768aa8df4774d2a8c3ac7045237cc748cd 02-May-2014 Andreas Gampe <agampe@google.com> ART: Fix assembler_test to use ScratchFile

This removes a warning about tmpnam usage.

Also add an assertion to ScratchFile about ANDROID_DATA being set,
which it relies on for the temp directory.

Change-Id: I1202f92e48e61492f0ed3ac36ff44fde34dbb0e1
afbaa1aab02cfe519d00336870b1bcd24b61378d 26-Mar-2014 Andreas Gampe <agampe@google.com> Build changes to build multilib tests

Test files will be emitted into directories for both first and second
target architectures. Going with the naming scheme for binaries,
single-architecture and 32b cases have the standard name, and
64b goes into a directory with "64" suffix.

In multi-architecture setups, the default concrete test targets are
extended with a "32" and "64" suffix, e.g., test-art-target-oat-JniTest64.
The suffix-less form is linked to the primary architecture target (usually 64).
That means running combined targets, e.g., test-art-target-oat, will only
test the primary architecture right now.

Fixed target run tests calling the right dalvikvm. Fixed library search
path for tests derived from CommonRuntimeTest.

Missing in this work-in-progress is correct handling of dex2oat for the
secondary architecture. To make it work on 64b, comment out line 101
in build/Android.executable.mk

Change-Id: I3d260994e6efe8b73b56c71994053cc9392943a9
05b15d6e896af7ae0075a690ea791e2e92ecf443 19-Mar-2014 Hiroshi Yamauchi <yamauchi@google.com> Make test-art pass with heap reference poisoning enabled.

Heap reference poisoning is currently interpreter only. This change
disables one compiler driver test that actually invokes compiled code
if heap reference poisoning is enabled.

Bug: 12687968
Change-Id: Ia9516f4067d84e9a4de50d9ff44cfbe38f282d16
c0a1b18ac71ec0ff3ec0cca3cc8db9eb74e50690 05-Mar-2014 Brian Carlstrom <bdc@google.com> Reuse NoopCompilerCallbacks in oatdump

Change-Id: Icb4d3941196c1a236f0184fe4d0b7f5838bc13bd
9583fbcf597eff6d0b3c5359b8e8d5f70ed82c40 28-Feb-2014 Nicolas Geoffray <ngeoffray@google.com> Remove oat file location in the image.

The oat file is now always in the same directory, and has the
same name as the image file. Only difference is the extension.

This also removes the need for host-prefix.

Change-Id: I16d1f7aeb1d58372d41921694664e9c321afc1ad
a1ce1fef2d49d1d537776a5308ace7102a815fe5 25-Feb-2014 Brian Carlstrom <bdc@google.com> Split up CommonTest into CommonRuntimeTest and CommonCompilerTest

Change-Id: I8dcf6b29a5aecd445f1a3ddb06386cf81dbc9c70