Return-Path: Delivered-To: apmail-incubator-harmony-commits-archive@www.apache.org Received: (qmail 51823 invoked from network); 11 Oct 2006 10:29:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 11 Oct 2006 10:29:17 -0000 Received: (qmail 3810 invoked by uid 500); 11 Oct 2006 10:29:16 -0000 Delivered-To: apmail-incubator-harmony-commits-archive@incubator.apache.org Received: (qmail 3750 invoked by uid 500); 11 Oct 2006 10:29:16 -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 3739 invoked by uid 99); 11 Oct 2006 10:29:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2006 03:29:16 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Oct 2006 03:29:15 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id A05A41A981A; Wed, 11 Oct 2006 03:28:55 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r462758 - /incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp Date: Wed, 11 Oct 2006 10:28:55 -0000 To: harmony-commits@incubator.apache.org From: mloenko@apache.org X-Mailer: svnmailer-1.1.0 Message-Id: <20061011102855.A05A41A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: mloenko Date: Wed Oct 11 03:28:54 2006 New Revision: 462758 URL: http://svn.apache.org/viewvc?view=rev&rev=462758 Log: applied patch from HARMONY-1678 [DRLVM] junit test o.a.h.crypto.tests.javax.crypto.EncryptedPrivateKeyInfoTest fails Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp?view=diff&rev=462758&r1=462757&r2=462758 ============================================================================== --- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp (original) +++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/cg_regs.cpp Wed Oct 11 03:28:54 2006 @@ -580,7 +580,7 @@ void Compiler::gen_bb_leave(unsigned to) { if (is_set(DBG_TRACE_CG)) { dbg(";;>bb_leave to %d\n", to); } - unsigned ref_count; + bool targetIsMultiRef = false; bool to_eh; if (to == NOTHING || m_pc == 0 || g_jvmtiMode) { // leaving JSR block - act as if were leaving to multiref block @@ -588,19 +588,32 @@ // and gen_prolog(). // The same for JVMTI mode - do not allow a thing to be transferred // on a temporary register between basic blocks - ref_count = 2; + targetIsMultiRef = true; to_eh = false; } else { - ref_count = m_insts[to].ref_count; const BBInfo& bbto = m_bbs[to]; // Must be BB assert(m_bbs.find(to) != m_bbs.end()); // Jumps to ehandler ? to_eh = bbto.ehandler; + // Now, check where the control flow may be transferred from the + // current instruction. If *any* of the targets is multi-ref, then + // perform a full sync. + const JInst& jinst = *m_curr_inst; + for (unsigned i=0; i 1); + } + if (jinst.is_switch()) { + unsigned targetPC = jinst.get_def_target(); + targetIsMultiRef = targetIsMultiRef || (m_insts[targetPC].ref_count > 1); + } + if (!jinst.is_set(OPF_DEAD_END)) { + unsigned targetPC = jinst.next; + targetIsMultiRef = targetIsMultiRef || (m_insts[targetPC].ref_count > 1); + } } - // Must be reachable - assert(ref_count != 0); if (to_eh) { // we're generating a 'goto/fall through/if_' to a basic block @@ -614,7 +627,7 @@ assert(m_jframe->dip(0).is_reg() && m_jframe->dip(0).reg() == gr_ret); } - if (ref_count == 1 && !to_eh) { + if (!targetIsMultiRef && !to_eh) { // nothing to do anymore if (is_set(DBG_TRACE_CG)) { dbg(";;>~bb_leave\n"); } return;