Re: Efficency in OCaml

From: Hendrik Tews (
Date: Fri Sep 10 1999 - 17:19:39 MET DST

Date: Fri, 10 Sep 1999 17:19:39 +0200
Message-Id: <>
From: Hendrik Tews <>
Subject: Re: Efficency in OCaml
In-Reply-To: <>

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?



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:25 MET