You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by ge...@apache.org on 2006/10/06 01:05:16 UTC
svn commit: r453419 - in /incubator/harmony/enhanced/drlvm/trunk:
src/test/harmony-1417/ src/test/harmony-1417/Test2_LE.java
vm/jitrino/config/ia32/server.emconf
vm/jitrino/config/ia32/server_static.emconf
vm/jitrino/src/optimizer/lazyexceptionopt.cpp
Author: geirm
Date: Thu Oct 5 16:05:15 2006
New Revision: 453419
URL: http://svn.apache.org/viewvc?view=rev&rev=453419
Log:
HARMONY-1417
Fixed bugs in lazy exception optimization pass.
Replaced lazyexc optpass after inline optpass in server and server_static emconf files.
Fixed bugs in lazy exception optimization pass:
1. Permitted to have more then one chknull instructions for exception initializer argument.
2. Added check that call exception initializer instruction is present in the code.
3. Changed side effect indication for stvar instruction from true to false.
Ubuntu. Smoke, c-unit, ~kernel
Tested also as suggested in JIRA, and that test passed.
Added:
incubator/harmony/enhanced/drlvm/trunk/src/test/harmony-1417/
incubator/harmony/enhanced/drlvm/trunk/src/test/harmony-1417/Test2_LE.java
Modified:
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf
incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp
Added: incubator/harmony/enhanced/drlvm/trunk/src/test/harmony-1417/Test2_LE.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/src/test/harmony-1417/Test2_LE.java?view=auto&rev=453419
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/src/test/harmony-1417/Test2_LE.java (added)
+++ incubator/harmony/enhanced/drlvm/trunk/src/test/harmony-1417/Test2_LE.java Thu Oct 5 16:05:15 2006
@@ -0,0 +1,48 @@
+public class Test2_LE {
+ static int num = 0;
+ static int ln = 10000000;
+ static int cln = ln/5;
+ public static void main(String[] args) {
+ System.out.println("Start Test_LE:");
+ Test2_LE test = new Test2_LE();
+ long start1, start2, end1, end2, time1, time2;
+
+ start1 = System.currentTimeMillis();
+ for(int i=0; i<ln; i++) {
+ try {
+ if (i%cln == 0)
+ System.out.println("...");
+ test.test();
+ } catch(Exception e) {
+ }
+ }
+ end1 = System.currentTimeMillis();
+ System.out.println("Total time: " + (time1=end1-start1));
+
+ start2 = System.currentTimeMillis();
+ for(int i=0; i<ln; i++) {
+ try {
+ if (i%cln == 0)
+ System.out.println("...");
+ test.test2();
+ } catch(Exception e) {
+ }
+ }
+ end2 = System.currentTimeMillis();
+ System.out.println("Total time: " + (time2=end2-start2));
+ if (time2/time1 > 1)
+ System.out.println("Test passed " + time2/time1);
+ else
+ System.out.println("Test failed " + time2/time1);
+ }
+ void test() throws Exception {
+ Exception e = new Exception();
+ throw e;
+ }
+ void test2() throws Exception {
+ Exception e = new Exception();
+ if (e.getMessage()!=null)
+ System.out.println("null");
+ throw e;
+ }
+}
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf?view=diff&rev=453419&r1=453418&r2=453419
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf Thu Oct 5 16:05:15 2006
@@ -41,7 +41,7 @@
-Djit.SD2_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
--Djit.SD2_OPT.path.optimizer=ssa,simplify,uce,dce,edge_annotate,lazyexc,devirt,inline,purge,simplify,uce,dce,dessa,statprof,peel,ssa,hvn,simplify,uce,dce,lower,uce,dce,memopt,reassoc,uce,dce,hvn,uce,dce,abcd,uce,dce,gcm,dessa,statprof,markglobals
+-Djit.SD2_OPT.path.optimizer=ssa,simplify,uce,dce,edge_annotate,devirt,inline,purge,simplify,uce,dce,lazyexc,dessa,statprof,peel,ssa,hvn,simplify,uce,dce,lower,uce,dce,memopt,reassoc,uce,dce,hvn,uce,dce,abcd,uce,dce,gcm,dessa,statprof,markglobals
-Djit.SD2_OPT.path.codegen=lock_method,bbp,gcpoints,cafl,dce1,i8l,early_prop,itrace-,native,constraints,dce2,regalloc,spillgen,layout,copy,rce+,stack,break-,iprof-,emitter!,si_insts,gcmap,info,unlock_method
-Djit.SD2_OPT.path.dce1=cg_dce
-Djit.SD2_OPT.path.dce2=cg_dce
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf?view=diff&rev=453419&r1=453418&r2=453419
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server_static.emconf Thu Oct 5 16:05:15 2006
@@ -9,7 +9,7 @@
-Djit.SS_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
--Djit.SS_OPT.path.optimizer=ssa,simplify,uce,dce,statprof,lazyexc,devirt,inline,purge,simplify,uce,dce,hvn,uce,dce,dessa,statprof,peel,ssa,hvn,simplify,uce,dce,lower,uce,dce,memopt,reassoc,uce,dce,hvn,uce,dce,abcd,uce,dce,gcm,dessa,statprof,markglobals
+-Djit.SS_OPT.path.optimizer=ssa,simplify,uce,dce,statprof,devirt,inline,purge,simplify,uce,dce,lazyexc,hvn,uce,dce,dessa,statprof,peel,ssa,hvn,simplify,uce,dce,lower,uce,dce,memopt,reassoc,uce,dce,hvn,uce,dce,abcd,uce,dce,gcm,dessa,statprof,markglobals
-Djit.SS_OPT.path.codegen=lock_method,bbp,gcpoints,cafl,dce1,i8l,early_prop,itrace-,native,constraints,dce2,regalloc,spillgen,layout,copy,rce+,stack,break-,iprof-,emitter!,si_insts,gcmap,info,unlock_method
-Djit.SS_OPT.path.dce1=cg_dce
-Djit.SS_OPT.path.dce2=cg_dce
Modified: incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp?view=diff&rev=453419&r1=453418&r2=453419
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp (original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp Thu Oct 5 16:05:15 2006
@@ -445,8 +445,16 @@
Log::out() << std::endl;
}
#endif
+ if ((*it)->initInst == NULL) {
+#ifdef _DEBUG
+ if (Log::isEnabled()) {
+ Log::out() << " init inst is null ";
+ Log::out() << std::endl;
+ }
+#endif
+ continue;
+ }
iinst = (*it)->initInst->asMethodCallInst();
- assert(iinst != NULL);
// inline info from constructor should be propogated to lazy
// exception if any
InlineInfo* constrInlineInfo = iinst->getInlineInfoPtr();
@@ -512,7 +520,6 @@
}
}
}
- irManager.getFlowGraph().purgeEmptyNodes();
}
}
}
@@ -789,8 +796,9 @@
#ifdef _DEBUG
if (Log::isEnabled()) {
- Log::out() << " checkArg: first node " << node->getId()
- << " inEdges " << node->getInDegree() << " " << std::endl;
+ Log::out() << " checkArg: first node " << node->getId() << " ";
+ FlowGraph::printLabel(Log::out(),node);
+ Log::out() << " inEdges " << node->getInDegree() << " " << std::endl;
}
#endif
@@ -799,24 +807,27 @@
if (nodeSet->call_inst->getNode() == node) {
#ifdef _DEBUG
if (Log::isEnabled()) {
- Log::out() << " node " << node->getId()
- << " again in call_inst node " << std::endl;
+ Log::out() << " node " << node->getId() << " ";
+ FlowGraph::printLabel(Log::out(),node);
+ Log::out() << " again in call_inst node " << std::endl;
}
#endif
doneOK = false;
}
#ifdef _DEBUG
if (Log::isEnabled()) {
- Log::out() << " node " << node->getId()
- << " inEdges " << node->getInDegree() << " was scanned " << std::endl;
+ Log::out() << " node " << node->getId() << " ";
+ FlowGraph::printLabel(Log::out(),node);
+ Log::out() << " inEdges " << node->getInDegree() << " was scanned " << std::endl;
}
#endif
break;
}
#ifdef _DEBUG
if (Log::isEnabled()) {
- Log::out() << " node " << node->getId()
- << " inEdges " << node->getInDegree() << std::endl;
+ Log::out() << " node " << node->getId() << " ";
+ FlowGraph::printLabel(Log::out(),node);
+ Log::out() << " inEdges " << node->getInDegree() << std::endl;
}
#endif
for (inst = instlast; inst!=instfirst; inst=inst->getPrevInst()) {
@@ -832,14 +843,18 @@
}
if (inst->getOpcode()==Op_TauCheckNull && inst->getSrc(0)==arg_opnd) {
if (nodeSet->check_inst != NULL) {
- dofind = false;
- doneOK = false;
#ifdef _DEBUG
if (Log::isEnabled()) {
Log::out() << " check_inst is not NULL" << std::endl;
}
#endif
+ break;
}
+#ifdef _DEBUG
+ if (Log::isEnabled()) {
+ Log::out() << " check_inst is FOUND" << std::endl;
+ }
+#endif
nodeSet->check_inst = inst;
break;
}
@@ -1007,7 +1022,7 @@
case Op_ScaledDiffRef:
return true;
case Op_StVar:
- return true;
+ return false;
case Op_TauStInd:
{
Inst* inst_src1 = inst->getSrc(1)->getInst();