History log of /art/test/004-JniTest/src/Main.java
Revision Date Author Comments
3a29a019a885087c10ad10413b299329945d5f32 26-Feb-2016 Alex Light <allight@google.com> Add JNI tests for lambdas

(cherry picked from commit e9d2ca237620b0af28eed9fef52b09bddebdbc6f)

Bug: 27259142

Change-Id: I2a1b31db85dc487c1e6a62609d4497c3a4d4d3a6
e9d2ca237620b0af28eed9fef52b09bddebdbc6f 26-Feb-2016 Alex Light <allight@google.com> Add JNI tests for lambdas

Bug: 27259142

Change-Id: I2a1b31db85dc487c1e6a62609d4497c3a4d4d3a6
7ead0c009c64f1e10aa39e44ea10383dd859d332 22-Feb-2016 Alex Light <allight@google.com> Make JNI work correctly with default methods.

Also adds some tests for JNI and DefaultMethods.

Bug: 27259142
Bug: 24618811

(cherry picked from commit 3612149aee482ab7a17da68b0ef5fef3879729a2)

Change-Id: I31222e3e41059d803be1dbb0f40e1144ac4bf457
3612149aee482ab7a17da68b0ef5fef3879729a2 22-Feb-2016 Alex Light <allight@google.com> Make JNI work correctly with default methods.

Also adds some tests for JNI and DefaultMethods.

Bug: 27259142
Bug: 24618811

Change-Id: I31222e3e41059d803be1dbb0f40e1144ac4bf457
20a0be0299183b54be9643820294e011d3358823 20-Feb-2016 Hiroshi Yamauchi <yamauchi@google.com> Fix CC collector thread flip and JNI critical section deadlocks.

There's a bug in the synchronization between the CC collector's thread
flip and JNI critical sections where it incorrectly attempts to make
the synchronization scheme to be writer (GC) preference to avoid
starvation of GC in the presence of frequent JNI critical section
enter/exit. This could cause a deadlock between them if a thread
enters a nested JNI critical section after a thread flip occurs. This
is reproduced in the added test.

The fix is to use a thread local disable counter in addition to the
global counter to detect a nested enter by the same thread and avoid
waiting if nested.

Bug: 19235243
Bug: 12687968
Change-Id: Idf7720a6906c9ea508219935af3727f76680d2d8
031768a340634e2dbdec1aebb2bb3fe509b2f1f6 27-Aug-2015 Mathieu Chartier <mathieuc@google.com> Add non debug version of libarttest

We now pass the libarttest as an argument to the java program. This
enables using libarttestd by default and libarttest when -O is
specified.

Change-Id: I0de1ae01e2bb5f7b9c7fd7487b6cb55051f60657
997673870a487baa136f1b13f81ae26dd3005e14 11-Jul-2015 Mathieu Chartier <mathieuc@google.com> Fix proxy handling in FindDeclaredVirtualMethod

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
72156e28fd6bc72ac965b29446f8801b2e82f2fd 11-Jul-2015 Mathieu Chartier <mathieuc@google.com> Fix proxy handling in FindDeclaredVirtualMethod

Added missing GetInterfaceMethodIfProxy and test.

Fixed formatting.

Bug: 22411819
https://code.google.com/p/android-developer-preview/issues/detail?id=2635

Change-Id: I3eece9c72091bb9d0262aacf0a75ec6908b5f4d2
22c1caa6fad7846cdf7de30323c6c7dc860b9b03 02-Jun-2015 Mathieu Chartier <mathieuc@google.com> Add more info for attempting to delete non-JNI local reference

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)

(cherry picked from commit ff6d8cffb7c14eee56df16d1422b1fcc180decde)

Bug: 20683465
Change-Id: I56b99c77ae7020cabf1aaeb1d5317b1d5ba940e5
ff6d8cffb7c14eee56df16d1422b1fcc180decde 02-Jun-2015 Mathieu Chartier <mathieuc@google.com> Add more info for attempting to delete non-JNI local reference

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
848f70a3d73833fc1bf3032a9ff6812e429661d9 15-Jan-2014 Jeff Hao <jeffhao@google.com> Replace String CharArray with internal uint16_t array.

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
58e5e5d12d5dc55e09088d6bf8d51e4313248a13 08-Sep-2014 Brian Carlstrom <bdc@google.com> Add CallNonvirtual test

Change-Id: If0cbfc587cb8fe5d47fda1149629954080dd0f6f
ab61295e55c38072095e498053b8f5bebf46ad63 14-Aug-2014 Andreas Gampe <agampe@google.com> ART: Fix another potential N-th visitor issue

Bug: 16867274
Change-Id: I5466af563032041ef4a547894f40f303871302c6
61bf6a1c80bf797af5d7911ff71fc367fdb36742 12-Aug-2014 Andreas Gampe <agampe@google.com> ART: Tolerate shallow call stack in VMStack_getCallingClassLoader

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
Change-Id: I5fb8f91f372a41e0bc11ef9f70640834591afa53
0d334ce54efd791da14536b6a16f61d9085b8785 14-Aug-2014 Andreas Gampe <agampe@google.com> ART: Fix another potential N-th visitor issue

Bug: 16867274

(cherry picked from commit ab61295e55c38072095e498053b8f5bebf46ad63)

Change-Id: I5466af563032041ef4a547894f40f303871302c6
718ac65aa78403124c2269f0dcadd341a18b8efe 12-Aug-2014 Andreas Gampe <agampe@google.com> ART: Tolerate shallow call stack in VMStack_getCallingClassLoader

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
1268b742c8cff7318dc0b5b283cbaeabfe0725ba 11-Jul-2014 Narayan Kamath <narayan@google.com> Fix broken JNI IsAssignableFrom.

The expected argument order was the opposite of what the spec
dictated.

Reported-By: Mikhail Naganov <mnaganov@google.com>
bug: 16531674

Change-Id: I1ebc6d5814ebb4feeb96f3ecdf1a4602da4ba7ce
1c83cbc4a817acbd7f9abb5b29a2d418a958e6a1 23-Jul-2014 Andreas Gampe <agampe@google.com> ART: Make run tests out of oat tests

Transforms all former oat tests into run tests.

Change-Id: I190dd39456454c36e5538a2c044d993965a67533