Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 14865 invoked from network); 5 Oct 2005 16:36:45 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 5 Oct 2005 16:36:45 -0000 Received: (qmail 18745 invoked by uid 500); 5 Oct 2005 16:38:03 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 18684 invoked by uid 500); 5 Oct 2005 16:38:02 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 18669 invoked by uid 99); 5 Oct 2005 16:38:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2005 09:38:02 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=RCVD_BY_IP,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of joewhaley@gmail.com designates 64.233.162.202 as permitted sender) Received: from [64.233.162.202] (HELO zproxy.gmail.com) (64.233.162.202) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Oct 2005 09:38:06 -0700 Received: by zproxy.gmail.com with SMTP id x3so98050nze for ; Wed, 05 Oct 2005 09:37:40 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hLbWlTbhNMSx1S0rXgkEKDzwZwtjgPD6nnJKlA8eVqwYFSEuGmAa/hsr4hRqHEH/y84hluefCoUHHbOxfT73WBpOUOQONupuZ4Xrgm9OMfO5Jj6fzEB5/ub22uJx+BU1ysy2M5MYMPfu+S7l1Ma7pNo76/qvw2VfFyFzU7Wclic= Received: by 10.36.138.16 with SMTP id l16mr739376nzd; Wed, 05 Oct 2005 09:37:40 -0700 (PDT) Received: by 10.36.38.1 with HTTP; Wed, 5 Oct 2005 09:37:39 -0700 (PDT) Message-ID: Date: Wed, 5 Oct 2005 09:37:39 -0700 From: John Whaley Reply-To: jwhaley@alum.mit.edu To: harmony-dev@incubator.apache.org Subject: Re: RT: Escape analysis In-Reply-To: <4341E548.9040207@anu.edu.au> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <72145349.1128221529793.JavaMail.root@set.superlinksoftware.com> <87psqmmxcn.fsf@mid.deneb.enyo.de> <4341E548.9040207@anu.edu.au> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 10/3/05, Robin Garner wrote: > Florian Weimer wrote: > > The conclusion reached in the OOPSLA paper referred to (Choi et al 1999) > is that stack allocation produced a relatively insignificant speedup, > but that locking optimizations for objects that don't escape thread > context was significant. > > In a heap with a bump-pointer allocator, allocation is cheap. Stack > allocation can potentially produce a slow-down by reducing locality in > the stack, and complicating the task of scanning the stack. > Another problem with stack allocation is that it increases object lifetimes because you cannot reclaim the storage until the stack frame disappears. It is possible to work around this if your escape analysis is sophisticated enough. Synchronization overhead definitely improves, but synchronization was so slow for such a long time that many mature programs already eliminate the synchronization by hand (consider ArrayList vs. Vector). Doing escape analysis in a JIT is not difficult; see, for example, my OOPSLA'01 paper or Suganuma et al PLDI'03. The real performance benefit of escape analysis is when you can do scalar replacement, replacing each of the object's fields/array elements with a register. Thus, you eliminate the object entirely, and making its fields into registers allows many more optimizations. John Whaley