From dev-return-35412-apmail-harmony-dev-archive=harmony.apache.org@harmony.apache.org Wed Nov 19 00:20:28 2008 Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 25774 invoked from network); 19 Nov 2008 00:20:28 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Nov 2008 00:20:28 -0000 Received: (qmail 16167 invoked by uid 500); 19 Nov 2008 00:20:34 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 16143 invoked by uid 500); 19 Nov 2008 00:20:34 -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 16132 invoked by uid 99); 19 Nov 2008 00:20:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Nov 2008 16:20:34 -0800 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 xiaofeng.li@gmail.com designates 209.85.200.169 as permitted sender) Received: from [209.85.200.169] (HELO wf-out-1314.google.com) (209.85.200.169) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Nov 2008 00:19:12 +0000 Received: by wf-out-1314.google.com with SMTP id 28so3166691wfc.24 for ; Tue, 18 Nov 2008 16:19:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=GRDY+xZROyKFt5mde8Dpso/uJ4OFknoVF4TY085s6kY=; b=sNZ/Nqj6vev+kuoN+mpHOsEO7BvCnMIcUSfYMmji8jhvwZrm/sJHgVGWi9FN6ai7Ng l9rQQ7HG1CDKDxiUy83WKXyaWlTnv+ukM+CM/XY46XtZQeGukqGjgTF84sQRtxFh/oHo 3jKWW3XpdZkwvBbgtWAjl+KjHlZysKkc4LZDA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=xbMhwR9wIzfdq0Ae/EaVvJQC1kMJoRHyD7D/H5H9Jb9Y3owcjj2vNZrHMOW+tFLODE dqMgamOC2wN4MxjdQ8Vi6Gr73JOFeB1WCkum8J6ODxg0hWowekQb7Skcg9rdQ7Mm2KnI x8BmZhq3Yt7lW8gCrXB8jVwIkG4YwyRucvYr4= Received: by 10.142.199.10 with SMTP id w10mr190650wff.235.1227053996711; Tue, 18 Nov 2008 16:19:56 -0800 (PST) Received: by 10.143.164.5 with HTTP; Tue, 18 Nov 2008 16:19:56 -0800 (PST) Message-ID: <9623c9a50811181619g4b1d314dh611ae75cc621f225@mail.gmail.com> Date: Wed, 19 Nov 2008 08:19:56 +0800 From: "Xiao-Feng Li" To: dev@harmony.apache.org Subject: Re: Enable the MACRO _DEBUG_CHECK_NULL_ In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <984eb2c70811120620p69f8c58an95bad0625eba3d9@mail.gmail.com> <984eb2c70811120734w4055f773gce9b57fd1de20cd4@mail.gmail.com> <984eb2c70811161921gce43f59kf6ae2f81f6ff4d4e@mail.gmail.com> <984eb2c70811172150w60b55482w1f89006b8f060511@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Nov 19, 2008 at 3:20 AM, Mikhail Fursov wrote: > Hi Buqi, > > I think the issue with not-inlined monenter must be fixed - if monenter is > "hot" it must be replaced with inlined magic code. Are you sure that > monenter inst is "hot" in the code you use? > > The null check for monenter must be done in Java code at least once. If > there is another nullcheck before the monenter -> the monenters one must be > eliminated. If it isn'tt - it's a bug that must be fixed. Agreed. We can't simply work around the issue by saying: hey I have double-checks, it is safe anyway, although one check is enough. Thanks, xiaofeng > > On Tue, Nov 18, 2008 at 11:50 AM, bu qi cheng wrote: > >> Hi Mikhail: >> >> Thanks for informatoin! I am sorry that I made a mistake in the >> command line. The -Xem:client should be -Xem:server. I copied a wrong >> command line. With your help, I found the magic code in >> threadhelper.java: >> @Inline >> static void monitorExit(Object obj) { >> Address lockWordPtr = >> ObjectReference.fromObject(obj).toAddress().plus(LOCK_WORD_OFFSET); >> int lockword = lockWordPtr.loadInt(); >> if (((lockword & (FAT_LOCK_MASK|RECURSION_MASK)))!=0) { >> if ((lockword & FAT_LOCK_MASK)==0) { >> lockword-=RECURSION_INC_IN_PLACE; >> lockWordPtr.store(lockword); >> return; >> } >> } else { >> lockword&=~HI_BITS; >> lockWordPtr.store(lockword); >> return; >> } >> VMHelper.monitorExit(obj); >> } >> >> >> However, in the test case in last email, from the SD2 IR, we can not >> find that the magic is called. So the same bug will happen. Of course >> if add back the null pointer check in rth_get_lil_monitor_enter(), the >> bug will disappear. However, the optimization chance will lost. >> >> Another problem is that in the inliner.cpp, in function >> connectRegion() we can find code like: >> Inst* tauNullCheckInst = tauNullChecked->getInst(); >> if(tauNullCheckInst->getOpcode() == Op_TauCheckNull) { >> tauNullCheckInst->setDefArgModifier(NonNullThisArg); >> } >> >> I think this means that if the inline done, the chknull for the >> argument will be un-optimizable. If the magic is called, no error, and >> no optimization at the same time. Am I right? >> >> Thanks! >> >> Buqi >> >> >> >> Thanks! >> >> Buqi >> > > > > -- > Mikhail Fursov > -- http://xiao-feng.blogspot.com