summaryrefslogtreecommitdiffstats
path: root/oatdump
Commit message (Collapse)AuthorAgeFilesLines
* Add support for .bss section in oat files.Vladimir Marko2015-03-021-0/+3
| | | | Change-Id: I779b80b8139d9afdc28373f8c68edff5df7726ce
* ART: oatdump enhancementsAnestis Bechtsoudis2015-02-251-46/+236
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New features list includes: - Class filter option to limit classes search space - Method filter is applied only against the method name, instead of the entire signature. Can be combined with class filter for maximum efficiency. - Bulk dump of class and method names list only. Can be combined with filters to limit results. - Export embedded dex files from input oat files to filesystem (symlinks not supported as utils functions are utilized for os & fs operations). - addr2instr option to locate the in-range method implementation and limit disassemble dumps. Input relative addr is added to oat executable offset to calculate the search offset. If method has been successfully located, code is dumped and program aborts further analysis of the input file. Methods located before the target address just print their signature, although skip all disassemble and other info. Calculated search offset is also printed as part of the initial header info. - Little-endian dex instructions bytecode is printed in the same line before the instruction string. Some minor re-orders have been also taken place for more targeted results. Change-Id: I3116ee3c99c258718f46faea8ea4295da6ae2bf7 Signed-off-by: Anestis Bechtsoudis <anestis@census-labs.com>
* Display optimizing compiler's CodeInfo objects in oatdump.Roland Levillain2015-02-191-27/+77
| | | | | | A few elements are not displayed yet (stack mask, inline info) though. Change-Id: I5e51a801c580169abc5d1ef43ad581aadc110754
* Use unique_ptr to track ownership of dex files.Richard Uhler2015-01-131-4/+8
| | | | | Bug: 18809837 Change-Id: Ie571eae8fc19ee9207390cff5c7e2a38071b126a
* ART: Fix oatdumpAndreas Gampe2014-12-171-2/+9
| | | | | | | | Refactor and modify cmdline.h to allow oatdump to run without a Runtime. Bug: 18789891 Change-Id: I1d7a1585e3672d04e58dbac9a4d4bd835c1c9143
* Add a new imgdiag tool to diff boot.art/core.art against a processIgor Murashkin2014-12-162-213/+140
| | | | | | | | | | | | | | 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
* Remove portable.Elliott Hughes2014-12-121-36/+8
| | | | Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
* Remove FieldHelper.Ian Rogers2014-12-021-32/+35
| | | | Change-Id: I2d74e2d5b3c35a691c95339de0db9361847fca11
* Delete ArtMethod gc_map_ fieldMathieu Chartier2014-11-241-12/+10
| | | | | | | | | | | Moved the gc_map field from OatMethod to OatQuickMethodHeader. Deleted the ArtMethod gc_map_ field. Bug: 17643507 Change-Id: Ifa0470c3e4c2f8a319744464d94c6838b76b3d48 (cherry picked from commit 807140048f82a2b87ee5bcf337f23b6a3d1d5269)
* Fix oatdump to use OatHeader pointer sizeMathieu Chartier2014-11-211-11/+24
| | | | | | | Bug: 18473190 Change-Id: If505b4f62105899f4f1257d3bccda3e6eb0dcd7c (cherry picked from commit c934e483ceabbd589422beea1fa35f5182ecfa99)
* Merge "Improvements to the ARM64 disassembler."Ian Rogers2014-11-191-1/+2
|\
| * Improvements to the ARM64 disassembler.Alexandre Rames2014-10-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This contains three changes: - Use register aliases in the disassembly. - When loading from a literal pool, show what is being loaded. - Disassemble using absolute addresses on ARM64. This ensures that addresses disassembled are coherent with instruction location addresses shown. Examples of disassembled instructions before and after the changes: Before: movz w17, #0x471f ldr d9, pc+736 (addr 0x72690d50) After: movz wip1, #0x471f ldr d9, pc+736 (addr 0x72690d50) (-745.133) Change-Id: I72fdc160fac26f74126921834f17a581c26fd5d8
* | ART: Track Flush & Close in FdFileAndreas Gampe2014-11-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement a check that aborts when a file hasn't been explicitly flushed and closed when it is destructed. Add WARN_UNUSED to FdFile methods. Update dex2oat, patchoat, scoped_flock and some gtests to pass with this. (cherry picked from commit 9433ec60b325b708b9fa87e699ab4a6565741494) Change-Id: I9ab03b1653e69f44cc98946dc89d764c3e045dd4
* | Instruction set features for ARM64, MIPS and X86.Ian Rogers2014-11-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Also, refactor how feature strings are handled so they are additive or subtractive. Make MIPS have features for FPU 32-bit and MIPS v2. Use in the quick compiler rather than #ifdefs that wouldn't have worked in cross-compilation. Add SIMD features for x86/x86-64 proposed in: https://android-review.googlesource.com/#/c/112370/ Bug: 18056890 Change-Id: Ic88ff84a714926bd277beb74a430c5c7d5ed7666
* | Add a --method-filter option to oatdump.Nicolas Geoffray2014-11-121-1/+17
| | | | | | | | | | | | | | | | I intend to use oatdump for testing generated code, and being able to filter on a method name will make the testing more reliable. Change-Id: Iaf7fef7228d9d8a901bd9b98452d244d42ca497e
* | Fix dump-oat-core-*Ian Rogers2014-11-071-2/+2
| | | | | | | | Change-Id: I53a3bfffb834284c5c3d2297305c7cdc241f8963
* | Add hash map, reduce excessive hashingMathieu Chartier2014-11-071-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changed the class def index to use a HashMap instead of unordered_map so that we can use FindWithHash to reduce how often we need to compute hashes. Fixed a bug in ClassLinker::UpdateClass where we didn't properly handle classes with the same descriptor but different class loaders. Introduced by previous CL. Before (fb launch): 1.74% art::ComputeModifiedUtf8Hash(char const*) After: 0.95% art::ComputeModifiedUtf8Hash(char const*) Bug: 18054905 Bug: 16828525 Change-Id: Iba2ee37c9837289e0ea187800ba4af322225a994 (cherry picked from commit 564ff985184737977aa26c485d0c1a413e530705)
* | ART: More warningsAndreas Gampe2014-11-041-12/+12
| | | | | | | | | | | | | | Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general, and -Wunused-but-set-parameter for GCC builds. Change-Id: I81bbdd762213444673c65d85edae594a523836e5
* | Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.Ian Rogers2014-11-031-9/+15
| | | | | | | | | | | | | | | | | | | | | | 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
* | Tidy and reduce ART library dependencies on the host.Ian Rogers2014-10-301-2/+2
|/ | | | | | | Move to shared rather than static libraries. Avoids capture of all static libraries library dependencies. Change-Id: I2be96e92dad4ed1842d76b044745f2a2e15372eb
* ART: Add support for patching and loading OAT files compiled with PICIgor Murashkin2014-10-271-3/+5
| | | | | | | | | | | | * Images (.art) compiled with pic now have a new field added. * isDexOptNeeded will now skip patch-ing for apps compiled PIC * First-boot patching now only copies boot.art, boot.oat is linked As a result, all system preopted dex files (with --compile-pic) no longer take up any space in /data/dalvik-cache/<isa>. Bug: 18035729 Change-Id: Ie1acad81a0fd8b2f24e1f3f07a06e6fdb548be62
* Optimize method linkingMathieu Chartier2014-10-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added more inlining, removed imt array allocation and replaced it with a handle scope. Removed some un-necessary handle scopes. Added logic to base interface method tables from the superclass so that we dont need to reconstruct for every interface (large win). Facebook launch Dalvik KK MR2: TotalTime: 3165 TotalTime: 3652 TotalTime: 3143 TotalTime: 3298 TotalTime: 3212 TotalTime: 3211 Facebook launch TOT before: WaitTime: 3702 WaitTime: 3616 WaitTime: 3616 WaitTime: 3687 WaitTime: 3742 WaitTime: 3767 After optimizations: WaitTime: 2903 WaitTime: 2953 WaitTime: 2918 WaitTime: 2940 WaitTime: 2879 WaitTime: 2792 LinkInterfaceMethods no longer one of the hottest methods, new list: 4.73% art::ClassLinker::LinkVirtualMethods(art::Thread*, art::Handle<art::mirror::Class>) 3.07% art::DexFile::FindClassDef(char const*) const 2.94% art::mirror::Class::FindDeclaredStaticField(art::mirror::DexCache const*, unsigned int) 2.90% art::DexFile::FindStringId(char const*) const Bug: 18054905 Bug: 16828525 (cherry picked from commit 1fb463e42cf1d67595cff66d19c0f99e3046f4c4) Change-Id: I27cc70178fd3655fbe5a3178887fcba189d21321
* Merge "Make ART compile with GCC -O0 again."Ian Rogers2014-10-171-3/+8
|\
| * Make ART compile with GCC -O0 again.Ian Rogers2014-10-161-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Fix oatdump for no imageMathieu Chartier2014-10-151-0/+2
|/ | | | | | | Added MemMap::Init if we dont initialize the runtime. Bug: 18000219 Change-Id: I1bd715e18838919c0773db5fa25623348326baa6
* stdint types all the way!Ian Rogers2014-10-091-5/+5
| | | | Change-Id: I4e4ef3a2002fc59ebd9097087f150eaf3f2a7e08
* Tidy ELF builder.Ian Rogers2014-10-091-11/+10
| | | | | | | | | Don't do "if (ptr)". Use const. Use DISALLOW_COPY_AND_ASSIGN. Avoid public member variables. Move ValueObject to base and use in ELF builder. Tidy VectorOutputStream to not use non-const reference arguments. Change-Id: I2c727c3fc61769c3726de7cfb68b2d6eb4477e53
* Implement method calls using relative BL on ARM.Vladimir Marko2014-09-251-0/+5
| | | | | | | | | | 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
* Merge "ART: Allow oatdump to verify oat file"Andreas Gampe2014-09-191-124/+243
|\
| * ART: Allow oatdump to verify oat fileAndreas Gampe2014-09-181-124/+243
| | | | | | | | | | | | | | | | | | Bring up a runtime for oatdump of an oat file if the boot image option is given. This allows to use the verifier on any oat file. Some refactoring. Change-Id: Ifa895f22b648c7064fb0837fb36a0118422a3462
* | Update comment about disabling vmap dump.Nicolas Geoffray2014-09-171-4/+7
|/ | | | Change-Id: If5d09b0d5cb9a8039b0037e6eedaae6785b1ded2
* Avoid printing absolute addresses in oatdumpBrian Carlstrom2014-09-161-107/+333
| | | | | | | | | | | | | | | | | - Added printing of OatClass offsets. - Added printing of OatMethod offsets. - Added bounds checks for code size size, code size, mapping table, gc map, vmap table. - Added sanity check of 100k for code size. - Added partial disassembly of questionable code. - Added --no-disassemble to disable disassembly. - Added --no-dump:vmap to disable vmap dumping. - Reordered OatMethod info to be in file order. Bug: 15567083 (cherry picked from commit 34fa79ece5b3a1940d412cd94dbdcc4225aae72f) Change-Id: I2c368f3b81af53b735149a866f3e491c9ac33fb8
* ART: Allow quickening in the boot imageAndreas Gampe2014-09-151-70/+62
| | | | | | | | | | | | | | 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-4/+4
| | | | | | | | | | 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-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Runtime support for the new stack maps for the opt compiler.Nicolas Geoffray2014-09-081-2/+6
| | | | | | | Now most of the methods supported by the compiler can be optimized, instead of using the baseline. Change-Id: I80ab36a34913fa4e7dd576c7bf55af63594dc1fa
* ART: Refactor elf_writer_quick, add symbolizerAndreas Gampe2014-09-052-7/+246
| | | | | | | | | Refactors some classes in elf_writer_quick.h to elf_builder.h to be more friendly for re-use. Use this in oatdump to add a symtab to an oat file. Bug: 17187621, 17322125 Change-Id: I2333291334fd98bd09cc5717fb83cb18efe3a029
* ART: Allow oatdump to print vr stack locationsRazvan A Lupusoru2014-09-041-0/+40
| | | | | | | | | For both debugging and performance analysis, it is necessary to understand stack layout. This patch adds capability to oatdump to print out the offsets of the locals, ins, method*, and out VRs. Change-Id: I73512f59e4fd2d2b12725a6c76d602182c46ff78 Signed-off-by: Razvan A Lupusoru <razvan.a.lupusoru@intel.com>
* Reduce and speed-up class def searches.Ian Rogers2014-09-021-2/+2
| | | | | | | | | | | | | | | | | | | | 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
* Reduced memory usage of primitive fields smaller than 4-bytesFred Shih2014-08-251-2/+13
| | | | | | | | | | Reduced memory used by byte and boolean fields from 4 bytes down to a single byte and shorts and chars down to two bytes. Fields are now arranged as Reference followed by decreasing component sizes, with fields shuffled forward as needed. Bug: 8135266 Change-Id: I65eaf31ed27e5bd5ba0c7d4606454b720b074752
* Clean up Handle usage.Mathieu Chartier2014-08-231-9/+7
| | | | | | | | | | | Prefer using ConstHandle instead of Handle as function arguments since you can't assign new references to ConstHandle which helps prevent bugs. Changed NullHandle to be a ConstHandle so that you can never modify it to be a non null reference. Change-Id: I81cb979f6f8d5b49e5614966a2caf28c3701dd4f
* Handlerize MethodVerifier::mirror_method_.Hiroshi Yamauchi2014-08-221-4/+6
| | | | | | | | | | The method (mirror_method_) wasn't handlerized across some allocation/GC points such as the ResolveType() call in ScanTryCatchBlocks() and the GetReturnType() calls in CodeFlowVerifyInstruction(). Bug: 12687968 Change-Id: I95323de14459eb5a7c4abfcf44f882f86d59be64
* Avoid use of std::string where we have const char*.Ian Rogers2014-08-121-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Runtime can now be set to require relocationAlex Light2014-07-221-4/+11
| | | | | | | | | | | | | | 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
* Remove object_utils.h.Ian Rogers2014-07-161-1/+1
| | | | | | | | | 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-1/+1
| | | | | | | | 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
* Merge "Revert "Revert "ART: Key-Value Store in Oat header"""Andreas Gampe2014-07-111-4/+12
|\
| * Revert "Revert "ART: Key-Value Store in Oat header""Andreas Gampe2014-07-111-4/+12
| | | | | | | | | | | | | | | | | | | | | | 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
* | Improve performance of invokevirtual/invokeinterface with embedded imt/vtableMingyao Yang2014-07-111-1/+1
|/ | | | | | | | | 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
* Revert "ART: Key-Value Store in Oat header"Nicolas Geoffray2014-07-091-12/+4
| | | | | | | | Broke arm64 build. This reverts commit c87d27b25994da8670d82a8f7bad6327b693bfff. Change-Id: I4c2ade295d2b5aa77fc3ad810e0e859629a5bf09