summaryrefslogtreecommitdiffstats
path: root/src/oatdump.cc
Commit message (Collapse)AuthorAgeFilesLines
* Create separate Android.mk for main build targetsBrian Carlstrom2013-07-121-1476/+0
| | | | | | | | | | The runtime, compiler, dex2oat, and oatdump now are in seperate trees to prevent dependency creep. They can now be individually built without rebuilding the rest of the art projects. dalvikvm and jdwpspy were already this way. Builds in the art directory should behave as before, building everything including tests. Change-Id: Ic6b1151e5ed0f823c3dd301afd2b13eb2d8feb81
* GC clean up.Ian Rogers2013-06-211-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Greater use of directories and namespaces. Fix bugs that cause verify options to fail. Address numerous other issues: GC barrier wait occurring holding locks: GC barrier waits occur when we wait for threads to run the check point function on themselves. This is happening with the heap bitmap and mutator lock held meaning that a thread that tries to take either lock exclusively will block waiting on a thread that is waiting. If this thread is the thread we're waiting to run the check point then the VM will deadlock. This deadlock occurred unnoticed as the call to check for wait safety was removed in: https://googleplex-android-review.googlesource.com/#/c/249423/1. NewTimingLogger: Existing timing log states when a split ends but not when it begins. This isn't good for systrace, in the context of GC it means that races between mutators and the GC are hard to discover what phase the GC is in, we know what phase it just finished and derive but that's not ideal. Support for only 1 discontinuous space: Code special cases continuous and large object space, rather than assuming we can have a collection of both. Sorted atomic stacks: Used to improve verification performance. Simplify their use and add extra checks. Simplify mod-union table abstractions. Reduce use of std::strings and their associated overhead in hot code. Make time units of fields explicit. Reduce confusion that IsAllocSpace is really IsDlMallocSpace. Make GetTotalMemory (exposed via System) equal to the footprint (as in Dalvik) rather than the max memory footprint. Change-Id: Ie87067140fa4499b15edab691fe6565d79599812
* Avoid resolution for field types in image dumping.Ian Rogers2013-06-171-1/+7
| | | | | | | | Bug seen when dumping EMPTY_TABLE of java.util.HashMap as EMPTY_TABLE has type java.util.Map$Entry[] which isn't in the boot image, but the value has type java.util.HashMap$HashMapEntry[] which is. Change-Id: Ia0bd445c6f5bb5837a92e6c2b2f4207e89b872f4
* Created compiled stubs in image.Jeff Hao2013-06-071-1/+1
| | | | | | | | | Saves class linker from having to set code pointers when loading from an image. Added stubs for quick and portable resolution trampolines, and interpreter-to-interpreter and interpreter-to-quick entry points. Also added sizing stats output for oat writer. Change-Id: I3905fae81047742c23d1cf0ca001db798db971b1
* Rename abstract method code_ to entry_point_from_compiled_code_.Jeff Hao2013-05-131-3/+3
| | | | Change-Id: I9b02d2df95bbeafa6e6387b461f574c57337a61e
* Removing remaining compiled stubs from image.Jeff Hao2013-04-261-2/+0
| | | | | | | Abstract method error stub and jni dlsym lookup stubs are gone. After this change, the image no longer needs to be executable. Change-Id: Ic75d72bf7e76e3b8ecc596e82af68ab592dde15e
* Removed compiled resolution trampoline.Jeff Hao2013-04-231-5/+2
| | | | | | | Created assembly versions of resolution trampoline for portable and quick. Removed compiled version from the image. Change-Id: I183e110c4e102fb45ce6e7f4e855f8bed7986251
* Fix Monkeys failureAnwar Ghuloum2013-04-221-1/+1
| | | | | | | | Ian's handy work: Interpreter was checking whether initializer was in progress instead of falling through to ensureinitialized. Should have instead check whether initialized and then fall through otherwise. Change-Id: Idc2f4724ea7c675b1682c2c4c88402bd46cf092f
* Add bool to verifier to allow soft failures.Jeff Hao2013-04-161-1/+1
| | | | | | | | When false, soft failures in the verifier become hard failures. It should only be false when not compiling, and calling the verifier from the class linker. Change-Id: I664e5cbe491784b280aa5bfdb7e7fc0b771814f5
* Remove code related to compiled invoke stubs.Jeff Hao2013-03-271-29/+1
| | | | | | | Note that the oat file version is now bumped to 004. A clean-oat will be necessary after syncing this change. Change-Id: If8875335b7fcc39b6b40c6f95de07da50da7b6b8
* Various performance improvements.Ian Rogers2013-03-181-0/+1
| | | | | | | | | Performance had regressed due to verify object and method invocation changes. Avoid trampolines for static calls in same class. Various inlining changes. Make verify object something that's only compiled-in in debug builds. Change-Id: Ia261a52232c3b10667c668f8adfadc0da3048bc5
* Remove Iceland.Ian Rogers2013-02-271-2/+0
| | | | | | | ART_USE_LLVM_COMPILER is removed and when necessary ART_USE_PORTABLE_COMPILER is used in #ifdefs. Change-Id: Iffa9ce5b0246c7c427ccc4e67ecc134624632e55
* Refactor DescribeVRegs to allow caching.Ian Rogers2013-02-211-7/+15
| | | | | | | | In oatdump we want to describe vregs at regular intervals and reverifying is slow. Refactor MethodVerifier to allow this. Move instruction flags into its own file so the complete type is visible to files other than method verifier. Change-Id: I14d491e7376ab1d7117a9725847870ef1337803f
* Directory restructuring of object.hIan Rogers2013-01-301-37/+44
| | | | | | | | | Break object.h into constituent files. Reduce number of #includes in other GC header files. Introduce -inl.h files to avoid mirror files #include-ing each other. Check invariants of verifier RegTypes for all constructors. Change-Id: Iecf1171c02910ac152d52947330ef456df4043bc
* Move .oat files to ELF formatBrian Carlstrom2013-01-251-4/+9
| | | | | | | | | | | | | | | Generates .oat in ELF file format using MCLinker - Uses MCLinker IRBuilder to create a synthetic .o from OatWriter output. - Uses new ElfFile for prelinking to support art image optimizations. Adapted OatFile to load using dlopen, ElfFile, or memory, removing raw MemMap mechanism. Changed image code to not assume oat data will be immediately after image to allow space for ELF headers. Passes test-art and works with installd. Change-Id: Idc026eddb5de93f4b97490c405f3ed7b39589749
* Move stringpiece.h and stringprintf.h to base/.Elliott Hughes2012-12-131-1/+1
| | | | Change-Id: I7f71b4a12f99c5f81771146c66629ae5a947b229
* Merge "Switch over to the google3 unix_file File*." into dalvik-devElliott Hughes2012-12-121-2/+2
|\
| * Switch over to the google3 unix_file File*.Elliott Hughes2012-12-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | I also moved macros.h to base/macros.h to ease google3 porting, at the expense of a larger than necessary change. (I learned my lesson, though, and didn't make the equivalent base/logging.h change.) I'm not sure whether we want to keep the unix_file MappedFile given our existing MemMap, but it's easier to bring it over and then remove it (and possibly revert the removal) than to bring it over later. Change-Id: Id50a66faa5ab17b9bc936cc9043dbc26f791f0ca
* | Remove now unused RelocationBehaviorBrian Carlstrom2012-12-121-1/+1
|/ | | | Change-Id: Ifdb98a63376014a698b53bc926fb1c5512dc2e57
* Add "kind" argument to Get/SetVReg.Ian Rogers2012-11-161-261/+355
| | | | | | | | | | | In order to determine where a register is promoted its necessary to know the kind of use of the register. Extend notion of precise-ness to numeric verifier register types. Dump verifier output in oatdump. Dump vregs with their location or constant value. Introduce indenting ostream utility. Change-Id: Ia3d29497877976bc24465484743bca08236e1768
* Interpret class initializers when building image.Ian Rogers2012-11-011-4/+4
| | | | | | | | | | | | | | | | | | | We initialize all image classes with the interpreter if they have a class/static initializer. Black list classes whose initializers need access to on device native code. If such classes are added to the image classes they will fail when they attempt to enter JNI code. A number of "intrinsic" style JNI routines are special cased to allow more than just trivial class initializers to run. Add a lock for initialization in the compiler to serialize the execution of class initializers and avoid deadlock. Remove InSourceSpace from image writer (cruft) and teach the image writer to fix up referent fields in references. Fix bugs in the interprerter and implement filled-new-array. Factor some VM code to more easily share between the interpreter and JNI entry points. Change-Id: I6bb811dea84f1b82260b1a4e73ac7412179c0b41
* Add Jack modifier.mikaelpeltier2012-10-261-1/+4
| | | | | Bug: 7419545 Change-Id: I58f40e11f3b3256ca7f7922f12b7bdeef724930f
* Dump dex file sizes in oatdump.Ian Rogers2012-10-241-7/+28
| | | | Change-Id: I15d1ecfb9900a07b36209015e8b47718fdee19a7
* Add oat file dependency on boot.oat load locationBrian Carlstrom2012-10-181-2/+5
| | | | Change-Id: I89742e361675bd4e5177e3af213bcc826ddd60de
* Fix oatdump's usage message.TDYa1272012-10-161-1/+1
| | | | Change-Id: I3d0e1797984ea0ee7c7a4303e959e54a6066809a
* More space refactoring.Mathieu Chartier2012-10-121-1/+2
| | | | | | | | | | | | | | | Add common interface, AllocSpace. Renamed the old AllocSpace to DLMallocSpace. Added an new option enforce_target_size_, which when enabled, doesn't let the heap grow past ideal heap size calculated during last Gc. Removed redundant AllocationSize calls. Moved large object space to its own file instead of being in space.h/cc. Change-Id: I15e60531114bf213800599737cbd66ef44b46b15
* Don't get stuck making all numeric disassembly hex.Ian Rogers2012-10-121-1/+1
| | | | | | Stateful streams suck. Change-Id: I738fd25f0d101624a1fd5c51849e2af5df552a2b
* Mac build fix and make oatdump dex PCs hex.Ian Rogers2012-10-091-4/+4
| | | | Change-Id: Icf0514910ffa31a408026234d8f5bb0d758e8945
* Dump maps inline in disassembled code.Ian Rogers2012-10-091-68/+154
| | | | | | | | | | | | | | | | | | | | | | | | In pursuit of Bug: 7250540, dump mapping and GC map tables inline such as: 0x607333a8: f8dfe11c ldr.w lr, [pc, #284] ; 0x6076416d 0x607333ac: 1c05 mov r5, r0 0x607333ae: f8df0144 ldr.w r0, [pc, #324] ; 0x6003ba08 0x607333b2: 9a0b ldr r2, [sp, #44] 0x607333b4: f04f0b2f orr r11, pc, ThumbExpand(47) 0x607333b8: 1c29 mov r1, r5 0x607333ba: 465b mov r3, r11 0x607333bc: 2900 cmp r1, #0 0x607333be: f0008070 beq.w +224 (0x607334a2) 0x607333c2: 47f0 blx lr suspend point dex PC: 44 GC map objects: v2 (r7), v3 (r5), v6 ([sp + #84]), v7 (r6) ... As GC map and mapping tables are inline, don't dump them. Also dump dex instructions before code. Change-Id: I9f0c04182a4cda6844027eae22e8151f2827dc99
* Refactor and remove copy mark bits.Mathieu Chartier2012-10-081-1/+1
| | | | | | | | | | | | Refactor code GC realted code to be in a GC folder. Remove copy mark bits by using pointer changing instead. Enable concurrent sweeping of system weaks. Fix non concurrent GC plan. Change-Id: I9c71478be27d21a75f8a4e6af6faabe896e5e263
* Explicitly pass Thread::Current to MutexLock and Alloc.Ian Rogers2012-10-051-2/+3
| | | | Change-Id: I8b75bc0617915465f102815b32306aa7760dcae4
* Refactor spaces and add free list large object spaceMathieu Chartier2012-10-041-3/+7
| | | | | | | | | | | | | Added some more abstraction for spaces, we now have ContinuousSpaces and DiscontinousSpaces. Added a free list version of large object space. Performance should be better than the memory map version since we avoid creating more than one memory map. Added a cause for Gc which prints with the Gc message, dalvik has this as well. Change-Id: Ie4aa6b204fbde7193e8305eb246158fae0444cc1
* Fix oatdump off-by-onebuzbee2012-10-031-0/+1
| | | | | | | The dump of the pc <-> dex mapping tables was broken by the recent mapping table restructuring change. Fixed now. Change-Id: I36c869e4a2853e18e021268b5b4eb49a4b76c970
* Split dex_pc<->native_pc mapping tableBill Buzbee2012-09-281-1/+6
| | | | | | | | | | | | | | | | | | | | | | First of 2 related CLs - this one moves to a split table, a future CL will compress the table to save image space. The current MappingTable mixes two flavors of entries: dex->pc and pc(return address)->dex. The problem is that we can have two entries with the same native pc address but two different dex pcs. The reason is that when we go from native pc to dex, the native pc is actually the return address from the previous call, whereas when we go from dex to native pc, the mapping refers to the first native instruction of the sequence. Previously, the first entry in the mapping table was the number of subsequent entries. That will remain the same, but now the second entry will be a count of the number of entries in the pc->dex section of the table. The difference between the two counts gives us the number of entries in the following dex->pc section. Change-Id: Ibadb96cb50bf1f93e079dff3832130b9f9782723
* Large object spaceMathieu Chartier2012-09-241-0/+3
| | | | | | | | The large object space helps prevent fragmentation by putting large objects in mem maps insead of the alloc space. Instead of mark and live bitmaps it uses mark and live sets. Change-Id: Iada5db70b88a1572007d8af921fa353681a55dc7
* Change dex cache to be java object instead of array, add pointer to dex file ↵Mathieu Chartier2012-09-211-8/+8
| | | | | | | | | | | | | | | | in dex cache. Generic clean up to facilitate having GDB macros for Pretty* helper functions. Improved cleanliness of DexCache since having it as an object array was not the best solution. Fixed a bug in InOrderWalk caused by ResolveType sometimes allocating classes. Rename C++ Method to AbstractMethod and add two new classes Constructor, Method which both inherit from AbstractMethod. Rename done to have the C++ code be closer to the java code. Change-Id: I4995b4c5e47a3822192b08afa24a639d3b1f4da9
* Dump native pcs rather than offsets, fix mac build.Ian Rogers2012-09-211-3/+5
| | | | | | | Dump the native PC associated with live vregs rather than the offset into the code. Change-Id: I093e35d580774bca894472f9e8a218f76b7473ce
* NativePcOffsetToReferenceMapIan Rogers2012-09-201-15/+10
| | | | | | | | | Rather than translate a native PC to a Dex PC and then to the reference bitmap, just go straight from the native PC to the reference bitmap. Encode the native PC offsets using a hash rather than linearly searching. Change-Id: Iee1073d93c941c0a31f639e5f23cea9e9f747bee
* Rename PcToReferenceMap adding Dex.Ian Rogers2012-09-181-2/+2
| | | | Change-Id: I21ebfe9ac7fd8a627299f1f721eb4b11c87642dc
* Prune useless entries from dex to pc mapbuzbee2012-09-131-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Step one of the change. Limit entries in the table to native code safepoint locations (which generally are the return PC addresses of any call that might trigger a stack walk and the start addresses of all catch blocks). Previously, the mapping_table described ranges. No longer. Any native PC located within compiled Dex code that is found in a stack walk should have an exact match in the table. In future CLs we'll add data compression (probably uLeb128) and may add inflation on first use to a faster access map (instead of the current linear search). Note that this CL introduces somewhat of a regression in the capabilities of oat-dump. Because the mapping table no longer associates each native intruction with its Dex counter-part, the native code disassembly no longer includes interspersed Dex disassembly. Note also that as of this CL, the compiler is adopting the 100-char line length limit used in the rest of Art. The 80-char limit should still be used in any code that we expect to upstream to llvm. Change-Id: I1beca4d57c41e8161bf746bc62abbce08d5bcb4d
* Rename GlobalSynchronization to LocksIan Rogers2012-09-051-13/+13
| | | | | | | Also address some review comments in common_throws relating to ToStr<InvokeType> and exception detail messages. Change-Id: Ibf2c0f147689fa236d349bd7f01eed3c2522552b
* Fix locking issue in oatdump.Ian Rogers2012-08-271-11/+21
| | | | | | | Calling FieldHelper GetType may cause class loading, only do this for non-null fields where we expect the type is part of the image. Change-Id: I3c016f27fb619cc0da755bd3cecfe98326bda83b
* Sticky mark bits "generational" GCMathieu Chartier2012-08-171-0/+5
| | | | | | | | | | | | | | | | | Sticky mark bits GC. Sticky mark bits implemented using allocation stack which enables us to use the previous GC live bitmap as the mark bitmap. Removed heap_end_ since checking versus it caused more overhead than it saved. Removed check for impossible allocations at the start of AllocObject since these allocations will just fall through and fail anyways. These allocations do not happen often enough for it to be worth checking for. A bunch of constant optimization performance improvements. Pre locking regression benchmark improvements: Deltablue: ~0.3 sec runtime. CaffeineMark: ~300 total score due to improved string score. Change-Id: I15016f1ae7fdf76fc3aadb5774b527bf802d9701
* Global lock levels.Ian Rogers2012-08-141-13/+26
| | | | | | | | | | | | | | | | | | Introduce the notion of the mutators/GC being a shared-exclusive (aka reader-writer) lock. Introduce globally ordered locks, analysable by annotalysis, statically at compile time. Add locking attributes to methods. More subtly, remove the heap_lock_ and split between various locks that are held for smaller periods (where work doesn't get blocked). Remove buggy Dalvik style thread transitions. Make GC use CMS in all cases when concurrent is enabled. Fix bug where suspend counts rather than debug suspend counts were sent to JDWP. Move the PathClassLoader to WellKnownClasses. In debugger refactor calls to send request and possibly suspend. Break apart different VmWait thread states. Move identity hash code to a shared method. Change-Id: Icdbfc3ce3fcccd14341860ac7305d8e97b51f5c6
* Each space has its own bitmap(s)Mathieu Chartier2012-07-111-4/+9
| | | | | | Each alloc space now has One mark+live bitmap. Each image space has only one live bitmap. Change-Id: I2e919d1bd7d9f4d35d0e95ed83a58df6f754df6e
* Remove LLVM specific code in oatdump.Logan Chien2012-06-271-7/+0
| | | | Change-Id: Ie1307ca5a62278f51099fd51a133f4e95eb14b07
* Compile method one-by-one.Logan Chien2012-06-271-49/+2
| | | | Change-Id: Ic56fb397f3bd6dee32372eb875261a3383eaf30c
* Fix initializer lists to be Google C++ style.Ian Rogers2012-06-261-4/+3
| | | | Change-Id: Iada52ea5cf95492684033993b3299042bdaf6cee
* Fix a bunch more lint.Elliott Hughes2012-06-211-1/+0
| | | | | | | (If you ignore the compilers, we've got relatively little lint now. Fits on a single screen.) Change-Id: I51389002894d4fd8cf46f79d2bac57079322a030
* "InitGoogle"-style argv stashing.Elliott Hughes2012-06-061-1/+1
| | | | | | | | | | | | | This lets us give the command line in crash dumps when dex2oat dies in the continuous build on the Mac. I've also taken the opportunity to use the basename of argv[0] as the default log tag, so dex2oat will now show up in logcat as "dex2oat" instead of "art" (and we can probably stop manually prefixing dex2oat log output). Also stash pthread_self() so we can _correctly_ report "handle=" in the SIGQUIT output. Change-Id: Ia8249cd19bab5b816cb94a531a65becdfacaa98b