summaryrefslogtreecommitdiff
path: root/compiler/compiler.h
AgeCommit message (Collapse)Author
2020-06-18Introduce an enum for the compilation kind.Nicolas Geoffray
Test: test.py Change-Id: I5329e50a6b4521933b6b171c8c0fbc618c3f67cd
2019-06-10Pass the memory region to allocate into to the compiler / allocation.Nicolas Geoffray
Test: test.py Bug: 119800099 Change-Id: Ie3cba5abe3dd4f8756af5ecfd6c26320de314fe8
2019-02-20ART: Reduce dependencies on CompilerDriver.Vladimir Marko
Preparation for moving CompilerDriver and other stuff from libart-compiler.so to dex2oat. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Change-Id: Ic221ebca4b8c79dd1549316921ace655f2e3f0fe
2019-01-02ART: Move dex structs into own headerAndreas Gampe
Separating out the structs from DexFile allows them to be forward- declared, which reduces the need to include the dex_file header. Bug: 119869270 Test: m Change-Id: I32dde5a632884bca7435cd584b4a81883de2e7b4
2018-10-10Introduce a 'baseline' variant for the compiler.Nicolas Geoffray
Implemented as a stripped down version of the optimizing compiler, not running any optimization. Adjust code to still work with expectations in code generators. bug: 111397239 Test: test.py --baseline Change-Id: I4328283825f9a890616e7496ed4c1e77d6bcc5dd
2018-06-25ART: Move CopyOption to OatWriterAndreas Gampe
All the code has moved. Move the enum to where it's used. Test: mmma art Change-Id: Ia5d412acd1240365e74059681dbe8f62502382aa
2018-03-05Move most of runtime/base to libartbase/baseDavid Sehr
Enforce the layering that code in runtime/base should not depend on runtime by separating it into libartbase. Some of the code in runtime/base depends on the Runtime class, so it cannot be moved yet. Also, some of the tests depend on CommonRuntimeTest, which itself needs to be factored (in a subsequent CL). Bug: 22322814 Test: make -j 50 checkbuild make -j 50 test-art-host Change-Id: I8b096c1e2542f829eb456b4b057c71421b77d7e2
2018-02-28Revert "Revert "Full-stack integrity: check vdex contents.""Nicolas Geoffray
bug: 30972906 Initial revert due to 'check' file of the test needing updating for target tests. This reverts commit a19b7649faf8780737be7ce3ec48a12d81c6d69f. Change-Id: I455780bd88cd89ff80c9084d399e2beeb819b95f
2018-02-27Revert "Full-stack integrity: check vdex contents."Nicolas Geoffray
bug: 30972906 Test fails on device. This reverts commit d6f914ea4bd09f2d60db2783f7a3fd93d3ec0afb. Change-Id: I53902b0d6d4dbe8237f61bf01542acf538229c71
2018-02-27Full-stack integrity: check vdex contents.Nicolas Geoffray
For priv-apps, if a vdex on /data has dex code, it must be because the APK has compressed dex code. Fall back to APK if not. For test convenience, update --copy-dex-files to also take a "always" variant. bug: 30972906 Test: 677-fsi Change-Id: I49f0eab46650145316a86de2971a3b9c140bcff7
2018-01-05Create dex subdirectoryDavid Sehr
Move all the DexFile related source to a common subdirectory dex/ of runtime. Bug: 71361973 Test: make -j 50 test-art-host Change-Id: I59e984ed660b93e0776556308be3d653722f5223
2017-11-15Use intrinsic codegen for compiling intrinsic methods.Vladimir Marko
When compiling an intrinsic method, generate a graph that invokes the same method and try to compile it. If the call is actually intrinsified (or simplified to other HIR) and yields a leaf method, use the result of this compilation attempt, otherwise compile the actual code or JNI stub. Note that CodeGenerator::CreateThrowingSlowPathLocations() actually marks the locations as kNoCall if the throw is not in a catch block, thus considering some throwing methods (for example, String.charAt()) as leaf methods. We would ideally want to use the intrinsic codegen for all intrinsics that do not generate a slow-path call to the default implementation. Relying on the leaf method is suboptimal as we're missing out on methods that do other types of calls, for example runtime calls. This shall be fixed in a subsequent CL. Test: m test-art-host-gtest Test: testrunner.py --host --optimizing Bug: 67717501 Change-Id: I640fda7c22d4ff494b5ff77ebec3b7f5f75af652
2017-11-10Merge "Record @{Fast,Critical}Native in method's access flags."Vladimir Marko
2017-11-10Record @{Fast,Critical}Native in method's access flags.Vladimir Marko
Repurpose the old kAccFastNative flag (which wasn't actually used for some time) and define a new kAccCriticalNative flag to record the native method's annotation-based kind. This avoids repeated determination of the kind from GenericJNI. And making two transitions to runnable and back (using the ScopedObjectAccess) from GenericJniMethodEnd() for normal native methods just to determine that we need to transition to runnable was really weird. Since the IsFastNative() function now records the presence of the @FastNative annotation, synchronized @FastNative method calls now avoid thread state transitions. When initializing the Runtime without a boot image, the WellKnowClasses may not yet be initialized, so relax the DCheckNativeAnnotation() to take that into account. Also revert https://android-review.googlesource.com/509715 as the annotation checks are now much faster. Bug: 65574695 Bug: 35644369 Test: m test-art-host-gtest Test: testrunner.py --host Change-Id: I2fc5ba192b9ce710a0e9202977b4f9543e387efe
2017-11-08cpplint: Cleanup errorsIgor Murashkin
Cleanup errors from upstream cpplint in preparation for moving art's cpplint fork to upstream tip-of-tree cpplint. Test: cd art && mm Bug: 68951293 Change-Id: I15faed4594cbcb8399850f8bdee39d42c0c5b956
2017-07-24ART: Include cleanupAndreas Gampe
Let clang-format reorder the header includes. Derived with: * .clang-format: BasedOnStyle: Google IncludeIsMainRegex: '(_test|-inl)?$' * Steps: find . -name '*.cc' -o -name '*.h' | xargs sed -i.bak -e 's/^#include/ #include/' ; git commit -a -m 'ART: Include cleanup' git-clang-format -style=file HEAD^ manual inspection git commit -a --amend Test: mmma art Change-Id: Ia963a8ce3ce5f96b5e78acd587e26908c7a70d02
2017-07-19Pass the logger to the JIT compiler.Nicolas Geoffray
To avoid effects of concurrent method entrypoints update, just pass the logger to the JIT compiler, which will invoke it directly with the pointer to the newly allocated code. Test: test.py --trace Change-Id: I5fbcd7cbc948b7d46c98c1545d6e530fb1190602
2017-05-30ART: Add missing namespace commentsAndreas Gampe
Add closing namespace comments. Bug: 32619234 Test: m Change-Id: I1f50e09dcd1038c4b540b87e5c19e319c1f592e4
2017-03-14Revert^6 "Hash-based dex cache type array."Vladimir Marko
Fixed ImageWriter to write class table also if it contains only boot class loader classes. Added a regression test and added extra checks for debug-build to verify that dex cache types from app image are also in the class table. Removed some unnecessary debug output. Test: 158-app-image-class-table Bug: 34839984 Bug: 30627598 Bug: 34659969 This reverts commit 0b66d6174bf1f6023f9d36dda8538490b79c2e9f. Change-Id: I6a747904940c6ebc297f4946feef99dc0adf930c
2017-03-13Revert^5 "Hash-based dex cache type array."Vladimir Marko
For app images, ImageWriter does not add boot image classes to the app image class table even though it keeps them in the dex caches. The reason for that is unknown, the code looks OK. Bug: 34839984 Bug: 30627598 Bug: 34659969 Also reverts "Improve debugging output for a crash." This reverts commits bfb80d25eaeb7a604d5dd25a370e3869e96a33ab, 8dd56fcb3196f466ecaffd445397cb11ef85f89f. Test: testrunner.py --host Change-Id: Ic8db128207c07588c7f11563208ae1e85c8b0e84
2017-02-20Revert^4 "Hash-based dex cache type array."Vladimir Marko
Added extra output to the abort message to collect more data when we hit the crash. Added extra check when loading an app image to verify that the class table isn't already broken. Test: testrunner.py --host Bug: 34839984 Bug: 30627598 Bug: 34659969 This reverts commit 5812e20ff7cbc8efa0b8d7486ada2f58840a6ad5. Change-Id: I9bb442a184c236dcb75b3e42a095f39cd6bee59d
2017-02-13Revert^3 "Hash-based dex cache type array."Mathieu Chartier
Assert failing for "earchbox:search": F zygote64: class_linker.cc:4612] Check failed: handle_scope_iface.Get() != nullptr Test: m test-art-host Bug: 34839984 Bug: 30627598 Bug: 34659969 This reverts commit 85c0f2ac03417f5125bc2ff1dab8109859c67d5c. Change-Id: I39846c20295af5875b0f945be7035c73ded23135
2017-02-10Revert^2 "Hash-based dex cache type array."Vladimir Marko
The reason for the revert was fixed by https://android-review.googlesource.com/332666 . We now enable clearing dex cache types in test 155 from that CL. Also avoid an unnecessary store in LookupResolvedTypes() and prevent verifier from messing up the dex cache types. Test: m test-art-host Bug: 34839984 Bug: 30627598 Bug: 34659969 This reverts commit d16363a93053de0f32252c7897d839a46aff14ae. Change-Id: Ie8603cfa772e78e648d005b0b6eae59062ae729d
2017-02-01Revert "Hash-based dex cache type array."Vladimir Marko
Reverting to work around some programs crashing with Check failed: handle_scope_iface.Get() != nullptr. though the reason for the failure not yet understood. Test: m test-art-host Bug: 34839984 Bug: 30627598 Bug: 34659969 Bug: 30419309 This reverts commit ec7862283dd49f5a58d0ac45960ce27c2f7671b8. Change-Id: Ifded663633082f1e59e5b6ff2e026dc559bd6b82
2017-01-30Hash-based dex cache type array.Vladimir Marko
Test: m test-art-host (Interpreter, Optimizing, JIT) Test: m test-art-target on Nexus 6P (Interpreter, Optimizing, JIT) Test: Nexus 6P boots Test: m valgrind-test-art-host Bug: 30627598 Bug: 34659969 Bug: 30419309 Change-Id: Ic00eda89e58088a3573fc9ec0ad04c0e69e161d1
2016-10-26Remove some unneeded header includesDavid Sehr
Bug: none Test: Builds still work Change-Id: I6c83326cc12aa0e7825312b238f5e0ae694ccffc
2016-09-14Separate annotations from dexfile reading.David Sehr
Bug: 22322814 Change-Id: I867d66da407dd80394a10d19903ebbc1ec3986ff Test: test-art
2016-09-09jni: Add @CriticalNative optimization to speed up JNI transitionsIgor Murashkin
Change-Id: I963059ac3a72dd8e6a867596c356d7062deb6da7
2016-08-30ART: SHARED_REQUIRES to REQUIRES_SHAREDAndreas Gampe
This coincides with the actual attribute name and upstream usage. Preparation for deferring to libbase. Test: m Test: m test-art-host Change-Id: Ia8986b5dfd926ba772bf00b0a35eaf83596d8518
2016-08-16jni: Fast path for @FastNative annotated java methodsIgor Murashkin
Adds a faster path for java methods annotated with dalvik.annotation.optimization.FastNative . Intended to replace usage of fast JNI (registering with "!(FOO)BAR" descriptors). Performance Microbenchmark Results (Angler): * Regular JNI cost in nanoseconds: 115 * Fast JNI cost in nanoseconds: 60 * @FastNative cost in nanoseconds: 36 Summary: Up to 67% faster (vs fast jni) JNI transition cost Change-Id: Ic23823ae0f232270c068ec999fd89aa993894b0e
2016-03-24Post-Quick cleanup: Remove CompilationUnit.Vladimir Marko
Change-Id: I309411b0fffaaed1e218e2c34394bdf6e2f75b48
2016-02-05Revert "Revert "Implement on-stack replacement for arm/arm64/x86/x86_64.""Nicolas Geoffray
This reverts commit bd89a5c556324062b7d841843b039392e84cfaf4. Change-Id: I08d190431520baa7fcec8fbdb444519f25ac8d44
2015-11-05Code cleanup to avoid CompilerDriver abstractions in JIT.Nicolas Geoffray
Avoids allocating a CompiledMethod. Change-Id: I35b4aa0d7c74daba68e827a01e71c300fce3b3bf
2015-10-15Use ATTRIBUTE_UNUSED more.Roland Levillain
Use it in lieu of UNUSED(), which had some incorrect uses. Change-Id: If247dce58b72056f6eea84968e7196f0b5bef4da
2015-09-03Reduce how often we call FindDexCacheMathieu Chartier
Before host boot.oat -j4 optimizing compile: real 1m17.792s user 3m26.140s sys 0m8.340s After: real 1m12.324s user 3m22.718s sys 0m8.320s Change-Id: If18e9e79e06cdf1676692e5efacb682bf93889c3
2015-08-12Remove unnecessary `explicit` qualifiers on constructors.Roland Levillain
Change-Id: Id12e392ad50f66a6e2251a68662b7959315dc567
2015-07-22Move to newer clang annotationsMathieu Chartier
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
2015-05-29Move mirror::ArtMethod to nativeMathieu Chartier
Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d
2015-04-10ART: Remove WriteElf from CompilerAndreas Gampe
As Portable is gone, we only have one elf_writer left. It also allows to put the decision for 32b vs 64b ELF into a central point. Change-Id: Iae67d06df85268b3f0ee5725abc65edd23eb2499
2015-04-07ART: Fix 64-bit ELF file supportAndreas Gampe
The API wasn't cross-compile-safe, 32-bit patchoat would fail for negative delta applied to a 64-bit ELF file. Add 64-bit ELF file output to the compilers, behind a flag, currently off by default (preserving current behavior). Bug: 20095017 Change-Id: I2cde7b4c7cc83413c76692d7b745868d644a604c
2015-01-27ART: Even more Quick cleanupAndreas Gampe
Remove Backend. Change-Id: I247cc65ccda6a362ba1a8f5e73e7f12ecd980a87
2014-12-17ART: Added Checker, a pattern matching test engineDavid Brazdil
This patch adds a Python script which implements a domain-specific mini-language similar to that of LLVM's FileCheck. It is primarily intended for writing tests for the optimizing compiler but could be configured for other use cases too. It is implemented from scratch in order to avoid dependency on LLVM. Checker tests are written in Java and dex2oat is invoked with a flag which dumps the CFG before and after each pass of the optimizing compiler. The output is then compared against assertions in the test's comments parsed by Checker. See comments in tools/checker.py for more details about the currently supported language features. This initial CL implements only one type of assertion - whether the output contains lines matching a desired pattern in the given order - but supports both plain text and regex matching and allows for equivalency testing by matching for the outcome of a previous match. See the tests in compiler/optimizing/test/ConstantFolding.java for examples. Change-Id: I1ad7431b399c38dc0391ccee74d2c643ba0b0675
2014-12-12Remove portable.Elliott Hughes
Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
2014-11-03Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.Ian Rogers
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
2014-10-31Support for CONST_STRING in optimizing compiler.Nicolas Geoffray
Change-Id: Iab8517bdadd1d15ffbe570010f093660be7c51aa
2014-08-22ART: Clean up compilerAndreas Gampe
Clean up the compiler: less extern functions, dis-entangle compilers, hide some compiler specifics, lower global includes. Change-Id: Ibaf88d02505d86994d7845cf0075be5041cc8438
2014-05-06Give Compiler a back reference to the driver.Ian Rogers
The compiler driver is a single object delegating work to the compiler, rather than passing it through to every Compiler call make it a member of Compiler so that it maybe queried. This simplifies the Compiler API and makes the relationship to CompilerDriver more explicit. Remove reference arguments that contravene code style. Change-Id: Iba47f2e3cbda679a7ec7588f26188d77643aa2c6
2014-04-29Force inlining on trivial accessors.Ian Rogers
Make volatility for GetFieldObject a template parameter. Move some trivial mirror::String routines to a -inl.h. Bug: 14285442 Change-Id: Ie23b11d4f18cb15a62c3bbb42837a8aaf6b68f92
2014-03-13Add command line support for enabling the optimizing compiler.Nicolas Geoffray
Also run tests with the optimizing compiler enabled when the file art/USE_OPTIMIZING_COMPILER is present. Change-Id: Ibc33eed62a43547bc3b9fe786d014c0d81b5add8