From commits-return-43170-apmail-harmony-commits-archive=harmony.apache.org@harmony.apache.org Tue Sep 04 11:09:23 2007 Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 68707 invoked from network); 4 Sep 2007 11:09:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 4 Sep 2007 11:09:22 -0000 Received: (qmail 82777 invoked by uid 500); 4 Sep 2007 11:09:17 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 82760 invoked by uid 500); 4 Sep 2007 11:09:17 -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 82751 invoked by uid 99); 4 Sep 2007 11:09:17 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 04 Sep 2007 04:09:17 -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; Tue, 04 Sep 2007 11:10:34 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 375DB714159 for ; Tue, 4 Sep 2007 04:08:59 -0700 (PDT) Message-ID: <32470982.1188904139216.JavaMail.jira@brutus> Date: Tue, 4 Sep 2007 04:08:59 -0700 (PDT) From: "Aleksey Shipilev (JIRA)" To: commits@harmony.apache.org Subject: [jira] Updated: (HARMONY-4714) [drlvm][jni] JNI transition checks exceptions twice In-Reply-To: <14263927.1188573630559.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-4714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Aleksey Shipilev updated HARMONY-4714: -------------------------------------- Attachment: jni-noexp.patch jni-noexp.patch Experimental patch. Introducing new LIL mnemonic: pop_noexp_m2n, which does not check the exceptions and inlines some calls. $ ../../Builds/shade.0903.jni.0.clean/bin/java -Xmx128m -Xms128m nalog.nalog iteration: 0 millis:8632 iteration: 1 millis:8572 iteration: 2 millis:8663 $ ../../Builds/shade.0903.jni.0.patched/bin/java -Xmx128m -Xms128m nalog.nalog iteration: 0 millis:8242 iteration: 1 millis:8292 iteration: 1 millis:8253 The boost is much bigger when combined with HARMONY-4705, as it's using the TLS get from LIL. > [drlvm][jni] JNI transition checks exceptions twice > --------------------------------------------------- > > Key: HARMONY-4714 > URL: https://issues.apache.org/jira/browse/HARMONY-4714 > Project: Harmony > Issue Type: Improvement > Reporter: Aleksey Shipilev > Attachments: jni-noexp.patch > > > During JNI transition the exception flags are checked twice. > 1. One check is generated in JNI lil stub (vm/vmcore/src/jit/compile.cpp:675) > //***** Part 11: Rethrow exception > cs = lil_parse_onto_end(cs, > "l0=ts;" > "ld l2,[l0+%0i:ref];" > "jc l2!=0,_exn_raised;" > "ld l2,[l0+%1i:ref];" > "jc l2=0,_no_exn;" > ":_exn_raised;" > "m2n_save_all;" > "out platform::void;" > "call.noret %2i;" > ":_no_exn;", > eoo, eco, exn_rethrow); > assert(cs); > 2. Second check is done during pop_m2n frame generation: (ex.: vm/port/src/lil/ia32/pim/m2n_ia32.cpp:259) > static void m2n_free_local_handles() { > assert(!hythread_is_suspend_enabled()); > // AGAIN! > if (exn_raised()) { > exn_rethrow(); > } > M2nFrame * m2n = m2n_get_last_frame(); > free_local_object_handles3(m2n->local_object_handles); > } > So, we might throw away the exception handling from JNI lil stub, as far push_m2n is made always during JNI transition. Much more effective is to throw away blocks from m2n_free_local_handles and m2n_pop_local_handles, but that could affect compatibility across the m2n calls. > Simple JNI test (executing several millions of empty JNI methods) shows: > $ ../../Builds/Harmony-clean/bin/java -cp . -Xmx128m -Xms128m nalog.nalog > iteration: 0 millis:8763 > iteration: 1 millis:8722 > iteration: 2 millis:8833 > $ ../../Builds/Harmony-noEXP/bin/java -cp . -Xmx128m -Xms128m nalog.nalog > iteration: 0 millis:7824 > iteration: 1 millis:7845 > iteration: 2 millis:7836 > $ ../../Builds/Harmony-noEXP-clean/bin/java -cp . -Xmx128m -Xms128m nalog.nalog > iteration: 0 millis:8241 > iteration: 1 millis:8255 > iteration: 2 millis:8214 -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.