You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by va...@apache.org on 2007/04/06 13:40:16 UTC

svn commit: r526126 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32: Ia32IRManager.cpp Ia32Inst.cpp Ia32Inst.h

Author: varlax
Date: Fri Apr  6 04:40:15 2007
New Revision: 526126

URL: http://svn.apache.org/viewvc?view=rev&rev=526126
Log:
Applied HARMONY-3396 [drlvm][winx64][jit] debug drlvm fails on HWA in OPT mode

Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h

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=526126&r1=526125&r2=526126
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp Fri Apr  6 04:40:15 2007
@@ -508,7 +508,7 @@
 CallInst * IRManager::newCallInst(Opnd * targetOpnd, const CallingConvention * cc, 
         uint32 argCount, Opnd ** args, Opnd * retOpnd, InlineInfo* ii)
 {
-    CallInst * callInst=new(memoryManager, (argCount + (retOpnd ? 1 : 0)) * 2 + 1) CallInst(this, instId++, cc, ii);
+    CallInst * callInst=new(memoryManager, (argCount + (retOpnd ? 1 : 0)) * 2 + 1) CallInst(this, instId++, cc, ii, targetOpnd->getRuntimeInfo());
     CallingConventionClient & ccc = callInst->callingConventionClient;
     uint32 i=0;
     if (retOpnd!=NULL){
@@ -1688,12 +1688,24 @@
                         corr += 16-(sz&15);
                     }
 #ifdef _WIN64
-                    Opnd::RuntimeInfo * rt = callInst->getOpnd(callInst->getTargetOpndIndex())->getRuntimeInfo();
-
-                    if (callInst->isDirect() && rt && rt->getKind() == Opnd::RuntimeInfo::Kind_InternalHelperAddress) {
-                        uint32 nRegOpnds = (uint32)(callInst->getOpndCount(Inst::OpndRole_Auxilary|Inst::OpndRole_Use) - stackOpndInfos.size());
-                        uint32 shadowSize = nRegOpnds * sizeof(POINTER_SIZE_INT);
-                        corr += shadowSize;
+                    Opnd::RuntimeInfo * rt = callInst->getRuntimeInfo();
+                    if (rt) {
+                        //stack size for parameters: "number of entries is equal to 4 or the maximum number ofparameters
+                        //See http://msdn2.microsoft.com/en-gb/library/ms794596.aspx for details
+                        //shadow - is an area on stack reserved to map parameters passed with registers
+                        bool needShadow = rt->getKind() == Opnd::RuntimeInfo::Kind_InternalHelperAddress;
+                        if (!needShadow && rt->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress) {
+                                CompilationInterface::RuntimeHelperId helperId = (CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)rt->getValue(0);
+                                //ABOUT: VM does not allocate shadow for most of the helpers
+                                //however some helpers are direct pointers to native funcs
+                                //TODO: create VM interface to get calling conventions for the helper
+                                //today  this knowledge is hardcoded here
+                                needShadow = helperId == CompilationInterface::Helper_GetTLSBase;
+                        }
+                        if (needShadow) {
+                            uint32 shadowSize = 4 * sizeof(POINTER_SIZE_INT);
+                            corr += shadowSize;
+                        }
                     }
 #endif
                     if (corr)

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp?view=diff&rev=526126&r1=526125&r2=526126
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp Fri Apr  6 04:40:15 2007
@@ -918,8 +918,8 @@
 // class CallInst
 //=================================================================================================
 //_________________________________________________________________________________________________
-CallInst::CallInst(IRManager * irm, int id, const CallingConvention * cc, InlineInfo* ii)  
-        : ControlTransferInst(Mnemonic_CALL, id), callingConventionClient(irm->getMemoryManager(), cc), inlineInfo(NULL)
+CallInst::CallInst(IRManager * irm, int id, const CallingConvention * cc, InlineInfo* ii, Opnd::RuntimeInfo* rri)  
+        : ControlTransferInst(Mnemonic_CALL, id), callingConventionClient(irm->getMemoryManager(), cc), inlineInfo(NULL), runtimeInfo(rri)
 { 
     if (ii && (!ii->isEmpty()) ) {
         inlineInfo = ii;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h?view=diff&rev=526126&r1=526125&r2=526126
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32Inst.h Fri Apr  6 04:40:15 2007
@@ -1256,16 +1256,17 @@
     }
 
     InlineInfo * getInlineInfo() const { return inlineInfo; }
+    Opnd::RuntimeInfo*  getRuntimeInfo() const {return runtimeInfo;}
 
 protected:
     CallingConventionClient callingConventionClient;
-
-    CallInst(IRManager * irm, int id, const CallingConvention * cc, InlineInfo* ii);
+    CallInst(IRManager * irm, int id, const CallingConvention * cc, InlineInfo* ii, Opnd::RuntimeInfo* targetInfo);
 
     //--------------------------------------------------------------------
     friend class    IRManager;
 private:
     InlineInfo * inlineInfo;
+    Opnd::RuntimeInfo* runtimeInfo;
 };
 
 //=========================================================================================================