harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r502594 - in /harmony/enhanced/drlvm/trunk/vm/jitrino: config/em64t/server.emconf config/ia32/server.emconf src/optimizer/syncopt.cpp
Date Fri, 02 Feb 2007 13:08:08 GMT
Author: varlax
Date: Fri Feb  2 05:08:07 2007
New Revision: 502594

URL: http://svn.apache.org/viewvc?view=rev&rev=502594
Log:
Applied HARMONY-2985 [drlvm][jit] Nested monitors eliminations

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/syncopt.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf?view=diff&rev=502594&r1=502593&r2=502594
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/em64t/server.emconf Fri Feb  2 05:08:07
2007
@@ -62,7 +62,7 @@
 
 -XDjit.SD2_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
 
--XDjit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,inline,uce,purge,simplify,dce,uce,hvn,dce,uce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,abcd,dce,uce,gcm,dessa,statprof,markglobals
+-XDjit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,inline,uce,purge,simplify,dce,uce,so2,simplify,dce,uce,hvn,dce,uce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,abcd,dce,uce,gcm,dessa,statprof,markglobals
 -XDjit.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
 -XDjit.SD2_OPT.path.dce1=cg_dce
 -XDjit.SD2_OPT.path.dce2=cg_dce

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf?view=diff&rev=502594&r1=502593&r2=502594
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/config/ia32/server.emconf Fri Feb  2 05:08:07
2007
@@ -63,7 +63,7 @@
 
 -XDjit.SD2_OPT.path=opt_init,translator,optimizer,hir2lir,codegen
 
--XDjit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,inline,uce,purge,simplify,dce,uce,lazyexc,inline_helpers,purge,simplify,uce,dce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,abcd,dce,uce,gcm,dessa,statprof,markglobals
+-XDjit.SD2_OPT.path.optimizer=ssa,simplify,dce,uce,devirt_virtual,edge_annotate,unguard,devirt_intf,inline,uce,purge,simplify,dce,uce,lazyexc,so2,simplify,dce,uce,inline_helpers,purge,simplify,uce,dce,dessa,statprof,peel,ssa,hvn,simplify,dce,uce,lower,dce,uce,memopt,reassoc,dce,uce,hvn,dce,uce,abcd,dce,uce,gcm,dessa,statprof,markglobals
 -XDjit.SD2_OPT.path.codegen=lock_method,bbp,btr,gcpoints,cafl,dce1,i8l,api_magic,early_prop,peephole,itrace-,native,constraints,dce2,regalloc,spillgen,layout,copy,rce+,stack,break-,iprof-,peephole,emitter!,si_insts,gcmap,info,unlock_method
 -XDjit.SD2_OPT.path.dce1=cg_dce
 -XDjit.SD2_OPT.path.dce2=cg_dce

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/syncopt.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/syncopt.cpp?view=diff&rev=502594&r1=502593&r2=502594
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/syncopt.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/syncopt.cpp Fri Feb  2 05:08:07
2007
@@ -2110,4 +2110,53 @@
 
 
 
+
+DEFINE_SESSION_ACTION(SO2, so2, "SyncOpt2")
+
+ 
+
+void SO2::_run(IRManager& irm) {
+    OptPass::computeDominators(irm);
+    ControlFlowGraph& fg = irm.getFlowGraph();
+    MemoryManager tmpMM(1024, "SO2MM");
+    StlVector<Inst*> monenters(tmpMM);   
+    DominatorTree* dom = fg.getDominatorTree();
+ 
+    const Nodes& nodes = fg.getNodesPostOrder();
+    for (Nodes::const_iterator it = nodes.begin(), end = nodes.end(); it!=end; ++it) {
+        Node* node = *it;
+        for (Inst* inst = (Inst*)node->getFirstInst(); inst!=NULL; inst = inst->getNextInst())
{
+            if (inst->getOpcode()== Op_TauMonitorEnter) {
+                monenters.push_back(inst);
+                for (size_t i = 0; i<monenters.size()-1; i++) {
+                    Inst* child = monenters[i];
+                    if (child->getNode()==NULL) {
+                        continue;
+                    }
+                    if (child->getSrc(0) == inst->getSrc(0) && dom->dominates(inst->getNode(),
child->getNode())) {
+                        //clean child
+                        int nExits=0;
+                        Node* enterNode = child->getNode();
+                        Node* exitNode = NULL;
+                        for (Nodes::const_iterator it2 = nodes.begin();exitNode!=enterNode;
++it2) {
+                            exitNode = *it2;
+                            Inst* exit = (Inst*)exitNode->getLastInst();
+                            if (exit->getOpcode() == Op_TauMonitorExit && exit->getSrc(0)
== child->getSrc(0) && dom->dominates(enterNode, exitNode)) {
+//                                printf("+++++++++++++++++++++++++++++++FOUND\n");
+                                Edge* exc = exitNode->getExceptionEdge();
+                                fg.removeEdge(exc);
+                                exit->unlink();
+                                nExits++;
+                            }
+                        }
+                        assert(nExits>0);
+                        child->unlink();
+                    }
+                }
+            }
+        }
+    }
+}
+
+
 } //namespace Jitrino 



Mime
View raw message