Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 82783 invoked from network); 9 Apr 2007 12:28:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 9 Apr 2007 12:28:53 -0000 Received: (qmail 46397 invoked by uid 500); 9 Apr 2007 12:28:59 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 46299 invoked by uid 500); 9 Apr 2007 12:28:59 -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 46290 invoked by uid 99); 9 Apr 2007 12:28:59 -0000 Received: from herse.apache.org (HELO herse.apache.org) (140.211.11.133) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 Apr 2007 05:28:59 -0700 X-ASF-Spam-Status: No, hits=-100.0 required=10.0 tests=ALL_TRUSTED 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, 09 Apr 2007 05:28:52 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 71C2071407B for ; Mon, 9 Apr 2007 05:28:32 -0700 (PDT) Message-ID: <26782233.1176121712462.JavaMail.jira@brutus> Date: Mon, 9 Apr 2007 05:28:32 -0700 (PDT) From: "Alexey Varlamov (JIRA)" To: commits@harmony.apache.org Subject: [jira] Closed: (HARMONY-3571) [drlvm][em64t] Jitrino.OPT emits incorrect code for instanceof bytecode In-Reply-To: <7185227.1175680592433.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-3571?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Alexey Varlamov closed HARMONY-3571. ------------------------------------ Resolution: Fixed Applied at r526728, thanks! > [drlvm][em64t] Jitrino.OPT emits incorrect code for instanceof bytecode > ----------------------------------------------------------------------- > > Key: HARMONY-3571 > URL: https://issues.apache.org/jira/browse/HARMONY-3571 > Project: Harmony > Issue Type: Bug > Components: DRLVM > Reporter: Mikhail Fursov > Assigned To: Alexey Varlamov > Attachments: instanceof.fix > > > For the example below: > static int foo2(String name, String defaultValue) { > Object result = get(name); > String property = result instanceof String ? (String) result : null; > return property.hashCode(); > Code: > 0: aload_0 > 1: invokestatic #9; //Method get:(Ljava/lang/String;)Ljava/lang/Object; > 4: astore_2 > 5: aload_2 > 6: instanceof #8; //class java/lang/String > 9: ifeq 19 > 12: aload_2 > 13: checkcast #8; //class java/lang/String > 16: goto 20 > 19: aconst_null > 20: astore_3 > 21: aload_3 > 22: invokevirtual #10; //Method java/lang/String.hashCode:()I > 25: ireturn > Jitrino generates the following code > Block ENTRY: > Predecessors: > Successors: L11 UNWIND > I0:--- MethodEntry(java/util/Properties::getProperty): () > I9:defarg.ths -) t1:cls:java/util/Properties > I10:tauisnonnull t1 -) t2:tau > I11:tauhastype t1,cls:java/util/Properties -) t3:tau > I12:defarg -) t4:cls:java/lang/String > I13:tauhastype t4,cls:java/lang/String -) t5:tau > I14:defarg -) t6:cls:java/lang/String > I15:tauhastype t6,cls:java/lang/String -) t7:tau > I16:tauunsafe() -) t8:tau > I17:call java/util/Hashtable::get(t1, t4) ((t2,t8)) -) t9:cls:java/lang/Object > GOTO L11 > Block L11: > Predecessors: ENTRY > Successors: L9 L12 > I20:L11: > I21:ldci4 #0 -) t10:int32 > I22:if ceq.i t10, t9 goto L9 > GOTO L12 > .... > The I22 is nullcheck caused by instanceof bytecode processing. > Because of the numeric type the NULL is not converted to MANAGED_NULL in CG: > 00000000033B9F40 I118: (ID:v12(EFLGS):uint32) =XOR t93(ECX):int32,t93(ECX):int32 > 00000000033B9F42 I2: MOVSX t11(RCX):int64,t93(ECX):int32 > 00000000033B9F45 I3: (ID:v12(EFLGS):uint32) =CMP t11(RCX):int64,v9(RAX):cls:java/lang/Object > 00000000033B9F48 I4: JZ BB_4 t13(318):int32 (IU:v12(EFLGS):uint32) > I'm not sure if this issue can affect any of scenarios, but it must be fixed anyway. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.