Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 97721 invoked from network); 13 Sep 2006 14:26:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 13 Sep 2006 14:26:22 -0000 Received: (qmail 28494 invoked by uid 500); 13 Sep 2006 14:26:15 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 28458 invoked by uid 500); 13 Sep 2006 14:26:15 -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 28447 invoked by uid 99); 13 Sep 2006 14:26:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Sep 2006 07:26:15 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of pmcfirst@gmail.com designates 64.233.166.179 as permitted sender) Received: from [64.233.166.179] (HELO py-out-1112.google.com) (64.233.166.179) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 13 Sep 2006 07:26:05 -0700 Received: by py-out-1112.google.com with SMTP id c30so3089923pyc for ; Wed, 13 Sep 2006 07:25:38 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=Icj4RCiaIQlQ/Lv6GDp6WE8sSdpeUDssw5yUe6dPZj7E1Vy+ATn0LCpMILUv0I3KOSfIKjqmXf+1pK8acKjcAFBNgomuneytbgbX3xX+5+5/DZcQCfqbLshnhenAgH9PbOgFWK3RX9Ih+HVfFmqdHTEsPF0JTqsIdBckfA89Dcg= Received: by 10.35.114.16 with SMTP id r16mr13716560pym; Wed, 13 Sep 2006 07:25:38 -0700 (PDT) Received: by 10.35.9.7 with HTTP; Wed, 13 Sep 2006 07:25:37 -0700 (PDT) Message-ID: Date: Wed, 13 Sep 2006 18:25:37 +0400 From: "Pavel Pervov" To: harmony-dev@incubator.apache.org Subject: Re: [drlvm] Cleaning insides of Class.h header In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_9081_11247175.1158157537974" References: <44C4E656.4050101@pobox.com> <4dd1f3f00609062031n57ff664ck976e424628ca65f5@mail.gmail.com> <4dd1f3f00609110823l15a186a4rf82ee6ec9a8c22c2@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_9081_11247175.1158157537974 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline Not sure C++ "friend"s are good design. Although class format is something one might want to localize to be known to only one entity (like ClassFileParser), it is much better to provide "format extractor" to anybody interested in its use and let them manage their content by themselves. This is how current implementation is designed. If something should be improved, ByteReader can be extended to provide more advanced "format extraction" methods than it has now. Treat the above as "I object". :) If you see some design issues in current class parsing code, please, fill free to share. Best regards, Pavel. On 9/13/06, Alexey Varlamov wrote: > 2006/9/11, Weldon Washburn : > > On 9/10/06, Alexey Varlamov wrote: > > > > > > 2006/9/10, Pavel Pervov : > > > > Weldon, > > > > > > > > one of good examples is static_method_block member variable of > struct > > > Class. > > > > Its size if calculated, memory is allocated for it, but it is never > used > > > > throughout the code. Roughly 3K classes loaded in simple Eclipse > usage > > > > scenario (open Eclipse, create "hello, world" application, run it, > exit > > > > Eclipse), which means 3K useless memory allocations are made during > this > > > > simple run. Heap is fragmented and Visual C runtime has locking on > each > > > > memory allocation. > > > > > > > > Regards, > > > > Pavel. > > > > > > Pavel, > > > > > > I believe the first step should be re-structuring of this ubiquitous > > > and huge (~1800 lines!) header to several more dedicated ones, and > > > regrouping of other related headers, like class_interface.h and > > > classloader.h. > > > Then we can go with reduction of possible duplicates in interfaces, > > > and optimizing structures layouts and memory usage. > > > What do you think? > > > > > > This works also! In any case, please attempt to break the work into > several > > stages. > > > > As the very first step, I volunteer to extract items related to > class-file parsing. The idea is to move methods like > Class_Member::parseXXX() to a new ClassFileParser class and declare > this class a friend of Class_Member's descendants. This way we'll > isolate CFF parsing utilities from ordinary user interface of Class & > members. > I will proceed if nobody objects. > > -- > Alexey > > [snip] > > --------------------------------------------------------------------- > Terms of use : http://incubator.apache.org/harmony/mailing.html > To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org > For additional commands, e-mail: harmony-dev-help@incubator.apache.org > > ------=_Part_9081_11247175.1158157537974--