Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 18643 invoked from network); 27 Jan 2007 12:04:02 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 27 Jan 2007 12:04:02 -0000 Received: (qmail 34010 invoked by uid 500); 27 Jan 2007 12:04:02 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 33809 invoked by uid 500); 27 Jan 2007 12:04:02 -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 33800 invoked by uid 99); 27 Jan 2007 12:04:02 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Jan 2007 04:04:02 -0800 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of ustczz@gmail.com designates 64.233.162.234 as permitted sender) Received: from [64.233.162.234] (HELO nz-out-0506.google.com) (64.233.162.234) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 27 Jan 2007 04:03:53 -0800 Received: by nz-out-0506.google.com with SMTP id j2so831891nzf for ; Sat, 27 Jan 2007 04:03:32 -0800 (PST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=rv8Sl+q7xQ2DzG9RmNqHmVt24A9YfulzE+LJw7/yO8KHL+CllGnN+gutk9C9wPN67QFXvTO0j4yGD11ZCUAm/Gn5ZVoiCSVSMAo8JlZwTrKwmnZwjOEbp29394T48D45isLpCmiIWpvxe8M2AD19p7sGuaIYA6yT4Ge2fUkxfkY= Received: by 10.65.251.1 with SMTP id d1mr6588483qbs.1169899412520; Sat, 27 Jan 2007 04:03:32 -0800 (PST) Received: by 10.64.233.16 with HTTP; Sat, 27 Jan 2007 04:03:32 -0800 (PST) Message-ID: <6342af3e0701270403q41ef5b43j85496d7eee9843c9@mail.gmail.com> Date: Sat, 27 Jan 2007 20:03:32 +0800 From: zouqiong To: dev@harmony.apache.org Subject: Re: [drlvm][opt] How to get object access sequence during runtime. In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_56105_9177399.1169899412476" References: <6342af3e0701212342n561cp484751d7cded0366@mail.gmail.com> <6342af3e0701230233n2100bab3k73022c8f8a2ef03b@mail.gmail.com> <6342af3e0701231717k5616db24q66a4aec57eedfa7@mail.gmail.com> <6342af3e0701241844k548e93eftb5d62d12b4e1acc6@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_56105_9177399.1169899412476 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I add the following expression in InstCodeSelector::addElemIndex(): Opnd* current_buffer = irManager.newImmOpnd(typeManager.getInt32Type(), (unsigned)¤t_obj_acc_record_pointer); Opnd * Ip_Opnd = irManager.newMemOpndAutoKind(typeManager.getPrimitiveType(Type::UInt32), current_buffer, irManager.newImmOpnd(typeManager.getInt32Type(), 8)); copyOpnd(Ip_Opnd, irManager.newImmOpnd(typeManager.getInt32Type(), 0x19820514)); It seems that the constraints of the Opnds are wrong. Is it? current_obj_acc_record_pointer points to a buffer of type obj_acc_record typedef struct { uint32 base; uint32 offset; uint32 ip; uint32 other_info; }obj_acc_record; 2007/1/25, Mikhail Fursov : > > On 1/25/07, zouqiong wrote: > > > > > > > > You are right. If the only change you do is a new extra call in > > translator > > > it will limit optimizations. The best place to add tracing calls could > > be > > > hir2lir conversion, after all HLO optimizations were finished, but in > > this > > > case your helper can't be inlined. > > > > > > If you want your helper to be inlined try to add additional 'getfield' > > > instrumentation pass into the middle of optimizer's pipeline: after > > > inliner > > > and memopt. > > > > > > -- > > > Mikhail Fursov > > > > > > I think I can directly instrument code to trace the object, not by > > instrumenting call instruction. > > > > What do you mean by HLO optimization? I instrument at Code Selector Pass > > and > > now I can trace getfield and aaload. > > > > > Jitrino's code generation pipeline can be splitted into 2 parts: HLO and > CG > (codegen) > HLO part performs HIR optimizations/transformations > CG part performs LIR optimizations/transformations > LIR optimizations are very limited and very platform specific. > For example, inlining of Java methods is not platform specific, so this is > HLO optimization. > > If you put your helper into Code Selector Pass (which is also called > 'hir2lir') it's OK. > The only drawback I see here: your tracking call will never be inlined. > > > -- > Mikhail Fursov > > -- Best Regards, Qiong,Zou ------=_Part_56105_9177399.1169899412476--