This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [vta/trunk] stabilize Java JNI function types


Alexandre Oliva writes:
 > Using type uids for hashing requires us to make sure that
 > canonicalizing a type always gets us the type with the same uid.
 > Unfortunately, if a type is garbage collected in between uses, we
 > won't canonicalize to it any more, and will instead use a new type.
 > If the canonicalization could have avoided the creation of other
 > types, this will also have the effect of getting TYPE_UIDs out of sync
 > between the compilations with or without garbage collection of that
 > type.  If they do get out of sync, we often get changes to Java UTF8
 > sections.
 > 
 > As it turns out, the Java front-end builds types to hold the proper
 > type of a JNI method implementation, but only uses it in code, and
 > so the type can quickly get garbage collected.
 > 
 > With as simple a change as using that type for the meth variable that
 > holds the pointer to that implementation, we keep the type around such
 > that other methods with the same signature get the same canonical
 > type, regardless of garbage collection.
 > 
 > As an additional benefit, the variable gets the correct static type in
 > debug information, rather than a generic pointer type.
 > 
 > Ok for trunk?  This is the last patch I needed to get
 > make bootstrap-debug &&
 > make prepare-bootstrap4-debug-lib-novta &&
 > make bootstrap4-debug &&
 > rm compare3-debug && make compare3-debug
 > 
 > to pass, i.e., all target libraries compiled with
 > -fvar-tracking-assignments and with -fno-var-tracking-assignments
 > compared identically, on x86_64-linux-gnu.
 > 
 > for  gcc/java/ChangeLog.vta
 > from  Alexandre Oliva  <aoliva@redhat.com>
 > 
 > 	* expr.c (build_jni_stub): Use the computed jni func type for
 > 	variable meth.
 > 

Ok, if you include a comment in the source explaining why you do this.

Andrew.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]