harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r574211 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src: optimizer/escanalyzer.cpp translator/java/JavaLabelPrepass.cpp vm/drl/DrlVMInterface.cpp
Date Mon, 10 Sep 2007 11:48:02 GMT
Author: mfursov
Date: Mon Sep 10 04:48:01 2007
New Revision: 574211

URL: http://svn.apache.org/viewvc?rev=574211&view=rev
Log:
Fix for HARMONY-4769 [drlvm][jit][opt] Regression tests H1802 and H3150 fails after enabling
lazy resolution mode in OPT compiler

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp?rev=574211&r1=574210&r2=574211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp Mon Sep 10 04:48:01
2007
@@ -114,7 +114,7 @@
     translatorAction = (TranslatorAction*)PMF::getAction(argSource->getPipeline(), translatorName);
     assert(translatorAction);
 
-    shortLog = Log::isEnabled();
+    shortLog = argSource->log(LogStream::CT).isEnabled();
     verboseLog = shortLog && argSource->isLogEnabled("escape_verbose");
 
     init();
@@ -1034,7 +1034,7 @@
         NamedType* nt = (NamedType*)(inst->getDst())->getType();
         if (nt->isUnresolvedType() || nt->isFinalizable()) {  
             // finalized objects cannot be removed
-            // unresolved objects too (not tested)
+            // unresolved objects too
             setOutEscaped(cgnode);
         }
     }
@@ -1381,8 +1381,7 @@
     for (it = cngNodes->begin( ); it != cngNodes->end( ); it++ ) {
         uint32 nt = (*it)->nodeType;
         if ((nt&(NT_OBJECT|NT_RETVAL) || nt==NT_LDOBJ) && (getEscState(*it)==ARG_ESCAPE))
{
-            for (it1 = (*it)->nodeMDs->begin(); it1 != (*it)->nodeMDs->end();

-                    it1++) {
+            for (it1 = (*it)->nodeMDs->begin(); it1 != (*it)->nodeMDs->end();
 it1++) {
                 CnGNode* n=findCnGNode_id(*it1);   // method argument node
                 assert(n!=NULL);
                 MethodPtrType* mpt = (MethodPtrType*)n->refObj;
@@ -1519,8 +1518,7 @@
             CalleeMethodInfo* mthInfo = findMethodInfo(mdesc,(*it)->nInst);
             if (mthInfo == NULL) {
                 if (verboseLog) {
-                    Log::out() <<"--setCOS 4:  nodeId "
-                        <<(*it)->cngNodeId<<"  opId "<<(*it)->opndId
<<" state ";
+                    Log::out() <<"--setCOS 4:  nodeId " <<(*it)->cngNodeId<<"
 opId "<<(*it)->opndId <<" state ";
                     printState(*it); Log::out() <<" to gl.esc."<< std::endl;
                 }
                 initNodeType = NT_STFLD;
@@ -1528,8 +1526,7 @@
             } else {
                 if (getEscState(*it)>((mthInfo->retValueState)&ESC_MASK) || getOutEscaped(*it)==0)
{
                     if (verboseLog) {
-                        Log::out() <<"--setCOS 5:  nodeId "
-                            <<(*it)->cngNodeId<<"  opId "<<(*it)->opndId
<<" state ";
+                        Log::out() <<"--setCOS 5:  nodeId " <<(*it)->cngNodeId<<"
 opId "<<(*it)->opndId <<" state ";
                         printState(*it);
                         Log::out() <<" to "<< mthInfo->retValueState<<
std::endl;
                     }
@@ -2190,7 +2187,6 @@
 void
 EscAnalyzer::printCnGNodes(char* text,::std::ostream& os) {
     CnGNodes::const_iterator it;
-    FieldDesc* fd;
     std::string t1;
     std::string t2;
     os << "    "<< text << std::endl;
@@ -2222,9 +2218,8 @@
             os << std::endl;
         }
         if ((*it)->nodeType & NT_STFLD) {    //field node 
-            fd = ((Inst*)(*it)->refObj)->asFieldAccessInst()->getFieldDesc();
-            os << fd->getParentType()->getName() << "::"<< fd->getName()
<< std::endl;
-            os << "                                "<<fd->getFieldType()->getName();
+            Inst* inst = (Inst*)(*it)->refObj;
+            inst->print(Log::out());
         }
         os << std::endl;
     }
@@ -3715,8 +3710,9 @@
     CnGNode* stnode = NULL;
 
     for (it = cngNodes->begin( ); it != cngNodes->end( ); it++ ) {
-        if ((*it)->nodeType == NT_OBJECT && getEscState(*it)==NO_ESCAPE 
-            && getOutEscaped(*it) == 0 && !((*it)->nInst->getOpcode()==Op_LdRef))
{
+        CnGNode* cgNode = *it;
+        if (cgNode->nodeType == NT_OBJECT && getEscState(cgNode)==NO_ESCAPE 
+            && getOutEscaped(cgNode) == 0 && !(cgNode->nInst->getOpcode()==Op_LdRef))
{
             if (prTitle) {
                 if (verboseLog) {
                     os_sc << "================ Local Object States   < "; 
@@ -3726,7 +3722,7 @@
                 prTitle = false;
             }
             lo_count++;  // number of local objects
-            stnode = checkCnGtoScalarize(*it,true);
+            stnode = checkCnGtoScalarize(cgNode,true);
             if (stnode != NULL) {
                 if (stnode->nodeType == NT_OBJECT) {
                     if (lnoids == NULL) {
@@ -4843,12 +4839,16 @@
     ob_ref_type = scnode->nodeRefType;   // object ref type
     if (!check_loc && (ob_ref_type != NR_REF))
         return NULL;   // vc arrays not scalarized
+    if (scnode->nodeType == NT_OBJECT && ((Opnd*)scnode->refObj)->getType()->isUnresolvedType())
{
+        //do not scalarize unresolved types -> resolution can have side effect
+        return NULL; 
+    }
     if (verboseLog) {
         os_sc << "=="; printCnGNode(scnode,os_sc);
         ((Opnd*)scnode->refObj)->printWithType(os_sc);
         NamedType* nt = (NamedType*)((Opnd*)scnode->refObj)->getType();
-        if (nt->isFinalizable()) {
-            os_sc << " - finalizable ";
+        if (nt->isUnresolvedType() || nt->isFinalizable()) {
+            os_sc << " - finalizable or unresolved";
         }
         os_sc << std::endl;
         os_sc << "  =="; ((Opnd*)scnode->refObj)->getInst()->print(os_sc);


Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp?rev=574211&r1=574210&r2=574211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaLabelPrepass.cpp Mon Sep
10 04:48:01 2007
@@ -406,6 +406,9 @@
                 //but verifier is turned off for bootstrap classes
                 if (Log::isEnabled()) Log::out()<<"WARNING: resolving type from inside
of compilation session!!"<<std::endl;
                 exceptionType = compilationInterface.resolveNamedType(enclosingMethod->getParentHandle(),exceptionTypeToken);
+                if (exceptionType->isUnresolvedType()) {
+                    return 0;
+                }
             }
         } else {
             //FIXME should use j.l.Throwable for correct type propagation ??

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp?rev=574211&r1=574210&r2=574211&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/vm/drl/DrlVMInterface.cpp Mon Sep 10 04:48:01
2007
@@ -835,9 +835,12 @@
 NamedType* CompilationInterface::resolveNamedType(Class_Handle enclClass, uint32 cpIndex)
{
     //this method is allowed to use only for unresolved exception types
     Class_Handle ch = resolve_class(compileHandle,enclClass,cpIndex);
+    if (ch == NULL) {
+        return typeManager.getUnresolvedObjectType();
+    }
     assert(!class_is_primitive(ch));
     ObjectType* res = typeManager.getObjectType(ch);    
-    assert(res->isLikelyExceptionType());
+    assert(res->isLikelyExceptionType()); //double check that this method is used only
to resolve exception types when verifier is off
     return res;
 }
 



Mime
View raw message