summaryrefslogtreecommitdiffstats
path: root/dex2oat
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix 2 new sets of clang compiler warnings.Ian Rogers2014-10-101-1/+2
| | | | | | | | | | | Fix issues that are flagged by -Wfloat-equal and -Wmissing-noreturn. In the case of -Wfloat-equal the current cases in regular code are deliberate, so the change is to silence the warning. For gtest code the appropriate fix is to switch from EXPECT_EQ to EXPECT_(FLOAT|DOUBLE)_EQ. The -Wmissing-noreturn warning isn't enabled due to a missing noreturn in gtest. This issue has been reported to gtest. Change-Id: Id84c70c21c542716c9ee0c41492e8ff8788c4ef8
* ART: Prepare for ELF64.Tong Shen2014-10-031-3/+2
| | | | | | Only expose necessary interface in ElfFile, and move all details into template class ElfFileImpl. Change-Id: I9df2bbc55f32ba0ba91f4f3d5d0009e84a2ddf74
* Implement method calls using relative BL on ARM.Vladimir Marko2014-09-251-123/+133
| | | | | | | | | | 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
* dex2oat should truncate files opened from file descriptorsBrian Carlstrom2014-09-231-0/+1
| | | | | | | | Bug: 17622827 (cherry picked from commit aa93129ca54cc897fdc2c8ddd0a7136f7b5632ed) Change-Id: I5467d488b4a57f7be35c72c16775df5bd5d69a52
* Merge "ART: Sync oat file to disk before patching"Andreas Gampe2014-09-171-0/+5
|\
| * ART: Sync oat file to disk before patchingAndreas Gampe2014-09-171-0/+5
| | | | | | | | | | | | | | | | Bug: 15567083, 17439961, 17510489, 17478752 (cherry picked from commit 035592c51fee2995a3d90a9043f91a7a3128df2b) Change-Id: I828dc6775044b5050c2520eb097abe6a920fd3ee
* | Add the "time" compilation filter and output compilation stats.Nicolas Geoffray2014-09-171-2/+11
|/ | | | | | | A "time" compiler filter means the compiler optimizes for compile time. Change-Id: Id1a207ceb2d95f3548aae5e45d51b80695da2029
* ART: Make elf loading not abortAndreas Gampe2014-09-151-0/+1
| | | | | | | | | | | | | | Changes elf_file code to use less CHECKs and instead return error values (usually nullptr). This avoids aborts. In oat_file, when loading an oat file fails, try to unlink at. If this succeeds, on the next run we may compile again. Bug: 17491333 (cherry picked from commit afa6b8e93a0dc0de33c9d404945c7c5621e20b1a) Change-Id: I50fdd2edacd86f25d4dacf2180ce2a6105eaf4af
* Increase dex2oat timeouts for debug buildsMathieu Chartier2014-09-091-4/+10
| | | | | | | | Should fix the 056-const-string-jumbo test. (cherry picked from commit 0bff4f375d8013a4a59cf70b3427fb461a17e6de) Change-Id: I38d03fa7f981f0c067c52782e57938bbcbabef17
* ART: Add capability for a pass to have optionsRazvan A Lupusoru2014-08-261-0/+19
| | | | | | | | | | | | | | | | | | | | | This patch adds capability to have pass options. These are needed when a pass has multiple flags that can be tweaked. The user is now allowed to pass those options via command line. Since passes are treated as singletons and they are immutable, the overridden options provided by user are set on the compilation unit. Doing this way also allows a selectivity system to tweak the option per compilation instead of doing it globally (due to the single pass existing). The following command line flags have been added: --print-pass-options - This prints all passes that have options along with their defaults. --pass-options= - This is used to pass the overridden options in format of PassName:PassOption:PassOptionSetting Change-Id: Ib5156f5d2ff51a0c64c4ea0fa050bd2170663417 Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com> Signed-off-by: Jean Christophe Beyler <jean.christophe.beyler@intel.com>
* Avoid use of std::string where we have const char*.Ian Rogers2014-08-121-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Turn on dex2oat watchdog on target"Andreas Gampe2014-08-091-1/+1
|\
| * ART: Turn on dex2oat watchdog on targetAndreas Gampe2014-07-171-1/+1
| | | | | | | | | | | | | | Activates the watchdog on device. Bug: 16364458 Change-Id: Id7c86f5a345da35b97bc7fa1a95c86e8685f8fcd
* | Add implicit checks for x86_64 architecture.Dave Allison2014-08-071-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This combines the x86 and x86_64 fault handlers into one. It also merges in the change to the entrypoints for X86_64. Replaces generic instruction length calculator with one that only works with the specific instructions we use. Bug: 16256184 Change-Id: I1e8ab5ad43f46060de9597615b423c89a836035c Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
* | Merge "AArch64: Implicit StackOverflow/NPE/Suspend checks."Dave Allison2014-08-061-0/+1
|\ \
| * | AArch64: Implicit StackOverflow/NPE/Suspend checks.Stuart Monteith2014-08-061-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | This implements implicit stack overflow checks and null pointer exceptions for AArch64. Suspend checks are implemented but not switched on yet. Change-Id: I2eb076f2c0c9d94793d5a898fea49cf409b4eb66 Signed-off-by: Stuart Monteith <stuart.monteith@arm.com>
* | | Merge "Fix art build script."Ian Rogers2014-08-061-2/+2
|\ \ \ | |/ / |/| |
| * | Fix art build script.Junmo Park2014-08-041-2/+2
| | | | | | | | | | | | | | | | | | | | | Use ART_BUILD_HOST_NDEBUG instead of ART_BUILD_NDEBUG. Change-Id: I1fcca4c52e79bad93dcdd750989f6223df2b0df4 Signed-off-by: Junmo Park <junmoz.park@samsung.com>
* | | ART: Fix memory unmapped twice issue in ElfFile::Load(bool)Jim_Guo2014-08-041-2/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Root Cause: The overlapped memory region will be unmapped by (1) ~MemMap() of reservation MemMap (reserve) and (2) ~MemMap() of "reuse" MemMap (segment). Someone takes the memory region after (1) and it will be unmapped in (2). So, SIGSEGV occurs when using the unmapped memory region. Solution: Fixes this issue by skip unmap "reuse" MemMap in destructor. And always create reservation MemMap before "reuse" MemMap. (It also solved the fixupELF case which does not reserve the whole needed memory region). Bug: 16486685 Change-Id: I8f2538861d5c3fa7b9a04d2c3f516319cc060291
* | Tweaks to patchoat and other related things.Alex Light2014-07-251-8/+0
| | | | | | | | | | | | | | | | | | Removed some flags from patchoat that were poorly specified and fixed some other issues with the relocation system. Bug: 15358152 Change-Id: Ia6d47b1a008f02373307d833ba45f00ea408d76f
* | Runtime can now be set to require relocationAlex Light2014-07-221-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-71/+22
|/ | | | | | | This reverts commit 0025a86411145eb7cd4971f9234fc21c7b4aced1. Bug: 16256184 Change-Id: Ie0760a0c293aa3b62e2885398a8c512b7a946a73
* Remove object_utils.h.Ian Rogers2014-07-161-1/+0
| | | | | | | | | 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-151-5/+6
| | | | | | | | 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
* Revert "Revert "ART: Key-Value Store in Oat header""Andreas Gampe2014-07-111-66/+93
| | | | | | | | | | | This reverts commit 452bee5da9811f62123978e142bd67b385e9ff82. Heap-allocate a couple of objects in dex2oat to avoid large frame size. Includes fixes originally in 100596 and 100605. Change-Id: Id51a44198c973c91f0a3f87b9d992a5dc110c6f8
* Add missing class initialization during compilation and testsSebastien Hertz2014-07-101-0/+1
| | | | | | | | | | | | | | | | | 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
* Revert "Add implicit null and stack checks for x86"Dave Allison2014-07-101-1/+0
| | | | | | | | It breaks cross compilation with x86_64. This reverts commit 34e826ccc80dc1cf7c4c045de6b7f8360d504ccf. Change-Id: I34ba07821fc0a022fda33a7ae21850957bbec5e7
* Add implicit null and stack checks for x86Dave Allison2014-07-091-0/+1
| | | | | | | | | | | This adds compiler and runtime changes for x86 implicit checks. 32 bit only. Both host and target are supported. By default, on the host, the implicit checks are null pointer and stack overflow. Suspend is implemented but not switched on. Change-Id: I88a609e98d6bf32f283eaa4e6ec8bbf8dc1df78a
* Revert "ART: Key-Value Store in Oat header"Nicolas Geoffray2014-07-091-67/+44
| | | | | | | | Broke arm64 build. This reverts commit c87d27b25994da8670d82a8f7bad6327b693bfff. Change-Id: I4c2ade295d2b5aa77fc3ad810e0e859629a5bf09
* ART: Key-Value Store in Oat headerAndreas Gampe2014-07-081-44/+67
| | | | | | | | | | | Allows the storage of string-string pairs in the oat header. The first significant use of this is storing the implicit-check flags, so that an oat file can be rejected if it doesn't agree with the current runtime. Bump the oat version as the header structure changes. Change-Id: I15a1c16886e6b8fa7b881c918c19c1efa5c7c00f
* Add patchoat tool to Art.Alex Light2014-07-071-13/+23
| | | | | | | | | | | | | Add a new executable called patchoat to art. This tool takes already compiled images and oat files and changes their base address, acting as a cheap form of relocation. Add a --include-patch-information flag to dex2oat and code to add required patch information to oat files created with the quick compiler. Bug: 15358152 Change-Id: Ie0c580db45bb14ec180deb84930def6c3628d97d
* Relax limits for profiler based compilation options.Calin Juravle2014-07-021-1/+1
| | | | Change-Id: I57a7b11588f5c5b5f12217239ecf58f59ae02e2b
* ART: Fix size error reported by ARM64 backendAndreas Gampe2014-07-011-1/+0
| | | | | | Also removes a spurious LOG in dex2oat. Change-Id: Ia264fbfb3cb8d59978f3a61e814eb6940e272ece
* Fixed gdb support and added some ElfFile functionsAlex Light2014-06-271-0/+2
| | | | | | | | | | | | | | | | | | Fixed gdb support so that it would continue working even when debug symbols or other sections are included in the elf file. Also made it actually read parts of the DWARF information so it should work even if there are minor changes to how and where DWARF information is written out. Added a dwarf.h file with the dwarf constants. Added a FindSectionByName function, a FindDynamicSymbol function, and the ability to specify the mmap protection and flags directly if we are mapping in the whole file. Modified elf_writer_quick.cc to use the dwarf constants from dwarf.h. Change-Id: I09e15c425fab252b331a2e4719863552e8b6b137
* Fix quick mode bugs for Mips.Douglas Leung2014-06-271-2/+2
| | | | | | | | | This patch enable quick mode for Mips and allows the emulator to boot. However the emulator is still not 100% functional. It still have problems launching some apps. Change-Id: Id46a39a649a2fd431a9f13b06ecf34cbd1d20930 Signed-off-by: Douglas Leung <douglas@mips.com>
* ART: Native support for multidexAndreas Gampe2014-06-251-11/+3
| | | | | | | | | | | | | | | | | | | | 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
* More advanced timing loggers.Mathieu Chartier2014-06-241-10/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new timing loggers have lower overhead since they only push into a vector. The new format has two types, a start timing and a stop timing. You can thing of these as brackets associated with a timestamp. It uses these to construct various statistics when needed, such as: Total time, exclusive time, and nesting depth. Changed PrettyDuration to have a default of 3 digits after the decimal point. Exaple of a GC dump with exclusive / total times and indenting: I/art (23546): GC iteration timing logger [Exclusive time] [Total time] I/art (23546): 0ms InitializePhase I/art (23546): 0.305ms/167.746ms MarkingPhase I/art (23546): 0ms BindBitmaps I/art (23546): 0ms FindDefaultSpaceBitmap I/art (23546): 0ms/1.709ms ProcessCards I/art (23546): 0.183ms ImageModUnionClearCards I/art (23546): 0.916ms ZygoteModUnionClearCards I/art (23546): 0.610ms AllocSpaceClearCards I/art (23546): 1.373ms AllocSpaceClearCards I/art (23546): 0.305ms/6.318ms MarkRoots I/art (23546): 2.106ms MarkRootsCheckpoint I/art (23546): 0.153ms MarkNonThreadRoots I/art (23546): 4.287ms MarkConcurrentRoots I/art (23546): 43.461ms UpdateAndMarkImageModUnionTable I/art (23546): 0ms/112.712ms RecursiveMark I/art (23546): 112.712ms ProcessMarkStack I/art (23546): 0.610ms/2.777ms PreCleanCards I/art (23546): 0.305ms/0.855ms ProcessCards I/art (23546): 0.153ms ImageModUnionClearCards I/art (23546): 0.610ms ZygoteModUnionClearCards I/art (23546): 0.610ms AllocSpaceClearCards I/art (23546): 0.549ms AllocSpaceClearCards I/art (23546): 0.549ms MarkRootsCheckpoint I/art (23546): 0.610ms MarkNonThreadRoots I/art (23546): 0ms MarkConcurrentRoots I/art (23546): 0.610ms ScanGrayImageSpaceObjects I/art (23546): 0.305ms ScanGrayZygoteSpaceObjects I/art (23546): 0.305ms ScanGrayAllocSpaceObjects I/art (23546): 1.129ms ScanGrayAllocSpaceObjects I/art (23546): 0ms ProcessMarkStack I/art (23546): 0ms/0.977ms (Paused)PausePhase I/art (23546): 0.244ms ReMarkRoots I/art (23546): 0.672ms (Paused)ScanGrayObjects I/art (23546): 0ms (Paused)ProcessMarkStack I/art (23546): 0ms/0.610ms SwapStacks I/art (23546): 0.610ms RevokeAllThreadLocalAllocationStacks I/art (23546): 0ms PreSweepingGcVerification I/art (23546): 0ms/10.621ms ReclaimPhase I/art (23546): 0.610ms/0.702ms ProcessReferences I/art (23546): 0.214ms/0.641ms EnqueueFinalizerReferences I/art (23546): 0.427ms ProcessMarkStack I/art (23546): 0.488ms SweepSystemWeaks I/art (23546): 0.824ms/9.400ms Sweep I/art (23546): 0ms SweepMallocSpace I/art (23546): 0.214ms SweepZygoteSpace I/art (23546): 0.122ms SweepMallocSpace I/art (23546): 6.226ms SweepMallocSpace I/art (23546): 0ms SweepMallocSpace I/art (23546): 2.144ms SweepLargeObjects I/art (23546): 0.305ms SwapBitmaps I/art (23546): 0ms UnBindBitmaps I/art (23546): 0.275ms FinishPhase I/art (23546): GC iteration timing logger: end, 178.971ms Change-Id: Ia55b65609468f212b3cd65cda66b843da42be645
* Fixed ImageWriter timings not being written out.Alex Light2014-06-241-0/+1
| | | | | | | During host runs of dex2oat the timings for ImageWriter would not be written out. Change-Id: I74ce8bae724d1e732a6a1efb1c82804473081693
* Fix implicit check option handling for non-cross-compilesDave Allison2014-06-231-2/+14
| | | | | | | | This fixes an issue where the compiler was not being told to generate implicit checks but the runtime was expecting them. Bug: 15747876 Change-Id: I65e7475bac245c44d5094eb666d67bc1af327ab1
* Merge "Use command line android root in dex2oat to find image."Ian Rogers2014-06-211-1/+1
|\
| * Use command line android root in dex2oat to find image.Ian Rogers2014-06-131-1/+1
| | | | | | | | Change-Id: I20a025e07da3792131d7126ef0e5863b923c794b
* | Quick compiler: enable Arm64 compilationbuzbee2014-06-201-3/+2
| | | | | | | | Change-Id: I19058defaff1c60b4b6b4d1ad82e0a42d50506a6
* | Merge "x86_64: Enable core.oat/boot.oat compilation"Bill Buzbee2014-06-191-2/+1
|\ \
| * | x86_64: Enable core.oat/boot.oat compilationDmitry Petrochenko2014-06-181-2/+1
| | | | | | | | | | | | | | | | | | | | | This patch enabled compilation of image. Change-Id: Idacce4a3898964d3a05762925dba236d7254a254 Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com>
* | | ART: Implicit checks in the compiler are independent from RuntimeAndreas Gampe2014-06-181-1/+62
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | When cross-compiling, those flags are independent. This is an initial CL that helps bypass fatal failures when cross-compiling, as not all architectures support (and have turned on) implicit checks. The actual transport for the target architecture when it is different from the runtime needs to be implemented in a follow-up CL. Bug: 15703710 Change-Id: Idc881a9a4abfd38643b862a491a5af9b8841f693
* | Arm64 hard-floatbuzbee2014-06-161-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Basic enabling of hard-float for Arm64. In future CLs we'll consolidate the various targets - there is a lot of overlap. Compilation remains turned off in this CL, but I expect to enable a subset shortly. With compilation fully enabled (including the EXPERIMENTAL opcodes with the exception of REM and THROW), we get the following run-test results: 003-omnibus-opcode failures: Classes.checkCast Classes.arrayInstance UnresTest2 Haven't gone deep, but these appear to be related to throw/catch and/or stacktrace. For REM, the generated code looks reasonable to me - my guess is that we've got something wrong on the transition to the runtime. Haven't looked deeper yet, though. The bulk of the other failure also appear to be related to transitioning to the runtime system, or handling try/catch. run-test status: Status with optimizations disabled, REM_FLOAT/DOUBLE and THROW disabled: succeeded tests: 94 failed tests: 22 failed: 003-omnibus-opcodes failed: 004-annotations failed: 009-instanceof2 failed: 024-illegal-access failed: 025-access-controller failed: 031-class-attributes failed: 044-proxy failed: 045-reflect-array failed: 046-reflect failed: 058-enum-order failed: 062-character-encodings failed: 063-process-manager failed: 064-field-access failed: 068-classloader failed: 071-dexfile failed: 083-compiler-regressions failed: 084-class-init failed: 086-null-super failed: 087-gc-after-link failed: 100-reflect2 failed: 107-int-math2 failed: 201-built-in-exception-detail-messages Change-Id: Ib66209285cad8998d77a14781de300af02a96b15
* | Merge "x86_64: Enable compilation"Ian Rogers2014-06-121-1/+1
|\ \
| * | x86_64: Enable compilationDmitry Petrochenko2014-06-131-1/+1
| |/ | | | | | | | | | | | | | | This patch enables compilation of all methods for x86_64 except image. Change-Id: Ie210809f2595cc25da688a4ad0363c258bcf8233 Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com>
* / Optionally add debug symbols to ELF files made by quick compiler.Alex Light2014-06-121-9/+23
|/ | | | | | | | | | | | | | | Added debug symbols to ELF files created by dex2oat using the quick compiler. Adds two flags --include-debug-symbols and --no-include-debug-symbols for dex2oat that control the inclusion of these debug symbols. Debug info is added by default if kIsDebugBuild is true. Fixed bug where Intel DWARF information would not correctly deal with deduplicated code the binary. Changed the portable compiler code path in dex2oat.cc so that symbols will not be stripped when run with --include-debug-symbols. Change-Id: Ia2eb2f654dedf0e5e8606f7744e05b8d14155fb1
* Remove deprecated WITH_HOST_DALVIK.Ian Rogers2014-06-101-8/+6
| | | | | | | | | | | | | | | | | | | | | | | Bug: 13751317 Fix the Mac build: - disable x86 selector removal that causes OS/X 10.9 kernel panics, - madvise don't need does zero memory on the Mac, factor into MemMap routine, - switch to the elf.h in elfutils to avoid Linux kernel dependencies, - we can't rely on exclusive_owner_ being available from other pthread libraries so maintain our own when futexes aren't available (we can't rely on the OS/X 10.8 hack any more), - fix symbol naming in assembly code, - work around C library differences, - disable backtrace in DumpNativeStack to avoid a broken libbacktrace dependency, - disable main thread signal handling logic, - align the stack in stub_test, - use $(HOST_SHLIB_SUFFIX) rather than .so in host make file variables. Not all host tests are passing on the Mac with this change. dex2oat works as does running HelloWorld. Change-Id: I5a232aedfb2028524d49daa6397a8e60f3ee40d3