| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
| |
Thread* self is passed on all architectures apart from ARM and ARM64.
On x86 restore ebx correctly. Pass self in correct register on x86-64.
Ensure methods are compiled in jni_compiler_test even if the generic JNI
trampoline is present.
Change-Id: If5fdb1de97b78ac5a5cf8d0915c5b82311f23eb9
|
|
|
|
|
|
|
| |
Refactors and optimizes Generic JNI. This version uses TwoWordReturn
to avoid writing to / loading from the bottom of the alloca.
Change-Id: I3287007c976f79c9fd32d3b3a43f2d1371bf4cd3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This patch modifies memcmp() to memcmp16(). Please note that this
implementation of memcmp16() is based on the bionic's memcmp().
However, to reflect a recent specification change, the file has been
modified to respect the new String.compareTo() behavior.
A test for memcmp16() has been added. The string_compareto test in
stub_test has been changed to invoke __memcmp16 in assembly stubs.
Add artIsAssignableFromCode to the list of native downcalls to
store and reload x18. Remove CheckSuspendFromCode, as it is unused.
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
Change-Id: Ie0b5425ecfb62906d29a5d02e84c7e07ffb34a11
|
|
|
|
| |
Change-Id: I4ed3783a96d844de0b0a295df26d0a48c02a3726
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
| |
Handle __memcmp16 / MemCmp16 in ART. Import assembly implementations
for arm and mips from Bionic. Use a generic C version for all other
platforms.
Removes the memcmp16 quick entrypoint, as it is never used. Bump
the oat version and update thread.cc and checks to reflect the
structural change.
Change-Id: I54a5a1da2a0a43ef271c8aeda0bf2276b8b11ac6
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Adds instrumentation stubs necessary for debugger support.
Refactors MethodAndCode to a top-level TwoWordReturn. A function
having a return type of TwoWordReturn will return its two-word
content, either 2x32b or 2x64b, in two registers according to
the architecture's ABI.
Bug: 15443938
Change-Id: Id7e1fbd4ad8eb6f29e23d48903c76f77b28d981a
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This allows to determine target method when the interface method has
no dex index, now also for X86-64 and ARM64.
Add constexpr functions to callee_save_frame.h to have compile-time
sizes of callee-save frames. Add a test that ensures they agree
with computations by the corresponding ArtMethod methods.
Move some instruction-set functions into the header file to allow
inlining them. Move arch-specific pointer sizes and alignment sizes
out of globals.h to instruction_set.h to reduce dependencies.
Change-Id: I2997592c7dd1f4dd2bd497522c64bd235ae615a6
Signed-off-by: Alexei Zavjalov <alexei.zavjalov@intel.com>
|
| | |
| | |
| | |
| | | |
Change-Id: I1c3644176c101064261d13b50484d2e3ae456316
|
| |/
|/|
| |
| |
| |
| | |
Add the generic JNI trampoline for x86. Small cleanup in the C code.
Change-Id: Icaf9de7c0e5e8d1e6cb1135a54552040344cc5a3
|
|\ \
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch shows our efforts on resolving the ART limitations:
- passing "float"/"double" arguments via FPR
- passing "long" arguments via single GPR, not pair
- passing more than 3 agruments via GPR.
Work done:
- Extended SpecialTargetRegister enum with kARG4, kARG5, fARG4..fARG7.
- Created initial LoadArgRegs/GenDalvikX/FlushIns version in X86Mir2Lir.
- Unlimited number of long/double/float arguments support
- Refactored (v2)
Change-Id: I5deadd320b4341d5b2f50ba6fa4a98031abc3902
Signed-off-by: Serguei Katkov <serguei.i.katkov@intel.com>
Signed-off-by: Dmitry Petrochenko <dmitry.petrochenko@intel.com>
Signed-off-by: Chao-ying Fu <chao-ying.fu@intel.com>
Signed-off-by: Mark Mendell <mark.p.mendell@intel.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The method reference at the bottom of a quick frame is a stack
reference and not a native pointer. This is important for 64b
architectures, where the notions do not coincide.
Change key methods to have StackReference<mirror::ArtMethod>*
parameter instead of mirror::ArtMethod**. Make changes to
invoke stubs for 64b archs, change the frame setup for JNI code
(both generic JNI and compilers), tie up loose ends.
Tested on x86 and x86-64 with host tests. On x86-64, tests succeed
with jni compiler activated. x86-64 QCG was not tested.
Tested on ARM32 with device tests.
Fix ARM64 not saving x19 (used for wSUSPEND) on upcalls.
Tested on ARM64 in interpreter-only + generic-jni mode.
Fix ARM64 JNI Compiler to work with the CL.
Tested on ARM64 in interpreter-only + jni compiler.
Change-Id: I77931a0cbadd04d163b3eb8d6f6a6f8740578f13
|
|
|
|
|
|
|
|
|
|
| |
For reasons lost in the mists of time, the Dalvik JIT tested
the results of an inlined sqrt for NaN on Arm targets, and then
called an out-of-line routine to recompute if true. The Quick
compiler inherited this behavior. It is not necessary, and the CL
purges it (along with the out-of-line sqrt entrypoint).
Change-Id: I8c8fa6feacf9b7c3b9e190dfc6f728932fd948c6
|
|
|
|
|
|
|
|
|
|
| |
Fixed the generic trampoline to not use ToJObject when unnecessary.
Bug: 15167269
This reverts commit 3bdb873122964da7937eb070cbcf2ef638a8e459.
Change-Id: I0525d0e0f3afb753c770e1572070a0fa22b02271
|
|
|
|
|
|
| |
This reverts commit e09ae0920be57760fb390b6944bce420fa0b5582.
Change-Id: I48036306130d5ccfec683d0dc3e9a642a02ee9c1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
| |
"Generalize" the return type notion of the interface helpers.
Includes a simple test for imt_conflict. The other interface
trampolines are as of yet untested.
Change-Id: I30fc75f5103766d57628ff22bcbac7c7f81037e3
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There is a race condition between the GCDaemon visiting
thread local roots starting from the thread's indirect ref table (IRT)
and another thread calling JNI::DeleteLocalReference, which is clearing
one of the indirect references.
To cope with the race condition the DeleteLocalReference used to transit
from suspended to running state by creating a ScopedObjectReference(env).
But this transition was removed with the following patch:
https://android.googlesource.com/platform/art/+/ef28b14268ed0f9db0c7bbd571aa514354a360bd%5E!/#F0
If so the GCDaemon must be careful to work with IRT entries.
This new patch:
1. calls the visitor only if the reference is not null. This if-null
behavior of ART GC is consistent with what Dalvik GC does.
2. But this might be not enough for some future sophisticated GC algorithms.
For example, if GC moves an object, then the IRT entry must be changed
with CAS only if it has not been cleared. So, for the safety reasons
the patch put backs the ScopedObjectReference soa(env) to
DeleteLocalReference.
Only one of those two changes would be enough.
mathieuc note: I decided to delete the root null check but kept the
ScopedObjectAccess in DeleteLocalRef and added missing annotations as
well as more ScopedObjectAccess in jni internals.
Bug: 14626564
Change-Id: I90d4b8494f61404579ecdd2918d1482093d99387
Signed-off-by: Yevgeny Rouban <yevgeny.y.rouban@intel.com>
Signed-off-by: Yang Chang <yang.chang@intel.com>
|
|
|
|
|
|
|
|
|
|
| |
Move a few functions from art_method.cc to art_method-inl.h
and introduce new overloads that take already known partial
results; do not rely on the compiler to magically merge the
identical but non-trivial paths. The partial results are
DCHECKed to be correct.
Change-Id: I342c3001bbff08a2bbbb9a7b62ae67188ad8cffc
|
|
|
|
|
|
|
| |
Also remove the Android.libcxx.mk and other bits of stlport compatibility
mechanics.
Change-Id: Icdf7188ba3c79cdf5617672c1cfd0a68ae596a61
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Delete SirtRef and replaced it with Handle. Handles are value types
which wrap around StackReference*.
Renamed StackIndirectReferenceTable to HandleScope.
Added a scoped handle wrapper which wraps around an Object** and
restores it in its destructor.
Renamed Handle::get -> Get.
Bug: 8473721
Change-Id: Idbfebd4f35af629f0f43931b7c5184b334822c7a
|
|
|
|
| |
Change-Id: Iba7d47b6a697ab61e10dfc9e1c2b8fde24af27be
|
|
|
|
|
|
| |
This reverts commit 8d5ead52a92675c258113d3dfa71bf8fceba5d9f.
Change-Id: I6b4774a9bd180de33551975e106322ba1192e6ab
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|