summaryrefslogtreecommitdiffstats
path: root/runtime/runtime.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Tidy gAborting."Nicolas Geoffray2014-12-091-8/+3
| | | | | | | | Creates infinite loop: b/18674776. This reverts commit 015b137efb434528173779bc3ec8d72494456254. Change-Id: I67fe310d2e95ee2ec37bec842be06fb1123b6f4e
* Tidy gAborting.Ian Rogers2014-12-041-3/+8
| | | | | | | Reduce scope to Runtime::Abort and short-cut recursive case earlier. gAborting remains global to avoid two fatal errors in thread and the verifier. Change-Id: Ibc893f891ffee9a763c65cde9507d99083d47b3f
* 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
* Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.Ian Rogers2014-11-031-4/+4
| | | | | | | | | | | Fix associated errors about unused paramenters and implict sign conversions. For sign conversion this was largely in the area of enums, so add ostream operators for the effected enums and fix tools/generate-operator-out.py. Tidy arena allocation code and arena allocated data types, rather than fixing new and delete operators. Remove dead code. Change-Id: I5b433e722d2f75baacfacae4d32aef4a828bfe1b
* Optimize method linkingMathieu Chartier2014-10-271-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added more inlining, removed imt array allocation and replaced it with a handle scope. Removed some un-necessary handle scopes. Added logic to base interface method tables from the superclass so that we dont need to reconstruct for every interface (large win). Facebook launch Dalvik KK MR2: TotalTime: 3165 TotalTime: 3652 TotalTime: 3143 TotalTime: 3298 TotalTime: 3212 TotalTime: 3211 Facebook launch TOT before: WaitTime: 3702 WaitTime: 3616 WaitTime: 3616 WaitTime: 3687 WaitTime: 3742 WaitTime: 3767 After optimizations: WaitTime: 2903 WaitTime: 2953 WaitTime: 2918 WaitTime: 2940 WaitTime: 2879 WaitTime: 2792 LinkInterfaceMethods no longer one of the hottest methods, new list: 4.73% art::ClassLinker::LinkVirtualMethods(art::Thread*, art::Handle<art::mirror::Class>) 3.07% art::DexFile::FindClassDef(char const*) const 2.94% art::mirror::Class::FindDeclaredStaticField(art::mirror::DexCache const*, unsigned int) 2.90% art::DexFile::FindStringId(char const*) const Bug: 18054905 Bug: 16828525 (cherry picked from commit 1fb463e42cf1d67595cff66d19c0f99e3046f4c4) Change-Id: I27cc70178fd3655fbe5a3178887fcba189d21321
* [native bridge] Make sure we always unload the native bridgeCalin Juravle2014-10-231-4/+6
| | | | | | | | | libnativebridge may allocate some resources during loading and intialization and de-allocate them when unloading. This makes sure that we don't leak anything. Bug: 18097480 Change-Id: I901f2d3c2ab1efb2875388f99e8c5c111ce82d5a
* Make ART compile with GCC -O0 again.Ian Rogers2014-10-161-6/+0
| | | | | | | | | | | | | 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
* Switch to C++11 style [[noreturn]].Ian Rogers2014-10-101-4/+1
| | | | | | | | Also remove old comment about calls to Abort getting merged. We have few LOG(FATAL)s so merging is less of an issue. Also, recompiling with O0 and similar will avoid the optimization and we expect that for GDB debugging. Change-Id: I840dc6f4b8511294be0e117c634ec15b745e7be5
* Fix 2 new sets of clang compiler warnings.Ian Rogers2014-10-101-1/+1
| | | | | | | | | | | 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
* Add VMRuntime.isBootClassPathOnDiskBrian Carlstrom2014-09-301-0/+5
| | | | | | | | Bug: 17679443 (cherry picked from commit 95a935415d44903b28326424beb4db5c013ef089) Change-Id: Iba40291dead3f0b6715903c986370fd0cf1e41e1
* Fix broken runtime SetStatsEnabled logicMathieu Chartier2014-09-261-1/+2
| | | | | | | | | | | | | | | Previously, Runtime::SetStatsEnabled wouldn't take stats_enabled_ into account when deciding whether or not to increment / decrement teh stats enabled counter. This resulted in counter underflows and other errors which caused some CTS tests to fail. Also added some locking to prevent race conditions. Bug: 17360878 (cherry picked from commit a98ffd745bbecb2e84a492194950c0b94966546b) Change-Id: I21d241a58d35bd6a607aa2305c6da81720bd0886
* Merge "ART: Update for split native bridge initialization"Andreas Gampe2014-09-241-13/+1
|\
| * ART: Update for split native bridge initializationjgu212014-09-231-13/+1
| | | | | | | | Change-Id: I0b93da93251c6b4638de786bf98cf99df07c3fc2
* | Avoid suspending for alloc trace enabling when already suspended.Jeff Hao2014-09-171-1/+1
|/ | | | | | | | Bug: 17499772 (cherry picked from commit 1d6ee090fddd4bfd35c304d6ceb929d5c529dfcc) Change-Id: Id09809c476c685f0a197ee75bb08638931364efd
* Compile time performance improvements focusing on interpret-only.Ian Rogers2014-09-121-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ART: Fix things for valgrindAndreas Gampe2014-09-101-12/+1
| | | | | | | | | | | | | | | | | | | | | | Wire up valgrind gtests. Add valgrind-test-art-host, currently only depending on valgrind-test-art-host-gtest32. Fix an Alloc setting to allow running valgrind. Refactor the fault handler to manage (and correctly release) the handlers. Fix minor failure-case leaks exposed by tests. Failing tests: The optimizing compiler is leaking non-arena-ed structures (e.g., assembler buffers), as code generators are not destroyed. The solution has been moved to a follow-up CL. Note: All 64b tests are failing as we cannot allocate a heap. Change-Id: I7f854cfd098d9f68107ce492363e7dba9a82b9fa
* Merge "ART: Change ART for new native bridge sequence"Andreas Gampe2014-09-041-1/+5
|\
| * ART: Change ART for new native bridge sequenceAndreas Gampe2014-09-041-1/+5
| | | | | | | | | | | | Initialize or unload after a fork. Change-Id: I5a20de1cb68dd1802937b369b14c50c9c1031c67
* | Merge "Remove abuse of mirror::Object* to reference special values."Ian Rogers2014-09-041-0/+10
|\ \ | |/ |/|
| * Remove abuse of mirror::Object* to reference special values.Ian Rogers2014-09-031-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove kInvalidIndirectRefObject, kClearedJniWeakGlobal and ObjectRegistry::kInvalidObject. Handle error conditions by passing in or returning an error value. GetObjectRefType is simplified to be faster and not return invalid references that are not expected according to the spec. Adjust check JNI and jni_internal_test appropriately. Fix cases in the debugger/JDWP of out arguments being passed by reference. Bug: 17376993 Change-Id: I3ce8a28c01827e163f4dc288449959464da788b1
* | Merge "Change intern table to unordered set."Mathieu Chartier2014-09-021-4/+4
|\ \ | |/ |/|
| * Change intern table to unordered set.Mathieu Chartier2014-09-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | Intern table active used bytes goes from 430k to 317k on system server. Similar %wise savings on other apps. Bug: 16238192 (cherry picked from commit d910fcef539e12ab181e56ec80684f39c4e95733) Change-Id: Ic70395124435c6f420a77e6d8639404a160f395a
* | Pre-allocate the NoClassDefFoundError to be thrown for boot classes.Ian Rogers2014-09-021-0/+4
|/ | | | | | | Bring over a Dalvik "optimization". Bug: 12804658 Bug: 16853450 Change-Id: I6419de7bd2ba18d91479cb52489104954f5c4524
* Add native memory accounting through custom allocator.Mathieu Chartier2014-08-291-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a custom allocator that lets you pass in a special tag which specifices where the allocation came from. This is used when dumping. The performance overhead is low since each allocation only does a atomic add/sub for each allocation/free. The measurements are dumped to traces.txt during SIGQUIT. Example output: I/art (27274): AllocatorTagHeap active=120 max=120 total=168 I/art (27274): AllocatorTagMonitorList active=1572 max=6240 total=11724 I/art (27274): AllocatorTagClassTable active=185208 max=185208 total=268608 I/art (27274): AllocatorTagInternTable active=430368 max=430368 total=436080 I/art (27274): AllocatorTagMaps active=5616 max=6168 total=34392 I/art (27274): AllocatorTagLOS active=1024 max=1536 total=2044 I/art (27274): AllocatorTagSafeMap active=0 max=51936 total=533688 I/art (27274): AllocatorTagLOSMaps active=144 max=1248 total=5760 I/art (27274): AllocatorTagReferenceTable active=10944 max=11840 total=19136 I/art (27274): AllocatorTagHeapBitmap active=32 max=40 total=56 I/art (27274): AllocatorTagHeapBitmapLOS active=8 max=8 total=8 I/art (27274): AllocatorTagVerifier active=0 max=18844 total=1073156 I/art (27274): AllocatorTagModUnionCardSet active=5300 max=5920 total=56020 I/art (27274): AllocatorTagModUnionReferenceArray active=24864 max=24864 total=24864 I/art (27274): AllocatorTagJNILibrarires active=320 max=320 total=320 I/art (27274): AllocatorTagOatFile active=1400 max=1400 total=5852 Change-Id: Ibb470ef2e9c9a24563bb46422d46a55799704d82 (cherry picked from commit 5369c40f75fdcb1be7a7c06db212ce965c83a164)
* Reduced memory usage of primitive fields smaller than 4-bytesFred Shih2014-08-251-0/+8
| | | | | | | | | | 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
* Merge "Support running without a boot image."Brian Carlstrom2014-08-251-1/+6
|\
| * Support running without a boot image.Alex Light2014-08-251-1/+6
| | | | | | | | | | | | Bug: 17000769 Change-Id: I6404d5050c8a2f4ee6e70d58532eb25ee9de248e
* | Always setup the native bridge libraryCalin Juravle2014-08-221-3/+4
|/ | | | | | | | | | | | | | | ... even if the string is empty. This will initialize the native bridge library but mark it as unavailable. - also, rename native_bridge_library_path to native_bridge_library_filename to be closer to the actual meaning (it's just the filename without any path). Bug: 16404669 (cherry picked from commit I94628639691459d48d1fbf0841f36b68d51818e7) Change-Id: I94628639691459d48d1fbf0841f36b68d51818e7
* Merge "[ART] Move to system/core native bridge library"Calin Juravle2014-08-151-0/+20
|\
| * [ART] Move to system/core native bridge libraryCalin Juravle2014-08-151-0/+20
| | | | | | | | | | | | | | | | | | | | | | Some cleanups on the way: - move NativeBridgeRuntimeCallbacks from a global to a field - rename native_bridge_library_string to the more suggestive navtive_bridge_library_path - clean up imports Bug: 16884833 Change-Id: I73aab8e212860ba5aee9444d801806d3da326a41
* | Execute an application even when dex2oat crashes.Nicolas Geoffray2014-08-131-0/+5
|/ | | | | | Bug: 17000769 Change-Id: Iffeb582862a5e794b6c7364c7ec2368cfd0f2214
* Add GcRoot to clean up and enforce read barriers.Hiroshi Yamauchi2014-07-291-12/+13
| | | | | | | | | | | | | Introduce a value-type wrapper around Object* for GC roots so that 1) we won't have to directly add the read barrier code in many places and 2) we can avoid accidentally bypassing/missing read barriers on GC roots (the GcRoot interface ensures that the read barrier is executed on a read). The jdwp test passed. Bug: 12687968 Change-Id: Ib167c7c325b3c7e3900133578815f04d219972a1
* Recycle mem-maps for collector transitions.Mathieu Chartier2014-07-221-1/+1
| | | | | | | | | | | | | | | | | | | | We now create spaces when we need them for collector transitions or homogeneous compaction by recycling mem maps. Change the bump pointer space size to be as large as the heap capacity instead of 1/2 heap capacity like it used to be. For GSS, bump pointer spaces are set to 32MB currently. Changed GSS to have main space == non moving space since we don't need to copy from the main space. Fixes GC stress tests 074, 096. Fixed test 080 oom throw with -Xmx2m for GC stress test, this was broken since it was allocating a 4 MB array before starting the OOM process. Bug: 14059466 Bug: 16406852 Change-Id: I62877cfa24ec944a6f34ffac30334f454a8002fd
* Runtime can now be set to require relocationAlex Light2014-07-221-1/+16
| | | | | | | | | | | | | | Add a pair of runtime flags -Xrelocate and -Xnorelocate that can force the runtime to require that all files that are run are relocated, to prevent attacks based on the known art base address. Add support for running patchoat on oat files compiled without an image. Change run-test to have new --prebuild and --relocate flags. Bug: 15358152 Change-Id: I91166c62dd1ab80e5cbcb7883a2cd0d56afca32d
* Add read barriers for the GC roots in Instrumentation.Hiroshi Yamauchi2014-07-211-0/+1
| | | | | Bug: 12687968 Change-Id: I324e2f950ce4500b0e00722044af3a9c82487b23
* Revert "Revert "Revert "Revert "Add implicit null and stack checks for x86""""Dave Allison2014-07-161-0/+5
| | | | | | | This reverts commit 0025a86411145eb7cd4971f9234fc21c7b4aced1. Bug: 16256184 Change-Id: Ie0760a0c293aa3b62e2885398a8c512b7a946a73
* Break apart header files.Ian Rogers2014-07-151-31/+13
| | | | | | | | 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
* Add read barriers for the roots in Runtime.Hiroshi Yamauchi2014-07-141-11/+22
| | | | | Bug: 12687968 Change-Id: If26518a8251702cfe4d5cd7d1f50e80e342704cf
* Revert "Revert "Revert "Add implicit null and stack checks for x86"""Nicolas Geoffray2014-07-111-5/+0
| | | | | | | | Broke the build. This reverts commit 7fb36ded9cd5b1d254b63b3091f35c1e6471b90e. Change-Id: I9df0e7446ff0913a0e1276a558b2ccf6c8f4c949
* Revert "Revert "Add implicit null and stack checks for x86""Dave Allison2014-07-101-0/+5
| | | | | | | | | Fixes x86_64 cross compile issue. Removes command line options and property to set implicit checks - this is hard coded now. This reverts commit 3d14eb620716e92c21c4d2c2d11a95be53319791. Change-Id: I5404473b5aaf1a9c68b7181f5952cb174d93a90d
* ART: Bump runtime version to 2.1.0Andreas Gampe2014-06-271-1/+1
| | | | | | | Bump the version of ART to 2.1.0 to reflect recent changes like native MultiDex support. Change-Id: Idcff71faac932c2b30359fbe13a975fb818ecb0e
* Reduce header files including header files.Ian Rogers2014-06-061-8/+6
| | | | | | Main focus is getting heap.h out of runtime.h. Change-Id: I8d13dce8512816db2820a27b24f5866cc871a04b
* Merge "Fixed and refactored profiler options handling"Calin Juravle2014-06-061-9/+8
|\
| * Fixed and refactored profiler options handlingCalin Juravle2014-06-061-9/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | - extracted profiler options in a separate class - switched from system property reading to command line arguments - added profile based compilation options to CompilerOptions - removed no longer used kProfile compilation filter - optimize dex files only if the profiler is enabled - clean up unused arguments Bug: 12877748 Bug: 15275634 Change-Id: I37ff68e7694370950ce8db2360562e9058ecebb7
* | Added workaround passing empty arg array for proxy invocation.Jeff Hao2014-06-021-0/+11
|/ | | | | | | | | | | This recreates old Dalvik behavior for older target sdk versions, but will still pass null for newer ones. Bug: 13247236 (cherry picked from commit 01d5a146e20660bd06f026c16f19ec080f8fdd7b) Change-Id: I911889cf559ad8d9f37ea9be3929387c86446851
* Add option to specify compiler executable.Tsu Chiang Chuang2014-05-271-0/+3
| | | | Change-Id: I973da5e74be5a62461caacbc708288fb95e1b99b
* Now we have a proper C++ library, use std::unique_ptr.Ian Rogers2014-05-191-2/+2
| | | | | | | Also remove the Android.libcxx.mk and other bits of stlport compatibility mechanics. Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
* Move quick frame info to OatQuickMethodHeader.Vladimir Marko2014-05-131-7/+16
| | | | | | | | | | | | | | | Rename OatMethodHeader to OatQuickMethodHeader, move frame info from OatMethodOffsets to OatQuickMethodHeader. Retrieve the info from other places for non-quick methods (portable compiled bytecode or jni stub, generic jni, runtime, abstract and proxy). This change has a libcore/ companion CL "Remove ArtMethod's quick fields for frame size and spills." https://android-review.googlesource.com/94164 Bug: 11767815 Change-Id: I0e31a7875d76732e1ec479c86b9b5ca01203507f
* Interpreter-only mode should cause dex-to-dex compilation.Ian Rogers2014-04-171-0/+4
| | | | | | | | | | | Also, fix quick iget/iput that had similar issues to: https://android-review.googlesource.com/91423 Also, remove fall-back resolution code from quick invokes/igets/iputs as we allow class loading for the exception throw and regular verification already allows class loading. Bug: 14133618 Change-Id: I51199e6e2392da0354f64b157e79af494c183778
* Merge "Profile: made startImmediately settable"Calin Juravle2014-04-081-1/+3
|\