From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 7B6F87EE73 for ; Mon, 5 Nov 2012 20:33:38 +0100 (CET) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=pra; client-ip=212.227.126.186; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of info@gerd-stolpmann.de) identity=mailfrom; client-ip=212.227.126.186; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="info@gerd-stolpmann.de"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of postmaster@moutng.kundenserver.de designates 212.227.126.186 as permitted sender) identity=helo; client-ip=212.227.126.186; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="info@gerd-stolpmann.de"; x-sender="postmaster@moutng.kundenserver.de"; x-conformance=sidf_compatible; x-record-type="v=spf1" X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvQAAKMTmFDU4366jmdsb2JhbABEFrB4kiYjAQEBAQkLCQkSBSSCHgEBAwEBOjQLBSQXXQkSBhMJCYdmAwkKB7EgA4leFItthjwDjV2JOpIY X-IronPort-AV: E=Sophos;i="4.80,716,1344204000"; d="scan'208";a="180250057" Received: from moutng.kundenserver.de ([212.227.126.186]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 05 Nov 2012 20:33:38 +0100 Received: from office1.lan.sumadev.de (dslb-188-097-000-221.pools.arcor-ip.net [188.97.0.221]) by mrelayeu.kundenserver.de (node=mrbap3) with ESMTP (Nemesis) id 0LZwFx-1T4PYD1BdN-00lmKW; Mon, 05 Nov 2012 20:33:37 +0100 Received: from samsung (ip-5-146-55-186.unitymediagroup.de [5.146.55.186]) by office1.lan.sumadev.de (Postfix) with ESMTPSA id D1DC0C00CF; Mon, 5 Nov 2012 20:33:35 +0100 (CET) Date: Mon, 05 Nov 2012 20:33:35 +0100 From: Gerd Stolpmann To: Norman Hardy Cc: Caml List In-Reply-To: <20D75025-C0A1-43A0-89BE-30AD5ED04545@cap-lore.com> (from norm@cap-lore.com on Mon Nov 5 20:21:13 2012) X-Mailer: Balsa 2.4.11 Message-Id: <1352144015.29929.0@samsung> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Disposition: inline Content-Transfer-Encoding: quoted-printable X-Provags-ID: V02:K0:xdu6o22VO9K8emG3aka//4BNcFSegRH1xA6nrPsl4p6 CqZyZPiPTqPjgXUZcc1CJCqrU7ptFmg3uT/x5FGw7tZTa4RNCc N1m9jV5TtZZLxSXU2UPDKxzOvshJvCKV3iCWfGzG5BX4wIp4Vs aDZbDEEk9Os9uPzIavD0SZ+GojVEjWWPSXt1A/OOxClO97rkP2 uFsGobnHvKOkvtY5Y40/f4yiPgtiv3fLJKrz62UaJbQXV8efvp n/OlMVmAsn21wg/xG17ezr9vHKw1oyv+gPFwCN3+zApwt6WSNI 8akLWmvE1Ge3LU2Hp06GZP6rtPtPcXEuvJD3y+qsELW9KY7rQl mnpZxPEl4rTZnCxI3BJM= Subject: AW: [Caml-list] Compiled code that uses the stack when it can. Am 05.11.2012 20:21:13 schrieb(en) Norman Hardy: > Is there a way to get ocamlopt to leave the C sources behind? > Does ocamlopt ever use the stack to call functions that it compiled? Yes, this is even part of the normal way: Arguments are passed in=20=20 registers, and if exceeding the number of registers, via the stack.=20=20 Same as in C (but different details). Only when a closure needs to be built because of incomplete arguments,=20= =20 the closure is allocated on the heap, and when the remaining arguments=20= =20 "arrive", a generated helper function shuffles the arguments back to=20=20 registers/stack, and the function is finally called. Gerd > Does anyone know of compilers that use the stack when they can but=20=20 > uses the heap when it must? > Is there literature on this? > This slide set is very useful but seems to suggest that internal=20=20 > functions representations are treated uniformly. > http://pauillac.inria.fr/~xleroy/talks/compilation-agay.pdf >=20 > I am thinking about static code analysis to determine two or perhaps=20= =20 > three ways free variables in a function might be handled. > It is hard enough that I would like to see if it has been done before. >=20 >=20 >=20 > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs >=20 --=20 ------------------------------------------------------------ Gerd Stolpmann, Darmstadt, Germany gerd@gerd-stolpmann.de Creator of GODI and camlcity.org. Contact details: http://www.camlcity.org/contact.html Company homepage: http://www.gerd-stolpmann.de ------------------------------------------------------------=