Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 10221 invoked from network); 15 Dec 2006 13:02:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 15 Dec 2006 13:02:56 -0000 Received: (qmail 37663 invoked by uid 500); 15 Dec 2006 12:50:53 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 36645 invoked by uid 500); 15 Dec 2006 12:50:47 -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 35556 invoked by uid 99); 15 Dec 2006 12:50:40 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 15 Dec 2006 04:50:40 -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; Thu, 14 Dec 2006 23:15:41 -0800 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 0EF537140F6 for ; Thu, 14 Dec 2006 23:15:21 -0800 (PST) Message-ID: <7622410.1166166921058.JavaMail.jira@brutus> Date: Thu, 14 Dec 2006 23:15:21 -0800 (PST) From: "Nikolay Sidelnikov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Created: (HARMONY-2727) [drlvm][jit][opt] JIt generates duplicated code. 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][opt] JIt generates duplicated code. ------------------------------------------------ Key: HARMONY-2727 URL: http://issues.apache.org/jira/browse/HARMONY-2727 Project: Harmony Issue Type: Bug Reporter: Nikolay Sidelnikov java.util.TreeMap.successor() Java code of the method: static TreeMapEntry successor(TreeMapEntry x) { if (x.right != null) return minimum(x.right); TreeMapEntry y = x.parent; while (y != null && x == y.right) { x = y; y = y.parent; } return y; } Also method "minimum" was inlined. Its code: static TreeMapEntry minimum(TreeMapEntry x) { while (x.left != null) x = x.left; return x; } The generated asm code the follwoing: line address code 1 B7EE60: push ebx 2 B7EE61: push ebp 3 B7EE62: mov eax,dword ptr [esp+0Ch] 4 B7EE66: mov ebp,eax 5 B7EE68: mov ebx,dword ptr [eax+14h] 6 B7EE6B: test ebx,ebx 7 B7EE6D: je 00B7EEA8 8 B7EE73: mov ebp,dword ptr fs:[00000014h] 9 B7EE7A: mov eax,ebx 10 B7EE7C: mov ebx,dword ptr [eax+18h] 11 B7EE7F: test ebx,ebx 12 B7EE81: je 00B7EEF2 13 B7EE87: mov ebp,dword ptr fs:[00000014h] 14 B7EE8E: cmp dword ptr [ebp+00000270h],0 15 B7EE98: je 00B7EE7A 16 B7EE9E: call 00A96850 17 B7EEA3: jmp 00B7EE7A 18 B7EEA8: mov ebx,dword ptr [eax+1Ch] 19 B7EEAB: mov eax,dword ptr fs:[00000014h] 20 B7EEB2: mov eax,ebx 21 B7EEB4: test eax,eax 22 B7EEB6: je 00B7EEED 23 B7EEBC: cmp ebp,dword ptr [eax+14h] 24 B7EEBF: jne 00B7EEED 25 B7EEC5: mov ebp,eax 26 B7EEC7: mov eax,dword ptr [eax+1Ch] 27 B7EECA: mov ebx,eax 28 B7EECC: mov eax,dword ptr fs:[00000014h] 29 B7EED3: cmp dword ptr [eax+00000270h],0 30 B7EEDD: je 00B7EEB2 31 B7EEE3: call 00A96850 32 B7EEE8: jmp 00B7EEB2 33 B7EEED: pop ebp 34 B7EEEE: pop ebx 35 B7EEEF: ret 4 36 B7EEF2: pop ebp 37 B7EEF3: pop ebx 38 B7EEF4: ret 4 ------------------------------------ Code in lines 33-35 and 36-38 are identical. The first one is return from the second cycle and the second is return from the first cycle. In order to make code less this code should be combined. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira