summaryrefslogtreecommitdiffstats
path: root/runtime/interpreter
Commit message (Collapse)AuthorAgeFilesLines
* Make ART compile with GCC -O0 again.Ian Rogers2014-10-163-23/+25
| | | | | | | | | | | | | 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
* Fix 2 new sets of clang compiler warnings.Ian Rogers2014-10-102-0/+20
| | | | | | | | | | | Fix issues that are flagged by -Wfloat-equal and -Wmissing-noreturn. In the case of -Wfloat-equal the current cases in regular code are deliberate, so the change is to silence the warning. For gtest code the appropriate fix is to switch from EXPECT_EQ to EXPECT_(FLOAT|DOUBLE)_EQ. The -Wmissing-noreturn warning isn't enabled due to a missing noreturn in gtest. This issue has been reported to gtest. Change-Id: Id84c70c21c542716c9ee0c41492e8ff8788c4ef8
* Don't copy fill array data to quick literal pool.Ian Rogers2014-10-082-39/+11
| | | | | | | | | | | Currently quick copies the fill array data from the dex file to the literal pool. It then has to go through hoops to pass this PC relative address down to out-of-line code. Instead, pass the offset of the table to the out-of-line code and use the CodeItem data associated with the ArtMethod. This reduces the size of oat code while greatly simplifying it. Unify the FillArrayData implementation in quick, portable and the interpreters. Change-Id: I9c6971cf46285fbf197856627368c0185fdc98ca
* Handlerize methods across some GC points.Hiroshi Yamauchi2014-10-062-17/+17
| | | | | Bug: 12687968 Change-Id: I0d5b0a78488ba76db4d25991d8db95b24bb624e9
* Merge "ART: Fix some -Wpedantic errors"Andreas Gampe2014-09-302-40/+40
|\
| * ART: Fix some -Wpedantic errorsAndreas Gampe2014-09-292-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Revert "Enable computed goto interpreter on the host"Sebastien Hertz2014-09-301-0/+28
|/ | | | | | This reverts commit 66d9bdb94f21106aaaa31a8fd686098672075e04. Bug: 17716550 Change-Id: Ib404242c86e96e8edf019a2dcc14f0f8294b79e8
* Some optimizations for the array alloc path.Hiroshi Yamauchi2014-09-252-3/+4
| | | | | | | | | | | | | | | | | - Force Array::Alloc() to be inlined. - Simplify the array size overflow check. - Turn fill_usable into a template parameter. - Remove a branch in Array::DataOffset() and avoid Primitive::ComponentSize(), which has a switch, in the array alloc path. - Strength reductions in the array size computation by using component size shifts instead of component sizes. Store component size shift in the upper 16 bits of primitive_type field. - Speedup: ~4% (3435->3284) in MemAllocTest on N4. Bug: 9986565 Change-Id: I4b142ffac4ab8b5b915836f1660a949d6442344c
* Enable computed goto interpreter on the hostSebastien Hertz2014-09-231-28/+0
| | | | | | | | | | | We disabled the computed goto interpreter when compiling with clang because of compilation issues. Since we compile with clang on the host, we used the switch-based interpreter. Now clang is able to compile the computed goto interpreter, we can use it by default on the host. Change-Id: Ifa2a2d3c171b1116ecd3b3f213382c3c85e93f66
* ART: Rename Handle hierarchyAndreas Gampe2014-09-151-3/+3
| | | | | | | Bring the names in line with normal OO principles: ConstHandle becomes Handle, and Handle becomes MutableHandle. Change-Id: I0f018eb7ba28bc422e3a23dd73a6cbe6fc2d2044
* Compile time performance improvements focusing on interpret-only.Ian Rogers2014-09-125-106/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Reduced memory usage of primitive fields smaller than 4-bytesFred Shih2014-08-253-22/+70
| | | | | | | | | | Reduced memory used by byte and boolean fields from 4 bytes down to a single byte and shorts and chars down to two bytes. Fields are now arranged as Reference followed by decreasing component sizes, with fields shuffled forward as needed. Bug: 8135266 Change-Id: I65eaf31ed27e5bd5ba0c7d4606454b720b074752
* Clean up Handle usage.Mathieu Chartier2014-08-231-2/+2
| | | | | | | | | | | Prefer using ConstHandle instead of Handle as function arguments since you can't assign new references to ConstHandle which helps prevent bugs. Changed NullHandle to be a ConstHandle so that you can never modify it to be a non null reference. Change-Id: I81cb979f6f8d5b49e5614966a2caf28c3701dd4f
* Avoid use of std::string where we have const char*.Ian Rogers2014-08-123-12/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "Set vtable in class object to null after linking."Mingyao Yang2014-07-221-1/+2
|\
| * Set vtable in class object to null after linking.Mingyao Yang2014-07-221-1/+2
| | | | | | | | | | | | | | | | This is follow-up work of embedding imt and vtable for faster interface/virtual call dispatching. Once vtable becomes embedded, the original vtable is nulled. Change-Id: I307696657d1e283654169dbecb8f7815c42bbabc
* | Interpreter can kick in even when implicit checks are enabled.Nicolas Geoffray2014-07-221-3/+6
|/ | | | | | Add a GetStackEndForInterpreter for its stack overfow check. Change-Id: I2d4fc229a8eb727fda509ff778e16d60d96ecc28
* Merge "Fix class initialization checks in interpreter"Sebastien Hertz2014-07-161-2/+2
|\
| * Fix class initialization checks in interpreterSebastien Hertz2014-07-161-2/+2
| | | | | | | | | | | | | | Check field's class initialization after handling null pointer exception. Bug: 16324235 Change-Id: I33d537168e068b7fb51ddf97bc5aadee9dd65f67
* | Remove object_utils.h.Ian Rogers2014-07-162-1/+3
|/ | | | | | | | | Break into object_lock, field_helper and method_helper. Clean up header files following this. Also tidy some of the Handle code in response to compiler errors when resolving the changes in this CL. Change-Id: I73e63015a0f02a754d0866bfaf58208aebcaa295
* Merge "Call strong CAS from unsafe. Add more CAS versions."Hans Boehm2014-07-111-4/+4
|\
| * Call strong CAS from unsafe. Add more CAS versions.Hans Boehm2014-07-111-4/+4
| | | | | | | | | | | | | | | | Adds a number of additional CAS versions. Calls the correct one from sun.misc.unsafe, fixing a recently introduced bug. Avoid unnecessary ordering constraint when installing hash code. Change-Id: I7c09d0c95ceb2a549ec28ee34084198ab3107946
* | Improve performance of invokevirtual/invokeinterface with embedded imt/vtableMingyao Yang2014-07-111-1/+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
* Merge "Add missing class initialization during compilation and tests"Sebastien Hertz2014-07-104-26/+55
|\
| * Add missing class initialization during compilation and testsSebastien Hertz2014-07-104-26/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds missing class initialization during compilation and tests, especially java.lang.Class. Otherwise, we'd be able to execute code while the referring class is not initialized or initializing. Also adds mirror::Class::AssertInitializedOrInitializingInThread method to check class initialization when entering the interpreter: the called method's declaring class must either be initialized or be initializing by the current thread (other threads must be waiting for the class initialization to complete holding its lock). Note we only do this check in debug build. Bump oat version to force compilation. Bug: 15899971 Change-Id: I9a4edd3739a3ca4cf1c4929dcbb44cdf7a1ca1fe
* | Make CAS operations in Object use art::Atomic.Ian Rogers2014-07-101-2/+4
|/ | | | | | Make naming consistent with art::Atomic. Change-Id: If3abdb019ef8b53bd809e3fef3fd5248aeb27e9a
* CW on Master: Propagate or throw exception when no class found happens in ↵Sean Wan2014-07-091-2/+7
| | | | | | | | | | | | | interpreter. The old behavior is a check fail which causes zygote process crash. This is particular a problem for CW in which webview is not used, and this stops CW system start. (cherry picked from commit 41a71f3db62e5bccb162a2b18ed3801e00ff6f87) Change-Id: Iabe091ebe4bbdd86d931ac6c06abd089f1338d59
* Ensure classes are initialized rather than initializing.Ian Rogers2014-06-181-2/+2
| | | | | | | | | | | A class can be being initialized on a different thread, in that case other threads should block trying to access the class. The initializing state shows the class is being initialized but not that its safe for other threads to access. Change occurances of IsInitializing to IsInitialized primarily in slow-path code. Bug: 15347354 Change-Id: Ib586d0a385be6086a890dfbf8868d76f16767fac
* Merge "Fix compilation errors when setting kTracing = true."Ian Rogers2014-06-101-0/+1
|\
| * Fix compilation errors when setting kTracing = true.Douglas Leung2014-06-111-0/+1
| | | | | | | | | | Change-Id: I946c98021166bd099983a8f50a18b57d8eac6af6 Signed-off-by: Douglas Leung <douglas@mips.com>
* | Fix exception reporting from interpreterSebastien Hertz2014-06-114-14/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To comply with JDWP exception report rules, we must report an exception at the location of the throw (or the first instruction encountered after a native call). To do this, we use the CatchLocationFinder visitor to look for a catch handler until we reach a native frame or the top frame. Because interpreter handles pending exception on a method-by-method basis, we need a flag to remember we already reported the exception and avoid reporting it multiple times when unwinding methods. The drawback is we need to maintain the state of this flag. We clear it when the exception is cleared. In the case we temporarily clear the exception (when finding a catch handler for instance), we restore the flag to its previous value at the same time we restore the pending exception. Bump oat version to force recompilation because we modify Thread offsets. Bug: 14402770 Change-Id: Ic059c58f80b2023b118038301f8f0a24f1e18241
* | Workaround frame size issues.Ian Rogers2014-06-102-405/+409
|/ | | | | | | | | | x86 and x86-64 are exceeding the frame size for the switch interpreter. The SOMETIMES_INLINE hack doesn't work with GCC as inline and the noinline attribute are mutually exclusive. As a temporary solution move the effected code to the the interpreter_common.cc file. Bug: 14882674 Change-Id: Id5383ef5436046b36565cd1d76de8e3d59f42cff
* Change MethodHelper to use a Handle.Mathieu Chartier2014-06-095-31/+48
| | | | | | | | | | | Added ConstHandle to help prevent errors where you modify the value stored in the handle of the caller. Also fixed compaction bugs related to not knowing MethodHelper::GetReturnType can resolve types. This bug was present in interpreter RETURN_OBJECT. Bug: 13077697 Change-Id: I71f964d4d810ab4debda1a09bc968af8f3c874a3
* Merge "Clean up and augment Atomic class. Replace QuasiAtomic MemBars."Hans Boehm2014-06-062-4/+4
|\
| * Clean up and augment Atomic class. Replace QuasiAtomic MemBars.Hans Boehm2014-06-062-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a number of missing C++11 operations to Atomic class. Invoke the 64 bit routines in QuasiAtomic when necessary. Replace QuasiAtomic membars with fences that correspond to C++11 fences. QuasiAtomic was moved to the top of the file. Only fence implementations actually changed. This replaces some buggy uses of MembarStoreStore, as reported in b/14685856 . Avoid some redundant fences for long volatile operations. Incompletely converts low-level memory access operations to Atomic. Change-Id: Iea828431a0cea46540eb74fcaa02071cab6fdcda
* | Change FieldHelper to use a handle.Mathieu Chartier2014-06-062-8/+11
|/ | | | | | | | | | | | | | | | Fixed compaction bugs related to FieldHelper::GetType in: artSet32InstanceFromCode SetFieldValueImpl CheckReceiver Field_set interpreter::DoFieldPut MethodVerifier::VerifyISGet MethodVerifier::VerifyISPut MethodVerifier::VerifyIGetQuick Bug: 13077697 Change-Id: I7de9ded2893b5568d43e4daa86fd135bf5508b72
* Merge "ART: Fix forbidden thread state change in interpreter"Andreas Gampe2014-06-041-4/+10
|\
| * ART: Fix forbidden thread state change in interpreterAndreas Gampe2014-06-041-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | While loading a type for assignability, it might happen that it's not available yet locally and must be resolved. Formerly, we disallowed a state change to ensure no GC taking place while a new shadow frame has not been pushed on the stack yet. As a fix, allow a "shadow frame under construction" in the thread, which is visited during GC. Change-Id: I973487a46b0e9e21fd6d49099d713b58f06d3b45
* | Add missing preamble in switch-based interpreterSebastien Hertz2014-06-041-0/+1
|/ | | | | | Adds missing preamble for CONST_WIDE_HIGH16 instruction. Change-Id: I80371d6f5e5d1b60c88837706dc139782776eefa
* Merge "Compaction cleanup for FindArrayClass."Mathieu Chartier2014-05-301-1/+1
|\
| * Compaction cleanup for FindArrayClass.Mathieu Chartier2014-05-301-1/+1
| | | | | | | | | | | | | | | | We now pass double pointer in to signify that it can cause thread suspension, this double pointer gets wrapped by a handle if don't find the array class in the cache. Change-Id: I43436b6c35597c7252b65d1180baddb5ac4caabb
* | Merge "Another workaround for stack overflow issue with clang"Sebastien Hertz2014-05-303-34/+45
|\ \
| * | Another workaround for stack overflow issue with clangSebastien Hertz2014-05-283-34/+45
| |/ | | | | | | | | Bug: 14882674 Change-Id: I465fda533714021b39b847afe89e454758646b47
* | Ignore catch blocks whose type can't be resolved.Ian Rogers2014-05-291-7/+1
|/ | | | | | | Reverts change 72b3e430d880ef57eaa6a34a0822165994052202 but keeps unit test and missing delete that would fail assertions on long jump context recycling. Change-Id: I926755e8b831b208aa7e1ce46421bef3793a1441
* Revert "Revert "Fix an outstanding compaction bug in interpreter.""Mathieu Chartier2014-05-233-15/+21
| | | | | | | | | | Fixed the generic trampoline to not use ToJObject when unnecessary. Bug: 15167269 This reverts commit 3bdb873122964da7937eb070cbcf2ef638a8e459. Change-Id: I0525d0e0f3afb753c770e1572070a0fa22b02271
* Revert "Fix an outstanding compaction bug in interpreter."Mathieu Chartier2014-05-223-21/+15
| | | | | | This reverts commit e09ae0920be57760fb390b6944bce420fa0b5582. Change-Id: I48036306130d5ccfec683d0dc3e9a642a02ee9c1
* Fix an outstanding compaction bug in interpreter.Mathieu Chartier2014-05-223-15/+21
| | | | | | | | | | | | | | | | Fixed a bug in DoFieldPut where the FieldHelper GetType could cause thread suspension which would result in a stale obj. Added more handles in the class linker to facilitate moving fiels and methods in the future. Removed un-necessarly passing handle references since these are value types and don't need to be passed by reference. Added a special NullHandle type which allows null handles without a handle scope. Change-Id: I1b51723920a2e4f4f8b2907066f578a3e879fd5b
* Merge "Secure move-exception in intepreter"Sebastien Hertz2014-05-222-4/+4
|\
| * Secure move-exception in intepreterSebastien Hertz2014-05-212-4/+4
| | | | | | | | | | | | | | Copies exception into the shadow frame before clearing it from its thread so it's always reachable. Change-Id: Ifdc68280424f5099aacf0724da94889881a99551
* | Workaround stack overflow issue with clangSebastien Hertz2014-05-202-16/+24
|/ | | | | Bug: 14882674 Change-Id: I633251eb5229f0a65c27c6d771a7ff21f616a0f3