Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 19899 invoked from network); 1 Apr 2009 05:02:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 1 Apr 2009 05:02:54 -0000 Received: (qmail 82707 invoked by uid 500); 1 Apr 2009 05:02:53 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 82644 invoked by uid 500); 1 Apr 2009 05:02:53 -0000 Mailing-List: contact dev-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list dev@harmony.apache.org Received: (qmail 82633 invoked by uid 99); 1 Apr 2009 05:02:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 05:02:53 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of zwd2005@gmail.com designates 209.85.146.178 as permitted sender) Received: from [209.85.146.178] (HELO wa-out-1112.google.com) (209.85.146.178) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 01 Apr 2009 05:02:46 +0000 Received: by wa-out-1112.google.com with SMTP id l24so1645134waf.4 for ; Tue, 31 Mar 2009 22:02:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=Wfa9W/fTuzecCh6eL0mvFYFDsOl0gqK8ZZdnJfXOWsE=; b=T8B4Qab1DG/i1tZDSFVhh+6DCwNBxHNpSh+NZ4MGL7x3e4ZFJMedPaDj5PzroinmEb 3fNupHdYzzs59pyMqtqhqN+655cJzmk4K09hiHSXSCwJf1DiB4g6NN9xh3cdtcptfhhj LoeFP7EG7Jvm1H0gB3nXkEvs8umESy6zxrVew= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=evXZDcZT+XbWKYUjGyI4N/4VrB7RwnGoYujmwSqmWHfC0eIj/lg43omh20Hhey4xIQ kYbw8py5wqedNTGuPk7u9Ik1MXsrz8kxr22MM8ITpdGvh42NxjUawnX08rTDb1FZ0pIT gWNKYhzrzwGITN2fnkEkJsrnEure/hTFuT9Y0= MIME-Version: 1.0 Received: by 10.114.169.20 with SMTP id r20mr4937614wae.110.1238562146011; Tue, 31 Mar 2009 22:02:26 -0700 (PDT) In-Reply-To: <1238555958.4074.2.camel@mikeandmore.3322.org.3322.org> References: <2cde31750903300201l314f4d7aj286dde250998c705@mail.gmail.com> <5c8e69f0903300857h51507ab9y944bec80834e632d@mail.gmail.com> <9623c9a50903302117v130e3646yaa21b1e75ed7c8a1@mail.gmail.com> <2cde31750903310930h5b563474h2e3ec8d7eb392894@mail.gmail.com> <1238551461.3171.2.camel@mikeandmore.3322.org.3322.org> <3938bb7b0903312003l65b36c17qbf7e97b9e3e30eea@mail.gmail.com> <1238555136.3917.3.camel@mikeandmore.3322.org.3322.org> <3938bb7b0903312016i4638551bp6b7b77c8e8568d58@mail.gmail.com> <1238555958.4074.2.camel@mikeandmore.3322.org.3322.org> Date: Wed, 1 Apr 2009 13:02:25 +0800 Message-ID: <3938bb7b0903312202h679292edo709da14bf27067a7@mail.gmail.com> Subject: Re: [GSoC] My proposal From: WenDong Zhang To: dev@harmony.apache.org Content-Type: text/plain; charset=GB2312 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org wonderful, I don't know what exactly technology it is, but we can see the compile info in Eclipse Class File Editor. 2009/4/1 Mike : > Precisely. ^_^, That just what i mean. > > Of course, Please try to prove me wrong if you found something more. > > Thanks > Yours Mike > > > =D4=DA 2009-04-01=C8=FD=B5=C4 11:16 +0800=A3=ACWenDong Zhang=D0=B4=B5=C0= =A3=BA >> oh, I see what you said: From the research i've been done, it seems >> that classfile will record the its imports for us. >> >> we can get the imports information from .class file, you mean we ony >> need the binary .class file and we don't have to run it? >> >> 2009/4/1 Mike : >> > You can search my ideas on the mail-archiver. >> > Besides dynamic tracing, I also use dot-class file parsing (The static >> > approach). The dot-class file will record dependency in its >> > ConstantPool. >> > >> > Dynamic tracing is used to cover java's reflection. so it should be ok >> > for user to test their reflection code, isn't it? >> > >> > Yours Mike >> > >> > =D4=DA 2009-04-01=C8=FD=B5=C4 11:03 +0800=A3=ACWenDong Zhang=D0=B4=B5= =C0=A3=BA >> >> I think dynamic tracing the loaded classes is pretty good, the only >> >> shortcoming is we need to write the test unit completely or there wil= l >> >> be some classes missing in our mimi jre. >> >> >> >> I still want to know are there any other ways to implement this work? >> >> My first thought is use text analysis, but there are to many problems= : >> >> dynamic loading class, third party lib... >> >> >> >> 2009/4/1 Mike : >> >> > =D4=DA 2009-04-01=C8=FD=B5=C4 00:30 +0800=A3=ACDaniel Gong=D0=B4=B5= =C0=A3=BA >> >> >> By saying dynamic class loading, do you mean reflection based clas= s loading >> >> >> or just class loader way? >> >> >> For the former one, I don't think the dynamic trace strategy is ri= ght. In my >> >> >> opinion, to do dynamic tracing we need to examine all possible run= ning path >> >> >> of the program. It is unrealistic, especially when the program mus= t interact >> >> >> with users. >> >> >> The latter one may have the same problem as the former one, I gues= s. >> >> >> In fact, there is a condition that the class name string is from t= he user >> >> >> input. If so, I think we can ignore the class selector and offer t= he whole >> >> >> jre. Except that, it is always possible to parse the code and gene= rate the >> >> >> dynamic loaded class name, although I still don't have a structure= d >> >> >> algorithm... >> >> >> Hehe, I find my words a bit orderless... >> >> >> >> >> >> Daniel >> >> > >> >> > 1 I think the dynamic tracing is possible. I took a look at the drl= vm's >> >> > source these days. It should be easy to let the drlvm leave a trace= for >> >> > us. >> >> > 2 Dynamic tracing should be involved because it can help developers= to >> >> > do their tests. which means that dynamic collection is being perfor= med >> >> > when testing. >> >> > >> >> > Yours Mike >> >> > >> >> >> On Tue, Mar 31, 2009 at 12:17 PM, Xiao-Feng Li wrote: >> >> >> >> >> >> > One another thing is the consideration of dynamic class loading. >> >> >> > >> >> >> > Thanks, >> >> >> > xiaofeng >> >> >> > >> >> >> > On Mon, Mar 30, 2009 at 11:57 PM, Jimmy,Jing Lv >> >> >> > wrote: >> >> >> > > Wow the plan's excellent Daniel! >> >> >> > > >> >> >> > > And an advanced question, as you know, the jre does not only h= ave >> >> >> > classes, >> >> >> > > but also resources files, property files and etc. So do you ha= ve any >> >> >> > ideas >> >> >> > > on select them and merge into the customized JRE? :) >> >> >> > > >> >> >> > > 2009/3/30 Daniel Gong >> >> >> > > >> >> >> > >> Hi all, >> >> >> > >> I'm a postgraduate student from Fudan University, Shanghai= , China. >> >> >> > >> This is my first time joining GSoC and I was not quite clea= r that I >> >> >> > >> should exchange my ideas with possible mentors. I've submitte= d my >> >> >> > proposal >> >> >> > >> today. It's lucky that I can still modify it. >> >> >> > >> Here is my proposal, any criticism and suggestions are welc= ome~ >> >> >> > >> >> >> >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >> >> >> > >> >> >> >> > >> *Abstract:* >> >> >> > >> >> >> >> > >> The main idea to deal with the subject is to collect infomati= on from the >> >> >> > >> input first and then generate smallest JRE according to the i= nfomation >> >> >> > >> collected and harmony classes dependences. >> >> >> > >> >> >> >> > >> *Detailed Description:* >> >> >> > >> >> >> >> > >> The implementation of the tool can be divided into 4 parts: >> >> >> > >> >> >> >> > >> 1. Infomation Collector. Automatic lexcial tool such as JLe= x may be >> >> >> > used >> >> >> > >> to analysis the input code and collect infomation including= which >> >> >> > classes >> >> >> > >> in >> >> >> > >> JRE does the project depend on. >> >> >> > >> 2. Data structure design. Both project-jre class dependence= and jre >> >> >> > inner >> >> >> > >> class dependence should be represented in an uniform way. >> >> >> > >> 3. Class Lister. An algorithm should be designed to compute= with the >> >> >> > >> dependence and list out the classes needed in the smallest = JRE. >> >> >> > >> 4. JRE Builder. Build a JRE according to the class list. >> >> >> > >> >> >> >> > >> *Initial* *Algorithm Design* >> >> >> > >> >> >> >> > >> Use a, b to represent two classes, and to represent a = relation >> >> >> > >> between a & b, that is, a depends on b, in other words, b is = refered in >> >> >> > >> source code of a. >> >> >> > >> >> >> >> > >> 1. Given a project with its class set P, let set S =3D P an= d set M =3D >> >> >> > empty. >> >> >> > >> >> >> >> > >> 2. For each class c in S, search for dependence , and= for each d >> >> >> > >> that exists and d is not in M, put d in S. After sea= rching for >> >> >> > > >> >> > >> *>, put c in M and delete it from S. >> >> >> > >> 3. Loop step 2 until S is empty, return M - P. >> >> >> > >> >> >> >> > >> Here a project's class set includes its customized classes an= d classes >> >> >> > in >> >> >> > >> other packages that the project may link to. >> >> >> > >> >> >> >> > >> *Possible problems to solve* >> >> >> > >> >> >> >> > >> To collect the infomation, just reading the "import" part of = the code is >> >> >> > >> not >> >> >> > >> a precise strategy. A lexicial scan of the code from begin to= end is a >> >> >> > >> must. >> >> >> > >> Automatic lexcial tools can be used to solve the problem. >> >> >> > >> >> >> >> > >> JRE is not just a simple collection of classes needed. Gettin= g familiar >> >> >> > >> with >> >> >> > >> the structure of Harmony JRE is a must. >> >> >> > >> >> >> >> > >> *Draft Timeline* >> >> >> > >> >> >> >> > >> - Week 1-2 Complete the design of data structure and the al= gorithm; >> >> >> > >> - Week 3-4 Implement the module of infomation collector; >> >> >> > >> - Week 5-6 Implement the algorithm to list out the classes; >> >> >> > >> - Week 7-8 Implement the JRE builder; >> >> >> > >> - Week 9 Debug the whole module and make necessary modifica= tions >> >> >> > >> to successfully complete the subject. >> >> >> > >> >> >> >> > >> *Additional Information:* >> >> >> > >> >> >> >> > >> I've been learning and using Java since 3 years ago. Although= my >> >> >> > >> experience of Harmony is not that vast, my knowledge in progr= amming, >> >> >> > >> software architecture, compiler building and algorithm can he= lp me to >> >> >> > learn >> >> >> > >> fast and handle the problem. >> >> >> > >> >> >> >> > >> I'm 23 years old, living in Shanghai, China, attending Fudan = University. >> >> >> > >> >> >> >> > >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D >> >> >> > >> >> >> >> > > >> >> >> > > >> >> >> > > >> >> >> > > -- >> >> >> > > >> >> >> > > Best Regards! >> >> >> > > >> >> >> > > Jimmy, Jing Lv >> >> >> > > China Software Development Lab, IBM >> >> >> > > >> >> >> > >> >> >> > >> >> >> > >> >> >> > -- >> >> >> > http://people.apache.org/~xli >> >> >> > >> >> > >> >> > >> >> >> >> >> >> >> > >> > >> >> >> > > --=20 Best Regards! Wen Dong