harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smish...@apache.org
Subject svn commit: r502137 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src: codegenerator/ia32/Ia32IRManager.cpp codegenerator/ia32/Ia32InstCodeSelector.cpp translator/java/JavaByteCodeTranslator.cpp
Date Thu, 01 Feb 2007 07:03:07 GMT
Author: smishura
Date: Wed Jan 31 23:03:07 2007
New Revision: 502137

URL: http://svn.apache.org/viewvc?view=rev&rev=502137
Log:
Roll back commit r501830
Applied HARMONY-3063 [drlvm][jit] ArrayCopyRepMove does not work on EM64T

It causes mass crashes of classlib tests. Rolling it back doesn't resolve all faliures - need
additional investigation

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp?view=diff&rev=502137&r1=502136&r2=502137
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp Wed Jan
31 23:03:07 2007
@@ -1752,9 +1752,9 @@
                         } else if (inst->getMnemonic() == Mnemonic_POP) {
                             stackDepth-=getByteSize(inst->getOpnd(it)->getSize());
                         } else if (inst->getMnemonic() == Mnemonic_PUSHFD) {
-                            stackDepth+=sizeof(POINTER_SIZE_INT);
+                            stackDepth+=4;
                         } else if (inst->getMnemonic() == Mnemonic_POPFD) {
-                            stackDepth-=sizeof(POINTER_SIZE_INT);
+                            stackDepth-=4;
                         } else if (inst->getMnemonic() == Mnemonic_CALL && ((CallInst
*)inst)->getCallingConventionClient().getCallingConvention()->calleeRestoresStack())
{
                             stackDepth -= ((CallInst *)inst)->getArgStackDepth();
                         }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp?view=diff&rev=502137&r1=502136&r2=502137
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
Wed Jan 31 23:03:07 2007
@@ -1817,6 +1817,9 @@
     Type * elemType=arrayType->getElementType();
     Type * dstType=irManager.getManagedPtrType(elemType);
 
+    uint32 elemSize = getByteSize(irManager.getTypeSize(elemType));
+
+    
 #ifdef _EM64T_
     Type * indexType = typeManager.getInt64Type();
     Type * offType = typeManager.getInt64Type();
@@ -1825,32 +1828,11 @@
     Type * offType = typeManager.getInt32Type();
 #endif
         
-    uint32 elemSize = 0;
-    if (elemType->isReference()
-        && Type::isCompressedReference(elemType->tag, compilationInterface) 
-        && !elemType->isCompressedReference()) {
-        elemSize = 4;
-    } else {
-        elemSize = getByteSize(irManager.getTypeSize(elemType));
-    }
-    Opnd * elemSizeOpnd  = irManager.newImmOpnd(indexType, elemSize);
-    
     Opnd * indexOpnd = (Opnd *)index;
     indexOpnd = convert(indexOpnd, indexType);
-
-    if ( indexOpnd->isPlacedIn(OpndKind_Imm) ) {
-        // wee need to put index operand on a register to satisfy LEA constraint
-        uint64 immValue = indexOpnd->getImmValue();
-        if (immValue == 0) {
-            indexOpnd = NULL;
-            elemSizeOpnd = NULL;
-        } else {
-            Opnd * indexReg = irManager.newOpnd(indexType);
-            copyOpnd(indexReg,indexOpnd);
-            indexOpnd = indexReg;
-        }
-    }    
-    Opnd * addr = irManager.newMemOpnd(dstType,(Opnd*)array, indexOpnd, elemSizeOpnd,
+    
+    Opnd * addr = irManager.newMemOpnd(dstType,(Opnd*)array, (Opnd*)index,
+                                       irManager.newImmOpnd(indexType, elemSize),
                                        irManager.newImmOpnd(offType, arrayType->getArrayElemOffset())
                                        );
     Opnd * dst = irManager.newOpnd(dstType);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp?view=diff&rev=502137&r1=502136&r2=502137
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
Wed Jan 31 23:03:07 2007
@@ -2888,6 +2888,12 @@
                                             uint32       numArgs,
                                             Opnd **      srcOpnds) {
 
+#ifdef _EM64T_
+    // FIXME: this was not tested (and does not work) on EM64T.
+    if (true) {
+        return false;
+    }
+#endif
     if( !methodIsArraycopy(methodDesc) ||
         !arraycopyOptimizable(methodDesc,numArgs,srcOpnds) )
     {
@@ -2949,52 +2955,48 @@
     LabelInst * reverseCopying = irBuilder.createLabel();
     LabelInst * boundsException = irBuilder.createLabel();
     LabelInst * Exit = irBuilder.createLabel();
-
     Type * intType = typeManager.getInt32Type();
-    Type::Tag intTag = intType->tag;
     Type * voidType = typeManager.getVoidType();
 
     newFallthroughBlock();
     Opnd * zero = irBuilder.genLdConstant((int32)0);
-    Opnd * minusone = irBuilder.genLdConstant((int32)-1);
-
-    irBuilder.genBranch(intTag,Cmp_GT,boundsException,zero,srcPos);        
+    irBuilder.genBranch(Type::Int32,Cmp_GT,boundsException,zero,srcPos);        
 
     newFallthroughBlock();
-    irBuilder.genBranch(intTag,Cmp_GT,boundsException,zero,dstPos);
+    irBuilder.genBranch(Type::Int32,Cmp_GT,boundsException,zero,dstPos);
 
     newFallthroughBlock();
-    irBuilder.genBranch(intTag,Cmp_GT,boundsException,zero,len);
+    irBuilder.genBranch(Type::Int32,Cmp_GT,boundsException,zero,len);
 
     Modifier mod = Modifier(Overflow_None)|Modifier(Exception_Never)|Modifier(Strict_No);
 
     newFallthroughBlock();   
-    Opnd * srcLen = irBuilder.genArrayLen(intType,intTag,src);
+    Opnd * srcLen = irBuilder.genArrayLen(intType,Type::Int32,src);
     Opnd * srcEnd = irBuilder.genAdd(intType,mod,srcPos,len);
-    irBuilder.genBranch(intTag,Cmp_GT,boundsException,srcEnd,srcLen);
+    irBuilder.genBranch(Type::Int32,Cmp_GT,boundsException,srcEnd,srcLen);
     
     newFallthroughBlock();
     Opnd * dstEnd = irBuilder.genAdd(intType,mod,dstPos,len);
-    Opnd * dstLen = irBuilder.genArrayLen(intType,intTag,dst);
-    irBuilder.genBranch(intTag,Cmp_GT,boundsException,dstEnd,dstLen);
+    Opnd * dstLen = irBuilder.genArrayLen(intType,Type::Int32,dst);
+    irBuilder.genBranch(Type::Int32,Cmp_GT,boundsException,dstEnd,dstLen);
 
     newFallthroughBlock();
 
     // The case of same arrays and same positions
-    Opnd * diff = irBuilder.genCmp3(intType,intTag,Cmp_GT,dstPos,srcPos);
+    Opnd * diff = irBuilder.genCmp3(intType,Type::Int32,Cmp_GT,dstPos,srcPos);
     Opnd * sameArrays = irBuilder.genCmp(intType,Type::IntPtr,Cmp_EQ,src,dst);
-    Opnd * zeroDiff = irBuilder.genCmp(intType,intTag,Cmp_EQ,diff,zero);
+    Opnd * zeroDiff = irBuilder.genCmp(intType,Type::Int32,Cmp_EQ,diff,zero);
     Opnd * nothingToCopy = irBuilder.genAnd(intType,sameArrays,zeroDiff);
-    irBuilder.genBranch(intTag,Cmp_GT,Exit,nothingToCopy,zero);
+    irBuilder.genBranch(Type::Int32,Cmp_GT,Exit,nothingToCopy,zero);
 
     newFallthroughBlock();
 
     Opnd* tauTypesChecked = irBuilder.genTauSafe();
 
     // Choosing direction
-    Opnd * dstIsGreater = irBuilder.genCmp(intType,intTag,Cmp_GT,diff,zero);
+    Opnd * dstIsGreater = irBuilder.genCmp(intType,Type::Int32,Cmp_GT,diff,zero);
     Opnd * reverseCopy = irBuilder.genAnd(intType,sameArrays,dstIsGreater);
-    irBuilder.genBranch(intTag,Cmp_GT,reverseCopying,reverseCopy,zero);
+    irBuilder.genBranch(Type::Int32,Cmp_GT,reverseCopying,reverseCopy,zero);
 
     newFallthroughBlock();
 
@@ -3010,6 +3012,7 @@
     cfgBuilder.genBlockAfterCurrent(reverseCopying);
     {   // Reverse Copying
 
+    Opnd* minusone = irBuilder.genLdConstant((int32)-1);
     Opnd* lastSrcIdx = irBuilder.genAdd(srcPosType,mod,srcEnd,minusone);
     Opnd* lastDstIdx = irBuilder.genAdd(dstPosType,mod,dstEnd,minusone);
 
@@ -3029,7 +3032,8 @@
 
     irBuilder.genLabel(boundsException);
     cfgBuilder.genBlockAfterCurrent(boundsException);
-    irBuilder.genTauCheckBounds(src,minusone,tauSrcNullChecked);
+    Opnd * minusOne = irBuilder.genLdConstant((int32)-1);
+    irBuilder.genTauCheckBounds(src,minusOne,tauSrcNullChecked);
 
     irBuilder.genLabel(Exit);
     cfgBuilder.genBlockAfterCurrent(Exit);



Mime
View raw message