Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 877 invoked from network); 26 Nov 2006 02:08:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 26 Nov 2006 02:08:56 -0000 Received: (qmail 92291 invoked by uid 500); 26 Nov 2006 02:08:55 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 92259 invoked by uid 500); 26 Nov 2006 02:08:55 -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 92250 invoked by uid 99); 26 Nov 2006 02:08:55 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Nov 2006 18:08:55 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (herse.apache.org: domain of gshimansky@gmail.com designates 64.233.182.186 as permitted sender) Received: from [64.233.182.186] (HELO nf-out-0910.google.com) (64.233.182.186) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Nov 2006 18:08:39 -0800 Received: by nf-out-0910.google.com with SMTP id a4so1787578nfc for ; Sat, 25 Nov 2006 18:08:18 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:to:subject:date:user-agent:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=ecGrne0GA25KNeq79iO4b3DE2mra203GMDUCtwHEtpon0o5WOrvfK0Lr3p6UXtIRbljkdWvqAQfnKAKu7cOxAo/LM9ps35XKKLUAXmi1+pt8tKewr0/h/lfBPk02qCN2GUT4D5c8jMq2ShTplSFJ/p3sPNOa0prdag6jR5pyWm4= Received: by 10.48.217.11 with SMTP id p11mr8297156nfg.1164506898510; Sat, 25 Nov 2006 18:08:18 -0800 (PST) Received: from ppp85-140-70-202.pppoe.mtu-net.ru ( [85.140.70.202]) by mx.google.com with ESMTP id q27sm15970967nfc.2006.11.25.18.08.17; Sat, 25 Nov 2006 18:08:18 -0800 (PST) From: Gregory Shimansky To: dev@harmony.apache.org Subject: Re: svn commit: r479181 - /harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp Date: Sun, 26 Nov 2006 05:08:16 +0300 User-Agent: KMail/1.9.1 References: <20061125195939.5167A1A9846@eris.apache.org> <4568E034.6000008@pobox.com> In-Reply-To: <4568E034.6000008@pobox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200611260508.17208.gshimansky@gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org On Sunday 26 November 2006 03:30 Geir Magnusson Jr. wrote: > 1) Why add the SuspendDisabledChecker if not using it? > > 2) exactly where did you add the assertion? :) It is a hidden assertion class :) Look at the file vm/vmcore/include/suspend_checker.h. There are 2 classes SuspendEnabledChecker and SuspendDisabledChecker. When declared, such variable in constructor checks for suspend status, in destructor it checks that the status is the same. It is often convenient to write just this one line to make sure that all returns from the function have the same suspend status because local variable destructor is executed on every function exit. In release, when assert is a noop, these constructors/destructors are optimized into noop as well. I saw that this function uses raw ManagedObject pointers. This is dangerous in case when suspend is enabled (equal to GC being enabled) as the object may be moved at any time. So I decided to add this assertion. If it fails some time it will signal that this function is called in a wrong unsafe mode. > gshimansky@apache.org wrote: > > Author: gshimansky > > Date: Sat Nov 25 11:59:38 2006 > > New Revision: 479181 > > > > URL: http://svn.apache.org/viewvc?view=rev&rev=479181 > > Log: > > Fixed 32-bitness in classloader tracing. Added assertion before using a > > raw heap object pointer > > > > > > Modified: > > > > harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp > > > > Modified: > > harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp > > URL: > > http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/vmcore/src/c > >lass_support/classloader.cpp?view=diff&rev=479181&r1=479180&r2=479181 > > ========================================================================= > >===== --- > > harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp > > (original) +++ > > harmony/enhanced/drlvm/trunk/vm/vmcore/src/class_support/classloader.cpp > > Sat Nov 25 11:59:38 2006 @@ -589,11 +589,13 @@ > > > > ClassLoader* ClassLoader::AddClassLoader( ManagedObject* loader ) > > { > > + SuspendDisabledChecker sdc; > > + > > LMAutoUnlock aulock( &(ClassLoader::m_tableLock) ); > > ClassLoader* cl = new UserDefinedClassLoader(); > > TRACE2("classloader.unloading.add", "Adding class loader " > > << cl << " (" << loader << " : " > > - << ((VTable*)(*(unsigned**)(loader)))->clss->get_name()->bytes > > << ")"); + << loader->vt()->clss->get_name()->bytes << ")"); > > cl->Initialize( loader ); > > if( m_capacity <= m_nextEntry ) > > ReallocateTable( m_capacity?(2*m_capacity):32 ); -- Gregory