Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 89987 invoked from network); 13 Nov 2006 13:03:58 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 13 Nov 2006 13:03:58 -0000 Received: (qmail 10607 invoked by uid 500); 13 Nov 2006 13:04:09 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 10492 invoked by uid 500); 13 Nov 2006 13:04:08 -0000 Mailing-List: contact harmony-commits-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-commits@incubator.apache.org Received: (qmail 10479 invoked by uid 99); 13 Nov 2006 13:04:08 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Nov 2006 05:04:08 -0800 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Nov 2006 05:03:57 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 449717142FC for ; Mon, 13 Nov 2006 05:03:37 -0800 (PST) Message-ID: <11403493.1163423017278.JavaMail.jira@brutus> Date: Mon, 13 Nov 2006 05:03:37 -0800 (PST) From: "Sergey Kuksenko (JIRA)" To: harmony-commits@incubator.apache.org Subject: [jira] Created: (HARMONY-2170) [drlvm][jit] Suggestion of new Range Check elimination optimization. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [drlvm][jit] Suggestion of new Range Check elimination optimization. -------------------------------------------------------------------- Key: HARMONY-2170 URL: http://issues.apache.org/jira/browse/HARMONY-2170 Project: Harmony Issue Type: Improvement Components: DRLVM Environment: All. Reporter: Sergey Kuksenko Currently [drlvm][jit] contains ABCD (range check elimination) algorithm. ABCD algorithm works pretty well if iterations over an array is perfomed with array.length access. However, there are a set of code patterns where ABCD algorithm won't work. For example, java.util classes ArrayList, Vector, HashMap, etc... very often contains a field where a real upper bound is stored (and usually this upped bound is less then array.legth). So, iteration over such arrays usually is performed by the following way: for (int i = 0; i < real_length; i++) { array[i].... } Where "real_length" is a field which contains real upper bound. Very often it is too expensive or impossible for JIT to determine value range for this field and in such ways (when cycle limit is value obtained outside method) ABCD range check elimination can't work. Suggestion: In case of cycle like: int i=0; while(i < real_length) { checkRange(array, i); // introduce explicit range check operation ...array[i]... i++; } Split this cycle to: int i=0; while(i < min(real_length, array.length) ) { ...array[i]... // NO range check here i++; } while(i