summaryrefslogtreecommitdiffstats
path: root/compiler/driver
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite class initialization check elimination.Vladimir Marko2014-10-273-27/+49
| | | | | | | | Split the notion of type being in dex cache away from the class being initialized. Include static invokes in the class initialization elimination pass. Change-Id: Ie3760d8fd55b987f9507f32ef51456a57d79e3fb
* C++11 related clean-up of DISALLOW_..Ian Rogers2014-10-222-14/+0
| | | | | | | | | | | | | | | | | | Move DISALLOW_COPY_AND_ASSIGN to delete functions. By no having declarations with no definitions this prompts better warning messages so deal with these by correcting the code. Add a DISALLOW_ALLOCATION and use for ValueObject and mirror::Object. Make X86 assembly operand types ValueObjects to fix compilation errors. Tidy the use of iostream and ostream. Avoid making cutils a dependency via mutex-inl.h for tests that link against libart. Push tracing dependencies into appropriate files and mutex.cc. x86 32-bit host symbols size is increased for libarttest, avoid copying this in run-test 115 by using symlinks and remove this test's higher than normal ulimit. Fix the RunningOnValgrind test in RosAllocSpace to not use GetHeap as it returns NULL when the heap is under construction by Runtime. Change-Id: Ia246f7ac0c11f73072b30d70566a196e9b78472b
* Tidy up logging.Ian Rogers2014-10-221-36/+53
| | | | | | | | | | | | | | | | | Move gVerboseMethods to CompilerOptions. Now "--verbose-methods=" option to dex2oat rather than runtime argument "-verbose-methods:". Move ToStr and Dumpable out of logging.h, move LogMessageData into logging.cc except for a forward declaration. Remove ConstDumpable as Dump methods are all const (and make this so if not currently true). Make LogSeverity an enum and improve compile time assertions and type checking. Remove log_severity.h that's only used in logging.h. With system headers gone from logging.h, go add to .cc files missing system header includes. Also, make operator new in ValueObject private for compile time instantiation checking. Change-Id: I3228f614500ccc9b14b49c72b9821c8b0db3d641
* Enable generic JNI for x86 and ARM when interpret-only.Ian Rogers2014-10-211-1/+15
| | | | Change-Id: I006ce1ce74acd0f0d53d380e28e409d24d772ea3
* Merge "Some code clean-up."Ian Rogers2014-10-172-2/+2
|\
| * Some code clean-up.Ian Rogers2014-10-162-2/+2
| | | | | | | | Change-Id: I4b745fd5298cd61c793e3b57514b48347bd66c0e
* | Merge "dex2oat: Add a --compile-pic option"Igor Murashkin2014-10-174-16/+52
|\ \ | |/ |/|
| * dex2oat: Add a --compile-pic optionIgor Murashkin2014-10-164-16/+52
| | | | | | | | Change-Id: I80e03613e3b6ac079bcbc7e068bbaae760c364c9
* | Make ART compile with GCC -O0 again.Ian Rogers2014-10-162-4/+4
|/ | | | | | | | | | | | | Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on architecture. Add to instruction_set_test to warn when InstructionSetFeatures don't agree with ones from system properties, AT_HWCAP and /proc/cpuinfo. Clean-up class linker entry point logic to not return entry points but to test whether the passed code is the particular entrypoint. This works around image trampolines that replicate entrypoints. Bug: 17993736 Change-Id: I5f4b49e88c3b02a79f9bee04f83395146ed7be23
* stdint types all the way!Ian Rogers2014-10-091-3/+3
| | | | Change-Id: I4e4ef3a2002fc59ebd9097087f150eaf3f2a7e08
* ART: Deprecate CompilationUnit's code_itemRazvan A Lupusoru2014-09-291-12/+0
| | | | | | | | | | | | | | | The code_item field is tracked in both the CompilationUnit and the MIRGraph. However, the existence of this field in CompilationUnit promotes bad practice because it creates assumption only a single code_item can be part of method. This patch deprecates this field and updates MIRGraph methods to make it easy to get same information as before. Part of this is the update to interface GetNumDalvikInsn which ensures to count all code_items in MIRGraph. Some dead code was also removed because it was not friendly to these updates. Change-Id: Ie979be73cc56350321506cfea58f06d688a7fe99 Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
* Implement method calls using relative BL on ARM.Vladimir Marko2014-09-252-310/+20
| | | | | | | | | | Store the linker patches with each CompiledMethod instead of keeping them in CompilerDriver. Reorganize oat file creation to apply the patches as we're writing the method code. Add framework for platform-specific relative call patches in the OatWriter. Implement relative call patches for ARM. Change-Id: Ie2effb3d92b61ac8f356140eba09dc37d62290f8
* Add ScopedAssertNoThreadSuspensionMathieu Chartier2014-09-191-6/+3
| | | | | | | | Added a new class, ScopedAssertNoThreadSuspension. Deleted some unnecessary ScopedAssertNoThreadSuspension since VisitObjects already has a ScopedAssertNoThreadSuspension. Change-Id: I29ec0006120c39a27184d30e2d1d0c179e203776
* Merge "Add the "time" compilation filter and output compilation stats."Nicolas Geoffray2014-09-171-1/+2
|\
| * Add the "time" compilation filter and output compilation stats.Nicolas Geoffray2014-09-171-1/+2
| | | | | | | | | | | | | | A "time" compiler filter means the compiler optimizes for compile time. Change-Id: Id1a207ceb2d95f3548aae5e45d51b80695da2029
* | Implement invoke virtual in optimizing compiler.Nicolas Geoffray2014-09-171-1/+1
| | | | | | | | | | | | | | Also refactor 004 tests to make them work with both Quick and Optimizing. Change-Id: I87e275cb0ae0258fc3bb32b612140000b1d2adf8
* | ART: Check for exceptions from unresolved classesAndreas Gampe2014-09-161-2/+5
|/ | | | | | | | | In no-verify mode, classes may be unresolved because of missing dependencies. Ignore and clear the exception. Bug: 17506140 Change-Id: I70602b089e6631b1e177dbe8316c5fefdaf777a0 (cherry picked from commit ba354a97a9742774f57bad7f96ccae2dbbd59f75)
* ART: Rename Handle hierarchyAndreas Gampe2014-09-151-3/+3
| | | | | | | Bring the names in line with normal OO principles: ConstHandle becomes Handle, and Handle becomes MutableHandle. Change-Id: I0f018eb7ba28bc422e3a23dd73a6cbe6fc2d2044
* ART: Allow quickening in the boot imageAndreas Gampe2014-09-152-67/+127
| | | | | | | | | | | | | | Update the class linker to accept class status from the boot image in compiler mode. Update compiler driver to allow quickening for boot image classes. Update method verifier to accept quickened instructions in compiler mode when we just want to dump. Update oatdump to the new verifier API. Bug: 17316928 (cherry picked from commit 35439baf287b291b67ee406308e17fc6194facbf) Change-Id: I9ef1bfd78b0d93625b89b3d662131d7d6e5f2903
* ART: Change access flag behavior in verifierAndreas Gampe2014-09-151-3/+3
| | | | | | | | | | Note: this moves the miranda modifier to the upper 16 bit. Bug: 16161620 (cherry picked from commit 7fc8f90b7160e879143be5cfd6ea3df866398884) Change-Id: I2f591d53b7d1559171e70aaaf22225d94b4882f5
* Compile time performance improvements focusing on interpret-only.Ian Rogers2014-09-121-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce virtual method dispatch in the method verifier and make more code inline-able. Add a StringPiece with const char* equality operator to avoid redundant StringPieces and strlens. Remove back link from register line to verifier and pass as argument to reduce size of RegisterLine. Remove instruction length from instruction flags and compute from the instruction, again to reduce size. Add suspend checks to resolve and verify to allow for more easy monitor inflation and reduce contention on Locks::thread_list_suspend_thread_lock_. Change ThrowEarlierClassFailure to throw pre-allocated exception. Avoid calls to Thread::Current() by passing self. Template specialize IsValidClassName. Make ANR reporting with SIGQUIT run using checkpoints rather than suspending all threads. This makes the stack/lock analysis less lock error prone. Extra Barrier assertions and condition variable time out is now returned as a boolean both from Barrier and ConditionVariable::Wait. 2 threaded host x86-64 interpret-only numbers from 341 samples: Before change: Avg 176.137ms 99% CI 3.468ms to 1060.770ms After change: Avg 139.163% 99% CI 3.027ms to 838.257ms Reduction in average compile time after change is 20.9%. Slow-down without change is 26.5%. Bug: 17471626 - Fix bug where RegTypeCache::JavaLangObject/String/Class/Throwable could return unresolved type when class loading is disabled. Bug: 17398101 Change-Id: Id59ce3cc520701c6ecf612f7152498107bc40684
* ART: Fix things for valgrindAndreas Gampe2014-09-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | Wire up valgrind gtests. Add valgrind-test-art-host, currently only depending on valgrind-test-art-host-gtest32. Fix an Alloc setting to allow running valgrind. Refactor the fault handler to manage (and correctly release) the handlers. Fix minor failure-case leaks exposed by tests. Failing tests: The optimizing compiler is leaking non-arena-ed structures (e.g., assembler buffers), as code generators are not destroyed. The solution has been moved to a follow-up CL. Note: All 64b tests are failing as we cannot allocate a heap. Change-Id: I7f854cfd098d9f68107ce492363e7dba9a82b9fa
* Merge "ART fix oat debug source map operations"Vladimir Marko2014-09-031-3/+3
|\
| * ART fix oat debug source map operationsYevgeny Rouban2014-08-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several places need to be fixed in OAT debug source map generation (see comments in https://android-review.googlesource.com/#/c/102610/19/compiler/compiled_method.h): 1. Source Maps are deduplicated in Compiler Driver by implicit conversion SrcMapElems to bytes. This implies incorrect operator==. 2. SrcMapElem operator < is peculiar, and cannot be applied to SrcMapElems with negative to_ fields 3. SrcMap.Arrange method is not elegant The fix is to introduce explicit conversion from SrcMapElem to one signed 64-bit value, which is used as a base of two new operators < and ==. They are correct and intuitive. DedupeHashFunc is changed to explicitly convert array elements to byte, so the explicit type conversion from SrcMapElem to byte is used. Minor fix: In Line Table Programs the file index set command is generated only if the index gets new value. Change-Id: I5e2c03404a437254fc2db3485b22bfc1799b39b7 Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
* | Reduce and speed-up class def searches.Ian Rogers2014-09-021-111/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the class linker for descriptor lookups from the compile driver so that dex caches are populated. Reduce the scope of functions for scanning class paths to just the class linker where they are performed. If we see more than a threshold number of find class def misses on a dex file lazily compute an index, so that future lookups are constant time (part of the collection code is taken from https://android-review.googlesource.com/#/c/103865/3). Note that we take a lazy approach so that we don't serialize on loading dex files, this avoids the reason the index was removed in 8b2c0b9abc3f520495f4387ea040132ba85cae69. Remove an implicit and unnecessary std::string creation for PrintableString. Single threaded interpret-only dex2oat performance is improved by roughly 10%. Bug: 16853450 Change-Id: Icf72df76b0a4328f2a24075e81f4ff267b9401f4
* | Reduce interpret-only compile time.Mathieu Chartier2014-08-261-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: 39.04user 5.18system 0:29.24elapsed 151%CPU (0avgtext+0avgdata 164176maxresident)k 38.87user 5.16system 0:29.14elapsed 151%CPU (0avgtext+0avgdata 164144maxresident)k After: 36.26user 3.25system 0:27.00elapsed 146%CPU (0avgtext+0avgdata 162592maxresident)k 36.25user 3.28system 0:26.28elapsed 150%CPU (0avgtext+0avgdata 162688maxresident)k Disabled implicit stack protection for the compiler, this reduces page faults. Added support for not timing every method compilation and verification. NanoTime is slow and adds ~2 seconds of real time. This is currently enabled since people want to know which methods are slow to compile. Bug: 16853450 Change-Id: I349ffb3f36db8c437137387aa6914dc17d743f09
* | CheckAndClearResolveException should allow LinkageErrorBrian Carlstrom2014-08-251-1/+2
|/ | | | | | | | Bug: 16565964 (cherry picked from commit 118785c6f82ac1ec7074b5efe367b3dafd904940) Change-Id: I7bc170e7a9ee9bd19defdd20187ee36a2381bf5d
* ART: Clean up compilerAndreas Gampe2014-08-223-15/+2
| | | | | | | Clean up the compiler: less extern functions, dis-entangle compilers, hide some compiler specifics, lower global includes. Change-Id: Ibaf88d02505d86994d7845cf0075be5041cc8438
* Merge "ART: Avoid expensive class lookup in compiler driver"Andreas Gampe2014-08-161-1/+7
|\
| * ART: Avoid expensive class lookup in compiler driverAndreas Gampe2014-08-181-1/+7
| | | | | | | | | | | | | | | | | | | | | | When we are not compiling multidex, avoid an expensive by-descriptor lookup for classes when deciding whether to skip compilation. Bug: 17072698 (cherry picked from commit d84f916d35bb0dc74d7daa075b883e5ee1ce1109) Change-Id: I19bcb2a2928207fcae0badd466cdc52945bd37c4
* | ART source line debug info in OAT filesYevgeny Rouban2014-08-152-7/+16
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | OAT files have source line information enough for ART runtime needs like jump to/from interpreter and thread suspension. But this information is not enough for finer grained source level debugging and low-level profiling (VTune or perf). This patch adds to OAT files two additional sections: .debug_line - DWARF formatted Elf32 section with detailed source line information (mapping from native PC to Java source lines). In addition to the debugging symbols added using the dex2oat option --include-debug-symbols, the source line information is added to the section .debug_line. The source line info can be read by many Elf reading tools like objdump, readelf, dwarfdump, gdb, perf, VTune, ... gdb can use this debug line information in x86. In 64-bit mode the information can be used if the oat file is mapped in the lower address space (address has higher 32 bits zeroed). Relocation works. Testing: 1. art/test/run-test --host --gdb [--64] 001-HelloWorld 2. in gdb: break Main.java:19 3. in gdb: break Runtime.java:111 4. in gdb: run - stops at void java.lang.Runtime.<init>() 5. in gdb: backtrace - shows call stack down to main() 6. in gdb: continue - stops at void Main.main() (only in 32-bit mode) 7. in gdb: backtrace - shows call stack down to main() 8. objdump -W <oat-file> - addresses are from VMA range of .text section reported by objdump -h <file> 9. dwarfdump -ka <oat-file> - no errors expected Size of aosp-x86-eng boot.oat increased by 11% from 80.5Mb to 89.2Mb with two sections added .debug_line (7.2Mb) and .rel.debug (1.5Mb). Change-Id: Ib8828832686e49782a63d5529008ff4814ed9cda Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
* Merge "Move explicit GC after we are done initalizing all classes."Mathieu Chartier2014-08-141-4/+4
|\
| * Move explicit GC after we are done initalizing all classes.Mathieu Chartier2014-08-111-4/+4
| | | | | | | | | | | | | | | | | | Previously we had the GC happen for each dex file, this added a few seconds of time on boot.oat creation. Bug: 16853450 Change-Id: I6b78c8c6f6c3bc20c164d951f2af8efbff0b8600
* | Avoid use of std::string where we have const char*.Ian Rogers2014-08-122-28/+47
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | Removing the ClassHelper caused std::string creation for all calls to Class::GetDescriptor and a significant performance regression. Make the std::string an out argument so the caller can maintain it and its life time while allowing GetDescriptor to return the common const char* case. Don't generate GC maps when compilation is disabled. Remove other uses of std::string that are occuring on critical paths. Use the cheaper SkipClass in CompileMethod in CompilerDriver. Specialize the utf8 as utf16 comparison code for the common shorter byte encoding. Force a bit of inlining, remove some UNLIKELYs (they are prone to pessimizing code), add some LIKELYs. x86-64 host 1-thread interpret-only of 57 apks: Before: 29.539s After: 23.467s Regular compile: Before: 1m35.347s After: 1m20.056s Bug: 16853450 Change-Id: Ic705ea24784bee24ab80084d06174cbf87d557ad
* Merge "ART: Add guards to the dex cache and its shortcuts"Andreas Gampe2014-08-061-2/+6
|\
| * ART: Add guards to the dex cache and its shortcutsAndreas Gampe2014-08-061-2/+6
| | | | | | | | | | | | | | | | Do not return fields, methods or classes if the (declaring) class is erroneous. Bug: 16692788 Change-Id: If43c2414ad0eb22db5eba7cf66396c7f16c26597
* | Merge "Added support for patching classes from different dex files."Mathieu Chartier2014-08-062-1/+53
|\ \
| * | Added support for patching classes from different dex files.Fred Shih2014-08-062-1/+53
| |/ | | | | | | | | | | | | | | | | Added support for class patching from different dex files and moved ScopedObjectAccess from the quick compiler to driver. Slight refactoring for clarity. Bug: 16656190 Change-Id: I107fcbce75db42ca61321ea1c5d5f236680a1b3d
* | Merge "ART: Rework CFA frame initialization and writing code"Andreas Gampe2014-08-062-21/+0
|\ \
| * | ART: Rework CFA frame initialization and writing codeAndreas Gampe2014-08-062-21/+0
| |/ | | | | | | | | | | | | | | Move eh_frame initialization code and CFI writing code to elf_writer_quick to remove hard-wired dependencies on specific Quick-compiler backends. Change-Id: I27ee8ce7245da33a20c90e0086b8d4fd0a2baf4d
* | ART: Skip compiling redefined classes in appsAndreas Gampe2014-08-062-19/+52
|/ | | | | | | | If for an app a class is defined in more than one dex file, skip all classes after the first. Bug: 16057120 Change-Id: Ifd71e6f462fd691ee23724a001190e9175988069
* Make system use patchoat to relocate during runtime.Alex Light2014-08-051-2/+2
| | | | | | | | | | Change dalvik_system_DexFile.cc so that isDexOptNeededInternal will be able to indicate that a patchoat is required. Change default of relocate option to be on. Bug: 15358152 Change-Id: Ibe92d8b55a24bbf718b0416a21b76e5df7a2de26
* Merge "Set vtable in class object to null after linking."Mingyao Yang2014-07-221-2/+2
|\
| * Set vtable in class object to null after linking.Mingyao Yang2014-07-221-2/+2
| | | | | | | | | | | | | | | | This is follow-up work of embedding imt and vtable for faster interface/virtual call dispatching. Once vtable becomes embedded, the original vtable is nulled. Change-Id: I307696657d1e283654169dbecb8f7815c42bbabc
* | Runtime can now be set to require relocationAlex Light2014-07-221-10/+21
|/ | | | | | | | | | | | | | 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
* Revert "Revert "Revert "Revert "Add implicit null and stack checks for x86""""Dave Allison2014-07-161-24/+24
| | | | | | | This reverts commit 0025a86411145eb7cd4971f9234fc21c7b4aced1. Bug: 16256184 Change-Id: Ie0760a0c293aa3b62e2885398a8c512b7a946a73
* Remove object_utils.h.Ian Rogers2014-07-162-4/+2
| | | | | | | | | Break into object_lock, field_helper and method_helper. Clean up header files following this. Also tidy some of the Handle code in response to compiler errors when resolving the changes in this CL. Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
* Break apart header files.Ian Rogers2014-07-152-62/+2
| | | | | | | | 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
* Support fields in optimizing compiler.Nicolas Geoffray2014-07-143-18/+38
| | | | | | | | - Required support for temporaries, to be only used by baseline compiler. - Also fixed a few invalid assumptions around locations and instructions that don't need materialization. These instructions should not have an Out. Change-Id: Idc4a30dd95dd18015137300d36bec55fc024cf62
* Improve performance of invokevirtual/invokeinterface with embedded imt/vtableMingyao Yang2014-07-113-1/+4
| | | | | | | | | Add an embedded version of imt/vtable into class object. Both tables start at fixed offset within class object so method/entry point can be loaded directly from class object for invokeinterface/invokevirtual. Bug: 8142917 Change-Id: I4240d58cfbe9250107c95c0708c036854c455968