summaryrefslogtreecommitdiffstats
path: root/runtime/transaction.h
Commit message (Collapse)AuthorAgeFilesLines
* Cleanup transaction supportSebastien Hertz2014-04-021-1/+1
| | | | | | | | | | | | | | | | | | | Updates Thread::CreateInternalStackTrace to support both transactional and non-transactional modes using template. Generalizes non-transactional mode for invariant fields (which are set only once). Removes ArrayLog::VisitRoots as we never create Array logs of ObjectArray. As ObjectArray elements are set using Object::SetFieldObject, they are already recorded in the object logs: the object is the array itself and the offset corresponds to the element index in this array. And also checks we never log ObjectArray in array logs. Fixes location of thrown exception when calling native method during class initialization. Change-Id: Idbc368d3b8292b85ff40bc8a7c559e085477bf89
* Enable annotalysis on clang ART builds.Ian Rogers2014-03-061-2/+1
| | | | | | | | | | | 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 blacklistSebastien Hertz2014-02-171-0/+195
Removes the class initialization blacklist and use transaction to detect and revert class initialization attempting to invoke native method. This only concerns class initialization happening at compilation time when generating an image (like boot.art for the system). In transactional mode, we log every object's field assignment and array update. Therefore we're able to abort a transaction to restore values of fields and array as they were before the transaction starts. We also log changes to the intern string table so we can restore its state prior to transaction start. Since transactional mode only happens at compilation time, we don't need to log all these changes at runtime. In order to reduce the overhead of testing if transactional mode is on/off, we templatize interfaces of mirror::Object and mirror::Array, respectively responsible for setting a field and setting an array element. For various reasons, we skip some specific fields from transaction: - Object's class and array's length must remain unchanged so garbage collector can compute object's size. - Immutable fields only set during class loading: list of fields, method, dex caches, vtables, ... as all classes have been loaded and verified before a transaction occurs. - Object's monitor for performance reason. Before generating the image, we browse the heap to collect objects that need to be written into it. Since the heap may still holds references to unreachable objects due to aborted transactions, we trigger one collection at the end of the class preinitialization phase. Since the transaction is held by the runtime and all compilation threads share the same runtime, we need to ensure only one compilation thread has exclusive access to the runtime. To workaround this issue, we force class initialization phase to run with only one thread. Note this is only done when generating image so application compilation is not impacted. This issue will be addressed in a separate CL. Bug: 9676614 Change-Id: I221910a9183a5ba6c2b99a277f5a5a68bc69b5f9