From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25112 invoked by alias); 8 Sep 2006 17:32:20 -0000 Received: (qmail 25070 invoked by uid 22791); 8 Sep 2006 17:32:17 -0000 X-Spam-Check-By: sourceware.org Received: from mtaout03-winn.ispmail.ntl.com (HELO mtaout03-winn.ispmail.ntl.com) (81.103.221.49) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 08 Sep 2006 17:32:12 +0000 Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout03-winn.ispmail.ntl.com with ESMTP id <20060908173206.PRCL1865.mtaout03-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com>; Fri, 8 Sep 2006 18:32:06 +0100 Received: from mammoth.littlepinkcloud.com ([82.6.106.47]) by aamtaout03-winn.ispmail.ntl.com with ESMTP id <20060908173206.NKCA11710.aamtaout03-winn.ispmail.ntl.com@mammoth.littlepinkcloud.com>; Fri, 8 Sep 2006 18:32:06 +0100 Received: from zebedee.littlepinkcloud.COM (zebedee.pink [10.0.0.17]) by mammoth.littlepinkcloud.com (8.12.11.20060308/8.12.11) with ESMTP id k88HW469031702; Fri, 8 Sep 2006 18:32:04 +0100 Received: from zebedee.littlepinkcloud.COM (localhost.localdomain [127.0.0.1]) by zebedee.littlepinkcloud.COM (8.13.6/8.13.5) with ESMTP id k88HW1P0030747; Fri, 8 Sep 2006 18:32:01 +0100 Received: (from aph@localhost) by zebedee.littlepinkcloud.COM (8.13.6/8.13.5/Submit) id k88HW09s030744; Fri, 8 Sep 2006 18:32:00 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17665.43280.746181.454951@zebedee.pink> Date: Fri, 08 Sep 2006 17:32:00 -0000 From: Andrew Haley To: java-patches@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [ecj] vtable entries for bridge methods X-Mailer: VM 7.19 under Emacs 21.4.1 X-IsSubscribed: yes Mailing-List: contact java-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-patches-owner@gcc.gnu.org X-SW-Source: 2006-q3/txt/msg00400.txt.bz2 We weren't distinguishing return types when building vtables, but the VM does so distinguish: for example, T.foo()bar is a different method from T.foo()Object, and we need vtable slots for both of them. Because we weren't using the return type when searching vtables, we were only building a vtable entry for the first one we saw. Arguably this is also a bug in mainline, but it really only affects generic code and bytecode written in languages other than Java. Andrew. 2006-09-08 Andrew Haley * class.c (layout_class_method): Use build_java_signature, not build_java_argument_signature. Use lookup_java_method, not lookup_argument_method. Index: class.c =================================================================== --- class.c (revision 116634) +++ class.c (working copy) @@ -2476,15 +2476,15 @@ p = ptr; } DECL_CONSTRUCTOR_P (method_decl) = 1; - build_java_argument_signature (TREE_TYPE (method_decl)); + build_java_signature (TREE_TYPE (method_decl)); } else if (! METHOD_STATIC (method_decl)) { tree method_sig = - build_java_argument_signature (TREE_TYPE (method_decl)); + build_java_signature (TREE_TYPE (method_decl)); bool method_override = false; - tree super_method = lookup_argument_method (super_class, method_name, - method_sig); + tree super_method = lookup_java_method (super_class, method_name, + method_sig); if (super_method != NULL_TREE && ! METHOD_DUMMY (super_method)) {