Return-Path: Delivered-To: apmail-incubator-harmony-dev-archive@www.apache.org Received: (qmail 23235 invoked from network); 8 Sep 2006 16:16:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 8 Sep 2006 16:16:11 -0000 Received: (qmail 99707 invoked by uid 500); 8 Sep 2006 16:16:06 -0000 Delivered-To: apmail-incubator-harmony-dev-archive@incubator.apache.org Received: (qmail 99662 invoked by uid 500); 8 Sep 2006 16:16:06 -0000 Mailing-List: contact harmony-dev-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: harmony-dev@incubator.apache.org Delivered-To: mailing list harmony-dev@incubator.apache.org Received: (qmail 99651 invoked by uid 99); 8 Sep 2006 16:16:05 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 09:16:05 -0700 X-ASF-Spam-Status: No, hits=0.5 required=10.0 tests=DNS_FROM_RFC_ABUSE,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of weldonwjw@gmail.com designates 64.233.184.227 as permitted sender) Received: from [64.233.184.227] (HELO wr-out-0506.google.com) (64.233.184.227) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 08 Sep 2006 09:16:04 -0700 Received: by wr-out-0506.google.com with SMTP id i5so203381wra for ; Fri, 08 Sep 2006 09:15:43 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=ZahS8JuvvLZUW6njv5CsqrpCgmJJqOr3wwYnP/eJxLviSWeyyhYwG9+S4joshGPmqmJ+FHhehj79ij0Aad3D4qdrIaWyeQJYEOA58v1JN8Y/X8GDYopPvgAg68owdQggCTEwX0eOzV63VQaYT3Dw/rbfrICV8GNDhDbinr9M9EU= Received: by 10.90.73.3 with SMTP id v3mr875200aga; Fri, 08 Sep 2006 09:15:43 -0700 (PDT) Received: by 10.90.69.20 with HTTP; Fri, 8 Sep 2006 09:15:42 -0700 (PDT) Message-ID: <4dd1f3f00609080915r503de7cdh8107cd24bbb08022@mail.gmail.com> Date: Fri, 8 Sep 2006 09:15:42 -0700 From: "Weldon Washburn" To: harmony-dev@incubator.apache.org Subject: Re: [DRLVM][JIT] can Jitrino.JET call MMTk alloc() instead of C helper? In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_42176_31278226.1157732142404" References: <4dd1f3f00609052132q5d969799sca3ea3d89e6d4610@mail.gmail.com> <4dd1f3f00609060834n4c889b4cva1333a425e11a2af@mail.gmail.com> <4dd1f3f00609070623p2601642fiae49efba0c7b0a74@mail.gmail.com> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_Part_42176_31278226.1157732142404 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 9/8/06, Mikhail Fursov wrote: > > Weldon, > I added 'alloc' support to JIRA 816 (magic2.zip file) > Now it supports objects allocation only, not arrays. MMTk allocation works > only for class named 'test' and methods with prefix 'testAlloc'. To turn > it on use "-Xjit jet::alloc4j" option. Thanks! I will take a look this weekend. I had a problem with implementation: usual 'new' vm helper does vtable field > initialization in allocated object space by itself. Your alloc() method > doesn't. > In the patch in JIRA I added vtable initialization code right after the > alloc() call to JIT, that is actually bad design decision (IMO). You are correct. Its bad design. Writing the vtable pointer is not the responsibility of the JIT. MMTk is somewhat vague on who owns vtable ptr init. In any case, it looks like the jit should follow the call to alloc() with a call to postAlloc(). I will make sure the postAlloc() code fixes up the vtable ptr. Its OK to "bend" the typeRef. All I want is the hard ptr that gets written into the object header. We will go back later and fix this interface hack. See below: /** * Perform post-allocation actions. For many allocators none are * required. * * @param ref The newly allocated object * @param typeRef the type reference for the instance being created * @param bytes The size of the space to be allocated (in bytes) * @param allocator The allocator number to be used for this allocation */ public void postAlloc(ObjectReference ref, ObjectReference typeRef, int bytes, int allocator) throws InlinePragma { Can we replace the 'alloc()' call with another Java method that uses > unboxed API and behaves exactly like 'new' helper? > > +The test in the patch throws NullPointerException because no memory is > allocated in alloc() now and JET tries to write vtable data by NULL > address. > > > > On 9/7/06, Weldon Washburn wrote: > > > > At some point soon we need to go multithread. When can you fix the > > vmmagic > > atomic operations? > > > > I need one more day to estimate the complexity of this move. > > > -- > Mikhail Fursov > > -- Weldon Washburn Intel Middleware Products Division ------=_Part_42176_31278226.1157732142404--