summaryrefslogtreecommitdiff
path: root/runtime/base/mutex-inl.h
AgeCommit message (Collapse)Author
2014-10-22C++11 related clean-up of DISALLOW_.. Ian Rogers
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
2014-08-12Avoid use of std::string where we have const char*. Ian Rogers
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
2014-07-10Remove legacy CAS implementations from mutex. Ian Rogers
Removes the use of __sync_bool_compare_and_swap and android_atomic_cas and uses intention revealing atomic operations from art::Atomic (which will eventually give way to std::atomic). Change-Id: Iea44e1923f6706ec04b5459fe25427282c189a7e
2014-06-10Remove deprecated WITH_HOST_DALVIK. Ian Rogers
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
2014-06-06Reduce header files including header files. Ian Rogers
Main focus is getting heap.h out of runtime.h. Change-Id: I8d13dce8512816db2820a27b24f5866cc871a04b
2014-05-23Extra debug output for a failing lock check. Ian Rogers
Change-Id: If4abae535a875a06f4fa4203e6aabc1169b1f38e
2014-05-22Move modify_ldt_lock into global lock order. Chao-ying Fu
Mutex modify_ldt_lock was being removed during runtime shutdown while daemons thread may still detach. Avoid this by placing in global lock order. This fixes cts dalvik vm-tests-tf that hang on some x86 devices. By irogers: also, tidy global locks to agree with enum constants and add extra verification that the global annotalysis order agrees with the LockLevel order. Bumped the oat version and moved the locks as LockLevel additions previously caused entrypoints to be moved. Make unattached lock not handle the default mutex level case by moving the allocated thread ids lock into the global order. Change-Id: I9d03f19d44ea254accf0ceae8022563c77f7a02f Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
2014-05-20Begin migration of art::Atomic to std::atomic. Ian Rogers
Change-Id: I4858d9cbed95e5ca560956b9dabd976cebe68333
2014-01-23Move __STDC_FORMAT_MACROS to a cflag. Ian Rogers
Current inttypes.h don't define stdint printf formatting characters for C++ but in the future this will change. Rather than #define __STDC_FORMAT_MACROS at the point of inclusion (conventional) pass it as a cflag so there is a single place to remove the #define when conventions change. Change-Id: Ice2fb07e19d8fc06ebc534c903a2d02497c31b3d
2014-01-2364bit cleanliness requires PRI*64 macros for stdint types. Ian Rogers
Change-Id: I0cdce36d5f875cdc64cd2db22fd8179916ffa10f
2013-11-11Compacting collector. Mathieu Chartier
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
2013-09-11More allocation code optimizations. Hiroshi Yamauchi
- Inline Class::AllocObject() and Array::Alloc(). - Inline some short Mutex functions and add LIKELY/UNLIKELY to some Mutex functions. - This change improves the Ritz MemAllocTest by ~6% on Nexus 4 and ~10% on host. Bug: 9986565 Change-Id: I1606c74ddb21676cbc1de1a40e9b076fc23eaea4
2013-09-09Disable lock contention logging by default. Jeff Hao
The verifier runs out of memory with lock contention logging on nakasi. Bug: 10646091 Change-Id: I8ddffdb48d779a20107bae7013cbe92d13dc8bdb
2013-08-13Add a systrace support for lock contention logging. Hiroshi Yamauchi
- Now several ART executables like oatdump need to link with libcutils as the mutex code is shared among them. - The blocking thread ID and lock owner thread ID are passed to ScopedContentionRecorder in the correct order. Bug: 9986464 Change-Id: Id766de23fbc4af1d8ba2de051595e365b04f5ae7
2013-08-09Polish the lock contention logging. Hiroshi Yamauchi
- Make the code compilable. - Surround the code with kLogLockContentions instead of #ifdef CONTENTION_LOGGING. - Dump contended locks before never-contended locks for better log readability. - Change the wait time unit from ms to us for better precision. Bug: 9986464 Change-Id: I121c6ccf4424d3e0339b0dcd25e18976b41fe4f3
2013-07-26Fix cpplint whitespace/comments issues Brian Carlstrom
Change-Id: Iae286862c85fb8fd8901eae1204cd6d271d69496
2013-07-18Fix cpplint whitespace/parens issues Brian Carlstrom
Change-Id: Ifc678d59a8bed24ffddde5a0e543620b17b0aba9
2013-07-17Fix multiple inclusion guards to match new pathnames Brian Carlstrom
Change-Id: Id7735be1d75bc315733b1773fba45c1deb8ace43
2013-07-12Create separate Android.mk for main build targets Brian Carlstrom
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