summaryrefslogtreecommitdiffstats
path: root/runtime/thread.cc
Commit message (Collapse)AuthorAgeFilesLines
* ART: Do not abort on exception in CreatePeerAndreas Gampe2015-10-021-1/+16
| | | | | | | | | Different parts of CreatePeer may throw an exception, especially the Thread constructor. Do not abort in such a case, but return and report a failure to attach/create a thread. Bug: 24200698 Change-Id: I06f2c997f0451c71f791d1f12bea6f8ee65e8ab2
* Get non proxy method for StackDumpVisitorMathieu Chartier2015-07-211-0/+1
| | | | | | | | | Fixes failing DCHECK. (cherry picked from commit ef76c3fa57ddf3f7ca32e118f599da8cb4eb1560) Bug: 22553459 Change-Id: I6fe1012f9a5f8d29cb98bf25e3a279da51c5e1c0
* Follow up on CL 151605Sebastien Hertz2015-06-181-1/+45
| | | | | | | | | | | | | | - Fixes return type of StackedShadowFrameRecord::GetType - Makes StackedShadowFrameType an enum class (scoped enum) - Moves DeoptimizationReturnValueRecord and StackedShadowFrameRecord to thread.cc file and use forward declaration in thread.h header - Fixes tools/generate-operator-out.py for scoped enum classes. Bug: 20845490 (cherry picked from commit f795869da0a1fa006fdcdacd8afb6149a63fc1a7) Change-Id: I6b67e288b1db563699161e58ec2e2330d42dd8f5
* Fix nested deoptimization.Mingyao Yang2015-06-181-28/+43
| | | | | | | | | | | | Handle nested deoptimization cases. Create a stacked shadow frame records to keep track of deoptimization shadow frames. Shadow frames under construction can be tracked in the same stack. Bug: 20845490 (cherry picked from commit 1f2d3ba6af52cf6f566deb38b7e07735c9a08fb6) Change-Id: I768285792c29e7c3cfcd21e7a2600802506024d8
* JDWP: asynchronous invoke command handlingSebastien Hertz2015-06-121-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The JDWP thread used to wait for the result of a method invocation running in an event thread. But doing that prevents the JDWP thread from processing incoming commands from the debugger if the event thread gets suspended by a debug event occurring in another thread. In Android Studio (or another IDE), this leads to the debugger being blocked (with the famous message "Waiting until last debugger command completes" of Android Studio / IntelliJ) because it is actually waiting for the reply of its latest command while the JDWP thread cannot process it. This CL changes the way invoke commands (ClassType.InvokeCommand, ClassType.NewInstance and ObjectReference.InvokeCommand) are handled in the ART runtime. The JDWP thread no longer waits for the event thread to complete the method invocation. It now simply waits for the next JDWP command to process. This means it does not send any reply for invoke commands, except if the information given by the debugger is wrong. In this case, it still sends a reply with the appropriate error code. The event thread is now responsible for sending the reply (containing the result and the exception object of the invoked method) before going back to the suspended state. In other words, we add special handling for invoke commands so they are handled asynchronously while other commands remained handled synchronously. In the future, we may want to handle all commands asynchronously (using a queue of reply/event for instance) to remove the special handling code this CL is adding. Now the JDWP thread can process commands while a thread is invoking a method, it is possible for the debugger to detach (by sending a VirtualMachine.Dispose command) before the invocation completes. In that situation, we must not suspend threads again (including the event thread that executed the method) because they would all remain suspended forever. Also minor cleanup of the use of JDWP constants and update comments. Bug: 21515842 Bug: 18899981 (cherry picked from commit cbc5064ff05179b97b416f00ca579c55e38cd7d9) Change-Id: I8d31006043468913ee8453212e6d16e11fcfe4ea
* ART: Refactor Thread::InitAndreas Gampe2015-06-031-31/+64
| | | | | | | | | | This refactor allows the parent thread to allocate the JNIEnvExt for the child (with a fallback in place in Init). This allows to throw an OOME in CreateNativeThread instead of aborting in the child. Bug: 21291279 Change-Id: Iccc1a5c202999f5bfacec706d9833e53135ba2fa
* Move mirror::ArtMethod to nativeMathieu Chartier2015-06-021-78/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimizing + quick tests are passing, devices boot. TODO: Test and fix bugs in mips64. Saves 16 bytes per most ArtMethod, 7.5MB reduction in system PSS. Some of the savings are from removal of virtual methods and direct methods object arrays. Bug: 19264997 (cherry picked from commit e401d146407d61eeb99f8d6176b2ac13c4df1e33) Change-Id: I622469a0cfa0e7082a2119f3d6a9491eb61e3f3d Fix some ArtMethod related bugs Added root visiting for runtime methods, not currently required since the GcRoots in these methods are null. Added missing GetInterfaceMethodIfProxy in GetMethodLine, fixes --trace run-tests 005, 044. Fixed optimizing compiler bug where we used a normal stack location instead of double on ARM64, this fixes the debuggable tests. TODO: Fix JDWP tests. Bug: 19264997 Change-Id: I7c55f69c61d1b45351fd0dc7185ffe5efad82bd3 ART: Fix casts for 64-bit pointers on 32-bit compiler. Bug: 19264997 Change-Id: Ief45cdd4bae5a43fc8bfdfa7cf744e2c57529457 Fix JDWP tests after ArtMethod change Fixes Throwable::GetStackDepth for exception event detection after internal stack trace representation change. Adds missing ArtMethod::GetInterfaceMethodIfProxy call in case of proxy method. Bug: 19264997 Change-Id: I363e293796848c3ec491c963813f62d868da44d2 Fix accidental IMT and root marking regression Was always using the conflict trampoline. Also included fix for regression in GC time caused by extra roots. Most of the regression was IMT. Fixed bug in DumpGcPerformanceInfo where we would get SIGABRT due to detached thread. EvaluateAndApplyChanges: From ~2500 -> ~1980 GC time: 8.2s -> 7.2s due to 1s less of MarkConcurrentRoots Bug: 19264997 Change-Id: I4333e80a8268c2ed1284f87f25b9f113d4f2c7e0 Fix bogus image test assert Previously we were comparing the size of the non moving space to size of the image file. Now we properly compare the size of the image space against the size of the image file. Bug: 19264997 Change-Id: I7359f1f73ae3df60c5147245935a24431c04808a [MIPS64] Fix art_quick_invoke_stub argument offsets. ArtMethod reference's size got bigger, so we need to move other args and leave enough space for ArtMethod* and 'this' pointer. This fixes mips64 boot. Bug: 19264997 Change-Id: I47198d5f39a4caab30b3b77479d5eedaad5006ab
* ART: Clean up arm64 kNumberOfXRegisters usage.Vladimir Marko2015-05-261-0/+1
| | | | | | | | | | | | | | | | | | | | | Avoid undefined behavior for arm64 stemming from 1u << 32 in loops with upper bound kNumberOfXRegisters. Create iterators for enumerating bits in an integer either from high to low or from low to high and use them for <arch>Context::FillCalleeSaves() on all architectures. Refactor runtime/utils.{h,cc} by moving all bit-fiddling functions to runtime/base/bit_utils.{h,cc} (together with the new bit iterators) and all time-related functions to runtime/base/time_utils.{h,cc}. Improve test coverage and fix some corner cases for the bit-fiddling functions. Bug: 13925192 (cherry picked from commit 80afd02024d20e60b197d3adfbb43cc303cf29e0) Change-Id: I905257a21de90b5860ebe1e39563758f721eab82
* Intercept JNI invocation of String.<init> methods.Jeff Hao2015-05-201-2/+4
| | | | | | | | | | | libmono uses JNI AllocObject and CallNonvirtualVoidMethod to create and initialize a string instead of using the recommended NewObject. This change adds an intercept to change the String.<init> call to a StringFactory call instead. Then, it uses the object id of the original string object referrer and maps it to the result of the StringFactory. Bug: 21288130 Change-Id: Ib4db402c178bc37188d5c5faf30b6e4fdc747b17
* Merge "Insert a read barrier in the JNI bridge."Hiroshi Yamauchi2015-05-111-0/+1
|\
| * Insert a read barrier in the JNI bridge.Hiroshi Yamauchi2015-05-071-0/+1
| | | | | | | | | | | | Bug: 20720510 Bug: 12687968 Change-Id: Ia9edb614853bad45ec25d6e2142361a8bda1eccf
* | Add a flag to StackVisitor for inlining.Nicolas Geoffray2015-05-111-9/+23
| | | | | | | | | | | | | | | | | | The flag tells whether the stack walk needs to include inlined Java frames. This does not do anything just yet, as we're not inlining anyways. Change-Id: I716e25094fe56fa335ca1f9a398c1bcdba478e73
* | Check IsReferenceVReg during deoptMathieu Chartier2015-05-081-4/+0
|/ | | | | | | | | | | Required since the quick GC maps may not agree with the verifier ones. Without this check we may copy stale object references into the shadow frame. (cherry picked from commit f00baf56ef647684888a407dbb6adadd704a2039) Bug: 20736048 Change-Id: I7783c8a8ee45cf601b08b4c38f1dec7f7d11380c
* Replace String CharArray with internal uint16_t array.Jeff Hao2015-04-271-0/+59
| | | | | | | | | | | | Summary of high level changes: - Adds compiler inliner support to identify string init methods - Adds compiler support (quick & optimizing) with new invoke code path that calls method off the thread pointer - Adds thread entrypoints for all string init methods - Adds map to verifier to log when receiver of string init has been copied to other registers. used by compiler and interpreter Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
* Guard against name == null in ShortDumpMathieu Chartier2015-04-241-5/+5
| | | | | Bug: 20561804 Change-Id: If1e4adb74d5b936cf171f2402bf4525bf8c2d209
* Fix reflection handling and test flakinessMathieu Chartier2015-04-231-3/+8
| | | | | | | | | | | | Fixed reflection invoke to handle exceptions which occur from FindClass or NewObject by throwing these instead of the expected InvocationTargetException. Added test case to 080 for this reflection invoke. Fixed println throwing OOM in 104-growth-limit. Change-Id: I65766e7c3478e299da06fdc3a521fe3f3e8fdba9
* Replace NULL with nullptrMathieu Chartier2015-04-221-10/+10
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* Fix valgrind testsMathieu Chartier2015-04-141-0/+3
| | | | | | Delete large objects in space destructor. Also some cleanup. Change-Id: I4c4e90149841a156b7a3236201b37683e14890fb
* Revert "ART: Turn of native stack dump on x86 on-device"Christopher Ferris2015-04-131-5/+0
| | | | | | | | This reverts commit 2f0751ea75e5f093d9ce7b8587e65a2ca3de0855. Bug: 20040863 Change-Id: Ibd40916c0f84512b0ba13af09d4fd345be39e227
* Move ArtField to nativeMathieu Chartier2015-04-101-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add linear alloc. Moved ArtField to be native object. Changed image writer to put ArtFields after the mirror section. Savings: 2MB on low ram devices 4MB on normal devices Total PSS measurements before (normal N5, 95s after shell start): Image size: 7729152 bytes 23112 kB: .NonMoving 23212 kB: .NonMoving 22868 kB: .NonMoving 23072 kB: .NonMoving 22836 kB: .NonMoving 19618 kB: .Zygote 19850 kB: .Zygote 19623 kB: .Zygote 19924 kB: .Zygote 19612 kB: .Zygote Avg: 42745.4 kB After: Image size: 7462912 bytes 17440 kB: .NonMoving 16776 kB: .NonMoving 16804 kB: .NonMoving 17812 kB: .NonMoving 16820 kB: .NonMoving 18788 kB: .Zygote 18856 kB: .Zygote 19064 kB: .Zygote 18841 kB: .Zygote 18629 kB: .Zygote 3499 kB: .LinearAlloc 3408 kB: .LinearAlloc 3424 kB: .LinearAlloc 3600 kB: .LinearAlloc 3436 kB: .LinearAlloc Avg: 39439.4 kB No reflection performance changes. Bug: 19264997 Bug: 17643507 Change-Id: I10c73a37913332080aeb978c7c94713bdfe4fe1c
* Add support for nested method verifiersMathieu Chartier2015-04-091-6/+6
| | | | | | | | | | | | | | Can occur in the following scenario: MethodVerifier::Verify -> MethodVerifier::GetStaticField -> ResolveFieldJLS -> ThrowNoSuchFieldError -> EnsureInitialized -> VerifyClass Also fixed another case where we can be requested to dump for ANR while we are suspended in one of the AllowSuspension points. Bug: 20140397 Change-Id: Ib17f6b98954caa5d1ea1c1dcde66091cc6d11c25
* ART: IRT refactorAndreas Gampe2015-04-091-1/+5
| | | | | | | | | | IRT creation might fail. Add a path that allows to bypass the aborts and instead signal validity. Hide this path with a private constructor, rewrite users to use a static Create method. Bug: 20110201 Change-Id: I440499c3372cd7557eb970b70ce2c4543da520e4
* Fix CC root visiting bugMathieu Chartier2015-04-071-1/+2
| | | | | | Also some cleanup. Change-Id: Ia3de8f2d409770be3619ec116e8b06ecd82338fe
* Refactor and improve GC root handlingMathieu Chartier2015-04-061-64/+64
| | | | | | | | | | | | | | | | | | | | | | Changed GcRoot to use compressed references. Changed root visiting to use virtual functions instead of function pointers. Changed root visting interface to be an array of roots instead of a single root at a time. Added buffered root marking helper to avoid dispatch overhead. Root marking seems a bit faster on EvaluateAndApplyChanges due to batch marking. Pause times unaffected. Mips64 is untested but might work, maybe. Before: MarkConcurrentRoots: Sum: 67.678ms 99% C.I. 2us-664.999us Avg: 161.138us Max: 671us After: MarkConcurrentRoots: Sum: 54.806ms 99% C.I. 2us-499.986us Avg: 136.333us Max: 602us Bug: 19264997 Change-Id: I0a71ebb5928f205b9b3f7945b25db6489d5657ca
* ART: Turn of native stack dump on x86 on-deviceAndreas Gampe2015-04-031-0/+5
| | | | | | | Temporary workaround for bug. Bug: 20040863 Change-Id: Ifdde68c66b94ebc2f13c7983f38700c8bcf41559
* Revert "Revert "Deoptimization-based bce.""Mingyao Yang2015-04-011-0/+1
| | | | | | This reverts commit 0ba627337274ccfb8c9cb9bf23fffb1e1b9d1430. Change-Id: I1ca10d15bbb49897a0cf541ab160431ec180a006
* Revert "Deoptimization-based bce."Andreas Gampe2015-03-241-1/+0
| | | | | | | | | | This breaks compiling the core image: Error after BCE: art::SSAChecker: Instruction 219 in block 1 does not dominate use 221 in block 1. This reverts commit e295e6ec5beaea31be5d7d3c996cd8cfa2053129. Change-Id: Ieeb48797d451836ed506ccb940872f1443942e4e
* Deoptimization-based bce.Mingyao Yang2015-03-231-0/+1
| | | | | | | | | | | | | | | | | | | A mechanism is introduced that a runtime method can be called from code compiled with optimizing compiler to deoptimize into interpreter. This can be used to establish invariants in the managed code If the invariant does not hold at runtime, we will deoptimize and continue execution in the interpreter. This allows to optimize the managed code as if the invariant was proven during compile time. However, the exception will be thrown according to the semantics demanded by the spec. The invariant and optimization included in this patch are based on the length of an array. Given a set of array accesses with constant indices {c1, ..., cn}, we can optimize away all bounds checks iff all 0 <= min(ci) and max(ci) < array-length. The first can be proven statically. The second can be established with a deoptimization-based invariant. This replaces n bounds checks with one invariant check (plus slow-path code). Change-Id: I8c6e34b56c85d25b91074832d13dba1db0a81569
* Compress the StackMaps.Nicolas Geoffray2015-03-201-3/+4
| | | | | | | | First step towards the compression of the StackMap (not the DexRegisterMap). Next step will be to just use what is needed (instead of byte -> word). Change-Id: I4f81b2d05bf5cc508585e16fbbed1bafbc850e2e
* Change method verifiers to be thread local rootsMathieu Chartier2015-03-131-0/+14
| | | | | | Bug: 10921004 Change-Id: I3a1425d76cd380587ba67ef6d5ec1227564e55bf
* API change in StackVisitor::GetVReg*.Nicolas Geoffray2015-03-131-3/+3
| | | | | | | | | | - Remove GetVReg() and SetVReg() that were expecting to always succeed. - Change Quick-only methods to take a FromQuickCode suffix. - Change deopt to use dead values when GetVReg does not succeed: the optimizing compiler will not have a location for uninitialized Dex registers and potentially dead registers. Change-Id: Ida05773a97aff8aa69e0caf42ea961f80f854b77
* Remove ThrowLocation.Nicolas Geoffray2015-03-101-21/+8
| | | | | | | Note that this is a cleanup change, and has no functionality change. The ThrowLocation had no use anymore. Change-Id: I3d2126af1dc673cec3a0453ff3d56a172663a5f6
* Merge "JDWP: allocate DebugInvokeReq only when requested"Sebastien Hertz2015-03-101-3/+17
|\
| * JDWP: allocate DebugInvokeReq only when requestedSebastien Hertz2015-03-091-3/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only allocates thread-local DebugInvokeReq when the debugger requests a thread to invoke a method. The JDWP thread allocates that structure then attaches it to the target thread. When the thread is resumed, it executes the method. Once the invocation completes, the thread detaches the DebugInvokeReq, signals the JDWP thread then suspends. Finally, the JDWP thread wakes up, prepares the reply with the invoke result (or exception) and deallocates the DebugInvokeReq. Also ensures GC safety for object returned by the invoke. We add the object to the JDWP object registry right after the invoke. We now reference that object with a JDWP ObjectID instead of an Object* in the DebugInvokeReq struct. This prevent from accessing a stale reference if the GC runs and moves the Object*. This CL includes the following changes: - Move former DebugInvokeReq::ready flag to Thread::tls_32bit_sized_values::ready_for_debug_invoke. It's needed to know whether a thread has been suspended by an event, thus ready to invoke a method from the debugger. - Remove DebugInvokeReq::invoke_needed: we now test if we attached a DebugInvokeReq* to the thread. - Rename misleading FinishMethod function to RequestMethod. Bug: 19142632 Bug: 18166750 Change-Id: I351fb4eb94bfe69fcafb544d21d55ff35a033000
* | Use the current Java stack instead of the ThrowLocation.Nicolas Geoffray2015-03-091-6/+6
|/ | | | | | | The ThrowLocation contains information we can actually retrieve from the current stack. Change-Id: I7e5b2f519f95830c457cb31ea10a581aa9c973ee
* Compute the right catch location for the debugger.Nicolas Geoffray2015-03-091-43/+23
| | | | | | Also remove tls ThrowLocation, it is not needed anymore. Change-Id: I78fddf09ce968ca475e39c17fa76d699c589c8d9
* Change how we report exceptions to the debugger.Nicolas Geoffray2015-03-031-6/+7
| | | | | | | This is only a refactoring/cleanup. Bug fixes with respect to catch location, and more cleanups will follow. Change-Id: I30d3c6260b0c8f8115a811621397225b88f2063a
* Revert "Revert "Add JIT""Mathieu Chartier2015-02-241-1/+1
| | | | | | | | Added missing EntryPointToCodePointer. This reverts commit a5ca888d715cd0c6c421313211caa1928be3e399. Change-Id: Ia74df0ef3a7babbdcb0466fd24da28e304e3f5af
* Revert "Add JIT"Nicolas Geoffray2015-02-241-1/+1
| | | | | | | | | | | | | | | Sorry, run-test crashes on target: 0-05 12:15:51.633 I/DEBUG (27995): Abort message: 'art/runtime/mirror/art_method.cc:349] Check failed: PcIsWithinQuickCode(reinterpret_cast<uintptr_t>(code), pc) java.lang.Throwable java.lang.Throwable.fillInStackTrace() pc=71e3366b code=0x71e3362d size=ad000000' 10-05 12:15:51.633 I/DEBUG (27995): r0 00000000 r1 0000542b r2 00000006 r3 00000000 10-05 12:15:51.633 I/DEBUG (27995): r4 00000006 r5 b6f9addc r6 00000002 r7 0000010c 10-05 12:15:51.633 I/DEBUG (27995): r8 b63fe1e8 r9 be8e1418 sl b6427400 fp b63fcce0 10-05 12:15:51.633 I/DEBUG (27995): ip 0000542b sp be8e1358 lr b6e9a27b pc b6e9c280 cpsr 40070010 10-05 12:15:51.633 I/DEBUG (27995): Bug: 17950037 This reverts commit 2535abe7d1fcdd0e6aca782b1f1932a703ed50a4. Change-Id: I6f88849bc6f2befed0c0aaa0b7b2a08c967a83c3
* Add JITMathieu Chartier2015-02-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently disabled by default unless -Xjit is passed in. The proposed JIT is a method JIT which works by utilizing interpreter instrumentation to request compilation of hot methods async during runtime. JIT options: -Xjit / -Xnojit -Xjitcodecachesize:N -Xjitthreshold:integervalue The JIT has a shared copy of a compiler driver which is accessed by worker threads to compile individual methods. Added JIT code cache and data cache, currently sized at 2 MB capacity by default. Most apps will only fill a small fraction of this cache however. Added support to the compiler for compiling interpreter quickened byte codes. Added test target ART_TEST_JIT=TRUE and --jit for run-test. TODO: Clean up code cache. Delete compiled methods after they are added to code cache. Add more optimizations related to runtime checks e.g. direct pointers for invokes. Add method recompilation. Move instrumentation to DexFile to improve performance and reduce memory usage. Bug: 17950037 Change-Id: Ifa5b2684a2d5059ec5a5210733900aafa3c51bca
* ART: Introduce NO_RETURN, Mark DoLongJump noreturnAndreas Gampe2015-02-231-2/+0
| | | | | | | Add NO_RETURN macro that adds C++11 noreturn attribute. Mark DoLongJump methods as noreturn. Change-Id: Ifde4318e370493237050d4c1349285a0382df23f
* ART: Make run-tests more verboseAndreas Gampe2015-02-171-2/+2
| | | | | | | | | Make run-tests log ERROR level on host. Adjust some internal LOG(ERROR) to LOG(WARNING). Add check scripts to adjust for other LOG(ERROR) messages. Bug: 18713034 Change-Id: I2a3e055baa6a0e31f106364c300c20963a59ed94
* JDWP: allocate single step control only when activeSebastien Hertz2015-01-261-2/+18
| | | | | | | | Only allocates SingleStepControl when a single step is requested in a thread. Bug: 19142632 Change-Id: I830b7eaea86b516d3fac80ce14d41c66b4bd5415
* More of the concurrent copying collector.Hiroshi Yamauchi2015-01-231-0/+53
| | | | | Bug: 12687968 Change-Id: I62f70274d47df6d6cab714df95c518b750ce3105
* Enable core callee-save on x64.Nicolas Geoffray2015-01-211-0/+11
| | | | | | Will work on other architectures and FP support in other CLs. Change-Id: I8cef0343eedc7202d206f5217fdf0349035f0e4d
* Print more info in MarkSweep::VerifyRootMathieu Chartier2015-01-151-21/+22
| | | | | | | | | | | | | | | | | | | | | | | Refactored old root callback to use a new class called RootInfo. RootInfo contains all the relevant info related to the root associated with the callback. The MarkSweep::VerifyRoot function now uses this info to print the StackVisitor's described location if the GC root is of the type kRootJavaFrame. Some other cleanup. Example output: E/art (12167): Tried to mark 0x123 not contained by any spaces E/art (12167): Attempting see if it's a bad root E/art (12167): Found invalid root: 0x123 with type RootJavaFrame E/art (12167): Location=Visiting method 'void java.lang.Runtime.gc()' at dex PC 0xffffffff (native PC 0x0) vreg=0 (cherry picked from commit 12f7423a2bb4bfab76700d84eb6d4338d211983a) Bug: 18588862 Change-Id: Ic5a2781f704e931265ffb3621c2eab4b2e25f60f
* Merge "Clean up some #ifdefs."Elliott Hughes2015-01-091-2/+2
|\
| * Clean up some #ifdefs.Elliott Hughes2015-01-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | Only the Mac doesn't have POSIX clocks. (And it still doesn't, a decade later.) glibc gained pthread_setname_np in 2.12. Only the Mac doesn't have prctl. Change-Id: I218e409f7e133736e15fb68e8a254cdc5799d667
* | Fix HandleScope with wrong thread errorMathieu Chartier2015-01-091-2/+3
|/ | | | | | | | | | | | | Possibly fixes +art F 5127 6995 art/runtime/handle_scope-inl.h:43] Check failed: top_handle_scope == this (top_handle_scope=0x2b449293c770, this=0x2b4492d6a0a8) Seen in tests. A possible cause was that the thread dumping stacks was running checkpoints on a suspended thread but putting a HandleScope on that thread instead of itself. This isn't safe if the suspended thread is doing HandleScope stuff in a non runnable state. Change-Id: Icdaadabca5aff8d380d5cc9570b9e899fe790a62
* Fix frequent gcstress ThreadStress crashMathieu Chartier2015-01-061-1/+4
| | | | | | | | | | Calling IdentityHashCode before PrettyTypeOf was causing occasional stale root errors since IdentityHashCode can cause thread suspension. Cleaned up VisitLocks. Bug: 18766916 Change-Id: I7679539877e48a8c9aadb8a34718404ebce98d25