| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This change has a libcore/ companion CL
"Remove ArtMethod's quick fields mapping table and vmap table."
https://android-review.googlesource.com/91254
Bug: 11767815
Change-Id: I46ce2067e1ecd915da3890606498e31ffc332813
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This CL refactors the exception handling (on the quick side) by isolating the
search of catch handler and the preparation of deoptimization.
We rename the CatchFinder class to QuickExceptionHandler so it's less specific
to catch handler search.
Finding catch handler happens in QuickExceptionHandler::FindCatch. Since the
CatchBlockStackVisitor resolves exception types, it may cause thread suspension
and breaks the assertion current thread can't be suspended. Therefore, we place
the exception in a SirtRef (while it is detached from the current thread) and
remove the thread suspension assertion.
Deoptimization now happens in QuickExceptionHandler::DeoptimizeStack. It uses
the new DeoptimizeStackVisitor class to create shadow frames.
We also add the Thread::GetDeoptimizationException method to get the definition
of the fake exception in only one place.
Change-Id: I01b19fa72af64329b5c3b6c7f0c3339d2d724978
|
|
|
|
|
|
| |
This reverts commit 5cb328362a633302ca0fcdbaa0da7d94069df051.
Change-Id: Icc0ec1a9f15c2e4e9103e732d7ba75a4feb853b1
|
|
|
|
|
|
|
| |
- Spill registers have different sizes.
- The ArtMethod at the bottom of the stack is always of kWordSize.
Change-Id: I92f67ff928477970c393c7146980255d08e8e6af
|
|
|
|
|
|
|
|
|
|
|
|
| |
The quick-trampoline treats caller's frame in a different way
then it was formed by quck-invoke stub for hard float ABI targets
such as x86_64 and aarch64. The patch workarounds the issue of
wrongly-read stack arguments due to no contract between quick-invoke
stub and quick-trampoline/shadow-frame-builder regarding the reg-
spill area.
Change-Id: I302f212b4ea5e38632527a5ace03f136b21ef806
Signed-off-by: Vladimir Kostyukov <vladimir.kostyukov@intel.com>
|
|
|
|
|
|
|
|
|
| |
Code did not properly call JNIMethodEnd, such that locks etc
where not correctly handled.
Add a test case to jni_compiler_test.
Change-Id: If2d5c628517d65a56dd6bb5c4cabdff77c7664a1
|
|
|
|
| |
Change-Id: I4112bf62c69b4f28ca369c4bf3c626be43692afd
|
|
|
|
| |
Change-Id: I5c078a197c5026e9bd886d0ba1e188054b5ffa75
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously, there were errors caused by not restoring the args for
the slow path in artInvokeInterfaceTrampoline and artInvokeCommon. The
slow path in artInvokeInterfaceTrampoline occurs when you attempt
to do an interface dispatch of a method in another dex file. The slow
path in artInvokeCommon occurs when the method in dex cache is not
already resolved.
Since FindMethodFromCode may resolve a method, it can occasionally
cause thread suspension/GC. If a moving GC occurred at this point it
resulted in this_object being invalid after the trampoline returned
the code pointer. This caused a native crash in one of the money runs
since there was an unbundeled app which did a List.iterator call.
Bug: 12934910
Change-Id: Ib454faad14bef0d7732a6d7f1ca5803472d502a6
|
|
|
|
|
|
|
| |
Begin a more full implementation x86-64 REX prefixes.
Doesn't implement 64bit thread offset support for the JNI compiler.
Change-Id: If9af2f08a1833c21ddb4b4077f9b03add1a05147
|
|
|
|
|
|
|
|
|
| |
Adds support for arm64 to ART. Assembler stubs are sufficient for
down calls into interpreter. JNI compiler and generics are not finished.
Basic Generic JNI functionality.
Change-Id: I4a07c79d1e037b9f5746673480e32cf456867b82
|
|
|
|
|
|
|
|
|
|
| |
Move invocation code out of JNI internal into reflection, including ArgArray
code. Make reflective invocation use the ArgArray to build arguments rather
than allocating a jvalue[] and unboxing arguments into that.
Move reflection part of jni_internal_test into reflection_test.
Make greater use of fast JNI.
Change-Id: Ib381372df5f9a83679e30e7275de24fa0e6b1057
|
|
|
|
| |
Change-Id: Ib276fa63b6a00480eaaff6c352d37917c61e966c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes some linking issues and native code retrieval errors.
All host tests are functional with this change.
Make ArtMethod::GetFrameSizeInBytes() templated to bypass the
embedded sanity check. Necessary for fix-up decision.
Add ArtMethod metadata fix-up code to ClassLinker::LinkCode.
Necessitates new parameters to access the shorty and compute
the frame size.
Fix handling the JNI dlsym lookup stub in the generic JNI code.
Change-Id: I4173b0fbb1ba5b1bcbee1bb340cfdd08a54767e5
|
|
|
|
|
|
|
|
|
|
| |
Separate declaration from definition in certain places to work-around issues
with clang.
Remove bogus lock annotation at definition in compilers.cc that is already
present at the declaration.
Remove duplicate definition of ClassReference.
Change-Id: I5368057bb36319a259110b2198610d9d2b2e5041
|
|
|
|
|
|
|
|
|
| |
This changes the layout of the callee-save frame used in generic
JNI to be consistent with the JNI compiler, that is, the SIRT is
inline (above the method reference). Now the location of the
"this" object is consistent.
Change-Id: Ibad0882680712cb640b4c70ada0229ef7cf4e62c
|
|
|
|
|
|
|
| |
Add checks for alignment, floats, and maximum number of parameters
Fixed x86_64 ABI wrong interpretation (floats not widened in registers)
Change-Id: I6c09af4914b7675ac0275ce21003e317ca44a403
|
|
|
|
|
|
|
| |
Ensure SIRT isn't accessed via quick callee save frame.
Some tidying of code.
Change-Id: I8fec3e89aa6d2e86789c60a07550db2e92478ca7
|
|
|
|
|
|
|
| |
Two-pass process for setting up the JNI frame so we can put Sirt
and native call stack as close together as possible.
Change-Id: I827167a55fafc4eba7d4eaf14a35fc69fd5f85ce
|
|
|
|
|
|
|
|
|
|
|
| |
Added verify object calls to SirtRef, IndirectReferenceTable,
ReferenceTable.
Removed un-needed verify object in ScopedObjectAccess / DecodeJObject
since object sources are handled.
Bug: 12934910
Change-Id: I55a46a8ea61fed2a77526eda27fd2cce97a9b125
|
|
|
|
|
|
|
|
|
|
|
| |
Fix clang build errors aswell as restructure locking/mutex code for correct
thread safety analysis support.
Reorder make dependencies so that host builds build first as they should
provide better compilation errors than target.
Remove host's use of -fno-omit-frame-pointer as it has no value with correct
use of CFI, which we should have.
Change-Id: I72cea8da9a3757b1a0b3acb4081feccb7c6cef90
|
|
|
|
|
|
|
|
| |
Starting implementation for generic JNI on x86_64. Frames are of
large static size (>4K) right now, should be compacted later. Passes
the whole of jni_compiler_test.
Change-Id: I88ac3e13a534afe7568d62a1ef97cb766e8260e4
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
image_writer.cc
Remove assumption that all methods in the boot classpath are compiled
oat_writer.cc
Don't skip writing ArtMethod::quick_code_offset_ for methods that need resolution, leave that to ImageWriter
dex2oat.cc
Allow dex2dex compilation of image dex files by making the in memory pages writable in all cases, not just app case.
oatdump.cc
dump new OatHeader fields
use ImageSpace.GetImageFilename, not command line image filename, since location may be in dalvik-cache
remove inaccurate check about non-null GC map
quick_trampoline_entrypoints.cc
add and improve some DCHECKS that were useful while debugging
class_linker.cc
image_space.cc
fix double facepalm
parsed_options.cc
fix zygote logging to not skip values to two part options like -classpath <foo>
runtime.cc
wireup parsed compiler options to runtime
Change-Id: Iad314df0b80623c0663d61713d5098297ab9ac87
|
|
|
|
|
|
|
|
|
|
|
|
| |
There was a race when we changed the allocation entrypoints where a
new thread would be starting (Thread::Init) and initialize to the
wrong entrypoints. Guarding allocation entrypoint changing
with the runtime shutdown lock fixes this race condition since
Thread::Init is only called with the runtime shutdown lock held.
Bug: 13250963
Change-Id: I8eb209c124b6bf17020de874e1b0083f158b8200
|
|
|
|
|
|
|
|
| |
Some initial changes that lead to an UNIMPLEMENTED. Works
by not compiling for JNI right now and tracking native methods
which have neither quick nor portable code. Uses new trampoline.
Change-Id: I5448654044eb2717752fd7359f4ef8bd5c17be6e
|
|
|
|
|
| |
Bug: 12934910
Change-Id: I9d0926100c5e08dfbaea8926e8ac7cdd4e7dfe1c
|
|
|
|
|
|
|
| |
Also fix possible compaction bug around ResolveMethod.
Bug: 13221223
Change-Id: I0495eaee8d5f9ae5da0a87c4800a66cd04dc4aa7
|
|
|
|
|
|
|
|
|
|
| |
Fixes a compaction related bug which could be caused by moving args
in artQuickProxyInvokeHandler and not updating them before returning
back into compiled code.
Also changed some Object** to StackReferences.
Change-Id: I0779c8fd5f10f142d3c6149ddc531c99ff8ee4c2
|
|
|
|
|
|
| |
Sufficient to pass jni_internal_test.
Change-Id: Ia0d9b8241ab8450e04765b9c32eb6dc8fc1a8733
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Removes the class initialization blacklist and use transaction to detect and
revert class initialization attempting to invoke native method. This only
concerns class initialization happening at compilation time when generating an
image (like boot.art for the system).
In transactional mode, we log every object's field assignment and array update.
Therefore we're able to abort a transaction to restore values of fields and
array as they were before the transaction starts. We also log changes to the
intern string table so we can restore its state prior to transaction start.
Since transactional mode only happens at compilation time, we don't need to log
all these changes at runtime. In order to reduce the overhead of testing if
transactional mode is on/off, we templatize interfaces of mirror::Object and
mirror::Array, respectively responsible for setting a field and setting an
array element.
For various reasons, we skip some specific fields from transaction:
- Object's class and array's length must remain unchanged so garbage collector
can compute object's size.
- Immutable fields only set during class loading: list of fields, method,
dex caches, vtables, ... as all classes have been loaded and verified before a
transaction occurs.
- Object's monitor for performance reason.
Before generating the image, we browse the heap to collect objects that need to
be written into it. Since the heap may still holds references to unreachable
objects due to aborted transactions, we trigger one collection at the end of
the class preinitialization phase.
Since the transaction is held by the runtime and all compilation threads share
the same runtime, we need to ensure only one compilation thread has exclusive
access to the runtime. To workaround this issue, we force class initialization
phase to run with only one thread. Note this is only done when generating image
so application compilation is not impacted. This issue will be addressed in a
separate CL.
Bug: 9676614
Change-Id: I221910a9183a5ba6c2b99a277f5a5a68bc69b5f9
|
|
|
|
|
|
|
|
|
| |
I believe this_object is sometimes is garbage for static invokes.
This may lead to bad roots being marked if ResolveMethod causes
suspension for GC.
Bug: 13051126
Change-Id: I6775b3db63ac5ce37ad423796f16c92645bd7891
|
|
|
|
|
|
|
|
|
| |
Cleans up the code since it helps make it easier to spot moving GC
related bugs.
Also fixed moving GC bugs in MonitorEnter, and FindFieldID.
Change-Id: I794e4fbcc2010875fc6b299c6d4c9fb0f071b71a
|
|
|
|
|
|
| |
Use already known name and proto.
Change-Id: I4505b81724bd6a0f3cf21ee6fed44774d38c4e15
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Modify mirror objects so that references between them use an ObjectReference
value type rather than an Object* so that functionality to compress larger
references can be captured in the ObjectRefererence implementation.
ObjectReferences are 32bit and all other aspects of object layout remain as
they are currently.
Expand fields in objects holding pointers so they can hold 64bit pointers. Its
expected the size of these will come down by improving where we hold compiler
meta-data.
Stub out x86_64 architecture specific runtime implementation.
Modify OutputStream so that reads and writes are of unsigned quantities.
Make the use of portable or quick code more explicit.
Templatize AtomicInteger to support more than just int32_t as a type.
Add missing, and fix issues relating to, missing annotalysis information on the
mutator lock.
Refactor and share implementations for array copy between System and uses
elsewhere in the runtime.
Fix numerous 64bit build issues.
Change-Id: I1a5694c251a42c9eff71084dfdd4b51fff716822
|
|
|
|
|
|
|
| |
Following https://android-review.googlesource.com/#/c/79302, embed
array class pointers at array allocation sites in the compiled code.
Change-Id: I67a1292466dfbb7f48e746e5060e992dd93525c5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Rather than looking up a class from its type ID (and checking if
it's resolved/initialized, resolving/initializing if not), use
direct class pointers, if possible (boot-code-to-boot-class pointers
and app-code-to-boot-class pointers.)
- This results in a 1-2% speedup in Ritz MemAllocTest on Nexus 4.
- Embedding the object size (along with class pointers) caused a 1-2%
slowdown in MemAllocTest and isn't implemented in this change.
- TODO: do the same for array allocations.
- TODO: when/if an application gets its own image, implement
app-code-to-app-class pointers.
- Fix a -XX:gc bug.
cf. https://android-review.googlesource.com/79460/
- Add /tmp/android-data/dalvik-cache to the list of locations to
remove oat files in clean-oat-host.
cf. https://android-review.googlesource.com/79550
- Add back a dropped UNLIKELY in FindMethodFromCode().
cf. https://android-review.googlesource.com/74205
Bug: 9986565
Change-Id: I590b96bd21f7a7472f88e36752e675547559a5b1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the process state changes to a state which does not perceives
jank, we copy from the main free-list backed allocation space to
the bump pointer space and enable the semispace allocator.
When we transition back to foreground, we copy back to a free-list
backed space.
Create a seperate non-moving space which only holds non-movable
objects. This enables us to quickly wipe the current alloc space
(DlMalloc / RosAlloc) when we transition to background.
Added multiple alloc space support to the sticky mark sweep GC.
Added a -XX:BackgroundGC option which lets you specify
which GC to use for background apps. Passing in
-XX:BackgroundGC=SS makes the heap compact the heap for apps which
do not perceive jank.
Results:
Simple background foreground test:
0. Reboot phone, unlock.
1. Open browser, click on home.
2. Open calculator, click on home.
3. Open calendar, click on home.
4. Open camera, click on home.
5. Open clock, click on home.
6. adb shell dumpsys meminfo
PSS Normal ART:
Sample 1:
88468 kB: Dalvik
3188 kB: Dalvik Other
Sample 2:
81125 kB: Dalvik
3080 kB: Dalvik Other
PSS Dalvik:
Total PSS by category:
Sample 1:
81033 kB: Dalvik
27787 kB: Dalvik Other
Sample 2:
81901 kB: Dalvik
28869 kB: Dalvik Other
PSS ART + Background Compaction:
Sample 1:
71014 kB: Dalvik
1412 kB: Dalvik Other
Sample 2:
73859 kB: Dalvik
1400 kB: Dalvik Other
Dalvik other reduction can be explained by less deep allocation
stacks / less live bitmaps / less dirty cards.
TODO improvements: Recycle mem-maps which are unused in the current
state. Not hardcode 64 MB capacity of non movable space (avoid
returning linear alloc nightmares). Figure out ways to deal with low
virtual address memory problems.
Bug: 8981901
Change-Id: Ib235d03f45548ffc08a06b8ae57bf5bada49d6f3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added a thread local allocator to the heap, each thread has three
pointers which specify the thread local buffer: start, cur, and
end. When the remaining space in the thread local buffer isn't large
enough for the allocation, the allocator allocates a new thread
local buffer using the bump pointer allocator.
The bump pointer space had to be modified to accomodate thread
local buffers. These buffers are called "blocks", where a block
is a buffer which contains a set of adjacent objects. Blocks
aren't necessarily full and may have wasted memory towards the
end. Blocks have an 8 byte header which specifies their size and is
required for traversing bump pointer spaces.
Memory usage is in between full bump pointer and ROSAlloc since
madvised memory limits wasted ram to an average of 1/2 page per
block.
Added a runtime option -XX:UseTLAB which specifies whether or
not to use the thread local allocator. Its a NOP if the garbage
collector is not the semispace collector.
TODO: Smarter block accounting to prevent us reading objects until
we either hit the end of the block or GetClass() == null which
signifies that the block isn't 100% full. This would provide a
slight speedup to BumpPointerSpace::Walk.
Timings: -XX:HeapMinFree=4m -XX:HeapMaxFree=8m -Xmx48m
ritzperf memalloc:
Dalvik -Xgc:concurrent: 11678
Dalvik -Xgc:noconcurrent: 6697
-Xgc:MS: 5978
-Xgc:SS: 4271
-Xgc:CMS: 4150
-Xgc:SS -XX:UseTLAB: 3255
Bug: 9986565
Bug: 12042213
Change-Id: Ib7e1d4b199a8199f3b1de94b0a7b6e1730689cad
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the code more compatible with different compilers.
clang doesn't allow extra static qualifiers on template
specializations, const qualifiers on function types,
or inline attributes on lambda functions, and is more
picky about casting away constness with reinterpret_cast.
These modifications are compatible with both gcc and
clang.
Change-Id: I739b10df2780bec537827a13679fd2bcc2cc7188
Signed-off-by: Bernhard Rosenkränzer <Bernhard.Rosenkranzer@linaro.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Slight reduction in Zygote size, memory savings are in the noise.
Before: Zygote size: 8739224
After: Zygote size: 8733568
Fixed a bug where we didn't set the concurrent start bytes after
switching the allocator from bump pointer to ROSAlloc in the
zygote. This caused excessive memory usage.
Added the method verifiers as roots to fix an issue caused by
RegTypes holding a Class*.
Added logic to clear card table in the SemiSpace collector, this
reduces DalvikOther from ~2400k -> ~1760k when using the SemiSpace
collector.
Added a missing lock to the timing loggers which caused a rare
one time crash in std::set.
Bug: 11771255
Bug: 8499494
Bug: 10802951
Change-Id: I99d2b528cd51c1c5ed7012e3220b3aefded680ae
|
|
|
|
|
| |
Bug: 11806947
Change-Id: I826875f23ee2233d4128e852ff6fe7e26ced378f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Adds support for switching entrypoints during runtime. Enables
addition of new allocators with out requiring significant copy
paste. Slight speedup on ritzperf probably due to more inlining.
TODO: Ensuring that the entire allocation path is inlined so
that the switch statement in the allocation code is optimized
out.
Rosalloc measurements:
4583
4453
4439
4434
4751
After change:
4184
4287
4131
4335
4097
Change-Id: I1352a3cbcdf6dae93921582726324d91312df5c9
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The compacting collector is currently similar to semispace. It works by
copying objects back and forth between two bump pointer spaces. There
are types of objects which are "non-movable" due to current runtime
limitations. These are Classes, Methods, and Fields.
Bump pointer spaces are a new type of continuous alloc space which have
no lock in the allocation code path. When you allocate from these it uses
atomic operations to increase an index. Traversing the objects in the bump
pointer space relies on Object::SizeOf matching the allocated size exactly.
Runtime changes:
JNI::GetArrayElements returns copies objects if you attempt to get the
backing data of a movable array. For GetArrayElementsCritical, we return
direct backing storage for any types of arrays, but temporarily disable
the GC until the critical region is completed.
Added a new runtime call called VisitObjects, this is used in place of
the old pattern which was flushing the allocation stack and walking
the bitmaps.
Changed image writer to be compaction safe and use object monitor word
for forwarding addresses.
Added a bunch of added SIRTs to ClassLinker, MethodLinker, etc..
TODO: Enable switching allocators, compacting on background, etc..
Bug: 8981901
Change-Id: I3c886fd322a6eef2b99388d19a765042ec26ab99
|
|
|
|
| |
Change-Id: Idf7fe85e1293453a8ad862ff2380dcd5db4e3a39
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
According to profiling results, field and method resolutions are hot points
during interpreter execution. This CL attempts to speed up these resolutions.
Forces aggressive inlining of FindFieldFromCode and FindMethodFromCode. This
allows to reduce the overhead of access check code when the interpreter runs
without these checks. Templatize these functions to optimize inlining and their
callers.
Also spread the use of C++11 "nullptr" in place of "NULL" in field access and
invoke helpers.
Change-Id: Ic1a69834d8975b2cddcddaae32f08a7de146a951
|
|/
|
|
|
|
|
|
|
|
|
| |
We ensured the resolved method was in the dex cache, but for a sharpened call
this is abstract. Ensure that the concrete method is also resolved.
Limit the use of direct dex cache based dispatch to cases where we know how to
patch the dex cache.
Bug 11389002
Change-Id: I08252686a53b5948650632837c74bcd5cbf8a862
|
|
|
|
|
|
|
| |
Use a modifier to signal a native method is a fast JNI method. If the
modifier is set then don't perform runnable transitions.
Change-Id: I7835b4d837bfdd1cb8e2d54b919c0d5e6cf90499
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1) don't type check known null.
2) if we know types in verify don't check at runtime.
3) if we're runtime checking then move all the code out-of-line.
Also, don't set up a callee-save frame for check-cast, do an instance-of test
then throw an exception if that fails.
Tidy quick entry point of Ldivmod to Lmod which it is on x86 and mips.
Fix monitor-enter/exit NPE for MIPS.
Fix benign bug in mirror::Class::CannotBeAssignedFromOtherTypes, a byte[]
cannot be assigned to from other types.
Change-Id: I9cb3859ec70cca71ed79331ec8df5bec969d6745
|