From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA14591 for caml-redistribution; Fri, 10 Sep 1999 19:23:48 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA29210 for ; Fri, 10 Sep 1999 17:20:29 +0200 (MET DST) Received: from tcs.inf.tu-dresden.de (tcs.inf.tu-dresden.de [141.76.75.119]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id RAA04480 for ; Fri, 10 Sep 1999 17:20:28 +0200 (MET DST) Received: from ithif20.inf.tu-dresden.de (ithif20 [141.76.75.120]) by tcs.inf.tu-dresden.de (8.9.1a/8.9.1) with SMTP id RAA02833 for ; Fri, 10 Sep 1999 17:19:38 +0200 (MET DST) Received: by ithif20.inf.tu-dresden.de (SMI-8.6/SMI-SVR4) id RAA18663; Fri, 10 Sep 1999 17:19:39 +0200 Date: Fri, 10 Sep 1999 17:19:39 +0200 Message-Id: <199909101519.RAA18663@ithif20.inf.tu-dresden.de> From: Hendrik Tews MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit To: caml-list@inria.fr Subject: Re: Efficency in OCaml In-Reply-To: <19990902010939.12962@pauillac.inria.fr> References: <7qj9lv$aa9$1@goldenapple.srv.cs.cmu.edu> <199909011840.OAA01846@bismarck.chet.org> <19990902010939.12962@pauillac.inria.fr> X-Mailer: VM 6.34 under Emacs 19.34.1 Sender: weis Jerome Vouillon writes: From: Jerome Vouillon Date: Thu, 2 Sep 1999 01:09:39 +0200 Subject: Re: Efficency in OCaml [...] Each object holds a table containing its methods (the table is shared among all objets of a same class). A unique integer is assigned at run-time to each method name of a program. This integer is used as an index in this table to find the method. As the table is rather sparse, it is implemented as a two-level array (an array of arrays of functions). So, a method call "object#m e1 ... en" is compile in something that looks like "object.(0).(idx mod N).(idx / N) objet e1 ... en" where idx is the integer associated to the method name "m". Sorry, I don't understand this. How can the compiler know idx, if it is not known until run-time? Bye, Hendrik