From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: ** X-Spam-Status: No, score=2.2 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id CC7F1BB84 for ; Sun, 25 Jan 2009 09:27:24 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar8BAOewe0nRVdsQlGdsb2JhbACTOz8BAQEBCQkKCQ+nNo08AQMBA4VJgxA X-IronPort-AV: E=Sophos;i="4.37,321,1231110000"; d="scan'208";a="20124552" Received: from mail-ew0-f16.google.com ([209.85.219.16]) by mail2-smtp-roc.national.inria.fr with ESMTP; 25 Jan 2009 09:27:24 +0100 Received: by ewy9 with SMTP id 9so1011808ewy.3 for ; Sun, 25 Jan 2009 00:27:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=L4ucpTpBA1UFjT8XjCtAh6iFcih5L3DG6Zt8vElu4IE=; b=fOwqi4a0xd8Y040KMEFqTp+YWTwPkiHmCMrE0zuvIerEaETxHy1gww754szfLhgida lJEJmWfsykRa30CNIyR/RqTaEKAtFgD7Mk8FPK4UETH6k55CPaycjUYJOzh4gTE6EVd2 931fBjw7FuuxkBdc0Gp8kV3ylz7hcO+mW6h7c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=elzmyGvE8lyFrIeedAUEr10T6M6073Ng4TofqXZgyws/yxgi2zvVGHSvwxavfzJu4Y R5jCxKqxqIcIxAWyDCFKdCpcmMIdBYZxOwMazkPhM6za64Qyip6Ot0rfyRgWzFY+rkKW 5AVGkUY8HXHfmFgtyMKCBEgG+CrQip5tBVN0c= MIME-Version: 1.0 Sender: mikkelfj@gmail.com Received: by 10.210.54.17 with SMTP id c17mr2896847eba.62.1232872044021; Sun, 25 Jan 2009 00:27:24 -0800 (PST) In-Reply-To: <200901250521.16361.jon@ffconsultancy.com> References: <200901250521.16361.jon@ffconsultancy.com> Date: Sun, 25 Jan 2009 09:27:23 +0100 X-Google-Sender-Auth: ea2ced33d57ea37b Message-ID: Subject: Re: [Caml-list] JIT compilation of OCaml's bytecode From: =?UTF-8?Q?Mikkel_Fahn=C3=B8e_J=C3=B8rgensen?= To: Jon Harrop Cc: "O'Caml Mailing List" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam: no; 0.00; compilation:01 ocaml's:01 bytecode:01 mikkel:01 rgensen:01 mikkel:01 afaik:01 ocaml's:01 bytecode:01 compilation:01 ocaml:01 runtime:01 polymorphism:01 compiler:01 ocaml:01 2009/1/25 Jon Harrop : > > AFAIK, OCaml's bytecode is typeless. How hard would it be to infer types from > the bytecode in order to create type-specific functions during JIT > compilation? I assume you have already studied the other ocamljit approach http://cristal.inria.fr/~starynke/ocamljit.html Regarding types in bytecode, I don't know, but perhaps it is worthwhile looking at Javascript (and possibly Lua) jitters. Recent advances in trace-trees does with dynamic type detection along execution paths. I suspect the polymorphic typing of ocaml requires a kind of typeless compilation otherwise it would not be possible to be polymorphic. Tracetrees would then be able to runtime optimize specific applications of this polymorphism and possibly do better than a static compiler in this area. However, since OCaml is relying so much on a predictable data structure layout I suspect it would be hard work to seriously optimize. Javascript optimizers do tend to realize that hash tables often behave as objects and can optimize this special case though. http://ejohn.org/blog/tracemonkey/ http://www.ics.uci.edu/%7Efranz/Site/pubs-pdf/ICS-TR-06-16.pdf Mikkel