Index: vm/jitrino/src/codegenerator/ia32/Ia32GCMap.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32GCMap.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32GCMap.cpp (working copy) @@ -133,9 +133,10 @@ } else if (opnd->getMemOpndKind() == MemOpndKind_StackAutoLayout) { const Opnd* displOpnd = opnd->getMemOpndSubOpnd(MemOpndSubOpndKind_Displacement); assert(displOpnd!=NULL); + assert(0 == (0xFFFFFFFF80000000 & (int64)displOpnd->getImmValue())); int offset_from_esp0 = (int)displOpnd->getImmValue(); //opnd saving offset from the esp on method call int inst_offset_from_esp0 = (int)inst->getStackDepth(); - POINTER_SIZE_INT ptrToAddrOffset = inst_offset_from_esp0 + offset_from_esp0; //opnd saving offset from the esp on inst + int ptrToAddrOffset = inst_offset_from_esp0 + offset_from_esp0; //opnd saving offset from the esp on inst gcOpnd = new (mm) GCSafePointOpnd(isObject, false, ptrToAddrOffset, offset); } else { assert(opnd->getMemOpndKind() == MemOpndKind_Heap); @@ -185,8 +186,8 @@ POINTER_SIZE_INT GCMap::getByteSize() const { POINTER_SIZE_INT slotSize = sizeof(POINTER_SIZE_INT); POINTER_SIZE_INT size = slotSize/*byte number */ + slotSize/*number of safepoints*/ - + slotSize*gcSafePoints.size()/*space to save safepoints sizes*/; - for (int i=0, n = gcSafePoints.size(); igetUint32Size(); } @@ -216,7 +217,7 @@ void GCMap::write(Byte* output) { POINTER_SIZE_INT* data = (POINTER_SIZE_INT*)output; data[0] = getByteSize(); - data[1] = gcSafePoints.size(); + data[1] = (POINTER_SIZE_INT)gcSafePoints.size(); POINTER_SIZE_INT offs = 2; #ifdef GCMAP_TRACK_IDS @@ -226,7 +227,7 @@ std::sort(gcSafePoints.begin(), gcSafePoints.end(), hwecompare()); #endif - for (int i=0, n = gcSafePoints.size(); igetUint32Size(); data[offs++] = siteUint32Size; @@ -261,9 +262,9 @@ gcOpnds.reserve(nOpnds); POINTER_SIZE_INT offs = 2; for (uint32 i = 0; i< nOpnds; i++, offs+=3) { - GCSafePointOpnd* gcOpnd= new (mm) GCSafePointOpnd(image[offs], int(image[offs+1]), int32(image[offs+2])); + GCSafePointOpnd* gcOpnd= new (mm) GCSafePointOpnd(uint32(image[offs]), int(image[offs+1]), int32(image[offs+2])); #ifdef GCMAP_TRACK_IDS - gcOpnd->firstId = image[offs+3]; + gcOpnd->firstId = uint32(image[offs+3]); offs++; #endif gcOpnds.push_back(gcOpnd); @@ -275,7 +276,7 @@ } POINTER_SIZE_INT GCSafePoint::getUint32Size() const { - POINTER_SIZE_INT size = 1/*ip*/+1/*nOpnds*/+GCSafePointOpnd::IMAGE_SIZE_UINT32 * gcOpnds.size()/*opnds images*/; + POINTER_SIZE_INT size = 1/*ip*/+1/*nOpnds*/+GCSafePointOpnd::IMAGE_SIZE_UINT32 * (POINTER_SIZE_INT)gcOpnds.size()/*opnds images*/; #ifdef GCMAP_TRACK_IDS size++; //instId size++; //hardwareExceptionPoint @@ -286,8 +287,8 @@ void GCSafePoint::write(POINTER_SIZE_INT* data) const { POINTER_SIZE_INT offs=0; data[offs++] = ip; - data[offs++] = gcOpnds.size(); - for (uint32 i = 0, n = gcOpnds.size(); iflags; data[offs+1] = gcOpnd->val; @@ -312,17 +313,11 @@ #ifdef GCMAP_TRACK_IDS assert(cond); #else -#if defined(WIN32) && !defined(_EM64T_) - if (!cond) { - __asm { - int 3; - } +#ifdef _WIN32 // any windows + if (!cond) { + DebugBreak(); } #endif -#if defined (_EM64T_) && defined(_WIN64) - // TODO: add proper code - assert(0); -#endif #endif } @@ -349,7 +344,7 @@ //In this case it's impossible to derive valid base for mptr with unknown offset. //1. Derive all offsets. Use GCSafePointOpnd.mptrOffset to store the result. - for (uint32 i=0, n = gcOpnds.size(); iisObject() || gcOpnd->getMPtrOffset()!=MPTR_OFFSET_UNKNOWN) { @@ -389,7 +384,7 @@ } //2. Report the results - for (uint32 i=0, n = gcOpnds.size(); iisObject()) { @@ -424,7 +419,7 @@ } else { assert(gcOpnd->isOnStack()); #ifdef _EM64T_ - addr = ctx->rsp + gcOpnd->getDistFromInstESP(); + addr = ctx->rsp + (POINTER_SIZE_INT)gcOpnd->getDistFromInstESP(); #else addr = ctx->esp + gcOpnd->getDistFromInstESP(); #endif @@ -464,7 +459,7 @@ */ // Compute stack information - uint32 stackInfoSize = StackInfo::getByteSize(methodDesc); + uint32 stackInfoSize = (uint32)StackInfo::getByteSize(methodDesc); Byte* infoBlock = methodDesc->getInfoBlock(); Byte* gcBlock = infoBlock + stackInfoSize; #ifdef _EM64T_ @@ -516,10 +511,10 @@ inlineInfo->write(compIntf.allocateJITDataBlock(inlineInfo->computeSize(), 8)); } - uint32 stackInfoSize = stackInfo->getByteSize(); - uint32 gcInfoSize = gcMap->getByteSize(); - uint32 bcMapSize = bcMap->getByteSize(); // we should write at least the size of map in the info block - assert(bcMapSize >= sizeof(POINTER_SIZE_INT)); // so bcMapSize should be more than 4 for ia32 + uint32 stackInfoSize = (uint32)stackInfo->getByteSize(); + uint32 gcInfoSize = (uint32)gcMap->getByteSize(); + uint32 bcMapSize = (uint32)bcMap->getByteSize(); // we should write at least the size of map in the info block + assert(bcMapSize >= sizeof(POINTER_SIZE_INT)); // so bcMapSize should be more than 4 for ia32 Byte* infoBlock = compIntf.allocateInfoBlock(stackInfoSize + gcInfoSize + bcMapSize); stackInfo->write(infoBlock); Index: vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (working copy) @@ -51,7 +51,7 @@ { assert(str!=NULL); if (length==EmptyUint32) - length=strlen(str); + length=(uint32)strlen(str); char * psz=new(mm) char[length+1]; strncpy(psz, str, length); psz[length]=0; @@ -82,7 +82,7 @@ { assert(opnd->id>=opnds.size()); opnds.push_back(opnd); - opnd->id=opnds.size()-1; + opnd->id=(uint32)opnds.size()-1; } //_____________________________________________________________________________________________ @@ -152,7 +152,7 @@ if (str==NULL) str=""; return new(memoryManager) ConstantAreaItem( - ConstantAreaItem::Kind_InternalStringConstantAreaItem, strlen(str)+1, + ConstantAreaItem::Kind_InternalStringConstantAreaItem, (uint32)strlen(str)+1, (void*)newInternalString(str) ); } @@ -638,15 +638,15 @@ assert(opnd->getType()->isObject() || opnd->getType()->isManagedPtr()); } #endif - GCInfoPseudoInst* inst = new(memoryManager, basesAndMptrs.size()) GCInfoPseudoInst(this, instId++); + GCInfoPseudoInst* inst = new(memoryManager, (uint32)basesAndMptrs.size()) GCInfoPseudoInst(this, instId++); Opnd ** opnds = inst->getOpnds(); Constraint * constraints = inst->getConstraints(); - for (uint32 i = 0, n = basesAndMptrs.size(); i < n; i++){ + for (uint32 i = 0, n = (uint32)basesAndMptrs.size(); i < n; i++){ Opnd * opnd = basesAndMptrs[i]; opnds[i] = opnd; constraints[i] = Constraint(OpndKind_Any, opnd->getSize()); } - inst->opndCount = basesAndMptrs.size(); + inst->opndCount = (uint32)basesAndMptrs.size(); inst->assignOpcodeGroup(this); return inst; } @@ -1391,7 +1391,7 @@ uint32 IRManager::calculateOpndStatistics(bool reindex) { POpnd * arr=&opnds.front(); - for (uint32 i=0, n=opnds.size(); igetOpnds(); #ifdef _EM64T_ unsigned sz = 0; - for (uint32 i=0, n=stackOpndInfos.size(); igetCallingConventionClient().getCallingConvention()->pushLastToFirst()?i:n-1-i; Inst * pushInst=newCopyPseudoInst(Mnemonic_PUSH, opnds[stackOpndInfos[index].opndIndex]); @@ -1954,7 +1954,7 @@ /** The value of the operand is the address where the interned version of the string is stored*/ { MethodDesc* mDesc = (MethodDesc*)info->getValue(0); - POINTER_SIZE_INT token = (POINTER_SIZE_INT)info->getValue(1); + uint32 token = (uint32)info->getValue(1); value = (POINTER_SIZE_INT) compilationInterface.loadStringObject(mDesc,token); }break; case Opnd::RuntimeInfo::Kind_StaticFieldAddress: Index: vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp (working copy) @@ -279,10 +279,10 @@ } else if (line.find("Counter.") == 0) { if(!opened) { opened = true; - num = config->counters.size(); + num = (int)config->counters.size(); config->counters.push_back(Counter()); - int pos1 = line.find("."); - int pos2 = line.find_first_of(".=" , pos1+1); + int pos1 = (int)line.find("."); + int pos2 = (int)line.find_first_of(".=" , pos1+1); config->counters[num].name = line.substr(pos1+1, pos2-pos1-1); } @@ -623,7 +623,7 @@ InternalProfilerAct& storage = *static_cast(getAction()); storage.statistics->push_back(ms); //method external properties, no need to count - uint32 cSize = storage.config->counters.size(); + uint32 cSize = (uint32)storage.config->counters.size(); if (!cSize) return; ms->bbStats[-1].counters= new(mm) uint32[cSize]; Index: vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32StackInfo.cpp (working copy) @@ -361,7 +361,7 @@ } } } - hashTableSize = stackDepthInfo->size(); + hashTableSize = (uint32)stackDepthInfo->size(); } void StackInfo::setMethodExitString(IRManager& irm) Index: vm/jitrino/src/codegenerator/ia32/Ia32Printer.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32Printer.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32Printer.cpp (working copy) @@ -24,6 +24,7 @@ #include "../../vm/drl/DrlVMInterface.h" #include "../../shared/PlatformDependant.h" #include "CGSupport.h" +#include "PlatformDependant.h" namespace Jitrino { @@ -364,7 +365,7 @@ os<<"[phase:"<desc<<"]"; os<<"("; assert(!offsets.empty()); - for (uint32 i = 0, n = offsets.size(); i0) { @@ -1107,7 +1108,7 @@ { char * retStr=NULL; uint32 si=0; - for (uint32 i=0, n=opnds.size(); iisPlacedIn(c)){ retStr=str; @@ -1218,7 +1219,7 @@ } out << "|\\" << std::endl; - for (uint32 i=0, n=opndsAll.size(); igetFirstId()<<'_'; } out << "\\l\\" << std::endl; @@ -1228,7 +1229,7 @@ out << regStrings[i] << "\\l\\" << ::std::endl; } - uint32 idx=liveSets.size()-1; + uint32 idx=(uint32)liveSets.size()-1; for (Inst * inst = (Inst*)bb->getFirstInst(); inst != NULL; inst = inst->getNextInst(), idx--) { printLivenessForInst(opndsAll, liveSets[idx], liveSets[idx-1]); // output at entry @@ -1274,7 +1275,7 @@ void IRLivenessDotPrinter::printLivenessForInst(const StlVector opnds, const BitSet * ls0, const BitSet * ls1) { ::std::ostream& out=getStream(); - for (uint32 i=0, n=opnds.size(); igetBit(opnd->getId()); bool isLiveAfter=ls1!=NULL && ls1->getBit(opnd->getId()); Index: vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp (working copy) @@ -50,7 +50,7 @@ // WARN: elements order could be changed! static void removeElementAt(GCSafePointPairs& pairs, uint32 idx) { assert(!pairs.empty()); - uint32 newSize = pairs.size() - 1; + uint32 newSize = (uint32)pairs.size() - 1; assert(idx<=newSize); if (idx < newSize) { pairs[idx] = pairs[newSize]; @@ -63,7 +63,7 @@ #ifdef _DEBUG_ uint32 nPairs = 0; #endif - for (int i = pairs.size(); --i>=0;) { + for (int i = (int)pairs.size(); --i>=0;) { MPtrPair& p = pairs[i]; if (p.mptr == mptr) { removeElementAt(pairs, i); @@ -341,7 +341,7 @@ if (!pairs.empty()) { const BitSet* livenessFilter = findLivenessFilter(inst); if (livenessFilter!=NULL) { - for (int i = pairs.size(); --i>=0;) { + for (int i = (int)pairs.size(); --i>=0;) { MPtrPair& p = pairs[i]; if (!livenessFilter->getBit(p.mptr->getId())) { removeElementAt(pairs, i); @@ -562,7 +562,7 @@ bool needToFilterDeadPairs = false; uint32 instsAddedBefore = instsAdded; std::sort(res.begin(), res.end()); - for (uint32 i=0, n = res.size(); i < n; i++) { + for (uint32 i=0, n = (uint32)res.size(); i < n; i++) { MPtrPair& p1 = res[i]; Opnd* newBase = NULL; //new base opnd to merge ambiguos mptrs while (i+1 < n) { @@ -660,7 +660,7 @@ GCSafePointPairs& pairs = *pairsByGCSafePointInstId[inst->getId()]; if (!pairs.empty()) { nSafePointsTmp--; - for (int i =pairs.size(); --i>=0;) { + for (int i = (int)pairs.size(); --i>=0;) { MPtrPair& p = pairs[i]; if (!ls.getBit(p.mptr->getId())) { removeElementAt(pairs, i); @@ -702,7 +702,7 @@ Node * predNode2 =edge2->getSourceNode(); const GCSafePointPairs& pairs2 = *pairsByNode[predNode2->getDfNum()]; //now check that for every mptr in pairs1 there is a pair in pairs2 with the same mptr - for (uint32 i1 = 0, n1 = pairs1.size();i1getBit(p1.mptr->getId())) { for (uint32 i2 = 0; ; i2++) { @@ -715,7 +715,7 @@ } } // and vice versa - for (uint32 i2 = 0, n2 = pairs2.size();i2getBit(p2.mptr->getId())) { for (uint32 i1 = 0; ; i1++) { Index: vm/jitrino/src/codegenerator/ia32/Ia32GCMap.h =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32GCMap.h (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32GCMap.h (working copy) @@ -85,7 +85,7 @@ POINTER_SIZE_INT getUint32Size() const; void write(POINTER_SIZE_INT* image) const; - uint32 getNumOpnds() const {return gcOpnds.size();} + uint32 getNumOpnds() const {return (uint32)gcOpnds.size();} static POINTER_SIZE_INT getIP(const POINTER_SIZE_INT* image); void enumerate(GCInterface* gcInterface, const JitFrameContext* c, const StackInfo& stackInfo) const; Index: vm/jitrino/src/codegenerator/ia32/Ia32RuntimeInterface.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32RuntimeInterface.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32RuntimeInterface.cpp (working copy) @@ -75,8 +75,8 @@ StackInfo stackInfo; Byte* infoBlock = method->getInfoBlock(); - uint32 stackInfoSize = stackInfo.readByteSize(infoBlock); - uint32 gcMapSize = GCMap::readByteSize(infoBlock + stackInfoSize); + POINTER_SIZE_INT stackInfoSize = stackInfo.readByteSize(infoBlock); + POINTER_SIZE_INT gcMapSize = GCMap::readByteSize(infoBlock + stackInfoSize); const char* methName; @@ -95,8 +95,8 @@ StackInfo stackInfo; Byte* infoBlock = method->getInfoBlock(); - uint32 stackInfoSize = stackInfo.readByteSize(infoBlock); - uint32 gcMapSize = GCMap::readByteSize(infoBlock + stackInfoSize); + POINTER_SIZE_INT stackInfoSize = stackInfo.readByteSize(infoBlock); + POINTER_SIZE_INT gcMapSize = GCMap::readByteSize(infoBlock + stackInfoSize); const char* methName; Index: vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h (working copy) @@ -400,7 +400,7 @@ are no longer in the LIR. */ uint32 getOpndCount()const - { return opnds.size(); } + { return (uint32)opnds.size(); } /** returns an operand from the internal array of all operands by its ID. */ Opnd * getOpnd(uint32 id)const Index: vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32SpillGen.cpp (working copy) @@ -410,7 +410,7 @@ indexes[i] = -1; for (size_t i = 0; i != size(); ++i) - indexes[operator[](i).getKind()] = i; + indexes[operator[](i).getKind()] = (int)i; } @@ -441,7 +441,7 @@ if (r.getKind() == c.getKind()) { r.setMask(r.getMask() | c.getMask()); - return i; + return (int)i; } } @@ -585,7 +585,7 @@ emitted = 0; opndcount = irManager->getOpndCount(); - lives_exit = new (mm) BitSet(mm, opndcount); + lives_exit = new (mm) BitSet(mm, (uint32)opndcount); actsmap.resize(opndcount); for (size_t i = 0; i < opndcount; ++i) @@ -602,7 +602,7 @@ } lives_start = irManager->getLiveAtEntry(bblock); - lives_exit->resize(opndcount); + lives_exit->resize((uint32)opndcount); irManager->getLiveAtExit(bblock, *lives_exit); size_t bfails = 0; @@ -635,7 +635,7 @@ { size_t oldcount = opndcount; opndcount = irManager->getOpndCount(); - lives_exit->resize(opndcount); + lives_exit->resize((uint32)opndcount); irManager->fixLivenessInfo(); actsmap.resize(opndcount); @@ -888,7 +888,7 @@ for (Oplines::iterator it = actives.begin(); it != actives.end(); ++it) { Opline& opline = *it; - opline.weight = bitCount(opline.initial.getMask()); + opline.weight = (int)bitCount(opline.initial.getMask()); } sort(actives.begin(), actives.end(), Opline::smaller); } @@ -1632,7 +1632,7 @@ return xbest == INT_MAX ? RegName_Null : - getRegName(static_cast(c.getKind()), c.getSize(), xbest); + getRegName(static_cast(c.getKind()), c.getSize(), (int)xbest); } @@ -1805,7 +1805,7 @@ for (ptrx = evict.endx+1; ptrx < endx && isEvict(evict.opnd, ptrx); ++ptrx) evict.endx = ptrx; - evict.weight = evict.endx - evict.begx; + evict.weight = int(evict.endx - evict.begx); DBGOUT(" evict " << *evict.opnd << " [" << *evict.begx->inst << " - " << *evict.endx->inst << "] w:" << evict.weight << endl;) Index: vm/jitrino/src/codegenerator/ia32/Ia32RegAllocCheck.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32RegAllocCheck.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32RegAllocCheck.cpp (working copy) @@ -98,7 +98,7 @@ static RegName regName (int x) { - size_t k = x / IRMaxRegNamesSameKind; + uint32 k = x / IRMaxRegNamesSameKind; return getRegName((OpndKind)k, Constraint::getDefaultSize(k), x % IRMaxRegNamesSameKind); } @@ -122,7 +122,7 @@ { lastbb = 0; - BitSet lives(mm, opandcount); + BitSet lives(mm, (uint32)opandcount); irm.getLiveAtExit(bblock, lives); Opnd* regdefs[MaxRegs], @@ -148,7 +148,7 @@ else if (regnxts[ridx] != opnd) { - error() << "at end of block," << regName(ridx) + error() << "at end of block," << regName((int)ridx) << " assigned to " << *regnxts[ridx] << " and " << *opnd << endl; } } @@ -175,7 +175,7 @@ else if (regdefs[ridx] != opnd) { - error() << " Invalid definitions at " << *inst << " " << regName(ridx) + error() << " Invalid definitions at " << *inst << " " << regName((int)ridx) << " of " << *regdefs[ridx] << " or " << *opnd << endl; } } @@ -187,7 +187,7 @@ else if (reguses[ridx] != opnd) { - error() << " Invalid usages at " << *inst << " " << regName(ridx) + error() << " Invalid usages at " << *inst << " " << regName((int)ridx) << " of " << *reguses[ridx] << " or " << *opnd << endl; } } @@ -203,7 +203,7 @@ if (regdefs[ridx] != regnxts[ridx]) if (regnxts[ridx] != 0) { - error() << " " << *inst << " " << regName(ridx) + error() << " " << *inst << " " << regName((int)ridx) << " invalid usage of " << *regnxts[ridx] << " instead of " << *regdefs[ridx] << endl; } @@ -220,7 +220,7 @@ { if (reguses[ridx] != regnxts[ridx] && regnxts[ridx] != 0) { - error() << " " << *inst << " " << regName(ridx) + error() << " " << *inst << " " << regName((int)ridx) << " invalid usage of " << *reguses[ridx] << " or " << *regnxts[ridx] << endl; } @@ -240,7 +240,7 @@ { for (size_t i = 0; i != opandcount; ++i) { - Opnd* opnd = irm.getOpnd(i); + Opnd* opnd = irm.getOpnd((uint32)i); if (!opnd->hasAssignedPhysicalLocation()) { header() << "Not assigned opand " << *opnd << endl; Index: vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32InternalTrace.cpp (working copy) @@ -41,18 +41,11 @@ #ifdef _DEBUG assert(cond); #else -#ifdef WIN32 -#ifndef _EM64T_ - if (!cond) { - __asm { - int 3; - } - } -#else - // TODO: add proper code - assert(0); -#endif -#endif + #ifdef _WIN32 // any windows + if(!cond) { + DebugBreak(); + } + #endif #endif } @@ -146,7 +139,7 @@ EntryPointPseudoInst * entryPointPseudoInst = (EntryPointPseudoInst *)inst; entryPointPseudoInst->getCallingConventionClient().finalizeInfos(Inst::OpndRole_Def, CallingConvention::ArgKind_InArg); const StlVector & infos=((const EntryPointPseudoInst *)entryPointPseudoInst)->getCallingConventionClient().getInfos(Inst::OpndRole_Def); - Opnd * argInfoOpnd=irManager->newBinaryConstantImmOpnd(infos.size()*sizeof(CallingConvention::OpndInfo), &infos.front()); + Opnd * argInfoOpnd=irManager->newBinaryConstantImmOpnd((uint32)infos.size()*sizeof(CallingConvention::OpndInfo), &infos.front()); Opnd * args[3]={ methodNameOpnd, irManager->newImmOpnd(irManager->getTypeManager().getInt32Type(), infos.size()), argInfoOpnd, Index: vm/jitrino/src/codegenerator/ia32/Ia32CodeLayoutBottomUp.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32CodeLayoutBottomUp.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32CodeLayoutBottomUp.cpp (working copy) @@ -207,7 +207,7 @@ assert(*chains.begin() ==irManager->getFlowGraph()->getEntryNode()); assert(*chains.begin() == irManager->getFlowGraph()->getEntryNode()); - for (uint32 i = 0, n = chains.size()-1; iappendInst(irManager.newCallInst(target, &CallingConvention_STDCALL, 0, NULL, tlsBase)); #else // PLATFORM_POSIX -#ifdef _EM64T_ - // TODO: #error "BBP not implemented on windows/em64t" - assert(0); -#endif // TLS base can be obtained from [fs:0x14] Opnd* tlsBase = irManager.newMemOpnd(tlsBaseType, MemOpndKind_Any, NULL, 0x14, RegName_FS); #endif // PLATFORM_POSIX @@ -484,7 +480,7 @@ if ( !toppestLoopHeader[id] ) { toppestLoopHeader[id] = loopHeader; // here we need to remember all otheredges and their start index for particular loopHeader - otherStartNdx[loopHeader->getId()] = otherEdges.size(); + otherStartNdx[loopHeader->getId()] = (uint32)otherEdges.size(); const Edges& edges = loopHeader->getInEdges(); for (Edges::const_iterator ite = edges.begin(), ende = edges.end(); ite!=ende; ++ite) { Edge* e = *ite; Index: vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32Inst.cpp (working copy) @@ -418,7 +418,7 @@ assert(form==Form_Native); instEnd = Encoder::emit(stream, this); } - setCodeSize(instEnd - stream); + setCodeSize((uint32)(instEnd - stream)); return instEnd; } @@ -799,12 +799,12 @@ { assert(callingConvention!=NULL); StlVector & infos = getInfos(role); - callingConvention->getOpndInfo(argKind, infos.size(), &infos.front()); + callingConvention->getOpndInfo(argKind, (uint32)infos.size(), &infos.front()); bool lastToFirst=callingConvention->pushLastToFirst(); uint32 slotNumber=0; for ( - uint32 i=lastToFirst?0:infos.size()-1, - end=lastToFirst?infos.size():(uint32)-1, + uint32 i=lastToFirst?0:(uint32)infos.size()-1, + end=lastToFirst?(uint32)infos.size():(uint32)-1, inc=lastToFirst?1:-1; i!=end; i+=inc @@ -827,7 +827,7 @@ uint32 regArgCount=0, stackArgCount=0; Inst::Opnds opnds(ownerInst, Inst::OpndRole_Auxilary|role); Inst::Opnds::iterator handledOpnds=opnds.begin(); - for (uint32 i=0, n=infos.size(); isize(); + POINTER_SIZE_INT mapSize = (POINTER_SIZE_INT)theMap->size(); return (mapSize * (byteCodeOffsetSize + wordSize) + wordSize); } @@ -58,7 +58,7 @@ POINTER_SIZE_INT mapSize; POINTER_SIZE_INT i = 0; - mapSize = theMap->size(); + mapSize = (POINTER_SIZE_INT)theMap->size(); data[0] = mapSize; //store map size data = data + 1; Index: vm/jitrino/src/codegenerator/ia32/Ia32ConstraintsResolver.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32ConstraintsResolver.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32ConstraintsResolver.cpp (working copy) @@ -384,7 +384,7 @@ if (node->isBlockNode()){ double bbecv = getBasicBlockPriority(node); uint32 ibb=0; - for (uint32 nbb=basicBlocks.size(); ibb getBasicBlockPriority(basicBlocks[ibb])) break; } @@ -671,7 +671,7 @@ void ConstraintsResolverImpl::resolveConstraints() { // for all basic blocks in the array - for (uint32 ibb=0, nbb=basicBlocks.size(); ibbgetOpnd(i)->hasAssignedPhysicalLocation()) + if (!irManager->getOpnd((uint32)i)->hasAssignedPhysicalLocation()) opndxp = new Opndx(mm); opndxs[i] = opndxp; } - BitSet lives(mm, opandcount); + BitSet lives(mm, (uint32)opandcount); globcount = 0; const Nodes& postOrder = irManager->getFlowGraph()->getNodesPostOrder(); @@ -236,7 +236,7 @@ Opndx* opndxp = opndxs.at(opndp->getId()); if (opndxp != 0) { - const uint32 oprole = const_cast(instp)->getOpndRoles(itx); + const uint32 oprole = const_cast(instp)->getOpndRoles((uint32)itx); const bool isdef = ((oprole & Inst::OpndRole_UseDef) == Inst::OpndRole_Def) && ((iprops & Inst::Properties_Conditional) == 0 ); if (isdef) @@ -264,7 +264,7 @@ OpDef& opdef = opndxp->opdefs.back(); if (opdef.defp->getNode() == nodep) { - opdef.globid = globcount++; + opdef.globid = (int)globcount++; bitsetp(opndxp->globdefsp)->setBit(opdef.globid, true); } } @@ -327,7 +327,7 @@ - BitSet wrkbs(mm, globcount); + BitSet wrkbs(mm, (uint32)globcount); bool wrkbsvalid; size_t passnb = 0; const Nodes& postOrder = irManager->getFlowGraph()->getNodesPostOrder(); @@ -433,7 +433,7 @@ if (opndxp != 0) { OpDef* opdefp = 0; - const uint32 oprole = const_cast(instp)->getOpndRoles(itx); + const uint32 oprole = const_cast(instp)->getOpndRoles((uint32)itx); const bool isdef = ((oprole & Inst::OpndRole_UseDef) == Inst::OpndRole_Def) && ((iprops & Inst::Properties_Conditional) == 0 ); DBGOUT(" O#" << opndp->getFirstId() << "(#" << opndp->getId() << ") def:" << isdef;) @@ -527,7 +527,7 @@ for (size_t i = 0; i != opandcount; ++i) if ((opndxp = opndxs[i]) != 0 && !opndxp->opdefs.empty()) { - Opnd* opndp = irManager->getOpnd(i); + Opnd* opndp = irManager->getOpnd((uint32)i); Opndx::OpDefs& opdefs = opndxp->opdefs; DBGOUT(" O#" << opndp->getFirstId() << "(#" << i << ")" << endl;) @@ -591,9 +591,9 @@ BitSet* WebMaker::bitsetp (BitSet*& bsp) { if (bsp == 0) - bsp = new BitSet(mm, globcount); + bsp = new BitSet(mm, (uint32)globcount); else - bsp->resize(globcount); + bsp->resize((uint32)globcount); return bsp; } Index: vm/jitrino/src/codegenerator/ia32/Ia32StackLayout.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32StackLayout.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32StackLayout.cpp (working copy) @@ -239,7 +239,7 @@ const StlVector& stackOpndInfos = ((const EntryPointPseudoInst*)entryPointInst)->getCallingConventionClient().getStackOpndInfos(Inst::OpndRole_Def); - for (uint32 i=0, n=stackOpndInfos.size(); igetSize(); POINTER_SIZE_INT alignment=size; @@ -250,7 +250,7 @@ dataBlock=(dataBlock+blockAlignment-1)&~(blockAlignment-1); assert(dataBlock % blockAlignment == 0); - for (uint32 i=0, n=items.size(); igetAddress(); item->setAddress((void*)(dataBlock+offset)); @@ -265,7 +265,7 @@ #ifdef _DEBUG const Nodes& nodes = irManager->getFlowGraph()->getNodes(); #endif - for (uint32 i=0, n=items.size(); ihasKind(ConstantAreaItem::Kind_SwitchTableConstantAreaItem)){ void ** table = (void **)item->getAddress(); @@ -323,7 +323,9 @@ Log::out() << "has inline info:" << std::endl; callinst->getInlineInfo()->printLevels(Log::out()); // report offset 1 bundle forward - inlineMap->registerOffset((POINTER_SIZE_INT)inst->getCodeStartAddr()+inst->getCodeSize() - (POINTER_SIZE_INT)irManager->getCodeStartAddr(), callinst->getInlineInfo()); + POINTER_SIZE_INT offset = (POINTER_SIZE_INT)inst->getCodeStartAddr() + inst->getCodeSize() - (POINTER_SIZE_INT)irManager->getCodeStartAddr(); + assert(0 == (0xFFFFFFFF00000000 & (uint64)offset)); + inlineMap->registerOffset((uint32)offset, callinst->getInlineInfo()); } Log::out() << std::endl; } @@ -377,17 +379,18 @@ if (alignment && lt->isLoopHeader(bb) && ((POINTER_SIZE_INT)ip & (alignment-1))) { - POINTER_SIZE_INT align = alignment - ((POINTER_SIZE_INT)ip & (alignment-1)); + unsigned align = alignment - (unsigned)((POINTER_SIZE_INT)ip & (alignment-1)); ip = (uint8*)EncoderBase::nops((char*)ip, align); } uint8 * blockStartIp = ip; - bb->setCodeOffset( blockStartIp-codeStreamStart ); + assert(0 == (0xFFFFFFFF00000000 & (uint64)(blockStartIp-codeStreamStart))); + bb->setCodeOffset( (uint32)(blockStartIp-codeStreamStart) ); for (Inst* inst = (Inst*)bb->getFirstInst(); inst!=NULL; inst = inst->getNextInst()) { if( inst->hasKind(Inst::Kind_PseudoInst)) { uint8 * instStartIp = ip; - inst->setCodeOffset( instStartIp-blockStartIp ); + inst->setCodeOffset( (uint32)(instStartIp-blockStartIp) ); continue; } @@ -398,23 +401,25 @@ { if ((POINTER_SIZE_INT)ip & 0xF) { - uint64 align = 0x10 - ((POINTER_SIZE_INT)ip & 0xF); + unsigned align = 0x10 - (unsigned)((POINTER_SIZE_INT)ip & 0xF); ip = (uint8*)EncoderBase::nops((char*)ip, align); } uint8 * instStartIp = ip; - inst->setCodeOffset( instStartIp-blockStartIp ); + assert(0 == (0xFFFFFFFF00000000 & (uint64)(instStartIp-blockStartIp))); + inst->setCodeOffset( (uint32)(instStartIp-blockStartIp) ); ip = inst->emit(ip); ip = (uint8*)EncoderBase::nops((char*)ip, 0x10 - inst->getCodeSize()); } else { #endif uint8 * instStartIp = ip; - inst->setCodeOffset( instStartIp-blockStartIp ); + assert(0 == (0xFFFFFFFF00000000 & (uint64)(instStartIp-blockStartIp))); + inst->setCodeOffset( (uint32)(instStartIp-blockStartIp) ); ip = inst->emit(ip); #ifdef _EM64T_ } #endif } - bb->setCodeSize( ip-blockStartIp ); + bb->setCodeSize( (uint32)(ip-blockStartIp) ); } unsigned codeSize = (unsigned)(ip-codeStreamStart); assert( codeSize < maxMethodSize ); @@ -453,7 +458,7 @@ if (offset >= -128 && offset < 127 && inst->getOpnd(targetOpndIndex)->getSize() != OpndSize_8) { inst->setOpnd(targetOpndIndex, irManager->newImmOpnd(irManager->getTypeFromTag(Type::Int8), offset)); uint8 * newInstCodeEndAddr = inst->emit(instCodeStartAddr); - bb->setCodeSize(bb->getCodeSize() + (newInstCodeEndAddr - instCodeEndAddr)); + bb->setCodeSize(bb->getCodeSize() + (uint32)(newInstCodeEndAddr - instCodeEndAddr)); newOpndsCreated = true; } } @@ -510,8 +515,7 @@ int64 offset=targetCodeStartAddr-instCodeEndAddr; #ifdef _EM64T_ -#ifndef WIN32 - if (llabs(offset) > 0xFFFFFFFF) { + if (0 != (offset & 0xFFFFFFFF80000000)) { // offset as a signed value does not fits into 32 bits const RegName TMP_BASE = RegName_R14; EncoderBase::Operands args; args.clear(); @@ -522,11 +526,7 @@ args.add(TMP_BASE); EncoderBase::encode(ip, Mnemonic_CALL, args); } else { -#else - // TODO: - assert(0); #endif -#endif inst->getOpnd(targetOpndIndex)->assignImmValue((int64)offset); // re-emit the instruction: inst->emit(instCodeStartAddr); @@ -535,10 +535,8 @@ registerDirectCall(inst); } #ifdef _EM64T_ -#ifndef WIN32 } #endif -#endif } // todo64 if (isBcRequired) { @@ -581,7 +579,8 @@ Byte ** indirectAddr = (Byte **)recompiledMethodDesc->getIndirectAddress(); Byte * targetAddr = *indirectAddr; Byte * callAddr = (Byte*)data; - uint32 offset = targetAddr - callAddr-5; + assert(0 == (0xFFFFFFFF00000000 & (uint64)(targetAddr - callAddr-5))); + uint32 offset = (uint32)(targetAddr - callAddr-5); //FIXME //if (Log::cat_rt()->isDebugEnabled()) { @@ -630,7 +629,7 @@ registerExceptionRegion((void*)regionStart, (void*)regionEnd, regionDispatchNode); } - uint32 handlerInfoCount=exceptionHandlerInfos.size(); + uint32 handlerInfoCount=(uint32)exceptionHandlerInfos.size(); irManager->getCompilationInterface().setNumExceptionHandler(handlerInfoCount); for (uint32 i=0; igetCodeStartAddr(), oldMethodEntryInst, - inlineStack.size()); + (uint32)inlineStack.size()); methodLocationMap[methMarkerInst] = methInfo; } else if (inst->getKind() == Inst::Kind_MethodEndPseudoInst) { Index: vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc2.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc2.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc2.cpp (working copy) @@ -235,7 +235,7 @@ beg = spans.front().beg, end = spans.back().end; length=0; - for (int i=0, n=spans.size(); iend - beg) < 0 ){ + if ( (d = int(x->end - beg)) < 0 ){ if (d==-1) adj=1; DBGOUT(" -free (below lower bound)!" << endl;) return true; } - if ( (d = x->beg - end) > 0 ){ + if ( (d = int(x->beg - end)) > 0 ){ if (d==1) adj=1; DBGOUT(" -free (above upper bound)!" << endl;) @@ -533,7 +533,7 @@ //irManager->indexInsts(); - BitSet lives(mm, opandcount); + BitSet lives(mm, (uint32)opandcount); const Nodes& nodes = irManager->getFlowGraph()->getNodesPostOrder(); for (Nodes::const_iterator it = nodes.begin(), end = nodes.end(); it!=end; ++it) { Index: vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc3.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc3.cpp (revision 511718) +++ vm/jitrino/src/codegenerator/ia32/Ia32RegAlloc3.cpp (working copy) @@ -395,7 +395,7 @@ indexes[i] = -1; for (size_t i = 0; i != size(); ++i) - indexes[operator[](i).getKind()] = i; + indexes[operator[](i).getKind()] = (int)i; } @@ -409,7 +409,7 @@ if (r.getKind() == c.getKind()) { r.setMask(r.getMask() | c.getMask()); - return i; + return (int)i; } } @@ -588,7 +588,7 @@ for (size_t i = 0; i != opandcount; ++i) { - Opnd* opnd = getIRManager().getOpnd(i); + Opnd* opnd = getIRManager().getOpnd((uint32)i); int mapto = -1; int ridx; @@ -613,7 +613,7 @@ opndx.ridx = ridx; opndx.alloc = 0; opndx.avail = loc.getMask() & registers[ridx].getMask(); - opndx.nbavails = bitCount(opndx.avail); + opndx.nbavails = (int)bitCount(opndx.avail); assert(opndx.nbavails != 0); opndx.spillcost = 1; opndx.spilled = false; @@ -641,7 +641,7 @@ BoolMatrix matrix(mm, graphsize); - BitSet lives(mm, opandcount); + BitSet lives(mm, (uint32)opandcount); const Nodes& nodes = irManager->getFlowGraph()->getNodesPostOrder(); for (Nodes::const_iterator it = nodes.begin(), end = nodes.end(); it!=end; ++it) { @@ -1007,7 +1007,7 @@ opndx.alloc = findHighest(alloc); opndx.opnd->assignRegName(getRegName((OpndKind)registers[opndx.ridx].getKind(), opndx.opnd->getSize(), - bitNumber(opndx.alloc))); + (int)bitNumber(opndx.alloc))); ++count_assigned; DBGOUT("assigned (" << x << ") = <" << getRegNameString(opndx.opnd->getRegName()) << ">" << endl;) Index: vm/jitrino/src/codegenerator/CodeGenIntfc.h =================================================================== --- vm/jitrino/src/codegenerator/CodeGenIntfc.h (revision 511718) +++ vm/jitrino/src/codegenerator/CodeGenIntfc.h (working copy) @@ -600,6 +600,7 @@ class InlineInfoMap { class OffsetPair { public: + OffsetPair() : offset(0), inline_info(NULL) {} OffsetPair(uint32 off, InlineInfo* ii) : offset(off), inline_info(ii) {} uint32 offset; InlineInfo* inline_info; Index: vm/jitrino/src/jet/cg_meth.cpp =================================================================== --- vm/jitrino/src/jet/cg_meth.cpp (revision 511718) +++ vm/jitrino/src/jet/cg_meth.cpp (working copy) @@ -375,7 +375,7 @@ if (is_set(DBG_TRACE_CG)) {dbg(";;>locals.gc_map\n");} Opnd reg(i32, valloc(i32)); alu(alu_xor, reg, reg); - for (unsigned i=locals_map.size(); i=1 && buf[len-1]<=' ') { buf[len-1] = 0; } if (len>=2 && buf[len-2]<=' ') { buf[len-2] = 0; } @@ -298,7 +298,7 @@ m_max_native_stack_depth = 0; m_bc = (unsigned char*)method_get_byte_code_addr(m_method); - unsigned bc_size = method_get_byte_code_size(m_method); + unsigned bc_size = (unsigned)method_get_byte_code_size(m_method); unsigned num_locals = method_vars_get_number(m_method); unsigned max_stack = method_get_max_stack(m_method); @@ -312,7 +312,7 @@ m_ra.resize(num_locals, ar_x); // - m_codeStream.init((size_t)(bc_size*NATIVE_CODE_SIZE_2_BC_SIZE_RATIO)); + m_codeStream.init((unsigned)(bc_size*NATIVE_CODE_SIZE_2_BC_SIZE_RATIO)); m_stack.init(num_locals, max_stack, num_input_slots); // We need to report 'this' additionally for the following cases: // - non-static sync methods - to allow VM to call monitor_exit() for @@ -369,7 +369,7 @@ comp_parse_bytecode(); comp_alloc_regs(); // Statistics:: number of basic blocks - STATS_MEASURE_MIN_MAX_VALUE(bbs, m_bbs.size(), meth_fname()); + STATS_MEASURE_MIN_MAX_VALUE(bbs, (unsigned)m_bbs.size(), meth_fname()); if (is_set(DBG_DUMP_BBS)) { dbg_dump_bbs(); @@ -378,7 +378,7 @@ // Phase 2 - code generation. // SmartPtr allStates; - allStates.alloc(m_bbs.size()); + allStates.alloc((unsigned)m_bbs.size()); unsigned c = 0; for (BBMAP::iterator i=m_bbs.begin(); i != m_bbs.end(); i++, c++) { m_bbStates[i->first] = &allStates[c]; @@ -1130,7 +1130,7 @@ void Compiler::comp_set_ehandlers(void) { unsigned real_num_handlers = 0; - for (unsigned i=0, n=m_handlers.size(); i(dinv); int shiftby = width - numones; - inttype newd = d + (1 << shiftby); + inttype newd = d + ((inttype)1 << shiftby); if (shiftby <= m.SMALL_SHIFT_MAXBITS) { DEBUGPRINT("planMulNeg(" << (int) d << ") case 2a, shiftby=" << shiftby); res2.append(MulOp::pushy); res2.append(MulOp::neg); @@ -711,7 +711,7 @@ if ((rightzeros <= small_shift_maxbits) && (rightzeros + bitswidth >= 2 * small_shift_maxbits)) { DEBUGPRINT("case smallshiftadd"); - inttype newd = d + (1 << rightzeros); + inttype newd = d + ((inttype)1 << rightzeros); m.append(MulOp::pushy); m.append(MulOp::neg); planMul(m, newd, depth+1); m.append(MulOp::shladd, rightzeros); @@ -723,12 +723,12 @@ } } else { DEBUGPRINT("case even, wider"); - inttype deltasubright = delta - (1 << deltaright); + inttype deltasubright = delta - ((inttype)1 << deltaright); int deltasubright_ntz = ntz(deltasubright); int region2 = deltasubright_ntz - deltaright +1; assert(region2 > 0); if (region2 > 2) { - inttype newd = d + (1 << rightzeros); + inttype newd = d + ((inttype)1 << rightzeros); if (rightzeros <= small_shift_maxbits) { DEBUGPRINT("case wide smalladdshift"); m.append(MulOp::pushy); m.append(MulOp::neg); @@ -758,7 +758,7 @@ m.append(MulOp::shladd, small_shift_maxbits); } } else { // region2 == 1 - inttype newd = d - (1 << rightzeros); + inttype newd = d - ((inttype)1 << rightzeros); if (rightzeros <= small_shift_maxbits) { DEBUGPRINT("case wide smalladdshift1"); m.append(MulOp::pushy); Index: vm/jitrino/src/optimizer/escanalyzer.cpp =================================================================== --- vm/jitrino/src/optimizer/escanalyzer.cpp (revision 511718) +++ vm/jitrino/src/optimizer/escanalyzer.cpp (working copy) @@ -162,7 +162,7 @@ const char* mn = mh.getName(); const Nodes& nodes = irManager.getFlowGraph().getNodes(); ControlFlowGraph& fg = irManager.getFlowGraph(); - uint32 nodeNum = nodes.size(); + uint32 nodeNum = (uint32)nodes.size(); uint32 num2 = fg.getNodeCount(); uint32 num3 = fg.getMaxNodeId(); Nodes::const_iterator niter; Index: vm/jitrino/src/optimizer/Inst.h =================================================================== --- vm/jitrino/src/optimizer/Inst.h (revision 511718) +++ vm/jitrino/src/optimizer/Inst.h (working copy) @@ -137,10 +137,6 @@ uint32 getId() const {return id;} - uint64 getMethodId() const {return methodId; } - - void setMethodId(uint64 id) {methodId = id; } - PersistentInstructionId getPersistentInstructionId() const {return pid; } void setPersistentInstructionId(PersistentInstructionId id) {pid = id; } @@ -386,7 +382,6 @@ uint32 numSrcs; Opnd* srcs[MAX_INST_SRCS]; Opnd* dst; - uint64 methodId; PersistentInstructionId pid; uint32 id; @@ -1319,15 +1314,11 @@ uint32 createLabelNumber() {return maxNumLabels++; } uint32 getMaxNumLabels() {return maxNumLabels; } uint32 getNumInsts() {return numInsts; } - uint64 getMethodId() {return numMethodInsts; } - void setMethodId(uint64 mid) {numMethodInsts = mid; } - void decMethodId() {numMethodInsts--; } - + private: uint32 maxNumLabels; // number of labels generated uint32 numInsts; // number of instructions generated - uint64 numMethodInsts; // a combination of - MemoryManager& memManager; + MemoryManager& memManager; // // Private constructor Index: vm/jitrino/src/optimizer/Inst.cpp =================================================================== --- vm/jitrino/src/optimizer/Inst.cpp (revision 511718) +++ vm/jitrino/src/optimizer/Inst.cpp (working copy) @@ -704,8 +704,6 @@ assert(0); } newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -713,8 +711,6 @@ InstFactory::makeClone(LabelInst* inst, OpndManager& opndManager, OpndRenameTable& table) { LabelInst *newInst = makeLabel(); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -731,8 +727,6 @@ CatchLabelInst *newInst =makeCatchLabelInst(createLabelNumber(), inst->getOrder(), inst->getExceptionType()); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -743,8 +737,6 @@ MethodEntryInst *newInst = makeMethodEntryInst(createLabelNumber(), inst->methodDesc); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -760,8 +752,6 @@ newInst = makeMethodMarkerInst(inst->kind, inst->methodDesc); } newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -790,8 +780,6 @@ default: assert(0); } newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -807,8 +795,6 @@ newTargets[i] = targets[i]; SwitchInst *newInst = makeSwitchInst(src, newTargets, numTargets, inst->getDefaultTarget()); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -843,8 +829,6 @@ default: assert(0); } newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -859,8 +843,6 @@ inst->getToken(), inst->getEnclosingMethod()); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -876,8 +858,6 @@ inst->getCPIndex(), inst->getOperation()); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -912,8 +892,6 @@ } } newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -944,8 +922,6 @@ break; } newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -977,8 +953,6 @@ break; } newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -1008,8 +982,6 @@ break; } newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -1030,8 +1002,6 @@ newArgs, inst->getMethodDesc()); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); InlineInfo* ii = newInst->getInlineInfoPtr(); ii->getInlineChainFrom(*inst->getInlineInfoPtr()); return newInst; @@ -1054,8 +1024,6 @@ inst->getNumArgs(), newArgs); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); InlineInfo* ii = newInst->getInlineInfoPtr(); ii->getInlineChainFrom(*inst->getInlineInfoPtr()); return newInst; @@ -1077,8 +1045,6 @@ newArgs, inst->getIntrinsicId()); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -1100,8 +1066,6 @@ newArgs, inst->getJitHelperId()); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -1117,8 +1081,6 @@ numArgs, newArgs); newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -1148,8 +1110,6 @@ break; } newInst->setPersistentInstructionId(inst->getPersistentInstructionId()); - decMethodId(); - newInst->setMethodId(inst->getMethodId()); return newInst; } @@ -1159,7 +1119,6 @@ InstFactory::InstFactory(MemoryManager& mm, MethodDesc &md) : memManager(mm) { maxNumLabels = 0; numInsts = 0; - numMethodInsts = ((uint64)md.getUniqueId())<<32; } Opnd** @@ -1229,14 +1188,12 @@ InstFactory::makeInst(Opcode op, Modifier mod, Type::Tag type, Opnd* dst) { Inst* inst = new (memManager) Inst(op, mod, type, dst); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } Inst* InstFactory::makeInst(Opcode op, Modifier mod, Type::Tag type, Opnd* dst, Opnd* src) { Inst* inst = new (memManager) Inst(op, mod, type, dst, src); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } Inst* @@ -1248,28 +1205,24 @@ Opnd* src2) { Inst* inst = new (memManager) Inst(op, mod, type, dst, src1, src2); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } LabelInst* InstFactory::makeLabelInst(uint32 labelId) { LabelInst* inst = new (memManager) LabelInst(labelId); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } LabelInst* InstFactory::makeLabelInst(Opcode opc, uint32 labelId) { LabelInst* inst = new (memManager) LabelInst(opc, labelId); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } DispatchLabelInst* InstFactory::makeDispatchLabelInst(uint32 labelId) { DispatchLabelInst* inst = new (memManager) DispatchLabelInst(labelId); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1279,7 +1232,6 @@ Type *exceptionType) { CatchLabelInst* inst = new (memManager) CatchLabelInst(labelId, ord, exceptionType); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1287,7 +1239,6 @@ InstFactory::makeMethodEntryInst(uint32 labelId, MethodDesc* md) { MethodEntryInst* inst = new (memManager) MethodEntryInst(labelId, md); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1297,7 +1248,6 @@ assert(obj && !obj->isNull()); MethodMarkerInst* inst = new (memManager) MethodMarkerInst(k, md, obj, retOpnd); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1306,7 +1256,6 @@ Opnd *retOpnd) { MethodMarkerInst* inst = new (memManager) MethodMarkerInst(k, md, retOpnd); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1314,7 +1263,6 @@ InstFactory::makeMethodMarkerInst(MethodMarkerInst::Kind k, MethodDesc* md) { MethodMarkerInst* inst = new (memManager) MethodMarkerInst(k, md); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1322,7 +1270,6 @@ InstFactory::makeBranchInst(Opcode op, LabelInst* target) { BranchInst* inst = new (memManager) BranchInst(op, target); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } BranchInst* @@ -1331,7 +1278,6 @@ LabelInst* target) { BranchInst* inst = new (memManager) BranchInst(op, src, target); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } BranchInst* @@ -1342,7 +1288,6 @@ LabelInst* target) { BranchInst* inst = new (memManager) BranchInst(op, mod, type, src, target); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } BranchInst* @@ -1354,7 +1299,6 @@ LabelInst* target) { BranchInst* inst = new (memManager) BranchInst(op, mod, type, src1, src2, target); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1363,56 +1307,48 @@ LabelInst* defTarget) { SwitchInst* inst = new (memManager) SwitchInst(src, targets, nTargets, defTarget); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } ConstInst* InstFactory::makeConstInst(Opnd* dst, int32 i4) { ConstInst* inst = new (memManager) ConstInst(dst, i4); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } ConstInst* InstFactory::makeConstInst(Opnd* dst, int64 i8) { ConstInst* inst = new (memManager) ConstInst(dst, i8); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } ConstInst* InstFactory::makeConstInst(Opnd* dst, float fs) { ConstInst* inst = new (memManager) ConstInst(dst, fs); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } ConstInst* InstFactory::makeConstInst(Opnd* dst, double fd) { ConstInst* inst = new (memManager) ConstInst(dst, fd); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } ConstInst* InstFactory::makeConstInst(Opnd* dst, ConstInst::ConstValue val) { ConstInst* inst = new (memManager) ConstInst(dst, val); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } ConstInst* InstFactory::makeConstInst(Opnd* dst) { ConstInst* inst = new (memManager) ConstInst(dst); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } TokenInst* InstFactory::makeTokenInst(Opcode opc, Modifier mod, Type::Tag type, Opnd* dst, uint32 t, MethodDesc* encMethod) { TokenInst* inst = new (memManager) TokenInst(opc, mod, type, dst, t, encMethod); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } LinkingExcInst* @@ -1421,42 +1357,36 @@ LinkingExcInst* inst = new (memManager) LinkingExcInst(opc, mod, type, dst, encClass, CPIndex, operation); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } VarAccessInst* InstFactory::makeVarAccessInst(Opcode op, Type::Tag type, Opnd* dst, VarOpnd* var) { VarAccessInst* inst = new (memManager) VarAccessInst(op, type, dst, var); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } VarAccessInst* InstFactory::makeVarAccessInst(Opcode op, Type::Tag type, VarOpnd* var, Opnd* src) { VarAccessInst* inst = new (memManager) VarAccessInst(op, type, var, src); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } VarAccessInst* InstFactory::makeVarAccessInst(Opcode op, Type::Tag type, Opnd* dst, SsaVarOpnd* var) { VarAccessInst* inst = new (memManager) VarAccessInst(op, type, dst, var); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } VarAccessInst* InstFactory::makeVarAccessInst(Opcode op, Type::Tag type, SsaVarOpnd* var, Opnd* src) { VarAccessInst* inst = new (memManager) VarAccessInst(op, type, var, src); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } TypeInst* InstFactory::makeTypeInst(Opcode op, Modifier mod, Type::Tag ty, Opnd* dst, Type* td) { TypeInst* inst = new (memManager) TypeInst(op, mod, ty, dst, td); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } TypeInst* @@ -1464,7 +1394,6 @@ Opnd* src, Type* td) { TypeInst* inst = new (memManager) TypeInst(op, mod, ty, dst, src, td); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } TypeInst* @@ -1472,7 +1401,6 @@ Opnd* src1, Opnd* src2, Type* td) { TypeInst* inst = new (memManager) TypeInst(op, mod, ty, dst, src1, src2, td); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } TypeInst* @@ -1482,7 +1410,6 @@ Opnd** srcs = copyOpnds(srcs_local, 3); TypeInst* inst = new (memManager) TypeInst(op, mod, ty, dst, 3, srcs, td); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } TypeInst* @@ -1492,7 +1419,6 @@ Opnd** srcs = copyOpnds(srcs_local, 4); TypeInst* inst = new (memManager) TypeInst(op, mod, ty, dst, 4, srcs, td); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } TypeInst* @@ -1500,7 +1426,6 @@ uint32 nArgs, Opnd** args_, Type* td) { TypeInst* inst = new (memManager) TypeInst(op, mod, ty, dst, nArgs, args_, td); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } FieldAccessInst* @@ -1511,7 +1436,6 @@ FieldDesc* fd) { FieldAccessInst* inst = new (memManager) FieldAccessInst(op, mod, type, dst, fd); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } FieldAccessInst* @@ -1523,7 +1447,6 @@ FieldDesc* fd) { FieldAccessInst* inst = new (memManager) FieldAccessInst(op, mod, type, dst, src, fd); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } FieldAccessInst* @@ -1536,7 +1459,6 @@ FieldDesc* fd) { FieldAccessInst* inst = new (memManager) FieldAccessInst(op, mod, type, dst, src1, src2, fd); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } FieldAccessInst* @@ -1550,21 +1472,18 @@ srcs = copyOpnds(srcs, numSrcs); FieldAccessInst* inst = new (memManager) FieldAccessInst(op, mod, type, dst, numSrcs, srcs, fd); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } MethodInst* InstFactory::makeMethodInst(Opcode op, Modifier mod, Type::Tag type, Opnd* dst, MethodDesc* md) { MethodInst* inst = new (memManager) MethodInst(op, mod, type, dst, md); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } MethodInst* InstFactory::makeMethodInst(Opcode op, Modifier mod, Type::Tag type, Opnd* dst, Opnd* base, MethodDesc* md) { MethodInst* inst = new (memManager) MethodInst(op, mod, type, dst, base, md); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } MethodInst* @@ -1573,7 +1492,6 @@ assert(tauHasMethod->getType()->tag == Type::Tau); MethodInst* inst = new (memManager) MethodInst(op, mod, type, dst, base, tauHasMethod, md); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } MethodInst* @@ -1585,7 +1503,6 @@ MethodDesc* md) { MethodInst* inst = new (memManager) MethodInst(op, mod, type, dst, nArgs, 0, md); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } MethodInst* @@ -1599,7 +1516,6 @@ srcs = copyOpnds(srcs, numSrcs); MethodInst* inst = new (memManager) MethodInst(op, mod, type, dst, numSrcs, srcs, md); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } MethodCallInst* @@ -1611,7 +1527,6 @@ MethodDesc* md) { MethodCallInst* inst = new (memManager) MethodCallInst(op, mod, type, dst, numArgs, args, md, memManager); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1624,7 +1539,6 @@ Opnd** args) { CallInst* inst = new (memManager) CallInst(op, mod, type, dst, funptr, numArgs, args, memManager); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1638,7 +1552,6 @@ IntrinsicCallInst * inst = new (memManager) IntrinsicCallInst(op, mod, type, dst, nArgs, args_, id); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1653,7 +1566,6 @@ JitHelperCallInst * inst = new (memManager) JitHelperCallInst(op, mod, type, dst, nArgs, args_, id); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1669,7 +1581,6 @@ VMHelperCallInst * inst = new (memManager) VMHelperCallInst(op, mod, type, dst, nArgs, args_, id); inst->id = numInsts++; - inst->methodId = numMethodInsts++; inst->inlInfo = inlInfo; return inst; } @@ -1683,7 +1594,6 @@ #endif PhiInst* inst = new (memManager) PhiInst(type, dst, nArgs, args_); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -1694,7 +1604,6 @@ Opnd* dst) { MultiSrcInst* inst = new (memManager) MultiSrcInst(opc, mod, ty, dst); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } MultiSrcInst* @@ -1705,7 +1614,6 @@ Opnd* src) { MultiSrcInst* inst = new (memManager) MultiSrcInst(opc, mod, ty, dst, src); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } MultiSrcInst* @@ -1717,7 +1625,6 @@ Opnd* src2) { MultiSrcInst* inst = new (memManager) MultiSrcInst(opc, mod, ty, dst, src1, src2); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } MultiSrcInst* @@ -1756,7 +1663,6 @@ Opnd** srcs) { MultiSrcInst* inst = new (memManager) MultiSrcInst(opc, mod, ty, dst, nSrcs, srcs); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -2051,7 +1957,6 @@ Inst* inst = makeCallInst(Op_IndirectCall, Modifier(Exception_Sometimes), returnType, dst, funAddr, numArgs+2, newArgs); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -2070,7 +1975,6 @@ Inst* inst = makeCallInst(Op_IndirectMemoryCall, Modifier(Exception_Sometimes), returnType, dst, funAddr, numArgs+2, newArgs); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } @@ -2128,7 +2032,6 @@ Type::Tag atype = src->getType()->tag; TauPiInst* inst = new (memManager) TauPiInst(atype, dst, src, tauDep, cond); inst->id = numInsts++; - inst->methodId = numMethodInsts++; return inst; } Index: vm/jitrino/src/optimizer/inliner.cpp =================================================================== --- vm/jitrino/src/optimizer/inliner.cpp (revision 511718) +++ vm/jitrino/src/optimizer/inliner.cpp (working copy) @@ -953,11 +953,7 @@ methodDesc->getSignatureString() << ::std::endl; // Generate flowgraph for new region - oldMethodId = _instFactory.getMethodId(); - uint32 id = methodDesc->getUniqueId(); - _instFactory.setMethodId(((uint64)id)<<32); - - + InlineNode* inlineNode = createInlineNode(inlineCC, call); assert(inlineNode!=NULL); Index: vm/jitrino/src/vm/drl/DrlVMInterface.cpp =================================================================== --- vm/jitrino/src/vm/drl/DrlVMInterface.cpp (revision 511718) +++ vm/jitrino/src/vm/drl/DrlVMInterface.cpp (working copy) @@ -92,7 +92,8 @@ hythread_tls_alloc(&key); offset = hythread_tls_get_offset(key); } - return offset; + assert(0 == (0xFFFFFFFF00000000 & (uint64)offset)); + return (uint32)offset; } ////////////////////////////////////////////////////////////////////////////// @@ -412,7 +413,7 @@ return method_get_code_block_size_jit_new(drlMethod,getJitHandle(), id); } -uint32 +POINTER_SIZE_INT DrlVMMethodDesc::getUniqueId() { #ifdef _IPF_ Index: vm/jitrino/src/vm/drl/DrlVMInterface.h =================================================================== --- vm/jitrino/src/vm/drl/DrlVMInterface.h (revision 511718) +++ vm/jitrino/src/vm/drl/DrlVMInterface.h (working copy) @@ -287,7 +287,7 @@ virtual uint32 getInfoBlockSize(); virtual Byte* getCodeBlockAddress(int32 id); virtual uint32 getCodeBlockSize(int32 id); - virtual uint32 getUniqueId(); + virtual POINTER_SIZE_INT getUniqueId(); // // DRL kernel Index: vm/jitrino/src/vm/VMInterface.h =================================================================== --- vm/jitrino/src/vm/VMInterface.h (revision 511718) +++ vm/jitrino/src/vm/VMInterface.h (working copy) @@ -182,7 +182,7 @@ // // accessors for DynoptInfo of this method // - virtual uint32 getUniqueId() = 0; + virtual POINTER_SIZE_INT getUniqueId() = 0; virtual void* getHandleMap() = 0; virtual void setHandleMap(void* ) = 0; Index: vm/jitrino/src/main/PMF.cpp =================================================================== --- vm/jitrino/src/main/PMF.cpp (revision 511718) +++ vm/jitrino/src/main/PMF.cpp (working copy) @@ -932,7 +932,7 @@ static int cmd_strength (bool jit_known, bool filter_known, size_t path_size) { - return ((1 + (filter_known ? 2 : 0) + (jit_known ? 4 : 0)) << 16) + path_size; + return int( ((1 + (filter_known ? 2 : 0) + (jit_known ? 4 : 0)) << 16) + path_size ); } @@ -1758,10 +1758,10 @@ continue; cmdp->log = true; - cmdp->xlog = i - leftbeg; + cmdp->xlog = int(i - leftbeg); int xpath = cmdp->xkeyword + 1, - xlast = cmdp->left->size() - 1; + xlast = (int)cmdp->left->size() - 1; if (cmdp->xlog == xlast) {// stream enable command @@ -1787,7 +1787,7 @@ continue; int xpath = cmdp->xkeyword + 1, - xlast = cmdp->left->size() - 1, + xlast = (int)cmdp->left->size() - 1, pathsz = cmdp->xlog - xpath; Str& key = cmdp->left->at(xlast); Index: vm/jitrino/src/shared/InlineInfo.h =================================================================== --- vm/jitrino/src/shared/InlineInfo.h (revision 511718) +++ vm/jitrino/src/shared/InlineInfo.h (working copy) @@ -108,7 +108,7 @@ os << ::std::endl; } - uint32 countLevels() { return inlineChain ? inlineChain->size() : 0; } + uint32 countLevels() { return inlineChain ? (uint32)inlineChain->size() : 0; } protected: friend class InlineInfoMap; Index: vm/jitrino/src/shared/ControlFlowGraph.h =================================================================== --- vm/jitrino/src/shared/ControlFlowGraph.h (revision 511718) +++ vm/jitrino/src/shared/ControlFlowGraph.h (working copy) @@ -719,14 +719,14 @@ * * @return The number of outgoing edges of the node. */ - uint32 getOutDegree() const {return getOutEdges().size();} + uint32 getOutDegree() const {return (uint32)getOutEdges().size();} /** * Gets the number of incoming edges to the node. * * @return The number of incoming edges to the node. */ - uint32 getInDegree() const {return getInEdges().size();} + uint32 getInDegree() const {return (uint32)getInEdges().size();} /** * Checks whether the node has only one outgoing edge. Index: vm/jitrino/src/shared/LoopTree.cpp =================================================================== --- vm/jitrino/src/shared/LoopTree.cpp (revision 511718) +++ vm/jitrino/src/shared/LoopTree.cpp (working copy) @@ -209,7 +209,7 @@ Node* block = fg->createNode(header->getKind()); if (coalesceCallback!=NULL) { - coalesceCallback->coalesce(header, block, edges.size()); + coalesceCallback->coalesce(header, block, (uint32)edges.size()); } //retarget all edges for (Edges::const_iterator ite = edges.begin(), ende = edges.end(); ite!=ende; ++ite) { Index: vm/jitrino/src/shared/PlatformDependant.h =================================================================== --- vm/jitrino/src/shared/PlatformDependant.h (revision 511718) +++ vm/jitrino/src/shared/PlatformDependant.h (working copy) @@ -30,8 +30,12 @@ #define strnicmp strncasecmp #else #pragma warning( push, 4 ) - #pragma warning( disable : 4100 4127 4201 4511 4512 ) + #pragma warning( disable : 4100 4127 4201 4511 4512) #pragma conform( forScope, on ) + + #define strdup _strdup + #define strcmpi _strcmpi + #define stricmp _stricmp #endif //_MSC_VER #undef stdcall__ Index: vm/jitrino/src/shared/Interval.cpp =================================================================== --- vm/jitrino/src/shared/Interval.cpp (revision 511718) +++ vm/jitrino/src/shared/Interval.cpp (working copy) @@ -79,13 +79,13 @@ while (i != iend && k != kend) { - if ((d = i->end - k->beg) < 0) + if ((d = int(i->end - k->beg)) < 0) { if (d == -1) ++adj; ++i; } - else if ((d = i->beg - k->end) > 0) + else if ((d = int(i->beg - k->end)) > 0) { if (d == 1) ++adj; Index: vm/jitrino/src/dynopt/ValueProfiler.cpp =================================================================== --- vm/jitrino/src/dynopt/ValueProfiler.cpp (revision 511718) +++ vm/jitrino/src/dynopt/ValueProfiler.cpp (working copy) @@ -118,7 +118,7 @@ } } - uint32 cc_size = counterKeys.size(); + uint32 cc_size = (uint32)counterKeys.size(); if (cc_size == 0) return; irm.getCompilationInterface().lockMethodData(); Index: vm/jitrino/src/dynopt/EdgeProfiler.cpp =================================================================== --- vm/jitrino/src/dynopt/EdgeProfiler.cpp (revision 511718) +++ vm/jitrino/src/dynopt/EdgeProfiler.cpp (working copy) @@ -87,7 +87,7 @@ //compute edge-ids before CFG modification: edge-ids are part of CFG consistency check. for (Edges::const_iterator it = edgesToInstrument.begin(), end = edgesToInstrument.end(); it!=end; ++it) { Edge* edge = *it; - uint32 key = genKey(counterKeys.size() + 1, edge, bcLevelProfiling, debug); + uint32 key = genKey((uint32)counterKeys.size() + 1, edge, bcLevelProfiling, debug); assert( key != 0 ); counterKeys.push_back(key); } @@ -110,7 +110,7 @@ ProfilingInterface* pi = irm.getProfilingInterface(); if (!pi->hasMethodProfile(ProfileType_Edge, md, JITProfilingRole_GEN)) { - pi->createEdgeMethodProfile(mm , md, counterKeys.size(), (uint32*)&counterKeys.front(), _checkSum); + pi->createEdgeMethodProfile(mm , md, (uint32)counterKeys.size(), (uint32*)&counterKeys.front(), _checkSum); } irm.getCompilationInterface().unlockMethodData(); Index: vm/jitrino/src/dynopt/StaticProfiler.cpp =================================================================== --- vm/jitrino/src/dynopt/StaticProfiler.cpp (revision 511718) +++ vm/jitrino/src/dynopt/StaticProfiler.cpp (working copy) @@ -315,7 +315,7 @@ Edge* falseEdge = c->node->getFalseEdge(); Edge* trueEdge = c->node->getTrueEdge(); double probLeft = 1.0; - uint32 edgesLeft = edges.size(); + uint32 edgesLeft = (uint32)edges.size(); if (falseEdge == NULL || trueEdge == NULL) { // can't apply general heuristics. Edge* uncondEdge = c->node->getUnconditionalEdge(); if (uncondEdge) {