summaryrefslogtreecommitdiffstats
path: root/runtime/thread.h
Commit message (Collapse)AuthorAgeFilesLines
* Follow up on CL 151605Sebastien Hertz2015-06-181-45/+4
| | | | | | | | | | | | | | - 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-20/+98
| | | | | | | | | | | | 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-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-3/+15
| | | | | | | | | | 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-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* JDWP: properly combine location eventsSebastien Hertz2015-05-071-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This CL properly groups JDWP events at the same location: Breakpoint, Single-step, Method Entry and Method Exit. This is necessary if the debugger is not the only instrumentation listener. This matches the behavior of Dalvik, especially for methods with a single return instruction. The interpreter was tuned so the instrumentation callbacks were called to satisfy the debugger with the idea the debugger was the only instrumentation listener. This is not true when method tracing is enabled at the same time. When tracing is enabled, there is always a listener for MethodEntry and MethodExit events (art::Trace class). However, if the debugger is only listening to DexPcMoved event (to manage JDWP Breakpoint event), it will not be notified of this event. We now properly call all the instrumentation callbacks in the interpreter and move the logic specific to debugging into the class DebugInstrumentationListener. This allows to properly group JDWP location events together depending on the sequence of instrumentation callbacks. We add Thread::tls_32bit_sized_values::debug_method_entry_ flag to remember we just entered a method. It replaces the local variable notified_method_entry_event in the interpreter and simplifies the code. Bump oat version to force recompilation because the layout of the Thread class is modified. Bug: 19829329 Bug: 20205350 (cherry picked from commit 9d6bf69ad3012a9d843268fdd5325b6719b6d5f2) Change-Id: I204af9112e37d2eebc86661fb7c961a41c74e598
* Replace String CharArray with internal uint16_t array.Jeff Hao2015-04-271-0/+12
| | | | | | | | | | | | 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
* Fix reflection handling and test flakinessMathieu Chartier2015-04-231-0/+1
| | | | | | | | | | | | 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-13/+13
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* Fix tlsPtr_.long_jump_context == nullptr check failure.Mingyao Yang2015-04-221-1/+13
| | | | | | | | This is a bogus assertion. We need to handle the case though to free the existing tlsPtr_.long_jump_context. Bug: 20449310 Change-Id: Ie1e49dd1fec9defab69f081d1f129aa8dc1dc6bf
* Add support for nested method verifiersMathieu Chartier2015-04-091-2/+2
| | | | | | | | | | | | | | 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
* Refactor and improve GC root handlingMathieu Chartier2015-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | 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
* Assembly TLAB allocation fast path for x86_64.Hiroshi Yamauchi2015-03-201-0/+15
| | | | | | | TODO: resolved/initialized cases, other architectures. Bug: 9986565 Change-Id: If6df3449a3b2f5074d11babdda0fd2791fd54946
* Change method verifiers to be thread local rootsMathieu Chartier2015-03-131-4/+13
| | | | | | Bug: 10921004 Change-Id: I3a1425d76cd380587ba67ef6d5ec1227564e55bf
* Remove ThrowLocation.Nicolas Geoffray2015-03-101-13/+5
| | | | | | | Note that this is a cleanup change, and has no functionality change. The ThrowLocation had no use anymore. Change-Id: I3d2126af1dc673cec3a0453ff3d56a172663a5f6
* JDWP: allocate DebugInvokeReq only when requestedSebastien Hertz2015-03-091-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Compute the right catch location for the debugger.Nicolas Geoffray2015-03-091-12/+3
| | | | | | Also remove tls ThrowLocation, it is not needed anymore. Change-Id: I78fddf09ce968ca475e39c17fa76d699c589c8d9
* Change how we report exceptions to the debugger.Nicolas Geoffray2015-03-031-15/+6
| | | | | | | This is only a refactoring/cleanup. Bug fixes with respect to catch location, and more cleanups will follow. Change-Id: I30d3c6260b0c8f8115a811621397225b88f2063a
* ART: Introduce NO_RETURN, Mark DoLongJump noreturnAndreas Gampe2015-02-231-1/+1
| | | | | | | Add NO_RETURN macro that adds C++11 noreturn attribute. Mark DoLongJump methods as noreturn. Change-Id: Ifde4318e370493237050d4c1349285a0382df23f
* Merge "JDWP: allocate single step control only when active"Sebastien Hertz2015-01-271-1/+10
|\
| * JDWP: allocate single step control only when activeSebastien Hertz2015-01-261-1/+10
| | | | | | | | | | | | | | | | Only allocates SingleStepControl when a single step is requested in a thread. Bug: 19142632 Change-Id: I830b7eaea86b516d3fac80ce14d41c66b4bd5415
* | Change AtomicStack to use StackReferenceMathieu Chartier2015-01-251-4/+6
|/ | | | | | | | | Previously used Object*, using StackReference saves memory on 64 bit devices. Bug: 12935052 Bug: 17643507 Change-Id: I035878690054eeeb24d655a900b8f26c837703ff
* More of the concurrent copying collector.Hiroshi Yamauchi2015-01-231-4/+22
| | | | | Bug: 12687968 Change-Id: I62f70274d47df6d6cab714df95c518b750ce3105
* Remove portable.Elliott Hughes2014-12-121-8/+1
| | | | Change-Id: I3bf3250fa866fd2265f1b115d52fa5dedc48a7fc
* Remove MethodHelper::HasSameNameAndSignature.Ian Rogers2014-12-021-1/+1
| | | | | | Move sole use to a static method with art_method.cc. Change-Id: I2e7994cc1c31b5ca74df5d7be5538003d4ed0150
* Instruction set features for ARM64, MIPS and X86.Ian Rogers2014-11-131-1/+1
| | | | | | | | | | | | | Also, refactor how feature strings are handled so they are additive or subtractive. Make MIPS have features for FPU 32-bit and MIPS v2. Use in the quick compiler rather than #ifdefs that wouldn't have worked in cross-compilation. Add SIMD features for x86/x86-64 proposed in: https://android-review.googlesource.com/#/c/112370/ Bug: 18056890 Change-Id: Ic88ff84a714926bd277beb74a430c5c7d5ed7666
* Allow JNI AttachCurrentThread to fail if not enough stack.Ian Rogers2014-11-111-2/+2
| | | | | | | Add unit tests and move JavaVM JNI tests into there own set of gtests. Bug: 18330119 Change-Id: I0e93dff783b1f5d787b3084d24122883e14951a1
* ART: More warningsAndreas Gampe2014-11-041-1/+0
| | | | | | | Enable -Wno-conversion-null, -Wredundant-decls and -Wshadow in general, and -Wunused-but-set-parameter for GCC builds. Change-Id: I81bbdd762213444673c65d85edae594a523836e5
* ART: Replace COMPILE_ASSERT with static_assert (runtime)Andreas Gampe2014-11-031-3/+3
| | | | | | Replace all occurrences of COMPILE_ASSERT in the runtime tree. Change-Id: I01e420899c760094fb342cc6cb9e692dd670a0b2
* Refactor quick entrypointsIan Rogers2014-10-201-9/+1
| | | | | | | | | | | Remove FinishCalleeSaveFrameSetup. Assembly routines write down anchor into TLS as well as placing runtime method in callee save frame. Simplify artSet64InstanceFromCode by not computing the referrer from the stack in the C++ code. Move assembly offset tests next to constant declaration and tidy arch_test. Change-Id: Iededeebc05e54a1e2bb7bb3572b8ba012cffa1c8
* Make ART compile with GCC -O0 again.Ian Rogers2014-10-161-0/+3
| | | | | | | | | | | | | Tidy up InstructionSetFeatures so that it has a type hierarchy dependent on architecture. Add to instruction_set_test to warn when InstructionSetFeatures don't agree with ones from system properties, AT_HWCAP and /proc/cpuinfo. Clean-up class linker entry point logic to not return entry points but to test whether the passed code is the particular entrypoint. This works around image trampolines that replicate entrypoints. Bug: 17993736 Change-Id: I5f4b49e88c3b02a79f9bee04f83395146ed7be23
* Work around ICE bugs with MIPS GCC and O1.Ian Rogers2014-10-101-1/+1
| | | | | | | | | Also, work around GCC warning bugs where array accesses with explicit bounds checks are flagged as being out-of-bounds. Significantly, clean-up the HandleScope so the array accesses don't appear out-of-bounds at compile time. Change-Id: I5d66567559cc1f97cd0aa02c0df8575ebadbfe3d
* stdint types all the way!Ian Rogers2014-10-091-9/+9
| | | | Change-Id: I4e4ef3a2002fc59ebd9097087f150eaf3f2a7e08
* ART: Fix some -Wpedantic errorsAndreas Gampe2014-09-291-1/+1
| | | | | | | | | | | | | | | | Remove extra semicolons. Dollar signs in C++ identifiers are an extension. Named variadic macros are an extension. Binary literals are a C++14 feature. Enum re-declarations are not allowed. Overflow. Change-Id: I7d16b2217b2ef2959ca69de84eaecc754517714a
* Add ScopedAssertNoThreadSuspensionMathieu Chartier2014-09-191-0/+17
| | | | | | | | Added a new class, ScopedAssertNoThreadSuspension. Deleted some unnecessary ScopedAssertNoThreadSuspension since VisitObjects already has a ScopedAssertNoThreadSuspension. Change-Id: I29ec0006120c39a27184d30e2d1d0c179e203776
* Compile time performance improvements focusing on interpret-only.Ian Rogers2014-09-121-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce virtual method dispatch in the method verifier and make more code inline-able. Add a StringPiece with const char* equality operator to avoid redundant StringPieces and strlens. Remove back link from register line to verifier and pass as argument to reduce size of RegisterLine. Remove instruction length from instruction flags and compute from the instruction, again to reduce size. Add suspend checks to resolve and verify to allow for more easy monitor inflation and reduce contention on Locks::thread_list_suspend_thread_lock_. Change ThrowEarlierClassFailure to throw pre-allocated exception. Avoid calls to Thread::Current() by passing self. Template specialize IsValidClassName. Make ANR reporting with SIGQUIT run using checkpoints rather than suspending all threads. This makes the stack/lock analysis less lock error prone. Extra Barrier assertions and condition variable time out is now returned as a boolean both from Barrier and ConditionVariable::Wait. 2 threaded host x86-64 interpret-only numbers from 341 samples: Before change: Avg 176.137ms 99% CI 3.468ms to 1060.770ms After change: Avg 139.163% 99% CI 3.027ms to 838.257ms Reduction in average compile time after change is 20.9%. Slow-down without change is 26.5%. Bug: 17471626 - Fix bug where RegTypeCache::JavaLangObject/String/Class/Throwable could return unresolved type when class loading is disabled. Bug: 17398101 Change-Id: Id59ce3cc520701c6ecf612f7152498107bc40684
* Handle nested signalsDave Allison2014-08-271-0/+8
| | | | | | | | | | | | | | | | | This allows for signals to be raised inside the ART signal handler. This can occur when the JavaStackTraceHandler attempts to generate a stack trace and something goes wrong. It also fixes an issue where the fault manager was not being correctly shut down inside the signal chaining code. In this case the signal handler was not restored to the original. Bug: 17006816 Bug: 17133266 (cherry picked from commit fabe91e0d558936ac26b98d2b4ee1af08f58831d) Change-Id: I10730ef52d5d8d34610a5293253b3be6caf4829e
* ART: Improve error message on oat writer failureAndreas Gampe2014-08-261-0/+1
| | | | | | | Try to log the pending exception to help resolve issues. Bug: 16406811 Change-Id: I035ae9e59a5ee02b9e90c35c0644ec088d3c7d12
* Merge stack usage reduction for overflow checksDave Allison2014-08-191-8/+2
| | | | | | Cherry pick from: b038ba66a166fb264ca121632f447712e0973b5b Change-Id: I19999e72ff731d4fc73d91b9ff767de5858c15ee
* Reduce stack usage for overflow checksDave Allison2014-08-131-6/+52
| | | | | | | | | | | | | | | | | This reduces the stack space reserved for overflow checks to 12K, split into an 8K gap and a 4K protected region. GC needs over 8K when running in a stack overflow situation. Also prevents signal runaway by detecting a signal inside code that resulted from a signal handler invokation. And adds a max signal count to the SignalTest to prevent it running forever. Also reduces the number of iterations for the InterfaceTest as this was taking (almost) forever with the --trace option on run-test. Bug: 15435566 Change-Id: Id4fd46f22d52d42a9eb431ca07948673e8fda694
* Wire up check JNI force copy mode.Ian Rogers2014-08-081-4/+3
| | | | | | | | | | | | Increase check JNI checks. Break apart jni_internal.h in to jni_env_ext.h and java_vm_ext.h. Fix the abuse of ScopedObjectAccess/annotalysis by ScopedCheck in the case of VM routines. Make class loader override and shared library class loader JNI global references rather than mirror pointers. Clean-ups to native bridge. Change-Id: If7c6110b5aade7a402bfb67534af86a7b2cdeb55
* ART: Clean up API after change 102631Andreas Gampe2014-07-251-1/+3
| | | | | | | | | This adds an abort_on_error parameter to GetCurrentMethod, which is by default true. This restores all previous behavior, except for monitor installation, where it follows 101639. Bug: 16556938 Change-Id: I9a12b9a21ccb9f558c86236bb58d15ff2fafaec0
* Interpreter can kick in even when implicit checks are enabled.Nicolas Geoffray2014-07-221-0/+10
| | | | | | Add a GetStackEndForInterpreter for its stack overfow check. Change-Id: I2d4fc229a8eb727fda509ff778e16d60d96ecc28
* ART: Throw StackOverflowError in native codeAndreas Gampe2014-07-211-3/+2
| | | | | | | | | | Initialize stack-overflow errors in native code to be able to reduce the preserved area size of the stack. Includes a refactoring away from constexpr in instruction_set.h to allow for easy changing of the values. Change-Id: I117cc8485f43da5f0a470f0f5e5b3dc3b5a06246
* Break apart header files.Ian Rogers2014-07-151-2/+3
| | | | | | | | Create libart-gtest for common runtime and compiler gtest routines. Rename CompilerCallbacksImpl that is quick compiler specific. Rename trace clock source constants to not use the overloaded profiler term. Change-Id: I4aac4bdc7e7850c68335f81e59a390133b54e933
* ART: Compacting ROS/DlMalloc spaces with semispace copy GCZuo Wang2014-07-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current semispace copy GC is mainly associated with bump pointer spaces. Though it squeezes fragmentation most aggressively, an extra copy is required to re-establish the data in the ROS/DlMalloc space to allow CMS GCs to happen afterwards. As semispace copy GC is still stop-the-world, this not only introduces unnecessary overheads but also longer response time. Response time indicates the time duration between the start of transition request and the start of transition animation, which may impact the user experience. Using semispace copy GC to compact the data in a ROS space to another ROS(or DlMalloc space to another DlMalloc) space solves this problem. Although it squeezes less fragmentation, CMS GCs can run immediately after the compaction. We apply this algorithm in two cases: 1) Right before throwing an OOM if -XX:EnableHSpaceCompactForOOM is passed in as true. 2) When app is switched to background if the -XX:BackgroundGC option has value HSpaceCompact. For case 1), OOMs are significantly delayed in the harmony GC stress test, with compaction ratio up to 0.87. For case 2), compaction ratio around 0.5 is observed in both built-in SMS and browser. Similar results have been obtained on other apps as well. Change-Id: Iad9eabc6d046659fda3535ae20f21bc31f89ded3 Signed-off-by: Wang, Zuo <zuo.wang@intel.com> Signed-off-by: Chang, Yang <yang.chang@intel.com> Signed-off-by: Lei Li <lei.l.li@intel.com> Signed-off-by: Lin Zang <lin.zang@intel.com>
* Improve performance of invokevirtual/invokeinterface with embedded imt/vtableMingyao Yang2014-07-111-2/+1
| | | | | | | | | Add an embedded version of imt/vtable into class object. Both tables start at fixed offset within class object so method/entry point can be loaded directly from class object for invokeinterface/invokevirtual. Bug: 8142917 Change-Id: I4240d58cfbe9250107c95c0708c036854c455968
* Faster TLAB allocator.Mathieu Chartier2014-07-111-1/+1
| | | | | | | | | | | | | New TLAB allocator doesn't increment bytes allocated until we allocate a new TLAB. This increases allocation performance by avoiding a CAS. MemAllocTest: Before GSS TLAB: 3400ms. After GSS TLAB: 2750ms. Bug: 9986565 Change-Id: I1673c27555330ee90d353b98498fa0e67bd57fad
* Missed use of android_atomic and thread state_.Ian Rogers2014-07-091-2/+6
| | | | | | Move to using art::Atomic, add necessary FetchAnd... operations to art::Atomic. Change-Id: I32f1cdc4e0a2037b73f459bf4bb4d544f357f41b