Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 71166 invoked from network); 30 Oct 2008 07:21:35 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 30 Oct 2008 07:21:35 -0000 Received: (qmail 60271 invoked by uid 500); 30 Oct 2008 07:21:40 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 60234 invoked by uid 500); 30 Oct 2008 07:21:40 -0000 Mailing-List: contact commits-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 commits@harmony.apache.org Received: (qmail 60225 invoked by uid 99); 30 Oct 2008 07:21:40 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2008 00:21:40 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 30 Oct 2008 07:20:34 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 668A0234C234 for ; Thu, 30 Oct 2008 00:20:44 -0700 (PDT) Message-ID: <993106893.1225351244419.JavaMail.jira@brutus> Date: Thu, 30 Oct 2008 00:20:44 -0700 (PDT) From: "Chunrong Lai (JIRA)" To: commits@harmony.apache.org Subject: [jira] Assigned: (HARMONY-5955) Jitrino does not reclaim some unused memory units during the course of native code generation In-Reply-To: <933800176.1219143944370.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-5955?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Chunrong Lai reassigned HARMONY-5955: ------------------------------------- Assignee: Chunrong Lai > Jitrino does not reclaim some unused memory units during the course of native code generation > --------------------------------------------------------------------------------------------- > > Key: HARMONY-5955 > URL: https://issues.apache.org/jira/browse/HARMONY-5955 > Project: Harmony > Issue Type: Improvement > Components: DRLVM > Affects Versions: 5.0M6 > Environment: Windows XP > Reporter: Zhiguo Ge > Assignee: Chunrong Lai > Priority: Minor > Fix For: 5.0M6 > > Attachments: patch.txt > > > The CodeEmitter::emitCode( void ) function will generate native code from LIR without solving the target addresses of branch instructions. The codepack() function in Jitrino will resolve the target addresses and make native code smaller. As a result, less momory units are required for storing the native code after codepack() . However, Jitrino still allocates more than enough memory units for storing the native code. > The following is an example of Java source code. > static MapEntry successor(MapEntry x) { > if (x.right != null) > return minimum(x.right); > MapEntry y = x.parent; > while (y != null && x == y.right) { > x = y; > y = y.parent; > } > return y; > } > static MapEntry minimum(MapEntry x) { > if(x.left != null) > x = x.left; > return x; > } > A portion of the output native code by codepack() function is as follows: > 03B20337 nop > 03B20338 xchg ax,ax > 03B2033A call 0764035F > 03B2033F add esp,4 > 03B20345 pop esi > 03B20346 pop ebp > 03B20347 pop ebx > 03B20348 ret 0Ch > 03B2034B add esp,4 > 03B20351 pop esi > 03B20352 pop ebp > 03B20353 pop ebx > 03B20354 ret 0Ch > 03B20357 add byte ptr [eax],al > 03B20359 pop esi > 03B2035A pop ebp > 03B2035B pop ebx > 03B2035C ret 0Ch > 03B2035F add esp,4 > 03B20365 pop esi > 03B20366 pop ebp > 03B20367 pop ebx > 03B20368 ret 0Ch > The instructions from 03B20357 to 03B20368 are not used by any places while they still occupy memory entries. > Our patch is to make Jitrino allocate exact demanded size of memory units for storing generated native code. Experiment result shows > 3.4% memory requirement reduction for the example shown above. > -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.