Return-Path: Delivered-To: apmail-harmony-dev-archive@www.apache.org Received: (qmail 66118 invoked from network); 28 Jun 2007 14:54:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 28 Jun 2007 14:54:13 -0000 Received: (qmail 51724 invoked by uid 500); 28 Jun 2007 14:54:10 -0000 Delivered-To: apmail-harmony-dev-archive@harmony.apache.org Received: (qmail 51689 invoked by uid 500); 28 Jun 2007 14:54:10 -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 51680 invoked by uid 99); 28 Jun 2007 14:54:10 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 07:54:10 -0700 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.166.176 as permitted sender) Received: from [64.233.166.176] (HELO py-out-1112.google.com) (64.233.166.176) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jun 2007 07:54:06 -0700 Received: by py-out-1112.google.com with SMTP id u77so1116908pyb for ; Thu, 28 Jun 2007 07:53:45 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=tNYHj4hVYWv6SYH6uR+L/pwHKYygmOBc0aqJ3v+nfGCIiIc0FJ3W3qN04U9XjFnTin6jBz7dc/P7A9392jkKJAXGKn8ys30MAFRZdpnCNB0iU/xNxm+iq0ke3Tkq2Jfk3ZsjPokvxq/guu0Lr/lCeYCqCWwyW1IkPhVV+7oa7qY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:user-agent:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding:sender; b=kDdiEviQnBXBjhT8QYgYxTfvZY5WUdXylNwgfWCMkF6/RD6+hm9Mntp7p6zENH6zVlYKL6geDQUqS//MkDz1zoMG3Qxdq8g8XSY3uHcsXtJackv7i3OFy7f/YdLmypNCNPDdOtriXFLqGcEJvNJdMPAKh3U+1hvM3f/I5e7h9y0= Received: by 10.65.100.14 with SMTP id c14mr3156445qbm.1183042425308; Thu, 28 Jun 2007 07:53:45 -0700 (PDT) Received: from ?127.0.0.1? ( [140.211.11.9]) by mx.google.com with ESMTPS id q16sm80691qbq.2007.06.28.07.53.41 (version=SSLv3 cipher=RC4-MD5); Thu, 28 Jun 2007 07:53:43 -0700 (PDT) Message-ID: <4683CB70.6000306@apache.org> Date: Thu, 28 Jun 2007 18:53:36 +0400 From: Gregory Shimansky User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: dev@harmony.apache.org Subject: Re: [jira] Commented: (HARMONY-4282) [drlvm][vmcore] obj_info agreement between VM and GC References: <23666863.1182844902607.JavaMail.jira@brutus> <4915162.1182944366267.JavaMail.jira@brutus> <9623c9a50706280604r3752d216i9a15b7a2ad567735@mail.gmail.com> <4683B6E8.6010503@apache.org> <4683BC4D.4040001@apache.org> <9623c9a50706280746y57114a38q97e20ee2bd760c80@mail.gmail.com> In-Reply-To: <9623c9a50706280746y57114a38q97e20ee2bd760c80@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: Gregory Shimansky X-Virus-Checked: Checked by ClamAV on apache.org Xiao-Feng Li wrote: > On 6/28/07, Gregory Shimansky wrote: >> Gregory Shimansky wrote: >> > Xiao-Feng Li wrote: >> >> Yes, exactly. The newly allocated object may have some bits set in >> >> obj_info by GC (only possible for those bits owned by GC). The >> >> allocation routine can guarantee the rest bits of obj_info are clear. >> >> This situation happens, e.g., when GC sets a property flag in obj_info >> >> so as to avoid the re-computation of the property every time using it. >> >> One example property flag is whether the object has reference fields; >> >> the other example is whether the object is bigger than 4KB; yet >> >> another example is, in concurrent GC, the newly allocated object is >> >> marked black in obj_info. >> >> >> >> Basically we want to set up a contract between GC and VM that, object >> >> allocation will take care of the object header initialization. >> > >> > If it is guaranteed that object allocation routine also sets VT pointer >> > correctly, then I can prepare a patch (I don't think it should be >> > committed before we unfreeze the code) to skip the first >> > ManagedObject::get_constant_header_size() bytes when copying memory in >> > object_clone() and not reset any information in object header >> relying GC >> > on the allocation routine. >> >> BTW, it is necessary that gc_cc also initialize the object header, VT >> and obj_info should contain correct information after object is >> allocated. > > Yes, this is actually the default behavior of object allocation. For > example, gc_alloc_fast API will return a well-formed object to jitted > code without any vt or obj_info manipulation by the jitted code. I've created a patch in HARMONY-4282. It can be committed when we unfreeze the code. I would also like to know where Object.clone function is used a lot, so that I could test the patch. Does anyone know? -- Gregory