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 NAA20926 for caml-redistribution; Fri, 17 Sep 1999 13:12:59 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA24283 for ; Wed, 15 Sep 1999 14:39:32 +0200 (MET DST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id OAA24889; Wed, 15 Sep 1999 14:39:29 +0200 (MET DST) Received: (from vouillon@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA24102; Wed, 15 Sep 1999 14:39:24 +0200 (MET DST) Message-ID: <19990915143924.26118@pauillac.inria.fr> Date: Wed, 15 Sep 1999 14:39:24 +0200 From: Jerome Vouillon To: Hendrik Tews , caml-list@inria.fr Subject: Re: Efficency in OCaml References: <7qj9lv$aa9$1@goldenapple.srv.cs.cmu.edu> <199909011840.OAA01846@bismarck.chet.org> <19990902010939.12962@pauillac.inria.fr> <199909101519.RAA18663@ithif20.inf.tu-dresden.de> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 0.89.1 In-Reply-To: <199909101519.RAA18663@ithif20.inf.tu-dresden.de>; from Hendrik Tews on Fri, Sep 10, 1999 at 05:19:39PM +0200 Sender: weis On Fri, Sep 10, 1999 at 05:19:39PM +0200, Hendrik Tews wrote: > 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? idx is a variable which is bound at run-time at the beginning of the toplevel module containing the method invocation. -- Jérôme