Question about -fvisibility=hidden

Ivan Krylov Ivan.Krylov at oracle.com
Thu Sep 2 07:22:54 PDT 2010


  That would be sustaining nightmare. Unless there is a way to generate an external map file for every libjvm.so like it is done my VS.
Ivan

On 02.09.2010 3:18, Paul Hohensee wrote:
>  I googled this and found
>
> http://gcc.gnu.org/wiki/Visibility
>
> which has some pretty amazing claims, but I can actually believe them given the
> number of symbols in a typical C++ compiled object file.   Coleen mentioned to
> me (she's just down the hall, which isn't typical of those working on hotspot)
> that the only problem she thinks might exist with this is that hs_err files and core
> files won't have the symbols we've come to expect.  So that would have to be
> investigated.  Other than that, this looks like all upside and no downside.
>
> Paul
>
> On 9/1/10 6:54 PM, Coleen Phillimore wrote:
>>
>> We have a bug that claims on linux we can get a big performance improvement with this flag.   Is anyone in the openjdk community able to try this 
>> out and/or verify this claim?
>>
>> Thanks,
>> Coleen
>>
>> http://bugs.sun.com/view_bug.do?bug_id=6588413
>>
>> "On compiling the JDK [JVM actually] code with the new gcc compiler option "-fvisibility=hidden"quite some speed improvements on all platforms are 
>> observed, but for it to work, SAP code which is marked with "JNI_EXPORT" needs to be exported correctly by the compiler. The attached patch fixes 
>> this.
>>
>> The attached "jni_md.h.new" file is a version of the file, how it could look like.
>> % more jni_md.h.diff
>> --- jni_md.h    2007-07-19 15:13:07.661299000 +0200
>> +++ jni_md.h.new        2007-07-19 15:12:02.826109000 +0200
>> @@ -8,9 +8,16 @@
>> #ifndef _JAVASOFT_JNI_MD_H_
>> #define _JAVASOFT_JNI_MD_H_
>>
>> -#define JNIEXPORT
>> -#define JNIIMPORT
>> -#define JNICALL
>> +#if defined(__GNUC__) && (__GNUC__ >= 4)
>> +# define JNIEXPORT     __attribute__((visibility("default")))
>> +# define JNIIMPORT     __attribute__((visibility("default")))
>> +# define JNICALL
>> +#else
>> +# define JNIEXPORT
>> +# define JNIIMPORT
>> +# define JNICALL
>> +#endif
>> +
>>
>> typedef int jint;
>> #ifdef _LP64 /* 64-bit Solaris */
>>
>>


-- 
Oracle <http://www.oracle.com>
Dr. Ivan Krylov | Java SE Licensee Engineer, EMEA | +7.812.334.6368
Oracle Development SPB
10th Krasnoarmeyskaya 22A, Saint-Petersburg, 190103, Russia

Software. Hardware. Complete. <http://www.oracle.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20100902/10648bfe/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: oracle_sig_logo.gif
Type: image/gif
Size: 658 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20100902/10648bfe/attachment.gif 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shc.jpg
Type: image/jpeg
Size: 5215 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/attachments/20100902/10648bfe/attachment.jpg 


More information about the hotspot-runtime-dev mailing list