summaryrefslogtreecommitdiffstats
path: root/luni/src/main/native/NativeRegEx.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Rewrite java.util.regex to use ICU's C++ API.Elliott Hughes2010-06-251-306/+0
| | | | | | | | | | | | | I've also removed a bunch of dead code and changed the interface to reduce the number of JNI transitions. Error checking is more uniform, various special cases have been removed, and we pass all the tests referenced by libcore/luni/src/test/java/tests/regex/AllTests.java for the first time. This should also be a stepping-stone to fixing http://b/2777924, removing the need to copy the input string to the native heap. Bug: 2587040 Change-Id: I62685a2384db441cd02df159e117187f3175e10d
* Stop using GetStringChars/ReleaseStringChars.Elliott Hughes2010-06-221-29/+23
| | | | | | | | | | Also fix unused variable warnings in "ExpatParser.cpp". This fixes one actual bug in the regular expression code where we weren't returning after throwing an exception from JNI, in a case where executing the remaining code in the native method would cause a crash. Change-Id: Ib5ce7ea9a3b6476cf47bda2384d5ba43579c785a
* Make valgrind stack traces more readable by using better names.Elliott Hughes2010-06-211-74/+41
| | | | Change-Id: I91e79a07207bb8cc4ae1a58f9d1c28af2bb56a22
* Remove dynamic calls to FindClass.Elliott Hughes2010-06-161-11/+9
| | | | | | | | | | | | | | | | | | | | | Initially, I was just fixing a threading bug in NativeDecimalFormat.cpp where we were bypassing GCC's built-in static initializer thread safety. This led me to the question of how expensive FindClass is, which led me to creating a new canonical cache of jclasses. Here's the motivating benchmark, showing the cost of calling an empty regular (non-native) method, an empty native method, a native method that calls FindClass, a native method that calls FindClass and GetFieldID, and a native method that calls FindClass and GetMethodID: benchmark ns logarithmic runtime NoArgsRegular 74 |||||||||||||| NoArgsNative 428 XX||||||||||||||||||| FindClass 3064 XXXXXXXXXXXXXXXX||||||||||| FindClassGetField 3654 XXXXXXXXXXXXXXXXXXX||||||||| FindClassGetMethod 5634 XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX Change-Id: I41ab2b347895f043a7e21d8fa19e4541e198c3fc
* Add write-back ScopedPrimitiveArrays (and use them).Elliott Hughes2010-05-201-14/+6
| | | | | | | | I've left the remaining Get/Release Critical calls in "NativeConverter.cpp" for the next patch, even though getting into position to fix them is part of the point of this patch. Change-Id: I99e15a3cf3919008343ae4dc856c86ced233e07a
* Enable -Wall -Wextra for libcore and cleanup all but one warningBrian Carlstrom2010-05-071-20/+19
| | | | Change-Id: Ied76662c470ba878cec61189acf29f5cbbd4ccd4
* Merge awt-kernel, icu, luni-kernel, prefs, security-kernel, x-net into luniPeter Hallam2010-05-041-0/+356
Merge xml except xmlpull and kxml into luni