summaryrefslogtreecommitdiffstats
path: root/runtime/utils.h
Commit message (Collapse)AuthorAgeFilesLines
* Move mirror::ArtMethod to nativeMathieu Chartier2015-06-021-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-288/+0
| | | | | | | | | | | | | | | | | | | | | 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
* Check IsReferenceVReg during deoptMathieu Chartier2015-05-081-0/+5
| | | | | | | | | 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. Bug: 20736048 Change-Id: I7783c8a8ee45cf601b08b4c38f1dec7f7d11380c
* Revert "Revert "[optimizing] Replace FP divide by power of 2""Nicolas Geoffray2015-04-271-0/+12
| | | | | | This reverts commit 067cae2c86627d2edcf01b918ee601774bc76aeb. Change-Id: Iaaa8772500ea7d3dce6ae0829dc0dc3bbc9c14ca
* Replace NULL with nullptrMathieu Chartier2015-04-221-1/+1
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* ART: Streaming trace modeAndreas Gampe2015-04-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Add a streaming mode for tracing. Streaming uses a buffer of 16KB and writes to the output when that buffer gets full. Streaming mode can be enabled with -Xmethod-trace-stream and is currently not exposed otherwise. Add a python script that can parse the streaming format, which simply contains strings for newly encountered threads and methods inline, and create output that can be used with traceview. Add Trace::Pause and Trace::Abort, which can pause and abort tracing. Abort is different from Stop in that it does not write the data. Add code to the zygote hooks JNI implementation that pauses tracing before the fork, making sure that a child cannot clobber the parent's data. Add code to the zygote hooks JNI implementation that aborts old tracing and starts new tracing in the child after the fork. Currently base the output on the pid. This will not work on an unmodified device, as the profiles directory is not generally writable, but we do not have enough information at that point. Consider a scheme that restarts tracing later. Change-Id: I93c7bf87e35af582bdfdd3ecc7c52454514220dd
* Move ArtField to nativeMathieu Chartier2015-04-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* ART: Fix IsInt when N==32, add testsDavid Brazdil2015-03-271-6/+11
| | | | | | | | Implicit type conversion caused IsInt to always return true for N==32 on 32-bit platforms. This patch templetizes the function to avoid the conversion and adds tests of this and similar functions. Change-Id: Ie526b68b7c3e7cb7b658253d51840794224785fe
* ART: Define IsInt when N==kBitsPerIntPtrTDavid Brazdil2015-03-261-0/+1
| | | | | | | | | 'utils.h' contains two implementations of the IsInt query, one of which is defined for bit sizes <= kBitsPerIntPtrT, while the other only for sizes < kBitsPerIntPtrT. This patch unifies the behaviour and fixes the breakage caused by it. Change-Id: I4f5589b1a36b6c24926e50574fbca528c33d701f
* Unify ART's various implementations of bit_cast.Roland Levillain2015-03-241-13/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ART had several implementations of art::bit_cast: 1. one in runtime/base/casts.h, declared as: template <class Dest, class Source> inline Dest bit_cast(const Source& source); 2. another one in runtime/utils.h, declared as: template<typename U, typename V> static inline V bit_cast(U in); 3. and a third local version, in runtime/memory_region.h, similar to the previous one: template<typename Source, typename Destination> static Destination MemoryRegion::local_bit_cast(Source in); This CL removes versions 2. and 3. and changes their callers to use 1. instead. That version was chosen over the others as: - it was the oldest one in the code base; and - its syntax was closer to the standard C++ cast operators, as it supports the following use: bit_cast<Destination>(source) since `Source' can be deduced from `source'. Change-Id: I7334fd5d55bf0b8a0c52cb33cfbae6894ff83633
* Fix copy/paste documentation error.Dan Albert2015-03-121-1/+1
| | | | Change-Id: I153a8fdb3644c7178895ce0cc6c1c3f6ce3c6876
* Merge "Opt compiler: Basic simplification for arithmetic operations."Roland Levillain2015-03-121-0/+6
|\
| * Opt compiler: Basic simplification for arithmetic operations.Alexandre Rames2015-03-111-0/+6
| | | | | | | | | | | | | | The optimisations in this patch do not look further than the inputs of each operation. Change-Id: Iddd0ab6b360b9e7bb042db22086d51a31be85530
* | Compress the Dex register maps built by the optimizing compiler.Roland Levillain2015-03-121-0/+18
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace the current list-based (fixed-size) Dex register encoding in stack maps emitted by the optimizing compiler with another list-based variable-size Dex register encoding compressing short locations on 1 byte (3 bits for the location kind, 5 bits for the value); other (large) values remain encoded on 5 bytes. - In addition, use slot offsets instead of byte offsets to encode the location of Dex registers placed in stack slots at small offsets, as it enables more values to use the short (1-byte wide) encoding instead of the large (5-byte wide) one. - Rename art::DexRegisterMap::LocationKind as art::DexRegisterLocation::Kind, turn it into a strongly-typed enum based on a uint8_t, and extend it to support new kinds (kInStackLargeOffset and kConstantLargeValue). - Move art::DexRegisterEntry from compiler/optimizing/stack_map_stream.h to runtime/stack_map.h and rename it as art::DexRegisterLocation. - Adjust art::StackMapStream, art::CodeGenerator::RecordPcInfo, art::CheckReferenceMapVisitor::CheckOptimizedMethod, art::StackVisitor::GetVRegFromOptimizedCode, and art::StackVisitor::SetVRegFromOptimizedCode. - Implement unaligned memory accesses in art::MemoryRegion. - Use them to manipulate data in Dex register maps. - Adjust oatdump to support the new Dex register encoding. - Update compiler/optimizing/stack_map_test.cc. Change-Id: Icefaa2e2b36b3c80bb1b882fe7ea2f77ba85c505
* Create OatFileAssistant class for assisting with oat files.Richard Uhler2015-03-091-6/+0
| | | | | | | | | | | | | | | The oat file assistant is used for determining whether dex2oat or patchoat is needed, for running dex2oat or patchoat as needed to make an oat file up to date, and to load dex files associated with a given dex location. The introduction of the OatFileAssistant class is meant to clean up and consolidate code related to the management of oat files that was duplicated and spread across dalvik_system_DexFile.cc and class_linker.cc. Bug: 11301553 Change-Id: I0c16027b9bae4570c2c50faa9c14f581c0cbafb8
* Don't require three-character extensions for dex locations.Richard Uhler2015-02-261-1/+2
| | | | | Bug: 19437875 Change-Id: Ib62b4c691b04f27c5d499affd5a7fd4d9f0c64f9
* ART: Print maps directly to logAndreas Gampe2015-02-241-0/+1
| | | | | | | | | | Do not read proc maps into a string before printing them later back to the log. In low-memory situations this can cause a bad_alloc. External bug: http://b.android.com/153990 Bug: 19494774 Change-Id: Ie63d8788afe8c9da65b30b2f89c50d3dbb820755
* Replace a few std::vector with ArenaVector in Mir2Lir.Vladimir Marko2015-02-191-1/+7
| | | | Change-Id: I7867d60afc60f57cdbbfd312f02883854d65c805
* ART: Templatize IsInt & IsUintAndreas Gampe2015-02-181-26/+40
| | | | | | Ensure that things are used correctly. Change-Id: I76f082b32dcee28bbfb4c519daa401ac595873b3
* art: Refactor RuntimeOptions/ParsedOptionsIgor Murashkin2015-02-041-0/+7
| | | | | | | | | | | | | Refactor the RuntimeOptions to be a type-safe map (VariantMap, see runtime_options.h) and the ParsedOptions to delegate the parsing to CmdlineParser (see cmdline/cmdline_parser.h). This is the start of a command line parsing refactor, and may include more in the future (dex2oat, patchoat, etc). For more details of the command line parsing generator usage see cmdline/README.md Change-Id: Ic67c6bca5e1f33bf2ec60e2e3ff8c366bab91563
* ART: Pass ucontext to Backtrace in Stack DumpAndreas Gampe2015-01-081-1/+1
| | | | | | | | | | In case of an unexpected signal on the host we dump the thread stack ourselves. We have to pass the context given to the signal handler, as the signal handler is run on an alternate stack. Otherwise libbacktrace can't dump the actual faulty part. Bug: 18933933 Change-Id: Id2710d2fd44b7c3b3335973a9288979a5793638b
* Make Barrier robust against spurious wakeupsHans Boehm2014-12-041-1/+2
| | | | | | | | | | | | | | | | | Fix Barrier implementation so that Wait cannot return prematurely due to a spurious condition variable wakeup or interrupted futex call. Document the resulting semantics of barrier.h, which are a bit surprising, but appear to be exactly what current clients need. Fix the test so that it actually passes with the fixed barrier.h, and no longer tests for properties that can't be correctly satisfied. Improve comment for InitTimeSpec, which we almost used. Bug:18509123 Change-Id: I0b25f33bcd22322ba04e3951cd484843788c2bf5
* dex2oat: Pack likely-dirty objects together when generating the boot imageIgor Murashkin2014-11-201-1/+42
| | | | | | | | | | | | | | | | | | | | This introduces a new algorithm into image writer which "bins" objects by how likely they are to be dirtied at runtime. Objects in the same bin are placed contiguously in memory (i.e. into the same page). We try to tune the bin selection based on how clean or how dirty the object will likely be at runtime. As-is, this saves about 150KB per-process (private-dirty pages) and 700KB in zygote (shared-dirty). There is still about 800KB of objects that are clean but located in dirty pages, so with more analysis we can tune the bin selection and get even more memory savings. (cherry picked from commit 3f735bd4f9d09a0f9b2b01321e4c6917879dcae6) Bug: 17611661 Change-Id: Ia1455e4c56ffd0a36ae2a723d35b7e06502980f7
* Merge "ART: Multiview assembler_test, fix x86-64 assembler"Andreas Gampe2014-11-141-0/+14
|\
| * ART: Multiview assembler_test, fix x86-64 assemblerAndreas Gampe2014-11-131-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Expose "secondary" names for registers so it is possible to test 32b views for 64b architectures. Add floating-point register testing. Refactor assembler_test for better code reuse (and simpler adding of combination drivers). Fix movss, movsd (MR instead of RM encoding), xchgl, xchgq, both versions of EmitGenericShift. Tighten imull(Reg,Imm), imulq(Reg,Imm), xchgl and xchgq encoding. Clarify cv*** variants with a comment. Add tests for movl, addl, imull, imuli, mull, subl, cmpqi, cmpl, xorq (regs), xorl, movss, movsd, addss, addsd, subss, subsd, mulss, mulsd, divss, divsd, cvtsi2ss, cvtsi2sd, cvtss2si, cvtss2sd, cvtsd2si, cvttss2si, cvttsd2si, cvtsd2ss, cvtdq2pd, comiss, comisd, sqrtss, sqrtsd, xorps, xorpd, fincstp, fsin, fcos, fptan, xchgl (disabled, see code comment), xchgq, testl, andl, andq, orl, orq, shll, shrl, sarl, negq, negl, notq, notl, enter and leave, call, ret, and jmp, and make some older ones more exhaustive. Follow-up TODOs: 1) Support memory (Address). 2) Support tertiary and quaternary register views. Bug: 18117217 Change-Id: I1d583a3bec552e3cc7c315925e1e006f393ab687
* | 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
* ART: Replace COMPILE_ASSERT with static_assert (runtime)Andreas Gampe2014-11-031-2/+2
| | | | | | Replace all occurrences of COMPILE_ASSERT in the runtime tree. Change-Id: I01e420899c760094fb342cc6cb9e692dd670a0b2
* Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.Ian Rogers2014-11-031-5/+2
| | | | | | | | | | | 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
* Make ART compile with GCC -O0 again.Ian Rogers2014-10-161-3/+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
* stdint types all the way!Ian Rogers2014-10-091-8/+8
| | | | Change-Id: I4e4ef3a2002fc59ebd9097087f150eaf3f2a7e08
* Header file clean up.Ian Rogers2014-10-081-24/+0
| | | | | | | | | | Remove runtime.h from object.h. Move TypeStaticIf to its own header file to avoid bringing utils.h into allocator.h. Move Array::DataOffset into -inl.h as it now has a utils.h dependency. Fix include issues arising from this. Change-Id: I4605b1aa4ff5f8dc15706a0132e15df03c7c8ba0
* ART: Better IllegalAccessException messageAndreas Gampe2014-09-291-0/+4
| | | | | | Bug: 17618578 Bug: 17614623 Change-Id: I0e3f15e676acd6ed5844fc86e136f75cc335372d
* ART: Only allow the zygote to create the global boot imageAndreas Gampe2014-09-181-1/+2
| | | | | | | | | Do not allow arbitrary processes, even when root, to write the boot image in /data/dalvik-cache. Bug: 17478752, 17510489, 17439961 Change-Id: Iba2b74be6d0752f4221f4ff5ee295b45a34cb2e1 (cherry picked from commit 33c36d4f22ab6a5e61eb47b654deaf647c34e49c)
* Improve dex location canonicalization-related performance.Vladimir Marko2014-09-101-0/+13
| | | | | | | | | | | | | | | | | | | Eagerly add canonical dex file locations to the OatFile's primary lookup map in Setup(). This moves the boot.oat work from every app startup to the zygote initialization. Since we always ended up initializing the canonical location map anyway due to the way that we're loading dex files, the lazy initialization didn't save anything. Clean up dex file name canonicalization to make sure we free() the memory returned by realpath() rather than using std::unique_ptr<> with the default deleter. Avoid some unnecessary duplicate OatDexFile lookups. Bug: 16828525 Bug: 17346103 Change-Id: Id8fbc8992f62996138eb2006a0046c6529747c09
* Reduce and speed-up class def searches.Ian Rogers2014-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | Use the class linker for descriptor lookups from the compile driver so that dex caches are populated. Reduce the scope of functions for scanning class paths to just the class linker where they are performed. If we see more than a threshold number of find class def misses on a dex file lazily compute an index, so that future lookups are constant time (part of the collection code is taken from https://android-review.googlesource.com/#/c/103865/3). Note that we take a lazy approach so that we don't serialize on loading dex files, this avoids the reason the index was removed in 8b2c0b9abc3f520495f4387ea040132ba85cae69. Remove an implicit and unnecessary std::string creation for PrintableString. Single threaded interpret-only dex2oat performance is improved by roughly 10%. Bug: 16853450 Change-Id: Icf72df76b0a4328f2a24075e81f4ff267b9401f4
* Actually ask the pthread implementation for the stack guard size.Elliott Hughes2014-08-281-1/+1
| | | | | | | (cherry-pick 307091dc306c34ce9e4ee6cc3b467807b3a3bd12.) Bug: 17111575 Change-Id: I23919b1e8aeff627a65daf57f1109bec60b196cc
* Avoid use of std::string where we have const char*.Ian Rogers2014-08-121-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Wire up check JNI force copy mode.Ian Rogers2014-08-081-5/+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
* Emit CFI for x86 & x86_64 JNI compiler.Tong Shen2014-08-051-0/+5
| | | | | | | | | | | Now for host-side x86 & x86_64 ART, we are able to get complete stacktrace with even mixed C/C++ & Java stack frames. Testing: 1. art/test/run-test --host --gdb [--64] --no-relocate 005 2. In gdb, run 'b art::Class_classForName' which is implementation of a Java native method, then 'r' 3. In gdb, run 'bt'. You should see stack frames down to main() Change-Id: I2d17e9aa0f6d42d374b5362a15ea35a2fce96302
* Runtime can now be set to require relocationAlex Light2014-07-221-1/+12
| | | | | | | | | | | | | | 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
* Merge "Disable adding main and non moving spaces to immune region in GSS"Mathieu Chartier2014-07-161-6/+4
|\
| * Disable adding main and non moving spaces to immune region in GSSMathieu Chartier2014-07-161-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Disabled adding the main and non moving space to the immune region. This will enable us to recycle bump pointer spaces for malloc space -> malloc space compaction as well as collector transitions. Also added logic for falling back to the non moving space, we may copy objects there. Refactored mod union table logic into MarkReachableObjects. No measurable performance benefit or regression. Bug: 14059466 Bug: 16291259 Change-Id: If663d9fdbde943b988173b7f6ac844e5f78a0327
* | Break apart header files.Ian Rogers2014-07-151-2/+1
|/ | | | | | | | 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
* Improve performance of invokevirtual/invokeinterface with embedded imt/vtableMingyao Yang2014-07-111-0/+14
| | | | | | | | | 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
* Add patchoat tool to Art.Alex Light2014-07-071-0/+29
| | | | | | | | | | | | | Add a new executable called patchoat to art. This tool takes already compiled images and oat files and changes their base address, acting as a cheap form of relocation. Add a --include-patch-information flag to dex2oat and code to add required patch information to oat files created with the quick compiler. Bug: 15358152 Change-Id: Ie0c580db45bb14ec180deb84930def6c3628d97d
* ART: Rework Generic JNI, add ARM versionAndreas Gampe2014-07-011-0/+13
| | | | | | | Refactors and optimizes Generic JNI. This version uses TwoWordReturn to avoid writing to / loading from the bottom of the alloca. Change-Id: I3287007c976f79c9fd32d3b3a43f2d1371bf4cd3
* ART: Native support for multidexAndreas Gampe2014-06-251-0/+1
| | | | | | | | | | | | | | | | | | | | Native support for zip files with multiple classesX.dex. Works by explicitly looking for those files in ascending order. As these files have no file system representation for themselves, introduce synthetic dex locations: the name of the originating file plus a colon plus the name of the dex file, e.g., test.jar:classes2.dex. Opening a zip dex file will return all dex files in this way. This keeps the changes to dex2oat minimal. To hide multidex/synthetic names from the Java layer, let the handle of dalvik.system.DexFile refer to a vector of DexFile objects. When opening a location, test possible synthetic names and add them to the vector. Thus, the original multidex jar in the classpath will be associated with all embedded dex files. Change-Id: I0de107e1369cbc94416c544aca3b17525c9eac8b
* More advanced timing loggers.Mathieu Chartier2014-06-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new timing loggers have lower overhead since they only push into a vector. The new format has two types, a start timing and a stop timing. You can thing of these as brackets associated with a timestamp. It uses these to construct various statistics when needed, such as: Total time, exclusive time, and nesting depth. Changed PrettyDuration to have a default of 3 digits after the decimal point. Exaple of a GC dump with exclusive / total times and indenting: I/art (23546): GC iteration timing logger [Exclusive time] [Total time] I/art (23546): 0ms InitializePhase I/art (23546): 0.305ms/167.746ms MarkingPhase I/art (23546): 0ms BindBitmaps I/art (23546): 0ms FindDefaultSpaceBitmap I/art (23546): 0ms/1.709ms ProcessCards I/art (23546): 0.183ms ImageModUnionClearCards I/art (23546): 0.916ms ZygoteModUnionClearCards I/art (23546): 0.610ms AllocSpaceClearCards I/art (23546): 1.373ms AllocSpaceClearCards I/art (23546): 0.305ms/6.318ms MarkRoots I/art (23546): 2.106ms MarkRootsCheckpoint I/art (23546): 0.153ms MarkNonThreadRoots I/art (23546): 4.287ms MarkConcurrentRoots I/art (23546): 43.461ms UpdateAndMarkImageModUnionTable I/art (23546): 0ms/112.712ms RecursiveMark I/art (23546): 112.712ms ProcessMarkStack I/art (23546): 0.610ms/2.777ms PreCleanCards I/art (23546): 0.305ms/0.855ms ProcessCards I/art (23546): 0.153ms ImageModUnionClearCards I/art (23546): 0.610ms ZygoteModUnionClearCards I/art (23546): 0.610ms AllocSpaceClearCards I/art (23546): 0.549ms AllocSpaceClearCards I/art (23546): 0.549ms MarkRootsCheckpoint I/art (23546): 0.610ms MarkNonThreadRoots I/art (23546): 0ms MarkConcurrentRoots I/art (23546): 0.610ms ScanGrayImageSpaceObjects I/art (23546): 0.305ms ScanGrayZygoteSpaceObjects I/art (23546): 0.305ms ScanGrayAllocSpaceObjects I/art (23546): 1.129ms ScanGrayAllocSpaceObjects I/art (23546): 0ms ProcessMarkStack I/art (23546): 0ms/0.977ms (Paused)PausePhase I/art (23546): 0.244ms ReMarkRoots I/art (23546): 0.672ms (Paused)ScanGrayObjects I/art (23546): 0ms (Paused)ProcessMarkStack I/art (23546): 0ms/0.610ms SwapStacks I/art (23546): 0.610ms RevokeAllThreadLocalAllocationStacks I/art (23546): 0ms PreSweepingGcVerification I/art (23546): 0ms/10.621ms ReclaimPhase I/art (23546): 0.610ms/0.702ms ProcessReferences I/art (23546): 0.214ms/0.641ms EnqueueFinalizerReferences I/art (23546): 0.427ms ProcessMarkStack I/art (23546): 0.488ms SweepSystemWeaks I/art (23546): 0.824ms/9.400ms Sweep I/art (23546): 0ms SweepMallocSpace I/art (23546): 0.214ms SweepZygoteSpace I/art (23546): 0.122ms SweepMallocSpace I/art (23546): 6.226ms SweepMallocSpace I/art (23546): 0ms SweepMallocSpace I/art (23546): 2.144ms SweepLargeObjects I/art (23546): 0.305ms SwapBitmaps I/art (23546): 0ms UnBindBitmaps I/art (23546): 0.275ms FinishPhase I/art (23546): GC iteration timing logger: end, 178.971ms Change-Id: Ia55b65609468f212b3cd65cda66b843da42be645
* Add D/CHECK_CONSTEXPR macros for use in constexpr context.Vladimir Marko2014-06-111-3/+2
| | | | | | | Make most RegStorage methods constexpr, make StorageSize() const. Change-Id: Ie63faa3b081094b3dd30352c6240fdf10ef8b87e
* Reduce header files including header files.Ian Rogers2014-06-061-12/+1
| | | | | | Main focus is getting heap.h out of runtime.h. Change-Id: I8d13dce8512816db2820a27b24f5866cc871a04b