harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From var...@apache.org
Subject svn commit: r521136 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32: Ia32CodeEmitter.cpp Ia32Encoder.cpp Ia32IRManager.cpp Ia32InstCodeSelector.cpp Ia32StackInfo.cpp
Date Thu, 22 Mar 2007 06:42:05 GMT
Author: varlax
Date: Wed Mar 21 23:42:04 2007
New Revision: 521136

URL: http://svn.apache.org/viewvc?view=rev&rev=521136
Log:
HARMONY-3441 [drlvm][jit][opt] redundant reservation of 'this' on EM64T

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CodeEmitter.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp
    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/codegenerator/ia32/Ia32StackInfo.cpp

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CodeEmitter.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CodeEmitter.cpp?view=diff&rev=521136&r1=521135&r2=521136
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CodeEmitter.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32CodeEmitter.cpp Wed
Mar 21 23:42:04 2007
@@ -520,7 +520,7 @@
                     Type* targetType = irManager->getTypeManager().getInt64Type();
 
                     Opnd* targetVal = irManager->newImmOpnd(targetType,(int64)targetCodeStartAddr);
-                    Opnd* targetReg = irManager->newRegOpnd(targetType, RegName_R14);
+                    Opnd* targetReg = irManager->newRegOpnd(targetType, RegName_R11);
                     
                     Inst* movInst = irManager->newInst(Mnemonic_MOV, targetReg, targetVal);
 
@@ -605,12 +605,12 @@
 /*
         EncoderBase::Operands args;
         args.clear();
-        args.add(RegName_R14);
+        args.add(RegName_R11);
         // direct call <imm> is relative, but call <reg> use an absolute address
to jump
         args.add(EncoderBase::Operand(OpndSize_64, (int64)targetAddr));
         char * ip = EncoderBase::encode((char*)callAddr, Mnemonic_MOV, args);
         args.clear();
-        args.add(RegName_R14);
+        args.add(RegName_R11);
         EncoderBase::encode(ip, Mnemonic_CALL, args);
 */
     } else

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp?view=diff&rev=521136&r1=521135&r2=521136
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Encoder.cpp Wed Mar
21 23:42:04 2007
@@ -233,25 +233,9 @@
                 RegName indexReg = pindex == NULL ? RegName_Null : pindex->getRegName();
 #ifdef _EM64T_
                 // adapter: all PTR types go as 64 bits
-                const RegName TMP_BASE = RegName_R13;
-                bool is_ptr = is_ptr_type(p->getType());
-                if (pindex== NULL && pbase == NULL) {
-                    // have only displacement - load displacement to register
-                    RegName reg = (RegName)(TMP_BASE + args.count());
-                    OPNDS tmp(reg, OPND(OpndSize_64, pdisp->getImmValue()));
-                    stream = (uint8*)EncoderBase::encode((char*)stream, Mnemonic_MOV, tmp);
-                    OPND mem(sz, reg, 0);
-                    args.add(mem);
-                }
-                else {
-                    EncoderBase::Operand o(is_ptr ? OpndSize_64 : sz, 
-                        baseReg, indexReg,
-                        NULL == pscale ? 0 : (unsigned char)pscale->getImmValue(),
-                        disp
-                        );
-                    args.add(o);
-                }
-#else 
+                assert(pindex != NULL || pbase != NULL);
+                sz = is_ptr_type(p->getType()) ? OpndSize_64 : sz;
+#endif
                 EncoderBase::Operand o(sz, 
                     baseReg,
                     indexReg,
@@ -260,7 +244,6 @@
                     );
                 args.add( o );
 
-#endif
             }
             break;
         default:

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=521136&r1=521135&r2=521136
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp Wed Mar
21 23:42:04 2007
@@ -1281,12 +1281,6 @@
         if (opnd->isPlacedIn(regKind))
             gpTotalRegUsage |= getRegMask(opnd->getRegName());
     }
-#ifdef _EM64T_
-    //FIXME!!
-    gpTotalRegUsage |= getRegMask(RegName_R15);
-    gpTotalRegUsage |= getRegMask(RegName_R13);
-    gpTotalRegUsage |= getRegMask(RegName_R14);
-#endif
 }
 //_________________________________________________________________________________________________
 uint32 IRManager::getTotalRegUsage(OpndKind regKind)const {
@@ -1663,7 +1657,9 @@
 void IRManager::finalizeCallSites()
 {
 #ifdef _EM64T_
-    if (!getMethodDesc().isStatic()) {
+    MethodDesc& md = getMethodDesc();
+    if (!md.isStatic() 
+            && (md.isSynchronized() || md.isMethodClassIsLikelyExceptionType()))
{
         Type* thisType = entryPointInst->getOpnd(0)->getType();
         entryPointInst->thisOpnd = newMemOpnd(thisType, MemOpndKind_StackAutoLayout, getRegOpnd(STACK_REG),
0); 
         entryPointInst->getBasicBlock()->appendInst(newCopyPseudoInst(Mnemonic_MOV,
entryPointInst->thisOpnd, entryPointInst->getOpnd(0)));

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=521136&r1=521135&r2=521136
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
Wed Mar 21 23:42:04 2007
@@ -1794,13 +1794,9 @@
 #ifndef _EM64T_
     Opnd * addr=irManager.newImmOpnd(fieldRefType, Opnd::RuntimeInfo::Kind_StaticFieldAddress,
fieldDesc);
 #else
-    Opnd * addr;
-    if(!fieldRefType->isReference()) {
-        addr =  irManager.newOpnd(fieldRefType);
-        appendInsts(irManager.newCopyPseudoInst(Mnemonic_MOV, addr, irManager.newImmOpnd(fieldRefType,
Opnd::RuntimeInfo::Kind_StaticFieldAddress, fieldDesc)));
-    } else {
-        addr = irManager.newImmOpnd(irManager.getTypeFromTag(Type::CompressedObject), Opnd::RuntimeInfo::Kind_StaticFieldAddress,
fieldDesc);
-    }
+    Opnd* immOp = irManager.newImmOpnd(fieldRefType, Opnd::RuntimeInfo::Kind_StaticFieldAddress,
fieldDesc);
+    Opnd* addr =  irManager.newOpnd(typeManager.getUnmanagedPtrType(fieldRefType));
+    appendInsts(irManager.newCopyPseudoInst(Mnemonic_MOV, addr, immOp));
 #endif
     return addr;
 }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp?view=diff&rev=521136&r1=521135&r2=521136
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp Wed Mar
21 23:42:04 2007
@@ -352,10 +352,15 @@
 
 void StackInfo::registerInsts(IRManager& irm) 
 {
-    if (!irm.getMethodDesc().isStatic()) {
+    MethodDesc& md = irm.getMethodDesc();
+    if (!md.isStatic()) {
 #ifdef _EM64T_
-        EntryPointPseudoInst * entryPointInst = irm.getEntryPointInst();
-        offsetOfThis = (uint32)entryPointInst->thisOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement)->getImmValue();
+        if ((md.isSynchronized() || md.isMethodClassIsLikelyExceptionType())) {
+            EntryPointPseudoInst * entryPointInst = irm.getEntryPointInst();
+            offsetOfThis = (uint32)entryPointInst->thisOpnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement)->getImmValue();
+        } else {
+            offsetOfThis = 0;
+        }
 #else
         EntryPointPseudoInst * entryPointInst = irm.getEntryPointInst();
         offsetOfThis = (uint32)entryPointInst->getOpnd(0)->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement)->getImmValue();



Mime
View raw message