This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: java.lang.Character
Eric Blake wrote:
>OK, I just committed this on the head and the 3.1 branch. Someone will
>need to go in and regenerate configure and Makefile.in, as I can't get
>the libjava version of the autotools to work on cygwin.
>
Thanks - I will do that shortly.
>>One thing that might be improved is to have the getType() method in
>>native code. Currently a lot of the methods in the Java code call
>>getType() which then calls the native readChar() - it would reduce the
>>number of calls to have getType() native as well?
>>
>
>There is still only one native call, whether getType() is native or in
>Java. I guess you are arguing that as long as we have to go native, we
>might as well reduce the Java call stack by one? But I went ahead and
>made getType() native, as you suggested.
>
Yeah, GCJ is a bit deficient when it comes to inlining, so the calls to
getType() will currently most likely be real calls that arn't inlined -
and a call to a "public static" Java method is currently actually slower
than a "public static native" method due to to class initialization
check overhead.
Having getType() as native makes sure there is only one call, and it
doesn't make the code any less readable. At least one call is required
because its unlikely that we'll be able to inline native calls into Java
methods for the forseeable future...
>>Also could some of the other tables like BLOCKS be done as C arrays also?
>>
>
>What tables are you referring to? I made sure all the tables of
>java.lang.Character are C arrays; any tables for other classes will have
>to be a future patch.
>
I was refering to the ones in gnu.java.lang.CharData, but you're right -
its not used by Character anyway.
regards
Bryce.