summaryrefslogtreecommitdiffstats
path: root/test/004-JniTest
Commit message (Collapse)AuthorAgeFilesLines
* Fix proxy handling in FindDeclaredVirtualMethodMathieu Chartier2015-07-112-0/+32
| | | | | | | | | | | | | Added missing GetInterfaceMethodIfProxy and test. Fixed formatting. Bug: 22411819 https://code.google.com/p/android-developer-preview/issues/detail?id=2635 (cherry picked from commit 72156e28fd6bc72ac965b29446f8801b2e82f2fd) Change-Id: I3eece9c72091bb9d0262aacf0a75ec6908b5f4d2
* Add more info for attempting to delete non-JNI local referenceMathieu Chartier2015-06-022-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Now we print the stack trace of the method which tried to remove the non-JNI local reference. Added test, example output: Attempt to remove non-JNI local reference, dumping thread "main" prio=5 tid=1 Runnable | group="main" sCount=0 dsCount=0 obj=0x12c2b400 self=0xf878af28 | sysTid=32662 nice=0 cgrp=default sched=0/0 handle=0xf73df700 | state=R schedstat=( 154297228 636505 121 ) utm=5 stm=10 core=11 HZ=100 | stack=0xff6f2000-0xff6f4000 stackSize=7MB | held mutexes= "mutator lock"(shared held) native: #00 pc 00455a7f /out/host/linux-x86/lib/libartd.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::ArtMethod*, void*)+191) native: #01 pc 00425d79 /out/host/linux-x86/lib/libartd.so (art::Thread::DumpStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+473) native: #02 pc 0028c555 /out/host/linux-x86/lib/libartd.so (art::IndirectReferenceTable::Remove(unsigned int, void*)+421) native: #03 pc 003319c8 /out/host/linux-x86/lib/libartd.so (art::JNI::DeleteLocalRef(_JNIEnv*, _jobject*)+56) native: #04 pc 0012db14 /out/host/linux-x86/lib/libartd.so (art::CheckJNI::DeleteRef(char const*, _JNIEnv*, _jobject*, art::IndirectRefKind)+292) native: #05 pc 00122176 /out/host/linux-x86/lib/libartd.so (art::CheckJNI::DeleteLocalRef(_JNIEnv*, _jobject*)+54) native: #06 pc 00005724 /out/host/linux-x86/lib/libarttest.so (Java_Main_removeLocalObject+36) native: #07 pc 00004d6e /tmp/test-32506/dalvik-cache/x86/tmp@mathieuc@test-32506@004-JniTest.jar@classes.dex (void Main.removeLocalObject(java.lang.Object)+130) at Main.removeLocalObject(Native method) at Main.testRemoveLocalObject(Main.java:118) at Main.main(Main.java:37) Bug: 20683465 Change-Id: I56b99c77ae7020cabf1aaeb1d5317b1d5ba940e5
* Add JNI String.<init> test for global and weak global refs.Jeff Hao2015-05-281-0/+16
| | | | | | | Test for change: https://googleplex-android-review.git.corp.google.com/#/c/698642/ Change-Id: I3e1182d42f9e24448d8616000de58ebfe1e50fb8
* Intercept JNI invocation of String.<init> methods.Jeff Hao2015-05-201-13/+50
| | | | | | | | | | | libmono uses JNI AllocObject and CallNonvirtualVoidMethod to create and initialize a string instead of using the recommended NewObject. This change adds an intercept to change the String.<init> call to a StringFactory call instead. Then, it uses the object id of the original string object referrer and maps it to the result of the StringFactory. Bug: 21288130 Change-Id: Ib4db402c178bc37188d5c5faf30b6e4fdc747b17
* Replace String CharArray with internal uint16_t array.Jeff Hao2015-04-272-0/+23
| | | | | | | | | | | | Summary of high level changes: - Adds compiler inliner support to identify string init methods - Adds compiler support (quick & optimizing) with new invoke code path that calls method off the thread pointer - Adds thread entrypoints for all string init methods - Adds map to verifier to log when receiver of string init has been copied to other registers. used by compiler and interpreter Change-Id: I797b992a8feb566f9ad73060011ab6f51eb7ce01
* Replace NULL with nullptrMathieu Chartier2015-04-221-2/+2
| | | | | | | Also fixed some lines that were too long, and a few other minor details. Change-Id: I6efba5fb6e03eb5d0a300fddb2a75bf8e2f175cb
* Don't re-use arttest when calling loadLibrary.Nicolas Geoffray2014-12-031-10/+10
| | | | | | | | | | | | | | | | | | | | When Android's build environment variables are set with envsetup.sh, the test "works" ok, by getting a LinkageError because two class loaders try to load the same library. I guess that is the reason for the if (ExceptionCheck()) after the loading. However, if the environment variables are set manually, there are cases where the paths provided between a Java loadLibrary, and a native loadLibrary are different, so we end up loading the library twice. This makes the assertion line 32 fail on the second JNI_OnLoad call. In my particular environment, ANDROID_BUILD_TOP was something lie /foo/bar/..//. This change stops re-using the same library, and makes the expected outcome constant: the native call of loadLibrary with a non exist library must throw a LinkageError. Change-Id: I8721a03715e099c55fb8b2b87813f1e772c8e83d
* Remove -Wno-unused-parameter and -Wno-sign-promo from base cflags.Ian Rogers2014-11-031-6/+6
| | | | | | | | | | | 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
* Add CallNonvirtual testBrian Carlstrom2014-09-083-9/+272
| | | | Change-Id: If0cbfc587cb8fe5d47fda1149629954080dd0f6f
* ART: Fix another potential N-th visitor issueAndreas Gampe2014-08-142-0/+44
| | | | | | | | Bug: 16867274 (cherry picked from commit ab61295e55c38072095e498053b8f5bebf46ad63) Change-Id: I5466af563032041ef4a547894f40f303871302c6
* ART: Tolerate shallow call stack in VMStack_getCallingClassLoaderAndreas Gampe2014-08-132-85/+117
| | | | | | | | | | | | | When the call stack does not have the three methods we expect, the visitor will return a nullptr value. Add a test to JniTest (and refactor the test a little for code reuse). Bug: 16867274 (cherry picked from commit 61bf6a1c80bf797af5d7911ff71fc367fdb36742) Change-Id: I5fb8f91f372a41e0bc11ef9f70640834591afa53
* Fix broken JNI IsAssignableFrom.Narayan Kamath2014-08-012-0/+21
| | | | | | | | | | The expected argument order was the opposite of what the spec dictated. Reported-By: Mikhail Naganov <mnaganov@google.com> bug: 16531674 Change-Id: I1ebc6d5814ebb4feeb96f3ecdf1a4602da4ba7ce
* ART: Make run tests out of oat testsAndreas Gampe2014-07-234-0/+443
Transforms all former oat tests into run tests. Change-Id: I190dd39456454c36e5538a2c044d993965a67533