harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfur...@apache.org
Subject svn commit: r645073 [1/2] - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src: codegenerator/ codegenerator/ia32/ codegenerator/ipf/ codegenerator/ipf/include/ dynopt/ optimizer/ translator/ translator/java/
Date Sat, 05 Apr 2008 10:58:34 GMT
Author: mfursov
Date: Sat Apr  5 03:58:31 2008
New Revision: 645073

URL: http://svn.apache.org/viewvc?rev=645073&view=rev
Log:
Fix for HARMONY-3584 [dlrvm][jit][opt] arrayfolding implementation in guarded manner


Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/EdgeProfiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/ValueProfiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FastArrayFilling.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Opcode.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/codelowerer.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escanalyzer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/escapeanalyzer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/hashvaluenumberer.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/inliner.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/lazyexceptionopt.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/memoryopt.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifier.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/simplifytaus.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/TranslatorIntfc.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/translator/java/JavaByteCodeTranslator.h

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/CodeGenIntfc.h Sat Apr  5 03:58:31 2008
@@ -152,26 +152,19 @@
     };
 };
 
-class IntrinsicCallOp {
-public:
-    enum Id {
-        CharArrayCopy,
-        ArrayCopyDirect,
-        ArrayCopyReverse
-    };
-};
-
 class JitHelperCallOp {
 public:
     enum Id {
-	Prefetch,
-	Memset0,
+        Prefetch,
+        Memset0,
         InitializeArray,
         FillArrayWithConst,
         SaveThisState,
         ReadThisState,
         LockedCompareAndExchange,
         AddValueProfileValue,
+        ArrayCopyDirect,
+        ArrayCopyReverse,
         StringCompareTo,
         StringRegionMatches,
         StringIndexOf
@@ -263,8 +256,6 @@
                                                 NamedType* vtableType) = 0;
     virtual CG_OpndHandle*  call(uint32 numArgs, CG_OpndHandle** args, Type* retType,
                                  MethodDesc *desc) = 0;
-    virtual CG_OpndHandle*  arraycopyReverse(uint32 numArgs, CG_OpndHandle** args) = 0;
-    virtual CG_OpndHandle*  arraycopy(uint32 numArgs, CG_OpndHandle** args) = 0;
     virtual CG_OpndHandle*  tau_call(uint32 numArgs, CG_OpndHandle** args, Type* retType,
                                      MethodDesc *desc,
                                      CG_OpndHandle *tauNullChecked,
@@ -277,10 +268,6 @@
                                       CG_OpndHandle* methodPtr, 
                                       CG_OpndHandle* tauNullChecked,
                                       CG_OpndHandle* tauTypesChecked) = 0;
-    virtual CG_OpndHandle*  tau_callintr(uint32 numArgs, CG_OpndHandle** args, Type* retType,
-                                         IntrinsicCallOp::Id callId,
-                                         CG_OpndHandle* tauNullChecked,
-                                         CG_OpndHandle* tauTypesChecked) = 0;
     virtual CG_OpndHandle*  callhelper(uint32 numArgs, CG_OpndHandle** args, Type* retType,
                                        JitHelperCallOp::Id callId) = 0;
     virtual CG_OpndHandle*  callvmhelper(uint32 numArgs, CG_OpndHandle** args, Type* retType,

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32APIMagics.cpp Sat Apr  5 03:58:31 2008
@@ -52,7 +52,8 @@
 
 class APIMagicHandler {
 public:
-    APIMagicHandler(IRManager* _irm, CallInst* _inst, MethodDesc* _md)   : irm(_irm), callInst(_inst), md(_md) {
+    APIMagicHandler(IRManager* _irm, CallInst* _inst, MethodDesc* _md)
+    : irm(_irm), callInst(_inst), md(_md), typeManager(irm->getTypeManager()) {
         cfg = irm->getFlowGraph();
     }
     virtual ~APIMagicHandler(){};
@@ -60,13 +61,14 @@
     virtual void run()=0;
 protected:
 
-    void    convertIntToInt(Opnd* dst, Opnd* src, Node* node);
-    Opnd*   addElemIndexWithLEA(Opnd* array, Opnd* index, Node* node);
+    void   convertIntToInt(Opnd* dst, Opnd* src, Node* node);
+    Opnd*  addElemIndexWithLEA(Opnd* array, Opnd* index, RegName dstRegName, Node* node);
 
     IRManager* irm;
     CallInst* callInst;
     MethodDesc*  md;
     ControlFlowGraph* cfg;
+    TypeManager& typeManager;
 };
 
 #define DECLARE_HELPER_INLINER(name)\
@@ -82,6 +84,8 @@
 DECLARE_HELPER_INLINER(Integer_numberOfTrailingZeros_Handler_x_I_x_I);
 DECLARE_HELPER_INLINER(Long_numberOfLeadingZeros_Handler_x_J_x_I);
 DECLARE_HELPER_INLINER(Long_numberOfTrailingZeros_Handler_x_J_x_I);
+DECLARE_HELPER_INLINER(System_arraycopyDirect_Handler);
+DECLARE_HELPER_INLINER(System_arraycopyReverse_Handler);
 DECLARE_HELPER_INLINER(String_compareTo_Handler_x_String_x_I);
 DECLARE_HELPER_INLINER(String_regionMatches_Handler_x_I_x_String_x_I_x_I_x_Z);
 DECLARE_HELPER_INLINER(String_indexOf_Handler_x_String_x_I_x_I);
@@ -130,7 +134,15 @@
                         }
 #endif
                     } else if( ri->getKind() == Opnd::RuntimeInfo::Kind_InternalHelperAddress ) {
-                        if( strcmp((char*)ri->getValue(0),"String_compareTo")==0 ) {
+                        if( strcmp((char*)ri->getValue(0),"memory_copy_direct")==0 ) {
+                            if(getBoolArg("System_arraycopy_as_magic", true)) {
+                                handlers.push_back(new (tmpMM) System_arraycopyDirect_Handler(irm, callInst, NULL));
+                            } else { assert(0); }
+                        } else if( strcmp((char*)ri->getValue(0),"memory_copy_reverse")==0 ) {
+                            if(getBoolArg("System_arraycopy_as_magic", true)) {
+                                handlers.push_back(new (tmpMM) System_arraycopyReverse_Handler(irm, callInst, NULL));
+                            } else { assert(0); }
+                        } else if( strcmp((char*)ri->getValue(0),"String_compareTo")==0 ) {
                             if(getBoolArg("String_compareTo_as_magic", true))
                                 handlers.push_back(new (tmpMM) String_compareTo_Handler_x_String_x_I(irm, callInst, NULL));
                         } else if( strcmp((char*)ri->getValue(0),"String_regionMatches")==0 ) {
@@ -318,6 +330,78 @@
 #endif
 }
 
+void System_arraycopyDirect_Handler::run()
+{
+    Node* currNode = callInst->getNode();
+    assert( currNode->getOutEdge(Edge::Kind_Dispatch) == NULL);
+#ifdef _EM64T_
+    RegName counterRegName = RegName_RCX;
+    RegName srcAddrRegName = RegName_RSI;
+    RegName dstAddrRegName = RegName_RDI;
+#else
+    RegName counterRegName = RegName_ECX;
+    RegName srcAddrRegName = RegName_ESI;
+    RegName dstAddrRegName = RegName_EDI;
+#endif
+    
+    Opnd* src = getCallSrc(callInst, 0);
+    Opnd* srcPos = getCallSrc(callInst, 1);
+    Opnd* dst = getCallSrc(callInst, 2);
+    Opnd* dstPos = getCallSrc(callInst, 3);
+    Opnd* counterVal = getCallSrc(callInst, 4);
+
+    // prepare counter
+    Opnd* counter = irm->newRegOpnd(typeManager.getIntPtrType(),counterRegName);
+    convertIntToInt(counter, counterVal, currNode);
+
+    // prepare src/dst positions
+    Opnd* srcAddr = addElemIndexWithLEA(src,srcPos,srcAddrRegName,currNode);
+    Opnd* dstAddr = addElemIndexWithLEA(dst,dstPos,dstAddrRegName,currNode);
+
+    Opnd* one = irm->newImmOpnd(typeManager.getInt8Type(), 1);
+
+    Mnemonic mn = Mnemonic_NULL;
+    Type* elemType = src->getType()->asArrayType()->getElementType();
+    OpndSize typeSize = IRManager::getTypeSize(elemType->tag);
+    switch(typeSize) {
+        case OpndSize_8:   mn = Mnemonic_MOVS8; break;
+        case OpndSize_16:  mn = Mnemonic_MOVS16; break;
+        case OpndSize_32:  mn = Mnemonic_MOVS32; break;
+        case OpndSize_64:
+            {
+                /**
+                 * FIXME 
+                 * Currently JIT erroneously supposes that compressed mode is always on.
+                 * So if type is object, it is actually compressed (32-bit sized).
+                 * But IRManager::getTypeSize() "correctly" returns OpndSize_64.
+                 */
+                if (!elemType->isObject()) {
+                    currNode->appendInst(irm->newInstEx(Mnemonic_SHL, 1, counter, counter, one));
+                }
+                mn = Mnemonic_MOVS32;
+            }
+            break;
+        default: assert(0); mn = Mnemonic_MOVS32; break;
+    }
+
+    Inst* copyInst = irm->newInst(mn,dstAddr,srcAddr,counter);
+    copyInst->setPrefix(InstPrefix_REP);
+    currNode->appendInst(copyInst);
+
+    callInst->unlink();
+}
+
+void System_arraycopyReverse_Handler::run()
+{
+    Node* currNode = callInst->getNode();
+    currNode->appendInst(irm->newInst(Mnemonic_PUSHFD));
+    currNode->appendInst(irm->newInst(Mnemonic_STD));
+    System_arraycopyDirect_Handler directHandler(irm, callInst, NULL);
+    directHandler.run();
+
+    currNode->appendInst(irm->newInst(Mnemonic_POPFD));
+}
+
 void String_compareTo_Handler_x_String_x_I::run() {
     //mov ds:esi, this
     //mov es:edi, src
@@ -348,13 +432,12 @@
     RegName counterRegName = RegName_RCX;
     RegName thisAddrRegName = RegName_RSI;
     RegName trgtAddrRegName = RegName_RDI;
-    Type*   counterType = irm->getTypeManager().getInt64Type();
 #else
     RegName counterRegName = RegName_ECX;
     RegName thisAddrRegName = RegName_ESI;
     RegName trgtAddrRegName = RegName_EDI;
-    Type*   counterType = irm->getTypeManager().getInt32Type();
 #endif
+    Type*   counterType = typeManager.getIntPtrType();
 
     Node* counterIsZeroNode = irm->getFlowGraph()->createBlockNode();
     // if counter is zero jump to counterIsZeroNode immediately
@@ -372,15 +455,9 @@
     Opnd* counter = irm->newRegOpnd(counterType,counterRegName);
     convertIntToInt(counter, valForCounter, node);
 
-    // prepare this position
-    Opnd* thisAddr = addElemIndexWithLEA(thisArr,thisIdx,node);
-    Opnd* thisAddrReg = irm->newRegOpnd(thisAddr->getType(),thisAddrRegName);
-    node->appendInst(irm->newCopyPseudoInst(Mnemonic_MOV, thisAddrReg, thisAddr));
-
-    // prepare trgt position
-    Opnd* trgtAddr = addElemIndexWithLEA(trgtArr,trgtIdx,node);
-    Opnd* trgtAddrReg = irm->newRegOpnd(trgtAddr->getType(),trgtAddrRegName);
-    node->appendInst(irm->newCopyPseudoInst(Mnemonic_MOV, trgtAddrReg, trgtAddr));
+    // prepare this/trgt positions
+    Opnd* thisAddrReg = addElemIndexWithLEA(thisArr,thisIdx,thisAddrRegName,node);
+    Opnd* trgtAddrReg = addElemIndexWithLEA(trgtArr,trgtIdx,trgtAddrRegName,node);
 
     Inst* compareInst = irm->newInst(Mnemonic_CMPSW,thisAddrReg,trgtAddrReg,counter);
     compareInst->setPrefix(InstPrefix_REPZ);
@@ -402,7 +479,7 @@
 
     // strings are different
     Opnd* minustwo = irm->newImmOpnd(counterType,-2);
-    Type* charType = irm->getTypeManager().getCharType();
+    Type* charType = typeManager.getCharType();
     Opnd* thisChar = irm->newMemOpnd(charType, thisAddrReg, NULL, NULL, minustwo);
     Opnd* trgtChar = irm->newMemOpnd(charType, trgtAddrReg, NULL, NULL, minustwo);
     Type* intType = res->getType();
@@ -449,27 +526,20 @@
     RegName counterRegName = RegName_RCX;
     RegName thisAddrRegName = RegName_RSI;
     RegName trgtAddrRegName = RegName_RDI;
-    Type*   counterType = irm->getTypeManager().getInt64Type();
 #else
     RegName counterRegName = RegName_ECX;
     RegName thisAddrRegName = RegName_ESI;
     RegName trgtAddrRegName = RegName_EDI;
-    Type*   counterType = irm->getTypeManager().getInt32Type();
 #endif
+    Type*   counterType = typeManager.getIntPtrType();
 
     // prepare counter
     Opnd* counter = irm->newRegOpnd(counterType,counterRegName);
     convertIntToInt(counter, valForCounter, node);
 
-    // prepare this position
-    Opnd* thisAddr = addElemIndexWithLEA(thisArr,thisIdx,node);
-    Opnd* thisAddrReg = irm->newRegOpnd(thisAddr->getType(),thisAddrRegName);
-    node->appendInst(irm->newCopyPseudoInst(Mnemonic_MOV, thisAddrReg, thisAddr));
-
-    // prepare trgt position
-    Opnd* trgtAddr = addElemIndexWithLEA(trgtArr,trgtIdx,node);
-    Opnd* trgtAddrReg = irm->newRegOpnd(trgtAddr->getType(),trgtAddrRegName);
-    node->appendInst(irm->newCopyPseudoInst(Mnemonic_MOV, trgtAddrReg, trgtAddr));
+    // prepare this/trgt positions
+    Opnd* thisAddrReg = addElemIndexWithLEA(thisArr,thisIdx,thisAddrRegName,node);
+    Opnd* trgtAddrReg = addElemIndexWithLEA(trgtArr,trgtIdx,trgtAddrRegName,node);
 
     Inst* compareInst = irm->newInst(Mnemonic_CMPSW,thisAddrReg,trgtAddrReg,counter);
     compareInst->setPrefix(InstPrefix_REPZ);
@@ -639,10 +709,10 @@
     mainNode->appendInst(irm->newCopyPseudoInst(Mnemonic_MOV, offset, thisOffset)); // mov offset, this.offset
     if (!startIsZero)
         mainNode->appendInst(irm->newInst(Mnemonic_ADD, offset, start)); // add offset, start
-    Opnd* thisAddrReg = addElemIndexWithLEA(thisArr, offset, mainNode); // lea edi, [this.value + offset*sizeof(char) + 12]
+    Opnd* thisAddrReg = addElemIndexWithLEA(thisArr, offset, RegName_Null, mainNode); // lea edi, [this.value + offset*sizeof(char) + 12]
 
     // prepare trgt position
-    Opnd* trgtAddrReg = addElemIndexWithLEA(trgtArr, trgtOffset, mainNode);  // lea esi, [subString.value + subString.offset*sizeof(char) + 12]
+    Opnd* trgtAddrReg = addElemIndexWithLEA(trgtArr, trgtOffset, RegName_Null, mainNode);  // lea esi, [subString.value + subString.offset*sizeof(char) + 12]
     
     // lastIndex = this.count - subString.count - start
     Opnd* lastIndex = irm->newOpnd(counterType, regConstr);
@@ -704,14 +774,16 @@
     Type* srcType = src->getType();
 
     // this works only for equal types 
-    // or Int32 into Int64 conversion
+    // or Int32 into IntPtr conversion
     assert(srcType == dstType || (srcType == irm->getTypeManager().getInt32Type() &&
-                                  dstType == irm->getTypeManager().getInt64Type()));
+                                  dstType == irm->getTypeManager().getIntPtrType()));
 
     if(srcType != dstType) {
+#ifdef _EM64T_
         node->appendInst(irm->newInstEx(Mnemonic_MOVZX, 1, dst, src));
-    } else {
+#else
         node->appendInst(irm->newCopyPseudoInst(Mnemonic_MOV, dst, src));
+#endif
     }
 }
 
@@ -719,20 +791,28 @@
 //  address of the first element and index
 //  using 'LEA' instruction
 
-Opnd*  APIMagicHandler::addElemIndexWithLEA(Opnd* array, Opnd* index, Node* node) 
+Opnd*  APIMagicHandler::addElemIndexWithLEA(Opnd* array, Opnd* index, RegName dstRegName, Node* node) 
 {
-    ArrayType * arrayType=((Opnd*)array)->getType()->asArrayType();
-    Type * elemType=arrayType->getElementType();
-    Type * dstType=irm->getManagedPtrType(elemType);
+    ArrayType * arrayType = array->getType()->asArrayType();
+    Type * elemType = arrayType->getElementType();
+    Type * dstType = irm->getManagedPtrType(elemType);
+    //Opnd * dst = irm->newRegOpnd(dstType,dstRegName);
+    Opnd* dst;
+    if (dstRegName != RegName_Null)
+        dst = irm->newRegOpnd(dstType,dstRegName);
+    else
+    {
+        Constraint reg32Constr(OpndKind_GPReg, OpndSize_32);
+        dst = irm->newOpnd(dstType,reg32Constr);
+    }
 
-    TypeManager& typeManager = irm->getTypeManager();
+//    TypeManager& typeManager = typeManager;
 #ifdef _EM64T_
-    Type * indexType = typeManager.getInt64Type();
     Type * offType = typeManager.getInt64Type();
 #else
-    Type * indexType = typeManager.getInt32Type();
     Type * offType = typeManager.getInt32Type();
 #endif
+    Type * indexType = typeManager.getIntPtrType();
         
     uint32 elemSize = 0;
     if (elemType->isReference()
@@ -754,13 +834,16 @@
     } 
     Opnd * arrOffset = irm->newImmOpnd(offType, arrayType->getArrayElemOffset());
     Opnd * addr = irm->newMemOpnd(dstType,(Opnd*)array, indexOpnd, elemSizeOpnd, arrOffset);
-    Opnd * dst = irm->newOpnd(dstType);
     node->appendInst(irm->newInstEx(Mnemonic_LEA, 1, dst, addr));
+
     return dst;
 }
 
 
 }} //namespace
+
+
+
 
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32I8Lowerer.cpp Sat Apr  5 03:58:31 2008
@@ -528,9 +528,9 @@
                 // to regalloc and constraint resolver.
                 // However, this seems does not change anything currently,
                 // so leaving as-is.
-                //test 	    low, low
-                //setns 	hi		; if lo is positive, then load 1 into hi
-                //sub		hi, 1	; if lo is positive, then hi is now '0'. otherwise, it's -1
+                //test      low, low
+                //setns     hi      ; if lo is positive, then load 1 into hi
+                //sub       hi, 1   ; if lo is positive, then hi is now '0'. otherwise, it's -1
                 irManager->newInstEx(Mnemonic_CDQ, 1, dst_2, dst_1)->insertBefore(inst);
             } else {
                 //fill upper word with 0
@@ -1519,5 +1519,9 @@
 }
 
 }}
+
+
+
+
 
 

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?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp Sat Apr  5 03:58:31 2008
@@ -243,6 +243,8 @@
     irManager.registerInternalHelperInfo("add_value_profile_value", IRManager::InternalHelperInfo((void*)&add_value_profile_value,&CallingConvention_STDCALL));
 
     irManager.registerInternalHelperInfo("fill_array_with_const", IRManager::InternalHelperInfo((void*)&fill_array_with_const,&CallingConvention_STDCALL));
+    irManager.registerInternalHelperInfo("memory_copy_direct", IRManager::InternalHelperInfo(NULL,&CallingConvention_STDCALL));
+    irManager.registerInternalHelperInfo("memory_copy_reverse", IRManager::InternalHelperInfo(NULL,&CallingConvention_STDCALL));
     irManager.registerInternalHelperInfo("String_compareTo", IRManager::InternalHelperInfo(NULL,&CallingConvention_STDCALL));
     irManager.registerInternalHelperInfo("String_regionMatches", IRManager::InternalHelperInfo(NULL,&CallingConvention_STDCALL));
     irManager.registerInternalHelperInfo("String_indexOf", IRManager::InternalHelperInfo(NULL,&CallingConvention_STDCALL));
@@ -585,11 +587,11 @@
 //  Convert to integer
 
 CG_OpndHandle* InstCodeSelector::convToInt(ConvertToIntOp::Types       opType,
-                                                bool                        isSigned,
-						bool                        isZeroExtend,
-                                                ConvertToIntOp::OverflowMod ovfMod,
-                                                Type*                       dstType, 
-                                                CG_OpndHandle*              src) 
+                                           bool                        isSigned,
+                                           bool                        isZeroExtend,
+                                           ConvertToIntOp::OverflowMod ovfMod,
+                                           Type*                       dstType, 
+                                           CG_OpndHandle*              src) 
 {
     Type * sizeType=NULL;
     switch (opType){
@@ -600,16 +602,16 @@
             sizeType=isSigned?typeManager.getInt16Type():typeManager.getUInt16Type();
             break;
 
-#ifdef _IA32_	    
+#ifdef _IA32_
         case ConvertToIntOp::I:
-#endif	
+#endif
         case ConvertToIntOp::I4:
             sizeType=isSigned?typeManager.getInt32Type():typeManager.getUInt32Type();
             break;
 
 #ifdef _EM64T_
         case ConvertToIntOp::I:
-#endif	
+#endif
         case ConvertToIntOp::I8:
             sizeType=isSigned?typeManager.getInt64Type():typeManager.getUInt64Type();
             break;
@@ -1927,7 +1929,7 @@
         
     uint32 elemSize = 0;
     if (elemType->isReference()
-        && Type::isCompressedReference(elemType->tag, compilationInterface) 
+        && Type::isCompressedReference(elemType->tag, compilationInterface)
         && !elemType->isCompressedReference()) {
         elemSize = 4;
     } else {
@@ -2576,98 +2578,6 @@
 }
 
 //_______________________________________________________________________________________________________________
-//  reverse copying with 'rep move' instruction
-//  start indexes (args[1] and args[3] must be prepared respectively)
-
-CG_OpndHandle* InstCodeSelector::arraycopyReverse(uint32          numArgs, 
-                                                  CG_OpndHandle** args)
-{
-
-
-    appendInsts(irManager.newInst(Mnemonic_PUSHFD));
-    appendInsts(irManager.newInst(Mnemonic_STD));
-
-    arraycopy(numArgs,args);
-
-    appendInsts(irManager.newInst(Mnemonic_POPFD));
-
-    return NULL;
-}
-
-//_______________________________________________________________________________________________________________
-//  Transforming System::arraycopy call into 'rep move'
-
-CG_OpndHandle* InstCodeSelector::arraycopy(uint32          numArgs, 
-                                           CG_OpndHandle** args)
-{
-    assert(numArgs == 5);
-    
-#ifdef _EM64T_
-    RegName counterRegName = RegName_RCX;
-    RegName srcAddrRegName = RegName_RSI;
-    RegName dstAddrRegName = RegName_RDI;
-#else
-    RegName counterRegName = RegName_ECX;
-    RegName srcAddrRegName = RegName_ESI;
-    RegName dstAddrRegName = RegName_EDI;
-#endif
-
-    // prepare counter
-    Type* counterType = typeManager.getIntPtrType();
-    Opnd* counter = irManager.newRegOpnd(counterType,counterRegName);
-    copyOpnd(counter,(Opnd*)args[4]);
-
-    // prepare src position
-    Opnd* srcAddr = (Opnd*)addElemIndexWithLEA(NULL,args[0],args[1]);
-    Opnd* srcAddrReg = irManager.newRegOpnd(srcAddr->getType(),srcAddrRegName);
-    copyOpnd(srcAddrReg,srcAddr);
-
-    // prepare dst position
-    Opnd* dstAddr = (Opnd*)addElemIndexWithLEA(NULL,args[2],args[3]);
-    Opnd* dstAddrReg = irManager.newRegOpnd(dstAddr->getType(),dstAddrRegName);
-    copyOpnd(dstAddrReg,dstAddr);
-
-    // double counter if elem type is 64 bits long
-    PtrType* srcAddrType = srcAddr->getType()->asPtrType();
-    assert(srcAddrType);
-    Type::Tag tag = srcAddrType->getPointedToType()->tag;
-    Mnemonic mn = Mnemonic_NULL;
-    OpndSize typeSize = IRManager::getTypeSize(tag);
-    switch(typeSize) {
-        case OpndSize_8:   mn = Mnemonic_MOVS8; break;
-        case OpndSize_16:  mn = Mnemonic_MOVS16; break;
-        case OpndSize_32:  mn = Mnemonic_MOVS32; break;
-        case OpndSize_64: 
-            {
-                /**
-                 * FIXME 
-                 * Currently JIT erroneously supposes that compressed mode is always on.
-                 * So if type is object, it is actually compressed (32-bit sized).
-                 * But IRManager::getTypeSize() "correctly" returns OpndSize_64.
-                 */
-#ifdef _EM64T_
-                if (irManager.refsAreCompressed() && srcAddrType->getPointedToType()->isObject()) {
-                    mn = Mnemonic_MOVS32;
-                } else {
-                    mn = Mnemonic_MOVS64;
-                }
-#else
-                // there are no MOVSQ on ia32
-                assert(!srcAddrType->getPointedToType()->isObject());
-                appendInsts(irManager.newInst(Mnemonic_SHL, counter, irManager.newImmOpnd(counterType, (int32)1)));
-                mn = Mnemonic_MOVS32;
-#endif // _EM64T_
-            }
-            break;
-        default: assert(0); mn = Mnemonic_MOVS32; break;
-    }
-    Inst* copyInst = irManager.newInst(mn,dstAddrReg,srcAddrReg,counter);
-    copyInst->setPrefix(InstPrefix_REP);
-    appendInsts(copyInst);
-    return NULL;
-}
-
-//_______________________________________________________________________________________________________________
 //  Direct call to the method. Depending on the code generator flags we
 //  either expand direct call into loading method address into a register and
 //  indirect call or true direct call that will be patched if method is recompiled.
@@ -2719,32 +2629,6 @@
 }
 
 //_______________________________________________________________________________________________________________
-//  Intrinsic call
-
-CG_OpndHandle* InstCodeSelector::callintr(uint32              numArgs, 
-                                             CG_OpndHandle**     args, 
-                                             Type*               retType,
-                                             IntrinsicCallOp::Id callId) 
-{
-    ICS_ASSERT(0);
-    return 0;
-}
-
-//_______________________________________________________________________________________________________________
-//  Intrinsic call
-
-CG_OpndHandle* InstCodeSelector::tau_callintr(uint32              numArgs, 
-                                                 CG_OpndHandle**     args, 
-                                                 Type*               retType,
-                                                 IntrinsicCallOp::Id callId,
-                                                 CG_OpndHandle*      tauNullsChecked,
-                                                 CG_OpndHandle*      tauTypesChecked) 
-{
-    ICS_ASSERT(0);
-    return 0;
-}
-
-//_______________________________________________________________________________________________________________
 //  JIT helper call
 
 CG_OpndHandle* InstCodeSelector::callhelper(uint32              numArgs, 
@@ -2761,16 +2645,16 @@
         Opnd* distance = (Opnd*) args[1];    
         Opnd* stride = (Opnd*) args[2];
 
-    	assert (distance->isPlacedIn(OpndKind_Imm) && stride->isPlacedIn(OpndKind_Imm));
-		assert(fit32(distance->getImmValue()));
-		assert(fit32(stride->getImmValue()));
-		int dist = (int)distance->getImmValue();
+        assert (distance->isPlacedIn(OpndKind_Imm) && stride->isPlacedIn(OpndKind_Imm));
+                assert(fit32(distance->getImmValue()));
+                assert(fit32(stride->getImmValue()));
+                int dist = (int)distance->getImmValue();
         int strd = (int)stride->getImmValue();
     
-    	for (int i=0; i< dist; i+=strd)
-    	{
+        for (int i=0; i< dist; i+=strd)
+        {
             Opnd* prefAddress = irManager.newMemOpnd(typeManager.getInt8Type(), address, 0, 0, irManager.newImmOpnd(typeManager.getInt32Type(), i));
-	    Inst* inst = irManager.newInst(Mnemonic_PREFETCH, prefAddress);
+            Inst* inst = irManager.newInst(Mnemonic_PREFETCH, prefAddress);
             appendInsts(inst);
         }
         break;
@@ -2783,29 +2667,29 @@
         Opnd *addr = opnds[0];
         Opnd *size = opnds[1];
 
-	RegName counterRegName = RegName_ECX;	
-	RegName dstRegName = RegName_EDI;
-	RegName zeroRegName = RegName_EAX;
-	
-	// prepare counter
-	Type* int32Type = typeManager.getInt32Type();
-	Opnd* counter = irManager.newRegOpnd(int32Type,counterRegName);
-	copyOpnd(counter,size);
-	appendInsts(irManager.newInst(Mnemonic_SHR, counter, irManager.newImmOpnd(int32Type,2)));
-
-	// prepare dst	
-	Opnd* dst = irManager.newRegOpnd(int32Type,dstRegName);
-	copyOpnd(dst, addr);
-	
-	// prepare zero
-	Opnd* eax = irManager.newRegOpnd(int32Type,zeroRegName);
-	//appendInsts(irManager.newInst(Mnemonic_XOR, eax, eax));
-	Opnd* zero = irManager.newImmOpnd(int32Type,0);
-	appendInsts(irManager.newInst(Mnemonic_MOV, eax, zero));
-	
-	Inst* storeInst = irManager.newInst(Mnemonic_STOS, dst, counter, eax);
-	storeInst->setPrefix(InstPrefix_REP);
-	appendInsts(storeInst);
+        RegName counterRegName = RegName_ECX;   
+        RegName dstRegName = RegName_EDI;
+        RegName zeroRegName = RegName_EAX;
+        
+        // prepare counter
+        Type* int32Type = typeManager.getInt32Type();
+        Opnd* counter = irManager.newRegOpnd(int32Type,counterRegName);
+        copyOpnd(counter,size);
+        appendInsts(irManager.newInst(Mnemonic_SHR, counter, irManager.newImmOpnd(int32Type,2)));
+
+        // prepare dst  
+        Opnd* dst = irManager.newRegOpnd(int32Type,dstRegName);
+        copyOpnd(dst, addr);
+        
+        // prepare zero
+        Opnd* eax = irManager.newRegOpnd(int32Type,zeroRegName);
+        //appendInsts(irManager.newInst(Mnemonic_XOR, eax, eax));
+        Opnd* zero = irManager.newImmOpnd(int32Type,0);
+        appendInsts(irManager.newInst(Mnemonic_MOV, eax, zero));
+        
+        Inst* storeInst = irManager.newInst(Mnemonic_STOS, dst, counter, eax);
+        storeInst->setPrefix(InstPrefix_REP);
+        appendInsts(storeInst);
           break;
     }
     case InitializeArray:
@@ -2887,6 +2771,20 @@
         assert(numArgs == 4);
         Opnd * newArgs[4] = {(Opnd *)args[0], (Opnd *)args[1], (Opnd *)args[2], (Opnd *)args[3]};
         appendInsts(irManager.newInternalRuntimeHelperCallInst("fill_array_with_const", numArgs, newArgs, dstOpnd));
+        break;
+    }
+    case ArrayCopyDirect:
+    {
+        assert(numArgs == 5);
+        Opnd * newArgs[5] = {(Opnd *)args[0], (Opnd *)args[1], (Opnd *)args[2], (Opnd *)args[3], (Opnd *)args[4]};
+        appendInsts(irManager.newInternalRuntimeHelperCallInst("memory_copy_direct", numArgs, newArgs, dstOpnd));
+        break;
+    }
+    case ArrayCopyReverse:
+    {
+        assert(numArgs == 5);
+        Opnd * newArgs[5] = {(Opnd *)args[0], (Opnd *)args[1], (Opnd *)args[2], (Opnd *)args[3], (Opnd *)args[4]};
+        appendInsts(irManager.newInternalRuntimeHelperCallInst("memory_copy_reverse", numArgs, newArgs, dstOpnd));
         break;
     }
     case StringCompareTo:

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h Sat Apr  5 03:58:31 2008
@@ -211,14 +211,10 @@
                              CG_OpndHandle* methodPtr, CG_OpndHandle* nonNullFirstArgTau,
                              CG_OpndHandle* tauTypesChecked);
     CG_OpndHandle* call(uint32 numArgs, CG_OpndHandle** args, Type* retType, MethodDesc *desc);
-    CG_OpndHandle* arraycopyReverse(uint32 numArgs, CG_OpndHandle** args);
-    CG_OpndHandle* arraycopy(uint32 numArgs, CG_OpndHandle** args);
     CG_OpndHandle* tau_call(uint32 numArgs, CG_OpndHandle** args, Type* retType,
                             MethodDesc *desc, CG_OpndHandle *nonNullFirstArgTau,
                             CG_OpndHandle *tauTypesChecked);
     CG_OpndHandle* tau_callvirt(uint32 numArgs,CG_OpndHandle** args, Type* retType, MethodDesc *desc,             CG_OpndHandle* tauNullChecked, CG_OpndHandle* tauTypesChecked);
-    CG_OpndHandle* callintr(uint32 numArgs, CG_OpndHandle** args, Type* retType,IntrinsicCallOp::Id callId);
-    CG_OpndHandle* tau_callintr(uint32 numArgs, CG_OpndHandle** args, Type* retType,IntrinsicCallOp::Id callId,      CG_OpndHandle *tauNullsChecked, CG_OpndHandle *tauTypesChecked);
     CG_OpndHandle* callhelper(uint32 numArgs, CG_OpndHandle** args, Type* retType,JitHelperCallOp::Id callId);
     CG_OpndHandle* callvmhelper(uint32 numArgs, CG_OpndHandle** args, Type* retType,
                                 VM_RT_SUPPORT callId);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp Sat Apr  5 03:58:31 2008
@@ -1315,22 +1315,6 @@
 }
 
 //----------------------------------------------------------------------------//
-// Intrinsic call
-
-CG_OpndHandle *IpfInstCodeSelector::tau_callintr(uint32              numArgs, 
-                                                 CG_OpndHandle       **args, 
-                                                 Type                *retType,
-                                                 IntrinsicCallOp::Id callId,
-                                                 CG_OpndHandle       *tauNullsChecked,
-                                                 CG_OpndHandle       *tauTypesChecked) {
-
-    IPF_LOG << "      tau_callintr" << endl;
-    IPF_ASSERT(0);
-
-    return NULL;
-}
-
-//----------------------------------------------------------------------------//
 
 void IpfInstCodeSelector::ret() {
 
@@ -1819,20 +1803,6 @@
 
     directCall(2, helperArgs, retOpnd, helperAddress, p0);
     return retOpnd;
-}
-
-//----------------------------------------------------------------------------//
-
-CG_OpndHandle* IpfInstCodeSelector::arraycopy(unsigned int numArgs, 
-                                              CG_OpndHandle** args) { 
-    NOT_IMPLEMENTED_C("arraycopy") 
-}
-
-//----------------------------------------------------------------------------//
-
-CG_OpndHandle* IpfInstCodeSelector::arraycopyReverse(unsigned int numArgs, 
-                                                     CG_OpndHandle** args) { 
-    NOT_IMPLEMENTED_C("arraycopyReverse") 
 }
 
 //----------------------------------------------------------------------------//

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h Sat Apr  5 03:58:31 2008
@@ -175,7 +175,6 @@
     CG_OpndHandle *call(uint32, CG_OpndHandle**, Type*, MethodDesc*);
     CG_OpndHandle *tau_call(uint32, CG_OpndHandle**, Type*, MethodDesc*, CG_OpndHandle*, CG_OpndHandle*);
     CG_OpndHandle *tau_calli(uint32,CG_OpndHandle**, Type*, CG_OpndHandle*, CG_OpndHandle*, CG_OpndHandle*);
-    CG_OpndHandle *tau_callintr(uint32, CG_OpndHandle**, Type*, IntrinsicCallOp::Id, CG_OpndHandle*, CG_OpndHandle*);
     void          ret();
     void          ret(CG_OpndHandle*);
 
@@ -307,8 +306,6 @@
     CG_OpndHandle* convToUPtr(PtrType*, CG_OpndHandle*)                       { NOT_IMPLEMENTED_C("convToUPtr") }
     CG_OpndHandle *tau_ldIntfTableAddr(Type*, CG_OpndHandle*, NamedType*, CG_OpndHandle*) { NOT_IMPLEMENTED_C("tau_ldIntfTableAddr"); }
     CG_OpndHandle* tau_ldIntfTableAddr(Type*, CG_OpndHandle*, NamedType*);
-    CG_OpndHandle* arraycopyReverse(unsigned int, CG_OpndHandle**);
-    CG_OpndHandle* arraycopy(unsigned int, CG_OpndHandle**);
     CG_OpndHandle* addElemIndexWithLEA(Type*, CG_OpndHandle*, CG_OpndHandle*) { NOT_IMPLEMENTED_C("addElemIndexWithLEA") }
     CG_OpndHandle* ldRef(Type*, MethodDesc*, unsigned int, bool); 
     void           pseudoInst()                                               {}

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/EdgeProfiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/EdgeProfiler.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/EdgeProfiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/EdgeProfiler.cpp Sat Apr  5 03:58:31 2008
@@ -751,7 +751,7 @@
         }
         Inst* last = (Inst*)node->getLastInst();
         // This method is not a leaf method.
-        if( last->getOpcode() >= Op_DirectCall && last->getOpcode() <= Op_IntrinsicCall ){
+        if( last->getOpcode() >= Op_DirectCall && last->getOpcode() <= Op_VMHelperCall ){
             return false;
         }
         Edges::const_iterator eiter;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/StaticProfiler.cpp Sat Apr  5 03:58:31 2008
@@ -346,7 +346,7 @@
                 double dprob = (*fn)(c);
                 assert(dprob>0 && dprob<1);
                 if (dprob!=PROB_HEURISTIC_FAIL) {
-                    double newprob = prob * dprob / (prob*dprob + (1-prob)*(1-dprob));
+                    double newprob = prob*dprob / (prob*dprob + (1-prob)*(1-dprob));
                     assert(newprob>0 && newprob<1);
                     prob = newprob;
                 }
@@ -415,8 +415,8 @@
 static double callHeuristic(const StaticProfilerContext* c) {
     Node* node1 = c->edge1->getTargetNode();
     Node* node2 = c->edge2->getTargetNode();
-    bool node1HasCall = findInst(node1, Op_DirectCall, Op_IntrinsicCall)!=NULL;
-    bool node2HasCall = findInst(node2, Op_DirectCall, Op_IntrinsicCall)!=NULL;
+    bool node1HasCall = findInst(node1, Op_DirectCall, Op_VMHelperCall)!=NULL;
+    bool node2HasCall = findInst(node2, Op_DirectCall, Op_VMHelperCall)!=NULL;
     
     if (!node1HasCall && !node2HasCall) {
         return PROB_HEURISTIC_FAIL;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/ValueProfiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/ValueProfiler.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/ValueProfiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/dynopt/ValueProfiler.cpp Sat Apr  5 03:58:31 2008
@@ -110,7 +110,7 @@
                 Opnd* valueOpnd = vtableInst->getDst();
                 const uint32 numArgs = 2;
                 Opnd* args[numArgs] = {indexOpnd, valueOpnd};
-                Inst* addValueInst = instFactory.makeJitHelperCall(opndManager.getNullOpnd(), AddValueProfileValue, numArgs, args);
+                Inst* addValueInst = instFactory.makeJitHelperCall(opndManager.getNullOpnd(), AddValueProfileValue, NULL, NULL, numArgs, args);
                 addValueInst->setBCOffset(call->getBCOffset());
                 ((CFGInst *)addValueInst)->insertBefore(call);
                 ((CFGInst *)loadIndexInst)->insertBefore(addValueInst);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.cpp Sat Apr  5 03:58:31 2008
@@ -388,29 +388,18 @@
     return ConvertToIntOp::NoOvf;    // to keep the compiler quiet
 }
 
-//
-//  Maps intrinsic id
-//
-IntrinsicCallOp::Id _BlockCodeSelector::convertIntrinsicId(IntrinsicCallId callId) {
-    switch(callId) {
-    case CharArrayCopy:      return IntrinsicCallOp::CharArrayCopy;
-    case ArrayCopyDirect:    return IntrinsicCallOp::ArrayCopyDirect;
-    case ArrayCopyReverse:   return IntrinsicCallOp::ArrayCopyReverse;
-    }
-    assert(0);
-    return IntrinsicCallOp::CharArrayCopy; // to keep compiler quiet
-}
-
 JitHelperCallOp::Id _BlockCodeSelector::convertJitHelperId(JitHelperCallId callId) {
     switch(callId) {
-        case Prefetch:           	return JitHelperCallOp::Prefetch;
-        case Memset0:           	return JitHelperCallOp::Memset0;
+        case Prefetch:                  return JitHelperCallOp::Prefetch;
+        case Memset0:                   return JitHelperCallOp::Memset0;
         case InitializeArray:           return JitHelperCallOp::InitializeArray;
         case SaveThisState:             return JitHelperCallOp::SaveThisState;
         case ReadThisState:             return JitHelperCallOp::ReadThisState;
         case LockedCompareAndExchange:  return JitHelperCallOp::LockedCompareAndExchange;
         case AddValueProfileValue:      return JitHelperCallOp::AddValueProfileValue;
         case FillArrayWithConst:        return JitHelperCallOp::FillArrayWithConst;
+        case ArrayCopyDirect:           return JitHelperCallOp::ArrayCopyDirect;
+        case ArrayCopyReverse:          return JitHelperCallOp::ArrayCopyReverse;
         case StringCompareTo:           return JitHelperCallOp::StringCompareTo;
         case StringRegionMatches:       return JitHelperCallOp::StringRegionMatches;
         case StringIndexOf:             return JitHelperCallOp::StringIndexOf;
@@ -722,11 +711,11 @@
                     (opType==CompareOp::S) ||
                     (opType==CompareOp::D)) {
                         switch (cmpOp) {
-        case CompareOp::Gt: cmpOp2 = CompareOp::Gtu; ifNaNResult = 1; break;
-        case CompareOp::Gtu: cmpOp2 = CompareOp::Gt; ifNaNResult = -1; break;
-        case CompareOp::Ge: cmpOp2 = CompareOp::Geu; ifNaNResult = 1; break;
-        case CompareOp::Geu: cmpOp2 = CompareOp::Ge; ifNaNResult = -1; break;
-        default: break;
+                        case CompareOp::Gt: cmpOp2 = CompareOp::Gtu; ifNaNResult = 1; break;
+                        case CompareOp::Gtu: cmpOp2 = CompareOp::Gt; ifNaNResult = -1; break;
+                        case CompareOp::Ge: cmpOp2 = CompareOp::Geu; ifNaNResult = 1; break;
+                        case CompareOp::Geu: cmpOp2 = CompareOp::Ge; ifNaNResult = -1; break;
+                        default: break;
                         };
                     }
 
@@ -797,11 +786,11 @@
                 uint32 numArgs = inst->getNumSrcOperands()-2; // also omit from count
                 cgInst = 
                     instructionCallback.tau_call(numArgs,
-                    args,
-                    inst->getDst()->getType(),
-                    methodDesc,
-                    getCGInst(tauNullChecked),
-                    getCGInst(tauTypesChecked));
+                                                 args,
+                                                 inst->getDst()->getType(),
+                                                 methodDesc,
+                                                 getCGInst(tauNullChecked),
+                                                 getCGInst(tauTypesChecked));
             }
             break;
         case Op_TauVirtualCall:
@@ -816,11 +805,11 @@
                 MethodDesc * methodDesc = call->getMethodDesc();
                 cgInst = 
                     instructionCallback.tau_callvirt(inst->getNumSrcOperands()-2, // omit taus
-                    genCallArgs(call, 2), // omit taus
-                    inst->getDst()->getType(),
-                    methodDesc,
-                    getCGInst(tauNullChecked),
-                    getCGInst(tauTypesChecked));
+                                                     genCallArgs(call, 2), // omit taus
+                                                     inst->getDst()->getType(),
+                                                     methodDesc,
+                                                     getCGInst(tauNullChecked),
+                                                     getCGInst(tauTypesChecked));
             }
             break;
         case Op_IndirectCall:
@@ -834,11 +823,11 @@
                 assert(inst->isCall());
                 cgInst = 
                     instructionCallback.tau_calli(inst->getNumSrcOperands() - 3, // omit taus and fnAddr
-                    genCallArgs(inst, 3), // omit taus and fnAddr
-                    inst->getDst()->getType(),
-                    getCGInst(fnAddr),
-                    getCGInst(tauNullChecked),
-                    getCGInst(tauTypesChecked));
+                                                  genCallArgs(inst, 3), // omit taus and fnAddr
+                                                  inst->getDst()->getType(),
+                                                  getCGInst(fnAddr),
+                                                  getCGInst(tauNullChecked),
+                                                  getCGInst(tauTypesChecked));
             }
             break;
         case Op_IndirectMemoryCall:
@@ -852,58 +841,29 @@
                 assert(inst->isCall());
                 cgInst = 
                     instructionCallback.tau_calli(inst->getNumSrcOperands() - 3, // omit taus andfnAddr
-                    genCallArgs(inst, 3), // omit taus and fnAddr
-                    inst->getDst()->getType(),
-                    getCGInst(fnAddr),
-                    getCGInst(tauNullChecked),
-                    getCGInst(tauTypesChecked));
-            }
-            break;
-        case Op_IntrinsicCall:
-            {
-                assert(inst->getNumSrcOperands() >= 2);
-                Opnd *tauNullChecked = inst->getSrc(0);
-                Opnd *tauTypesChecked = inst->getSrc(1);
-                assert(tauNullChecked->getType()->tag == Type::Tau);
-                assert(tauTypesChecked->getType()->tag == Type::Tau);
-
-                IntrinsicCallInst * call = (IntrinsicCallInst *)inst;
-                IntrinsicCallId callId = call->getIntrinsicId();
-
-                if (callId == ArrayCopyDirect)
-                {
-                    cgInst = 
-                        instructionCallback.arraycopy(inst->getNumSrcOperands()-2, // omit taus
-                        genCallArgs(call,2) // omit taus
-                        );
-                } else if (callId == ArrayCopyReverse)
-                {
-                    cgInst = 
-                        instructionCallback.arraycopyReverse(inst->getNumSrcOperands()-2, // omit taus
-                        genCallArgs(call,2) // omit taus
-                        );
-                } else {
-
-                    cgInst = 
-                        instructionCallback.tau_callintr(inst->getNumSrcOperands()-2, // omit taus
-                        genCallArgs(call,2), // omit taus
-                        inst->getDst()->getType(),
-                        convertIntrinsicId(callId),
-                        getCGInst(tauNullChecked),
-                        getCGInst(tauTypesChecked));
-                }
-
+                                                  genCallArgs(inst, 3), // omit taus and fnAddr
+                                                  inst->getDst()->getType(),
+                                                  getCGInst(fnAddr),
+                                                  getCGInst(tauNullChecked),
+                                                  getCGInst(tauTypesChecked));
             }
             break;
         case Op_JitHelperCall:
             {
                 JitHelperCallInst* call = inst->asJitHelperCallInst();
                 JitHelperCallId callId = call->getJitHelperId();
-                cgInst = 
+                if (callId == ArrayCopyDirect || callId == ArrayCopyReverse)                
+                    cgInst = 
+                    instructionCallback.callhelper(inst->getNumSrcOperands()-2, // omit taus
+                                                   genCallArgs(call,2), // omit taus
+                                                   inst->getDst()->getType(),
+                                                   convertJitHelperId(callId));
+                else                    
+                    cgInst = 
                     instructionCallback.callhelper(inst->getNumSrcOperands(),
-                    genCallArgs(call,0),
-                    inst->getDst()->getType(),
-                    convertJitHelperId(callId));
+                                                   genCallArgs(call,0),
+                                                   inst->getDst()->getType(),
+                                                   convertJitHelperId(callId));
             }
             break;
         case Op_VMHelperCall:
@@ -912,9 +872,9 @@
                 VM_RT_SUPPORT callId = call->getVMHelperId();
                 cgInst = 
                     instructionCallback.callvmhelper(inst->getNumSrcOperands(),
-                    genCallArgs(call,0),
-                    inst->getDst()->getType(),
-                    callId);
+                                                     genCallArgs(call,0),
+                                                     inst->getDst()->getType(),
+                                                     callId);
             }
             break;
         case Op_Return:

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.h?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/CodeSelectors.h Sat Apr  5 03:58:31 2008
@@ -104,9 +104,6 @@
     //  Maps instruction to ConvertToIntOp::OverflowMod
     ConvertToIntOp::OverflowMod mapToIntConvertOvfMod(Inst *inst);
 
-    //  Maps intrinsic id
-    IntrinsicCallOp::Id convertIntrinsicId(IntrinsicCallId callId);
-
     JitHelperCallOp::Id convertJitHelperId(JitHelperCallId callId);
 
     CG_OpndHandle ** genCallArgs(Inst * call, uint32 arg0Pos);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FastArrayFilling.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FastArrayFilling.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FastArrayFilling.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/FastArrayFilling.cpp Sat Apr  5 03:58:31 2008
@@ -349,7 +349,7 @@
         // insert the helper.
         // this helper should be expanded in the code generator phase
         Inst* initInst = irManager.getInstFactory().makeJitHelperCall(
-            OpndManager::getNullOpnd(), FillArrayWithConst, 4, args);
+            OpndManager::getNullOpnd(), FillArrayWithConst, NULL, NULL, 4, args);
         prepNode->appendInst(initInst);
 
         fg.addEdge(prepNode, outEdge->getTargetNode());
@@ -357,5 +357,9 @@
     }
 }
 }
+
+
+
+
 
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.cpp Sat Apr  5 03:58:31 2008
@@ -25,6 +25,255 @@
 
 namespace Jitrino {
 
+bool arraycopyOptimizable(Inst* arraycopyCall, bool needWriteBarriers) {
+    //
+    //  an ArrayStoreException is thrown and the destination is not modified: 
+    //  
+    //  - The src argument refers to an object that is not an array. 
+    //  - The dest argument refers to an object that is not an array. 
+    //  - The src argument and dest argument refer to arrays whose component types are different primitive types. 
+    //  - The src argument refers to an array with a primitive component type and the dest argument
+    //    refers to an array with a reference component type. 
+    //  - The src argument refers to an array with a reference component type and the dest argument
+    //    refers to an array with a primitive component type. 
+    //
+    Opnd * src = arraycopyCall->getSrc(2);
+    Type * srcType = src->getType();
+    Opnd * dst = arraycopyCall->getSrc(4);
+    Type * dstType = dst->getType();
+    assert(srcType->isObject() &&
+           arraycopyCall->getSrc(3)->getType()->isInt4() && // 1 - srcPos
+           dstType->isObject() &&
+           arraycopyCall->getSrc(5)->getType()->isInt4() && // 3 - dstPos
+           arraycopyCall->getSrc(6)->getType()->isInt4());  // 4 - length
+
+    bool srcIsArray = srcType->isArray() && !srcType->isUnresolvedType();
+    bool dstIsArray = dstType->isArray() && !dstType->isUnresolvedType();
+
+    bool isOptimizable = true;
+
+    if ( srcIsArray && dstIsArray )  {
+        // these are arrays        
+
+        ArrayType* srcAsArrayType = srcType->asArrayType();
+        ArrayType* dstAsArrayType = dstType->asArrayType();
+        bool srcIsArrOfPrimitive = srcIsArray && VMInterface::isArrayOfPrimitiveElements(srcAsArrayType->getVMTypeHandle());
+        bool dstIsArrOfPrimitive = dstIsArray && VMInterface::isArrayOfPrimitiveElements(dstAsArrayType->getVMTypeHandle());
+
+        // are these primitive or reference arrays?
+        if ( srcIsArrOfPrimitive && dstIsArrOfPrimitive ) {
+            // both arrays are primitive
+
+            // if we are dealing with different primitive type arrays, reject optimization
+            // TODO: is that really necessary?
+            isOptimizable = (srcType == dstType); 
+
+        } else if ( srcIsArrOfPrimitive ^ dstIsArrOfPrimitive ) {
+            // arrays are mixed primitive and reference types
+            // reject optimization
+            isOptimizable = false;
+
+        } else {
+            // both arrays are reference
+
+            // if write barriers are enabled, reject optimization
+            // if not, check the types
+            if ( needWriteBarriers ) { 
+                isOptimizable = false;
+            } else {
+                // Here is some inaccuracy. If src is a subclass of dst there is no ASE for sure.
+                // If it is not, we should check the assignability of each element being copied.
+                // To avoid this we just reject the inlining of System::arraycopy call in this case.
+                NamedType* srcElemType = srcAsArrayType->getElementType();
+                NamedType* dstElemType = dstAsArrayType->getElementType();
+                isOptimizable = (srcElemType->getVMTypeHandle() == dstElemType->getVMTypeHandle());
+            }
+
+        }
+
+    } else {
+        // source or destination are not arrays
+        isOptimizable = false;
+    }
+
+    return isOptimizable;
+}
+
+
+void
+System_arraycopy_HLO_Handler::run()
+{
+    InstFactory&        instFactory = builder->getInstFactory();
+    ControlFlowGraph&   cfg         = builder->getControlFlowGraph();
+
+    Node* firstNode = callInst->getNode();
+    Edge* outEdge = firstNode->getOutEdge(Edge::Kind_Unconditional);
+    Node* exitNode = outEdge->getTargetNode();
+    Node* dispatch = firstNode->getExceptionEdgeTarget();
+    assert(dispatch);
+    callInst->unlink();
+    cfg.removeEdge(outEdge);
+
+    builder->setCurrentBCOffset(callInst->getBCOffset());
+    builder->setCurrentNode(firstNode);
+
+    // the fist two are tau operands
+    Opnd * src = callInst->getSrc(2);
+    Opnd * srcPos = callInst->getSrc(3);
+    Type * srcPosType = srcPos->getType();
+    Opnd * dst = callInst->getSrc(4);
+    Opnd * dstPos = callInst->getSrc(5);
+    Type * dstPosType = dstPos->getType();
+    Opnd * len = callInst->getSrc(6);
+
+    //
+    //  Generate exception condition checks:
+    //      chknull src
+    //      chknull dst
+    //      cmpbr srcPos < 0, boundsException
+    //      cmpbr dstPos < 0, boundsException
+    //      cmpbr len < 0, boundsException
+    //      srcEnd = add srcPos, len
+    //      srcLen = src.length
+    //      cmpbr srcEnd > srcLen, boundsException
+    //      dstEnd = add dstPos, len
+    //      dstLen = dst.length
+    //      cmpbr dstEnd > dstLen, boundsException
+    //  Skip trivial:
+    //      cmpbr (src == dst) && (dstPos == srcPos), Exit
+    //
+    //  Choose a direction:
+    //      cmpbr (dstPos > srcPos), Reverse
+    //
+    //  Direct:
+    //      JitHelperCall id=ArrayCopyDirect
+    //      goto Exit
+    //  Reverse:
+    //      srcPos = srcPos + len - 1
+    //      dstPos = dstPos + len - 1
+    //      JitHelperCall id=ArrayCopyReverse
+    //      goto Exit
+    //
+    //  boundsException:
+    //      chkbounds -1, src
+    //  Exit:
+    //
+
+    // Referenced nodes creation
+    LabelInst * reverseCopying = (LabelInst*)instFactory.makeLabel();
+    LabelInst * boundsException = (LabelInst*)instFactory.makeLabel();
+    LabelInst * Exit = (LabelInst*)exitNode->getLabelInst();
+
+    Node* BExcNode = cfg.createBlockNode(boundsException);
+    Node* RevCopyNode = cfg.createBlockNode(reverseCopying);
+
+    //Other nodes creation and filling
+    Opnd* tauSrcNullChecked = builder->genTauCheckNull(src);
+
+    // node
+    builder->genFallthroughNode(dispatch);
+    Opnd* tauDstNullChecked = builder->genTauCheckNull(dst);
+
+    // node
+    builder->genFallthroughNode();
+    builder->genEdgeFromCurrent(BExcNode, 0);
+
+    Opnd* tauNullCheckedRefArgs = builder->genTauAnd(tauSrcNullChecked, tauDstNullChecked);
+
+    Type * intType = builder->getTypeManager().getInt32Type();
+    Type::Tag intTag = intType->tag;
+
+    Opnd * zero = builder->genLdConstant(0);
+    builder->appendInst(instFactory.makeBranch(Cmp_GT,intTag,zero,srcPos,boundsException));
+
+    // node
+    builder->genFallthroughNode();
+    builder->genEdgeFromCurrent(BExcNode, 0);
+    builder->appendInst(instFactory.makeBranch(Cmp_GT,intTag,zero,dstPos,boundsException));
+
+    // node
+    builder->genFallthroughNode();
+    builder->genEdgeFromCurrent(BExcNode, 0);
+    builder->appendInst(instFactory.makeBranch(Cmp_GT,intTag,zero,len,boundsException));
+
+    Modifier mod = Modifier(Overflow_None)|Modifier(Exception_Never)|Modifier(Strict_No);
+
+    // node
+    builder->genFallthroughNode();
+    builder->genEdgeFromCurrent(BExcNode, 0);
+
+    Opnd * srcLen = builder->genArrayLen(intType, intTag, src, tauSrcNullChecked);
+    Opnd * srcEnd = builder->genAdd(intType,mod,srcPos,len);
+    builder->appendInst(instFactory.makeBranch(Cmp_GT,intTag,srcEnd,srcLen,boundsException));
+    
+    // node
+    builder->genFallthroughNode();
+    builder->genEdgeFromCurrent(BExcNode, 0);
+
+    Opnd * dstEnd = builder->genAdd(intType,mod,dstPos,len);
+    Opnd * dstLen = builder->genArrayLen(intType, intTag, dst, tauDstNullChecked);
+    builder->appendInst(instFactory.makeBranch(Cmp_GT,intTag,dstEnd,dstLen,boundsException));
+
+    // node
+    builder->genFallthroughNode();
+    builder->genEdgeFromCurrent(exitNode, 0);
+
+    // The case of same arrays and same positions
+    Opnd * diff = builder->genCmp3(intType,intTag,Cmp_GT,dstPos,srcPos);
+    Opnd * sameArrays = builder->genCmp(intType,Type::IntPtr,Cmp_EQ,src,dst);
+    Opnd * zeroDiff = builder->genCmp(intType,intTag,Cmp_EQ,diff,zero);
+    Opnd * nothingToCopy = builder->genAnd(intType,sameArrays,zeroDiff);
+    builder->appendInst(instFactory.makeBranch(Cmp_NonZero,intTag,nothingToCopy,Exit));
+
+    // node
+    builder->genFallthroughNode();
+    builder->genEdgeFromCurrent(RevCopyNode,0);
+
+    Opnd* tauTypesChecked = builder->genTauSafe();
+
+    // Choosing direction
+    builder->appendInst(instFactory.makeBranch(Cmp_GT,intTag,dstPos,srcPos,reverseCopying));
+
+    // Direct Copying
+    builder->genFallthroughNode();
+    builder->genEdgeFromCurrent(exitNode,0);
+
+    Opnd* directArgs [5];
+    directArgs[0] = src;
+    directArgs[1] = srcPos;
+    directArgs[2] = dst;
+    directArgs[3] = dstPos;
+    directArgs[4] = len;
+    builder->appendInst(instFactory.makeJitHelperCall(OpndManager::getNullOpnd(), ArrayCopyDirect,
+                                                      tauNullCheckedRefArgs, tauTypesChecked,
+                                                      5, directArgs));
+
+    // Reverse Copying
+    builder->setCurrentNode(RevCopyNode);
+    builder->genEdgeFromCurrent(exitNode);
+
+    Opnd* one = builder->genLdConstant(1);
+    Opnd* lastSrcIdx = builder->genSub(srcPosType,mod,srcEnd,one);
+    Opnd* lastDstIdx = builder->genSub(dstPosType,mod,dstEnd,one);
+
+    Opnd* reverseArgs [5];
+    reverseArgs[0] = src;
+    reverseArgs[1] = lastSrcIdx;  // srcPos+len-1
+    reverseArgs[2] = dst;
+    reverseArgs[3] = lastDstIdx;  // dstPos+len-1
+    reverseArgs[4] = len;
+    builder->appendInst(instFactory.makeJitHelperCall(OpndManager::getNullOpnd(), ArrayCopyReverse,
+                                                      tauNullCheckedRefArgs, tauTypesChecked,
+                                                      5, reverseArgs));
+
+    // Bounds Exception
+    builder->setCurrentNode(BExcNode);
+    builder->genEdgeFromCurrent(exitNode);
+    builder->genEdgeFromCurrent(dispatch, 0);
+    Opnd* minusone = builder->genLdConstant(-1);
+    builder->genTauCheckBounds(src,minusone,tauSrcNullChecked);
+}
+
 void
 String_compareTo_HLO_Handler::run()
 {
@@ -110,7 +359,7 @@
     Opnd* opnds[] = {thisValue,thisStart,thisLength,trgtValue,trgtStart,trgtLength,counter};
 
     // This helper call will be processed in Ia32ApiMagics pass
-    builder->appendInst(instFactory.makeJitHelperCall(dst, StringCompareTo, 7, opnds));
+    builder->appendInst(instFactory.makeJitHelperCall(dst, StringCompareTo, NULL, NULL, 7, opnds));
 
     cfg.orderNodes(true);
 }
@@ -214,7 +463,7 @@
     VarOpnd* resultVar = builder->createVarOpnd(dst->getType(),false);
     SsaVarOpnd* resVar = builder->createSsaVarOpnd(resultVar);
     Opnd* res = builder->createOpnd(dst->getType());
-    builder->appendInst(instFactory.makeJitHelperCall(res, StringRegionMatches, 5, opnds));
+    builder->appendInst(instFactory.makeJitHelperCall(res, StringRegionMatches, NULL, NULL, 5, opnds));
     builder->genStVar(resVar,res);
     builder->genEdgeFromCurrent(lastNode);
 
@@ -293,13 +542,13 @@
     // prefetch String objects
     Opnd * voidDst = builder->createOpnd(irm->getTypeManager().getVoidType());
     Opnd* prefetchThis[] = {thisStr, imm128, imm64};
-    builder->appendInst(instFactory.makeJitHelperCall(voidDst, Prefetch, 3, prefetchThis));
+    builder->appendInst(instFactory.makeJitHelperCall(voidDst, Prefetch, NULL, NULL, 3, prefetchThis));
 
     // node
     builder->genFallthroughNode(dispatch);
     
     Opnd* prefetchTrgt[] = {trgtStr, imm128, imm64};
-    builder->appendInst(instFactory.makeJitHelperCall(voidDst, Prefetch, 3, prefetchTrgt));
+    builder->appendInst(instFactory.makeJitHelperCall(voidDst, Prefetch, NULL, NULL, 3, prefetchTrgt));
 
     Opnd* thisLength = builder->genLdField(fieldCountDesc, thisStr, tauThisNullChecked, tauThisInRange);
     Opnd* trgtLength = builder->genLdField(fieldCountDesc, trgtStr, tauTrgtNullChecked, tauTrgtInRange);
@@ -315,20 +564,20 @@
 
     // prefetch character arrays
     Opnd* prefetchThisValue[] = {thisValue, imm128, imm64};
-    builder->appendInst(instFactory.makeJitHelperCall(voidDst, Prefetch, 3, prefetchThisValue));
+    builder->appendInst(instFactory.makeJitHelperCall(voidDst, Prefetch, NULL, NULL, 3, prefetchThisValue));
 
     // node
     builder->genFallthroughNode(dispatch);
     
     Opnd* prefetchTrgtValue[] = {trgtValue, imm128, imm64};
-    builder->appendInst(instFactory.makeJitHelperCall(voidDst, Prefetch, 3, prefetchTrgtValue));
+    builder->appendInst(instFactory.makeJitHelperCall(voidDst, Prefetch, NULL, NULL, 3, prefetchTrgtValue));
 
     // node
     builder->genFallthroughNode(dispatch);
 
     Opnd* opnds[] = {thisValue, thisOffset, thisLength, trgtValue, trgtOffset, trgtLength, start};
     // This helper call will be processed in Ia32ApiMagics pass
-    builder->appendInst(instFactory.makeJitHelperCall(dst, StringIndexOf, 7, opnds));
+    builder->appendInst(instFactory.makeJitHelperCall(dst, StringIndexOf, NULL, NULL, 7, opnds));
 
     builder->genEdgeFromCurrent(lastNode);
 
@@ -358,6 +607,7 @@
 void
 HLOAPIMagicIRBuilder::appendInst(Inst* inst) {
     inst->setBCOffset(currentBCOffset);
+    assert(currentNode);
     currentNode->appendInst(inst);
 }
 
@@ -463,7 +713,6 @@
     return dst;
 }
 
-
 Opnd*
 HLOAPIMagicIRBuilder::genLdConstant(int32 val) {
     Opnd* dst = createOpnd(typeManager.getInt32Type());
@@ -522,7 +771,7 @@
 
 Opnd*
 HLOAPIMagicIRBuilder::genTauCheckBounds(Opnd* array, Opnd* index, Opnd *tauNullChecked) {
-    Opnd *tauArrayTypeChecked = genTauHasType(array, array->getType());
+    Opnd* tauArrayTypeChecked = genTauHasType(array, array->getType());
     Opnd* arrayLen = genTauArrayLen(typeManager.getInt32Type(), Type::Int32, array, 
                                     tauNullChecked, tauArrayTypeChecked);
 
@@ -541,21 +790,6 @@
 HLOAPIMagicIRBuilder::genTauHasType(Opnd *src, Type *castType) {
     Opnd* dst = createOpnd(typeManager.getTauType());
     appendInst(instFactory.makeTauHasType(dst, src, castType));
-    return dst;
-}
-
-Opnd*
-HLOAPIMagicIRBuilder::genIntrinsicCall(IntrinsicCallId intrinsicId,
-                            Type* returnType,
-                            Opnd* tauNullCheckedRefArgs,
-                            Opnd* tauTypesChecked,
-                            uint32 numArgs,
-                            Opnd*  args[]) {
-    Opnd * dst = createOpnd(returnType);
-    appendInst(instFactory.makeIntrinsicCall(dst, intrinsicId, 
-                                             tauNullCheckedRefArgs,
-                                             tauTypesChecked,
-                                             numArgs, args));
     return dst;
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.h?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/HLOAPIMagics.h Sat Apr  5 03:58:31 2008
@@ -55,7 +55,7 @@
     uint16 getCurrentBCOffset() {return currentBCOffset;}
     void   setCurrentBCOffset(uint16 offset) {currentBCOffset = offset;}
 
-    void  genEdgeFromCurrent(Node* target) {cfg.addEdge(currentNode, target);}
+    void  genEdgeFromCurrent(Node* target, double edgeProb = 1.0) {cfg.addEdge(currentNode, target, edgeProb);}
     void  genEdgeToCurrent(Node* source) {cfg.addEdge(source,currentNode);}
 
     Node* genNodeAfter(Node* node, LabelInst* label, Node* dispatch=NULL);
@@ -87,8 +87,6 @@
     Opnd* genTauCheckBounds(Opnd* array, Opnd* index, Opnd *tauNullChecked);
     Opnd* genTauCheckBounds(Opnd* ub, Opnd *index);
     Opnd* genTauHasType(Opnd *src, Type *castType);
-    Opnd* genIntrinsicCall(IntrinsicCallId intrinsicId, Type* returnType, Opnd* tauNullCheckedRefArgs,
-                           Opnd* tauTypesChecked, uint32 numArgs, Opnd*  args[]);
 
 private:
     IRManager*          irm;
@@ -126,12 +124,15 @@
     virtual void run();\
 };\
 
+DECLARE_HLO_MAGIC_INLINER(System_arraycopy_HLO_Handler);
 DECLARE_HLO_MAGIC_INLINER(String_compareTo_HLO_Handler);
 DECLARE_HLO_MAGIC_INLINER(String_regionMatches_HLO_Handler);
 DECLARE_HLO_MAGIC_INLINER(String_indexOf_HLO_Handler);
 
 DEFINE_SESSION_ACTION(HLOAPIMagicSession, hlo_api_magic, "APIMagics HLO Pass")
 
+bool arraycopyOptimizable(Inst* arraycopyCall, bool needWriteBarriers);
+
 void
 HLOAPIMagicSession::_run(IRManager& irm)
 {
@@ -153,6 +154,12 @@
                 const char* className = md->getParentType()->getName();
                 const char* methodName = md->getName();
                 const char* signature = md->getSignatureString();
+                if (!strcmp(className, "java/lang/System")) {
+                    if (!strcmp(methodName, "arraycopy") && !strcmp(signature, "(Ljava/lang/Object;ILjava/lang/Object;II)V")) {
+                        if(getBoolArg("System_arraycopy_as_magic", true) && arraycopyOptimizable(callInst, irm.getCompilationInterface().needWriteBarriers()))
+                            handlers.push_back(new (mm) System_arraycopy_HLO_Handler(callInst));
+                    }
+                }
                 if (!strcmp(className, "java/lang/String")) {
                     if (!strcmp(methodName, "compareTo") && !strcmp(signature, "(Ljava/lang/String;)I")) {
                         if(getBoolArg("String_compareTo_as_magic", true))

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.cpp Sat Apr  5 03:58:31 2008
@@ -940,7 +940,7 @@
     }
     if (!dst) {
         dst = createOpnd(dstType);
-	Inst* inst = instFactory->makeConv(ovfMod, toType, dst, src);
+        Inst* inst = instFactory->makeConv(ovfMod, toType, dst, src);
         appendInst(inst);
     }
     insertHash(hashcode, src->getId(), dst->getInst());
@@ -992,7 +992,7 @@
     }
     if (!dst) {
         dst = createOpnd(dstType);
-	Inst* inst = instFactory->makeConvZE(ovfMod, toType, dst, src);
+        Inst* inst = instFactory->makeConvZE(ovfMod, toType, dst, src);
         appendInst(inst);
     }
     insertHash(hashcode, src->getId(), dst->getInst());
@@ -1404,44 +1404,30 @@
 }
 
 Opnd*
-IRBuilder::genIntrinsicCall(IntrinsicCallId intrinsicId,
+IRBuilder::genJitHelperCall(JitHelperCallId helperId,
                             Type* returnType,
-                            Opnd* tauNullCheckedRefArgs,
-                            Opnd* tauTypesChecked,
                             uint32 numArgs,
                             Opnd*  args[]) {
     for (uint32 i=0; i<numArgs; i++) {
         args[i] = propagateCopy(args[i]);
     }
     Opnd * dst = createOpnd(returnType);
-    tauNullCheckedRefArgs = propagateCopy(tauNullCheckedRefArgs);
-    if (!tauTypesChecked) {
-        assert(intrinsicId == CharArrayCopy);
-        Opnd *tauTypesCheckedSrc = genTauHasType(args[0], args[0]->getType());
-        Opnd *tauTypesCheckedDst = genTauHasType(args[2], args[2]->getType());
-        tauTypesChecked = genTauAnd(tauTypesCheckedSrc,
-                                    tauTypesCheckedDst);
-    } else {
-        tauTypesChecked = propagateCopy(tauTypesChecked);
-    }
-
-    appendInst(instFactory->makeIntrinsicCall(dst, intrinsicId, 
-                                             tauNullCheckedRefArgs,
-                                             tauTypesChecked,
-                                             numArgs, args));
+    appendInst(instFactory->makeJitHelperCall(dst, helperId, NULL, NULL, numArgs, args));
     return dst;
 }
 
 Opnd*
 IRBuilder::genJitHelperCall(JitHelperCallId helperId,
                             Type* returnType,
+                            Opnd* tauNullCheckedRefArgs,
+                            Opnd* tauTypesChecked,
                             uint32 numArgs,
                             Opnd*  args[]) {
     for (uint32 i=0; i<numArgs; i++) {
         args[i] = propagateCopy(args[i]);
     }
     Opnd * dst = createOpnd(returnType);
-    appendInst(instFactory->makeJitHelperCall(dst, helperId, numArgs, args));
+    appendInst(instFactory->makeJitHelperCall(dst, helperId, tauNullCheckedRefArgs, tauTypesChecked, numArgs, args));
     return dst;
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/IRBuilder.h Sat Apr  5 03:58:31 2008
@@ -156,23 +156,21 @@
                                  uint32 numArgs,
                                   Opnd* args[]);
 
-    Opnd*  genIntrinsicCall(
-                        IntrinsicCallId intrinsicId, //TR
-                                  Type* returnType,
-                                  Opnd* tauNullCheckedRefArgs, // 0 for unsafe
-                                  Opnd* tauTypesChecked,       // 0 to let IRBuilder find it
-                                 uint32 numArgs,
-                                  Opnd*  args[]);
-
     Opnd*  genJitHelperCall(JitHelperCallId helperId,
-                                  Type* returnType,
-                                  uint32 numArgs,
-                                  Opnd*  args[]);
-
-    Opnd*  genVMHelperCall(VM_RT_SUPPORT helperId,
                             Type* returnType,
                             uint32 numArgs,
                             Opnd*  args[]);
+    Opnd*  genJitHelperCall(JitHelperCallId helperId,
+                            Type* returnType,
+                            Opnd* tauNullCheckedRefArgs,
+                            Opnd* tauTypesChecked,
+                            uint32 numArgs,
+                            Opnd*  args[]);
+
+    Opnd*  genVMHelperCall(VM_RT_SUPPORT helperId,
+                           Type* returnType,
+                           uint32 numArgs,
+                           Opnd*  args[]);
 
     
     void       genReturn(Opnd* src, Type* retType);//TR

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp Sat Apr  5 03:58:31 2008
@@ -440,26 +440,6 @@
     }
 }
 
-void IntrinsicCallInst::handlePrintEscape(::std::ostream& os, char code) const {
-    switch(code) {
-    case 'd':
-        switch(intrinsicId) {
-        case CharArrayCopy:
-            os << "charArrayCopy"; break;
-        case ArrayCopyDirect:
-            os << "ArrayCopyDirect"; break;
-        case ArrayCopyReverse:
-            os << "ArrayCopyReverse"; break;
-        default:
-            assert(0); break;
-        }
-        break;
-    default:
-        Inst::handlePrintEscape(os, code);
-        break;
-    }
-}
-
 void JitHelperCallInst::handlePrintEscape(::std::ostream& os, char code) const {
     switch(code) {
     case 'd':
@@ -480,6 +460,10 @@
         os << "AddValueProfileValue"; break;
     case FillArrayWithConst:
         os << "FillArrayWithConst"; break;
+    case ArrayCopyDirect:
+        os << "ArrayCopyDirect"; break;
+    case ArrayCopyReverse:
+        os << "ArrayCopyReverse"; break;
     case StringCompareTo:
         os << "StringCompareTo"; break;
     case StringIndexOf:
@@ -644,9 +628,6 @@
     void accept(CatchLabelInst* inst) {
         clone = instFactory.makeClone(inst, opndManager, renameTable);
     }
-    void accept(IntrinsicCallInst* inst) {
-        clone = instFactory.makeClone(inst, opndManager, renameTable);
-    }
     void accept(JitHelperCallInst* inst) {
         clone = instFactory.makeClone(inst, opndManager, renameTable);
     }
@@ -1071,25 +1052,6 @@
     return newInst;
 }
 
-IntrinsicCallInst*
-InstFactory::makeClone(IntrinsicCallInst* inst,
-                       OpndManager& opndManager,
-                       OpndRenameTable& table) {
-    uint32 nsrcs = inst->getNumSrcOperands();
-    Opnd** newArgs = new (memManager) Opnd*[nsrcs];
-    for (uint32 i=0; i<nsrcs; i++)
-        newArgs[i] = table.rename(inst->getSrc(i));
-    IntrinsicCallInst *newInst = makeIntrinsicCallInst(inst->getOpcode(),
-                                 inst->getModifier(),
-                                 inst->getType(),
-                                 table.duplicate(opndManager, inst->getDst()),
-                                 nsrcs,
-                                 newArgs,
-                                 inst->getIntrinsicId());
-    newInst->setPersistentInstructionId(inst->getPersistentInstructionId());
-    return newInst;
-}
-
 JitHelperCallInst*
 InstFactory::makeClone(JitHelperCallInst* inst,
                        OpndManager& opndManager,
@@ -1605,19 +1567,6 @@
     return inst;
 }
 
-IntrinsicCallInst* 
-InstFactory::makeIntrinsicCallInst(Opcode op, Modifier mod,
-                                 Type::Tag type,
-                                 Opnd* dst,
-                                 uint32 nArgs,
-                                 Opnd** args_,
-                                 IntrinsicCallId id) {
-    IntrinsicCallInst * inst = 
-        new (memManager) IntrinsicCallInst(op, mod, type, dst, nArgs, args_, id);
-    inst->id       = numInsts++;
-    return inst;
-}
-
 JitHelperCallInst* 
 InstFactory::makeJitHelperCallInst(Opcode op,
                                     Modifier mod,
@@ -2050,24 +1999,18 @@
 }
 
 Inst*
-InstFactory::makeIntrinsicCall(Opnd* dst, 
-                               IntrinsicCallId id,
-                               Opnd* tauNullChecked,
-                               Opnd* tauTypesChecked,
-                               uint32 numArgs, 
-                               Opnd** args) {
-    assert(tauNullChecked->getType()->tag == Type::Tau);
-    assert(tauTypesChecked->getType()->tag == Type::Tau);
-    Type::Tag returnType = dst->isNull()? Type::Void : dst->getType()->tag;
-    args = copyOpnds(tauNullChecked, tauTypesChecked, args, numArgs);
-    return makeIntrinsicCallInst(Op_IntrinsicCall, Modifier(Exception_Sometimes), 
-                                 returnType, dst, numArgs+2, args, id);
-}
-
-Inst*
-InstFactory::makeJitHelperCall(Opnd* dst, JitHelperCallId id, uint32 numArgs, Opnd** args) {
+InstFactory::makeJitHelperCall(Opnd* dst, JitHelperCallId id,
+                               Opnd* tauNullChecked, Opnd* tauTypesChecked,
+                               uint32 numArgs, Opnd** args)
+{
     Type::Tag returnType = dst->isNull()? Type::Void : dst->getType()->tag;
-    args = copyOpnds(args, numArgs);
+    if (id == ArrayCopyDirect || id == ArrayCopyReverse) // these three need taus
+    {
+        args = copyOpnds(tauNullChecked, tauTypesChecked, args, numArgs);
+        numArgs = numArgs+2;
+    } else {
+        args = copyOpnds(args, numArgs);
+    }
     Modifier mod;
     switch(id) {
         case StringCompareTo:
@@ -2726,7 +2669,6 @@
     case Op_TauVirtualCall:        return caseTauVirtualCall(inst->asMethodCallInst());
     case Op_IndirectCall:       return caseIndirectCall(inst->asCallInst());
     case Op_IndirectMemoryCall: return caseIndirectMemoryCall(inst->asCallInst());
-    case Op_IntrinsicCall:      return caseIntrinsicCall(inst->asIntrinsicCallInst());
     case Op_JitHelperCall:      return caseJitHelperCall(inst->asJitHelperCallInst());
     case Op_VMHelperCall:       return caseVMHelperCall(inst->asVMHelperCallInst());
     case Op_Return:             return caseReturn(inst);

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h?rev=645073&r1=645072&r2=645073&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.h Sat Apr  5 03:58:31 2008
@@ -69,7 +69,6 @@
 class   TokenInst;
 class   LinkingExcInst;
 class   CallInst;
-class   IntrinsicCallInst;
 class   JitHelperCallInst;
 class   VMHelperCallInst;
 class   PhiInst;
@@ -89,7 +88,6 @@
     virtual void accept(CatchLabelInst*) = 0;
     virtual void accept(ConstInst*) = 0;
     virtual void accept(DispatchLabelInst*) = 0;
-    virtual void accept(IntrinsicCallInst*) = 0;
     virtual void accept(JitHelperCallInst*) = 0;
     virtual void accept(VMHelperCallInst*) = 0;
     virtual void accept(FieldAccessInst*) = 0;
@@ -199,9 +197,6 @@
     FieldAccessInst* asFieldAccessInst() const {
         if (isFieldAccess()) return (FieldAccessInst*)this; else return NULL;
     }
-    IntrinsicCallInst* asIntrinsicCallInst() const {
-        if (isIntrinsicCallInst()) return (IntrinsicCallInst*) this; else return NULL;
-    }
     JitHelperCallInst* asJitHelperCallInst() const {
         if (isJitHelperCallInst()) return (JitHelperCallInst*) this; else return NULL;
     }
@@ -256,7 +251,6 @@
     virtual bool isConst() const { return false; };
     virtual bool isDispatchLabel() const { return false; };
     virtual bool isFieldAccess() const { return false; };
-    virtual bool isIntrinsicCallInst() const { return false; };
     virtual bool isJitHelperCallInst() const { return false; };
     virtual bool isVMHelperCallInst() const { return false; };
     virtual bool isMethodCall() const { return false; };
@@ -939,40 +933,6 @@
     Opnd**    args;
 };
 
-// intrinsic calls
-class IntrinsicCallInst : public Inst {
-public:
-    void visit(InstFormatVisitor& visitor)  {visitor.accept(this);}
-    bool isIntrinsicCallInst() const { return true; }
-    IntrinsicCallId getIntrinsicId() const {return intrinsicId;}
-private:
-    virtual void handlePrintEscape(::std::ostream&, char code) const;
-    friend class InstFactory;
-    IntrinsicCallInst(Opcode op, Modifier mod,
-                      Type::Tag type,
-                      Opnd* dst,
-                      uint32 nArgs,
-                      Opnd** args_,
-                      IntrinsicCallId intr) : Inst(op, mod, type, dst, nArgs),
-                                              intrinsicId(intr) {
-        args = NULL;
-        switch (nArgs) {
-        default:    args = args_ + MAX_INST_SRCS;
-        case 2:     srcs[1] = args_[1];
-        case 1:     srcs[0] = args_[0];
-        case 0:     break;
-        }
-    }
-    Opnd* getSrcExtended(uint32 srcIndex) const {
-        return args[srcIndex - MAX_INST_SRCS];
-    }
-    void  setSrcExtended(uint32 srcIndex, Opnd* src) {
-        args[srcIndex - MAX_INST_SRCS] = src;
-    }
-    Opnd**    args;
-    IntrinsicCallId intrinsicId;
-};
-
 // JIT helper calls
 class JitHelperCallInst : public Inst {
 public:
@@ -1133,10 +1093,9 @@
                                     Opnd *tauNullCheckedFirstArg, 
                                     Opnd *tauTypesChecked,
                                     uint32 numArgs, Opnd** args);
-    Inst*    makeIntrinsicCall(Opnd* dst, IntrinsicCallId id, 
+    Inst*    makeJitHelperCall(Opnd* dst, JitHelperCallId id, 
                                Opnd* tauNullChecked, Opnd* tauTypesChecked, 
                                uint32 numArgs, Opnd** args);
-    Inst*    makeJitHelperCall(Opnd* dst, JitHelperCallId id, uint32 numArgs, Opnd** args);
     Inst*    makeVMHelperCall(Opnd* dst, VM_RT_SUPPORT id, uint32 numArgs,
                                Opnd** args);
     
@@ -1347,7 +1306,6 @@
     MethodInst*         makeClone(MethodInst*, OpndManager&, OpndRenameTable&);
     MethodCallInst*     makeClone(MethodCallInst*, OpndManager&, OpndRenameTable&);
     CallInst*           makeClone(CallInst*, OpndManager&, OpndRenameTable&);
-    IntrinsicCallInst*  makeClone(IntrinsicCallInst*, OpndManager&, OpndRenameTable&);
     JitHelperCallInst*  makeClone(JitHelperCallInst*, OpndManager&, OpndRenameTable&);
     VMHelperCallInst*   makeClone(VMHelperCallInst*, OpndManager&, OpndRenameTable&);
     PhiInst*            makeClone(PhiInst*, OpndManager&, OpndRenameTable&);
@@ -1499,13 +1457,6 @@
                            Opnd* ptr,
                            uint32 nArgs,
                            Opnd** args);
-    IntrinsicCallInst* makeIntrinsicCallInst(Opcode op, 
-                                             Modifier mod,
-                                             Type::Tag,
-                                             Opnd* dst,
-                                             uint32 nArgs,
-                                             Opnd** args_,
-                                             IntrinsicCallId id);
     JitHelperCallInst* makeJitHelperCallInst(Opcode op, 
                                              Modifier mod,
                                              Type::Tag,
@@ -1654,9 +1605,6 @@
     caseIndirectMemoryCall(CallInst* inst)=0;//{return caseDefault(inst);}
 
     virtual Inst*
-    caseIntrinsicCall(IntrinsicCallInst* inst)=0;//{return caseDefault(inst);}
-
-    virtual Inst*
     caseJitHelperCall(JitHelperCallInst* inst)=0;//{return caseDefault(inst);}
 
     virtual Inst*
@@ -2039,5 +1987,10 @@
 } //namespace Jitrino 
 
 #endif // _INST_H_
+
+
+
+
+
 
 



Mime
View raw message