[BC] Patch: RFC: indirect dispatch on our own fields

Tom Tromey tromey@redhat.com
Thu Nov 4 23:43:00 GMT 2004


Bryce> Perhaps we should consider just removing the condition and
Bryce> always access static fields via the atable?

Andrew> Sounds good.

Motion carried then.  I'm committing the appended instead.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* class.c (build_static_field_ref): Don't emit direct references
	when using indirect dispatch.

Index: class.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/class.c,v
retrieving revision 1.180.2.14
diff -u -r1.180.2.14 class.c
--- class.c 12 Oct 2004 12:42:41 -0000 1.180.2.14
+++ class.c 4 Nov 2004 23:09:04 -0000
@@ -1054,8 +1054,7 @@
      However, currently sometimes gcj is too eager and will end up
      returning the field itself, leading to an incorrect external
      reference being generated.  */
-  if ((is_compiled 
-       && (! flag_indirect_dispatch || current_class == fclass))
+  if ((is_compiled && ! flag_indirect_dispatch)
       || (FIELD_FINAL (fdecl) && DECL_INITIAL (fdecl) != NULL_TREE
 	  && (JSTRING_TYPE_P (TREE_TYPE (fdecl))
 	      || JNUMERIC_TYPE_P (TREE_TYPE (fdecl)))



More information about the Gcc-patches mailing list