This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java 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]

[gcjx] Patch: FYI: dispatch for private methods


I'm checking this in on the gcjx branch.

We don't want to use virtual dispatch for private methods.

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>
	* abi.cc (build_method_call): Don't use virtual dispatch for
	private methods.
	(get_vtable_index): Return -1 for private methods.

Index: abi.cc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/java/Attic/abi.cc,v
retrieving revision 1.1.2.15
diff -u -r1.1.2.15 abi.cc
--- abi.cc 24 Mar 2005 02:15:42 -0000 1.1.2.15
+++ abi.cc 24 Mar 2005 02:16:25 -0000
@@ -71,7 +71,8 @@
       func = build1 (NOP_EXPR, build_pointer_type (TREE_TYPE (meth_tree)),
 		     func);
     }
-  else if (is_super || meth->final_p () || meth->constructor_p ())
+  else if (is_super || meth->final_p () || meth->constructor_p ()
+	   || (meth->get_modifiers () & ACC_PRIVATE) != 0)
     {
       assert (obj != NULL_TREE);
 
@@ -237,7 +238,8 @@
 cxx_abi::get_vtable_index (aot_class *klass, model_method *method)
 {
   assert (method->get_declaring_class () == klass->get ());
-  if (method->static_p () || method->constructor_p ())
+  if (method->static_p () || method->constructor_p ()
+      || (method->get_modifiers () & ACC_PRIVATE) != 0)
     return integer_minus_one_node;
   // A special case for methods that are never virtual.
   if (method->final_p ()


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