summaryrefslogtreecommitdiffstats
path: root/runtime/monitor.h
Commit message (Collapse)AuthorAgeFilesLines
* Comment disallow new monitors.Ian Rogers2014-04-171-0/+4
| | | | Change-Id: Ie50424c73be051f9856ef9e86bdbf83fa76bbc48
* Add monitor deflation.Mathieu Chartier2014-04-071-3/+5
| | | | | | | | | | | We now deflate the monitors when we perform a heap trim. This causes a pause but it shouldn't matter since we should be in a state where we don't care about pauses. Memory savings are hard to measure. Fixed integer overflow bug in GetEstimatedLastIterationThroughput. Bug: 13733906 Change-Id: I4e0e68add02e7f43370b3a5ea763d6fe8a5b212c
* Add more VerifyObject calls.Mathieu Chartier2014-03-071-0/+2
| | | | | | | | | | | Added verify object calls to SirtRef, IndirectReferenceTable, ReferenceTable. Removed un-needed verify object in ScopedObjectAccess / DecodeJObject since object sources are handled. Bug: 12934910 Change-Id: I55a46a8ea61fed2a77526eda27fd2cce97a9b125
* Enable annotalysis on clang ART builds.Ian Rogers2014-03-061-3/+4
| | | | | | | | | | | Fix clang build errors aswell as restructure locking/mutex code for correct thread safety analysis support. Reorder make dependencies so that host builds build first as they should provide better compilation errors than target. Remove host's use of -fno-omit-frame-pointer as it has no value with correct use of CFI, which we should have. Change-Id: I72cea8da9a3757b1a0b3acb4081feccb7c6cef90
* Remove using mirror::* in jni internal.Mathieu Chartier2014-02-141-1/+1
| | | | | | | | | Cleans up the code since it helps make it easier to spot moving GC related bugs. Also fixed moving GC bugs in MonitorEnter, and FindFieldID. Change-Id: I794e4fbcc2010875fc6b299c6d4c9fb0f071b71a
* Add root types and thread id to root visiting.Mathieu Chartier2014-02-111-2/+3
| | | | | | | Enables us to pass the root type and thread id to hprof. Bug: 12680863 Change-Id: I6a0f1f9e3aa8f9b4033d695818ae7ca3460d67cb
* Object model changes to support 64bit.Ian Rogers2014-02-061-4/+13
| | | | | | | | | | | | | | | | | | | | | | | Modify mirror objects so that references between them use an ObjectReference value type rather than an Object* so that functionality to compress larger references can be captured in the ObjectRefererence implementation. ObjectReferences are 32bit and all other aspects of object layout remain as they are currently. Expand fields in objects holding pointers so they can hold 64bit pointers. Its expected the size of these will come down by improving where we hold compiler meta-data. Stub out x86_64 architecture specific runtime implementation. Modify OutputStream so that reads and writes are of unsigned quantities. Make the use of portable or quick code more explicit. Templatize AtomicInteger to support more than just int32_t as a type. Add missing, and fix issues relating to, missing annotalysis information on the mutator lock. Refactor and share implementations for array copy between System and uses elsewhere in the runtime. Fix numerous 64bit build issues. Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
* Tidy up memory barriers.Ian Rogers2013-12-201-1/+1
| | | | Change-Id: I937ea93e6df1835ecfe2d4bb7d84c24fe7fc097b
* Fix portable + mips build.Mathieu Chartier2013-11-121-0/+3
| | | | Change-Id: Ia200e582b04c84973281e12331777351feb8a401
* Compacting collector.Mathieu Chartier2013-11-111-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The compacting collector is currently similar to semispace. It works by copying objects back and forth between two bump pointer spaces. There are types of objects which are "non-movable" due to current runtime limitations. These are Classes, Methods, and Fields. Bump pointer spaces are a new type of continuous alloc space which have no lock in the allocation code path. When you allocate from these it uses atomic operations to increase an index. Traversing the objects in the bump pointer space relies on Object::SizeOf matching the allocated size exactly. Runtime changes: JNI::GetArrayElements returns copies objects if you attempt to get the backing data of a movable array. For GetArrayElementsCritical, we return direct backing storage for any types of arrays, but temporarily disable the GC until the critical region is completed. Added a new runtime call called VisitObjects, this is used in place of the old pattern which was flushing the allocation stack and walking the bitmaps. Changed image writer to be compaction safe and use object monitor word for forwarding addresses. Added a bunch of added SIRTs to ClassLinker, MethodLinker, etc.. TODO: Enable switching allocators, compacting on background, etc.. Bug: 8981901 Change-Id: I3c886fd322a6eef2b99388d19a765042ec26ab99
* Lazily compute object identity hash codes.Mathieu Chartier2013-10-311-6/+9
| | | | | | | | | | | | | | | Before, we computed identity hashcodes whenever we inflated a monitor. This caused issues since it meant that we would have all of these hash codes in the image, causing locks to excessively inflate during application run time. This change makes it so that we lazily compute hash codes. When a thin lock gets inflated, we assign a hash code of 0 assigned to it. This value signifies no hash code. When we try to get the identity hash code of an object with an inflated monitor, it gets computed if it is 0. Change-Id: Iae6acd1960515a36e74644e5b1323ff336731806
* Fix object identity hash.Mathieu Chartier2013-10-291-5/+16
| | | | | | | | | | | | | The object identity hash is now stored in the monitor word after being computed. Hashes are computed by a pseudo random number generator. When we write the image, we eagerly compute object hashes to prevent pages getting dirtied. Bug: 8981901 Change-Id: Ic8edacbacb0afc7055fd740a52444929f88ed564
* Notify doesn't inflate, rename helper.Ian Rogers2013-10-111-3/+3
| | | | Change-Id: I85c93b522478b3116a66630856a2370ec0fda490
* Inflate contended lock word by suspending owner.Ian Rogers2013-10-021-50/+56
| | | | | | | | | | | | | | | | | | | | Bug 6961405. Don't inflate monitors for Notify and NotifyAll. Tidy lock word, handle recursive lock case alongside unlocked case and move assembly out of line (except for ARM quick). Also handle null in out-of-line assembly as the test is quick and the enter/exit code is already a safepoint. To gain ownership of a monitor on behalf of another thread, monitor contenders must not hold the monitor_lock_, so they wait on a condition variable. Reduce size of per mutex contention log. Be consistent in calling thin lock thread ids just thread ids. Fix potential thread death races caused by the use of FindThreadByThreadId, make it invariant that returned threads are either self or suspended now. Code size reduction on ARM boot.oat 0.2%. Old nexus 7 speedup 0.25%, new nexus 7 speedup 1.4%, nexus 10 speedup 2.24%, nexus 4 speedup 2.09% on DeltaBlue. Change-Id: Id52558b914f160d9c8578fdd7fc8199a9598576a
* resolved conflicts for merge of bb0140e0 to dalvik-devMathieu Chartier2013-09-201-0/+4
|\ | | | | | | Change-Id: I31e0c05c5e917cf3275296a7f65bd8b78ec9b78b
| * Re-enable concurrent system weak sweeping.Mathieu Chartier2013-09-201-2/+4
| | | | | | | | | | | | | | | | | | | | | | Enabled by disallowing new system weaks during the pause and re-allowing it after the system weaks have been swept. Reduces GC pause by ~1ms. Fixes pause regression caused by fix for Bug: 10626133 Change-Id: If49d33e7ef19cb728ed3cef5187acfa53b9b05d8
* | Refactor system weak sweeping, add support for modification.Mathieu Chartier2013-09-171-3/+3
|/ | | | | | Required for moving collectors. Change-Id: Ib97ba4a05af1139f8d388077a15e62bcb9534855
* Don't scan image space when starting runtime.Ian Rogers2013-08-231-0/+3
| | | | | | | | | | | | | | | | | Bug 10432288. Find Classes and Strings from dex caches lazily rather than when the image is loaded. Make class status changes do notifies when there can be waiters. For Class lookup there's a pathology if we always search dex caches and so after 1000 failures move all classes into the class table. Be consistent in using "const char*" for class linker descriptors as this most easily agrees with the type in the dex file. Improve the intern run-test so that it has a case of a literal contained in the image. Modify image_test to allow any valid lock word rather than expecting 0, ideally we wouldn't see inflated monitors but we do due to NotifyAll (see bug 6961405). Change-Id: Ia9bfa748eeccb9b4498784b97c6823141b1f6db8
* Refactor java.lang.reflect implementationBrian Carlstrom2013-08-131-4/+4
| | | | | | | | | | | Cherry-picked from commit ed41d5c44299ec5d44b8514f6e17f802f48094d1. Move to ArtMethod/Field instead of AbstractMethod/Field and have java.lang.reflect APIs delegate to ArtMethod/ArtField. Bug: 10014286. Change-Id: Iafc1d8c5b62562c9af8fb9fd8c5e1d61270536e7
* Fix cpplint runtime/explicit issuesBrian Carlstrom2013-07-171-1/+1
| | | | Change-Id: I352ba0b427f1ff9b22887693952b180eae0839ba
* Fix multiple inclusion guards to match new pathnamesBrian Carlstrom2013-07-171-3/+3
| | | | Change-Id: Id7735be1d75bc315733b1773fba45c1deb8ace43
* Create separate Android.mk for main build targetsBrian Carlstrom2013-07-121-0/+211
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