Index: vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (working copy) @@ -479,7 +479,7 @@ hlpArgs[0] = newImmOpnd(typeManager.getIntPtrType(), Opnd::RuntimeInfo::Kind_MethodRuntimeId, &methodDesc); Node* prolog = getFlowGraph()->getEntryNode(); - prolog->appendInst(newRuntimeHelperCallInst(CompilationInterface::Helper_MethodEntry, + prolog->appendInst(newRuntimeHelperCallInst(VM_RT_JVMTI_METHOD_ENTER_CALLBACK, 1, (Opnd**)hlpArgs, NULL)); } @@ -513,7 +513,7 @@ } //_________________________________________________________________________________________________ -CallInst * IRManager::newRuntimeHelperCallInst(CompilationInterface::RuntimeHelperId helperId, +CallInst * IRManager::newRuntimeHelperCallInst(VM_RT_SUPPORT helperId, uint32 numArgs, Opnd ** args, Opnd * retOpnd) { Inst * instList = NULL; @@ -1251,15 +1251,15 @@ } //_________________________________________________________________________________________________ -const CallingConvention * IRManager::getCallingConvention(CompilationInterface::RuntimeHelperId helperId)const +const CallingConvention * IRManager::getCallingConvention(VM_RT_SUPPORT helperId)const { - CompilationInterface::VmCallingConvention callConv=compilationInterface.getRuntimeHelperCallingConvention(helperId); + HELPER_CALLING_CONVENTION callConv = compilationInterface.getRuntimeHelperCallingConvention(helperId); switch (callConv){ - case CompilationInterface::CallingConvention_Drl: + case CALLING_CONVENTION_DRL: return &CallingConvention_DRL; - case CompilationInterface::CallingConvention_Stdcall: + case CALLING_CONVENTION_STDCALL: return &CallingConvention_STDCALL; - case CompilationInterface::CallingConvention_Cdecl: + case CALLING_CONVENTION_CDECL: return &CallingConvention_CDECL; default: assert(0); @@ -1721,12 +1721,12 @@ //shadow - is an area on stack reserved to map parameters passed with registers bool needShadow = rt->getKind() == Opnd::RuntimeInfo::Kind_InternalHelperAddress; if (!needShadow && rt->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress) { - CompilationInterface::RuntimeHelperId helperId = (CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)rt->getValue(0); + VM_RT_SUPPORT helperId = (VM_RT_SUPPORT)(POINTER_SIZE_INT)rt->getValue(0); //ABOUT: VM does not allocate shadow for most of the helpers //however some helpers are direct pointers to native funcs //TODO: create VM interface to get calling conventions for the helper //today this knowledge is hardcoded here - needShadow = helperId == CompilationInterface::Helper_GetTLSBase; + needShadow = helperId == VM_RT_GC_GET_TLS_BASE; } if (needShadow) { uint32 shadowSize = 4 * sizeof(POINTER_SIZE_INT); @@ -1907,7 +1907,7 @@ #endif )){ Node* throwBasicBlock = fg->createBlockNode(); - Inst* throwInst = newRuntimeHelperCallInst(CompilationInterface::Helper_NullPtrException, 0, NULL, NULL); + Inst* throwInst = newRuntimeHelperCallInst(VM_RT_NULL_PTR_EXCEPTION, 0, NULL, NULL); assert(lastInst->getBCOffset()!=ILLEGAL_BC_MAPPING_VALUE); throwInst->setBCOffset(lastInst->getBCOffset()); throwBasicBlock->appendInst(throwInst); @@ -1995,7 +1995,7 @@ case Opnd::RuntimeInfo::Kind_HelperAddress: /** The value of the operand is compilationInterface->getRuntimeHelperAddress */ value=(POINTER_SIZE_INT)compilationInterface.getRuntimeHelperAddress( - (CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)info->getValue(0) + (VM_RT_SUPPORT)(POINTER_SIZE_INT)info->getValue(0) ); assert(value!=0); break; @@ -2297,7 +2297,7 @@ if (!isInternalHelper) { CompilationInterface* ci = CompilationContext::getCurrentContext()->getVMCompilationInterface(); isNonGCVMHelper = rt && rt->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress - && !ci->mayBeInterruptible((CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)rt->getValue(0)); + && !ci->mayBeInterruptible((VM_RT_SUPPORT)(POINTER_SIZE_INT)rt->getValue(0)); } bool isGCPoint = !isInternalHelper && !isNonGCVMHelper; return isGCPoint; Index: vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp (working copy) @@ -92,7 +92,7 @@ FilterAttr mnemonic; FilterAttr operandNumber; FilterAttr rtKind; - FilterAttr rtHelperID; + FilterAttr rtHelperID; FilterAttr rtIntHelperName; FilterAttr isNative; FilterAttr isStatic; @@ -111,7 +111,7 @@ StlMap operandFilters; - Filter() : isInitialized(false), isNegative(false), isOR(false), mnemonic(Mnemonic_NULL), operandNumber(-1), rtKind(Opnd::RuntimeInfo::Kind_Null),rtHelperID(CompilationInterface::Helper_Null), rtIntHelperName("none"), isNative(false), isStatic(false), isSynchronized(false), isNoInlining(false), isInstance(false), isFinal(false), isVirtual(false), isAbstract(false), isClassInitializer(false), isInstanceInitializer(false), isStrict(false), isRequireSecObject(false), isInitLocals(false), isOverridden(false), operandFilters(Jitrino::getGlobalMM()) {} + Filter() : isInitialized(false), isNegative(false), isOR(false), mnemonic(Mnemonic_NULL), operandNumber(-1), rtKind(Opnd::RuntimeInfo::Kind_Null), rtHelperID(VM_RT_UNKNOWN), rtIntHelperName("none"), isNative(false), isStatic(false), isSynchronized(false), isNoInlining(false), isInstance(false), isFinal(false), isVirtual(false), isAbstract(false), isClassInitializer(false), isInstanceInitializer(false), isStrict(false), isRequireSecObject(false), isInitLocals(false), isOverridden(false), operandFilters(Jitrino::getGlobalMM()) {} Filter& operator=(const Filter& c) { Filter& f = *this; @@ -806,7 +806,7 @@ if(filter.rtHelperID.isInitialized) { if(!rt) return false; - res = filter.rtHelperID.value == (CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)rt->getValue(0); + res = filter.rtHelperID.value == (VM_RT_SUPPORT)(POINTER_SIZE_INT)rt->getValue(0); if(filter.rtHelperID.isNegative) res = !res; Index: vm/jitrino/src/codegenerator/ia32/Ia32Printer.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32Printer.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32Printer.cpp (working copy) @@ -434,7 +434,7 @@ { os<<"h:"<< irManager->getCompilationInterface().getRuntimeHelperName( - (CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)info->getValue(0) + (VM_RT_SUPPORT)(POINTER_SIZE_INT)info->getValue(0) ); }break; case Opnd::RuntimeInfo::Kind_InternalHelperAddress: Index: vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp (working copy) @@ -426,8 +426,8 @@ CallInst* callInst = (CallInst*)inst; Opnd::RuntimeInfo * rt = callInst->getRuntimeInfo(); if (rt && rt->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress - && ((CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)rt->getValue(0) - == CompilationInterface::Helper_GetStaticFieldAddrWithResolve)) + && ((VM_RT_SUPPORT)(POINTER_SIZE_INT)rt->getValue(0) + == VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE)) { return true; } Index: vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp (working copy) @@ -244,8 +244,8 @@ void* rt_data = ri->getValue(0); POINTER_SIZE_INT helperId = (POINTER_SIZE_INT)rt_data; switch(helperId) { - case CompilationInterface::Helper_ConvStoI32: - case CompilationInterface::Helper_ConvDtoI32: + case VM_RT_F2I: + case VM_RT_D2I: return handleInst_Convert_F2I_D2I(inst); default: break; Index: vm/jitrino/src/codegenerator/ia32/Ia32CgUtils.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32CgUtils.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32CgUtils.cpp (working copy) @@ -242,10 +242,10 @@ } else if (ri->getKind() == Opnd::RuntimeInfo::Kind_InternalHelperAddress) { return false; } else if (ri->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress) { - CompilationInterface::RuntimeHelperId helperId = (CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)ri->getValue(0); + VM_RT_SUPPORT helperId = (VM_RT_SUPPORT)(POINTER_SIZE_INT)ri->getValue(0); switch (helperId) { - case CompilationInterface::Helper_GetTLSBase: - case CompilationInterface::Helper_EnableThreadSuspension: + case VM_RT_GC_GET_TLS_BASE: + case VM_RT_GC_SAFE_POINT: return false; default: break; Index: vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32IRManager.h (working copy) @@ -207,7 +207,7 @@ uint32 numArgs, Opnd ** args, Opnd * retOpnd); /** A specialization of the newCallInst to create a VM Helper CallInst. */ - CallInst * newRuntimeHelperCallInst(CompilationInterface::RuntimeHelperId helperId, + CallInst * newRuntimeHelperCallInst(VM_RT_SUPPORT helperId, uint32 numArgs, Opnd ** args, Opnd * retOpnd); /** A specialization of the newCallInst to create an internal helper CallInst. */ CallInst * newInternalRuntimeHelperCallInst(const char * internalHelperID, uint32 numArgs, Opnd ** args, Opnd * retOpnd); @@ -261,7 +261,7 @@ void setHasNonExceptionCalls(){ hasNonExceptionCalls=true; } bool getHasNonExceptionCalls()const{ return hasNonExceptionCalls; } //----------------------------------------------------------------------------------------------- - const CallingConvention * getCallingConvention(CompilationInterface::RuntimeHelperId helperId)const; + const CallingConvention * getCallingConvention(VM_RT_SUPPORT helperId)const; const CallingConvention * getCallingConvention(MethodDesc * methodDesc)const; Index: vm/jitrino/src/codegenerator/ia32/Ia32Tls.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32Tls.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32Tls.cpp (working copy) @@ -69,7 +69,7 @@ { // Dunno where the HYTHR keeps its thread structure - request through the helper Opnd* tlsBase = irManager.newOpnd(tlsBaseType); - Inst* callInst = irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_GetTLSBase, 0, NULL, tlsBase); + Inst* callInst = irManager.newRuntimeHelperCallInst(VM_RT_GC_GET_TLS_BASE, 0, NULL, tlsBase); ctrlNode->appendInst(callInst); return tlsBase; } Index: vm/jitrino/src/codegenerator/ia32/Ia32BBPolling.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32BBPolling.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32BBPolling.cpp (working copy) @@ -380,7 +380,7 @@ #endif bbpBBHelpCaller->appendInst(irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_EnableThreadSuspension, 0, NULL, NULL) + VM_RT_GC_SAFE_POINT, 0, NULL, NULL) ); bbpCFG->addEdge(bbpBBController,bbpBBHelpCaller, 0); @@ -405,7 +405,7 @@ } CompilationInterface* ci = CompilationContext::getCurrentContext()->getVMCompilationInterface(); if ( ri->getKind() == Opnd::RuntimeInfo::Kind_HelperAddress && - ci->isInterruptible((CompilationInterface::RuntimeHelperId)(POINTER_SIZE_INT)ri->getValue(0)) ) + ci->isInterruptible((VM_RT_SUPPORT)(POINTER_SIZE_INT)ri->getValue(0)) ) { return true; } Index: vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.cpp (working copy) @@ -256,7 +256,7 @@ Opnd* opcodeArg = irManager.newImmOpnd(typeManager.getUInt32Type(), opcode); Opnd* args[] = {encClassArg, cpIndexArg, opcodeArg}; - appendInsts(irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_Throw_LinkingException, lengthof(args), args, NULL)); + appendInsts(irManager.newRuntimeHelperCallInst(VM_RT_THROW_LINKING_EXCEPTION, lengthof(args), args, NULL)); } //_______________________________________________________________________________________________________________ Opnd * InstCodeSelector::convertIntToInt(Opnd * srcOpnd, Type * dstType, Opnd * dstOpnd, bool isZeroExtend) @@ -321,17 +321,17 @@ Opnd * InstCodeSelector::convertFpToInt(Opnd * srcOpnd, Type * dstType, Opnd * dstOpnd) { assert(srcOpnd->getType()->isFP() && dstType->isInteger()); - CompilationInterface::RuntimeHelperId helperId; + VM_RT_SUPPORT helperId; OpndSize dstSize=irManager.getTypeSize(dstType); if (dstSize<=OpndSize_32){ if (dstOpnd==NULL) dstOpnd=irManager.newOpnd(typeManager.getInt32Type()); - helperId=srcOpnd->getType()->isSingle()?CompilationInterface::Helper_ConvStoI32:CompilationInterface::Helper_ConvDtoI32; + helperId=srcOpnd->getType()->isSingle()?VM_RT_F2I:VM_RT_D2I; }else{ assert(dstSize==OpndSize_64); if (dstOpnd==NULL) dstOpnd=irManager.newOpnd(dstType); - helperId=srcOpnd->getType()->isSingle()?CompilationInterface::Helper_ConvStoI64:CompilationInterface::Helper_ConvDtoI64; + helperId=srcOpnd->getType()->isSingle()?VM_RT_F2L:VM_RT_D2L; } Opnd * args[] = {srcOpnd}; @@ -1361,8 +1361,8 @@ Opnd * args[]={ (Opnd*)exceptionObj }; CallInst * callInst=irManager.newRuntimeHelperCallInst( createStackTrace ? - CompilationInterface::Helper_Throw_SetStackTrace : - CompilationInterface::Helper_Throw_KeepStackTrace, + VM_RT_THROW_SET_STACK_TRACE : + VM_RT_THROW, lengthof(args), args, NULL ); appendInsts(callInst); @@ -1378,19 +1378,19 @@ switch (id) { case CompilationInterface::Exception_NullPointer: callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_NullPtrException, 0, NULL, NULL); + VM_RT_NULL_PTR_EXCEPTION, 0, NULL, NULL); break; case CompilationInterface::Exception_ArrayIndexOutOfBounds: callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_ArrayBoundsException, 0, NULL, NULL); + VM_RT_IDX_OUT_OF_BOUNDS, 0, NULL, NULL); break; case CompilationInterface::Exception_ArrayTypeMismatch: callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_ElemTypeException, 0, NULL, NULL); + VM_RT_ARRAY_STORE_EXCEPTION, 0, NULL, NULL); break; case CompilationInterface::Exception_DivideByZero: callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_DivideByZeroException, 0, NULL, NULL); + VM_RT_DIVIDE_BY_ZERO_EXCEPTION, 0, NULL, NULL); break; default: assert(0); @@ -1507,7 +1507,7 @@ cmpType = CompareOp::I; Node* throwBasicBlock = irManager.getFlowGraph()->createBlockNode(); - Inst* throwInst = irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_ArrayBoundsException, 0, NULL, NULL); + Inst* throwInst = irManager.newRuntimeHelperCallInst(VM_RT_IDX_OUT_OF_BOUNDS, 0, NULL, NULL); throwInst->setBCOffset(currentHIRInstBCOffset); throwBasicBlock->appendInst(throwInst); @@ -1541,7 +1541,7 @@ cmpOp = CompareOp::Gtu; } Node* throwBasicBlock = irManager.getFlowGraph()->createBlockNode(); - Inst* throwInst = irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_ArrayBoundsException, 0, NULL, NULL); + Inst* throwInst = irManager.newRuntimeHelperCallInst(VM_RT_IDX_OUT_OF_BOUNDS, 0, NULL, NULL); throwInst->setBCOffset(currentHIRInstBCOffset); throwBasicBlock->appendInst(throwInst); @@ -1571,7 +1571,7 @@ CG_OpndHandle* tauIsArray) { Node* throwBasicBlock = irManager.getFlowGraph()->createBlockNode(); - Inst* throwInst = irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_ElemTypeException, 0, NULL, NULL); + Inst* throwInst = irManager.newRuntimeHelperCallInst(VM_RT_ARRAY_STORE_EXCEPTION, 0, NULL, NULL); assert(currentHIRInstBCOffset!=ILLEGAL_BC_MAPPING_VALUE); throwInst->setBCOffset(currentHIRInstBCOffset); throwBasicBlock->appendInst(throwInst); @@ -1580,7 +1580,7 @@ Opnd * flag = irManager.newOpnd(typeManager.getInt32Type()); appendInsts(irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_IsValidElemType, lengthof(args), args, flag)); + VM_RT_AASTORE_TEST, lengthof(args), args, flag)); // the helper returns boolean value bzero(CompareZeroOp::I4, flag); @@ -1595,7 +1595,7 @@ CG_OpndHandle* InstCodeSelector::tau_checkZero(CG_OpndHandle* src) { Node* throwBasicBlock = irManager.getFlowGraph()->createBlockNode(); - Inst* throwInst = irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_DivideByZeroException, 0, NULL, NULL); + Inst* throwInst = irManager.newRuntimeHelperCallInst(VM_RT_DIVIDE_BY_ZERO_EXCEPTION, 0, NULL, NULL); assert(currentHIRInstBCOffset!=ILLEGAL_BC_MAPPING_VALUE); throwInst->setBCOffset(currentHIRInstBCOffset); throwBasicBlock->appendInst(throwInst); @@ -2070,7 +2070,7 @@ { Opnd* helperOpnds[] = {(Opnd*)base,(Opnd*)ptr,(Opnd*)src}; CallInst * callInst = irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_WriteBarrier, + VM_RT_GC_HEAP_WRITE_REF, 3,helperOpnds,NULL); appendInsts(callInst); } @@ -2118,7 +2118,7 @@ Opnd * retOpnd=irManager.newOpnd(objType); CallInst * callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_NewObj_UsingVtable, + VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE, 2, helperOpnds, retOpnd); appendInsts(callInst); return retOpnd; @@ -2137,7 +2137,7 @@ }; Opnd * retOpnd=irManager.newOpnd(arrayType); CallInst * callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_NewVector_UsingVtable, + VM_RT_NEW_VECTOR_USING_VTABLE, 2, helperOpnds, retOpnd); appendInsts(callInst); return retOpnd; @@ -2158,7 +2158,7 @@ helperOpnds[i + 2] = (Opnd*)dims[numDims - 1 - i]; Opnd * retOpnd=irManager.newOpnd(arrayType); CallInst * callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_NewMultiArray, + VM_RT_MULTIANEWARRAY_RESOLVED, 2+numDims, helperOpnds, retOpnd); appendInsts(callInst); return retOpnd; @@ -2193,7 +2193,7 @@ }; #endif - CallInst * callInst = irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_LdRef, 2, helperOpnds, retOpnd); + CallInst * callInst = irManager.newRuntimeHelperCallInst(VM_RT_LDC_STRING, 2, helperOpnds, retOpnd); appendInsts(callInst); } else { // this optimized version is based on determinig item address at compile time. @@ -2392,7 +2392,7 @@ Opnd * retOpnd=irManager.newOpnd(dstType); CallInst * callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_LdInterface, + VM_RT_GET_INTERFACE_VTABLE_VER0, 2, helperOpnds, retOpnd); appendInsts(callInst); return retOpnd; @@ -2703,11 +2703,11 @@ CG_OpndHandle* InstCodeSelector::callvmhelper(uint32 numArgs, CG_OpndHandle** args, Type* retType, - CompilationInterface::RuntimeHelperId callId) + VM_RT_SUPPORT callId) { Opnd* dstOpnd=NULL; switch(callId) { - case CompilationInterface::Helper_Throw_Lazy: + case VM_RT_THROW_LAZY: { Opnd **hlpArgs = new (memManager) Opnd* [numArgs+1]; @@ -2719,11 +2719,11 @@ hlpArgs[i+1] = (Opnd*)args[i+1]; hlpArgs[numArgs] = irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_MethodRuntimeId, md); - appendInsts(irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_Throw_Lazy, + appendInsts(irManager.newRuntimeHelperCallInst(VM_RT_THROW_LAZY, numArgs+1, (Opnd**)hlpArgs, dstOpnd)); break; } - case CompilationInterface::Helper_GetTLSBase: + case VM_RT_GC_GET_TLS_BASE: { assert(numArgs == 0); Type* tlsBaseType = typeManager.getUnmanagedPtrType(typeManager.getInt8Type()); @@ -2732,28 +2732,28 @@ break; } //vmhelper slow paths - case CompilationInterface::Helper_NewObj_UsingVtable: - case CompilationInterface::Helper_NewVector_UsingVtable: - case CompilationInterface::Helper_ObjMonitorEnter: - case CompilationInterface::Helper_ObjMonitorExit: - case CompilationInterface::Helper_WriteBarrier: - case CompilationInterface::Helper_LdInterface: - case CompilationInterface::Helper_Cast: - case CompilationInterface::Helper_IsInstanceOf: + case VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE: + case VM_RT_NEW_VECTOR_USING_VTABLE: + case VM_RT_MONITOR_ENTER_NON_NULL: + case VM_RT_MONITOR_EXIT_NON_NULL: + case VM_RT_GC_HEAP_WRITE_REF: + case VM_RT_GET_INTERFACE_VTABLE_VER0: + case VM_RT_CHECKCAST: + case VM_RT_INSTANCEOF: //helpers used by JIT in lazy resolution mode - case CompilationInterface::Helper_NewObjWithResolve: - case CompilationInterface::Helper_NewArrayWithResolve: - case CompilationInterface::Helper_GetNonStaticFieldOffsetWithResolve: - case CompilationInterface::Helper_GetStaticFieldAddrWithResolve: - case CompilationInterface::Helper_CheckCastWithResolve: - case CompilationInterface::Helper_InstanceOfWithResolve: - case CompilationInterface::Helper_GetInvokeStaticAddrWithResolve: - case CompilationInterface::Helper_GetInvokeInterfaceAddrWithResolve: - case CompilationInterface::Helper_GetInvokeVirtualAddrWithResolve: - case CompilationInterface::Helper_GetInvokeSpecialAddrWithResolve: - case CompilationInterface::Helper_InitializeClassWithResolve: - case CompilationInterface::Helper_NewMultiArray: + case VM_RT_NEWOBJ_WITHRESOLVE: + case VM_RT_NEWARRAY_WITHRESOLVE: + case VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE: + case VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE: + case VM_RT_CHECKCAST_WITHRESOLVE: + case VM_RT_INSTANCEOF_WITHRESOLVE: + case VM_RT_GET_INVOKESTATIC_ADDR_WITHRESOLVE: + case VM_RT_GET_INVOKEINTERFACE_ADDR_WITHRESOLVE: + case VM_RT_GET_INVOKEVIRTUAL_ADDR_WITHRESOLVE: + case VM_RT_GET_INVOKE_SPECIAL_ADDR_WITHRESOLVE: + case VM_RT_INITIALIZE_CLASS_WITHRESOLVE: + case VM_RT_MULTIANEWARRAY_RESOLVED: { dstOpnd = retType==NULL ? NULL: irManager.newOpnd(retType); CallInst * callInst=irManager.newRuntimeHelperCallInst(callId, numArgs, (Opnd**)args, dstOpnd); @@ -2824,7 +2824,7 @@ void InstCodeSelector::tau_monitorEnter(CG_OpndHandle* obj, CG_OpndHandle* tauIsNonNull) { Opnd * helperOpnds[] = { (Opnd*)obj }; - CallInst * callInst=irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_ObjMonitorEnter, + CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_ENTER_NON_NULL, 1, helperOpnds, NULL); appendInsts(callInst); } @@ -2836,7 +2836,7 @@ CG_OpndHandle* tauIsNonNull) { Opnd * helperOpnds[] = { (Opnd*)obj }; - CallInst * callInst=irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_ObjMonitorExit, + CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_EXIT_NON_NULL, 1, helperOpnds, NULL); appendInsts(callInst); } @@ -2902,7 +2902,7 @@ void InstCodeSelector::typeMonitorEnter(NamedType *type) { Opnd * helperOpnds[]={irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, type)}; - CallInst * callInst=irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_TypeMonitorEnter, + CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_ENTER_STATIC, 1, helperOpnds, NULL); appendInsts(callInst); } @@ -2914,7 +2914,7 @@ void InstCodeSelector::typeMonitorExit(NamedType *type) { Opnd * helperOpnds[]={irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, type)}; - CallInst * callInst=irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_TypeMonitorExit, + CallInst * callInst=irManager.newRuntimeHelperCallInst(VM_RT_MONITOR_EXIT_STATIC, 1, helperOpnds, NULL); appendInsts(callInst); } @@ -2944,7 +2944,7 @@ Opnd * dst=irManager.newOpnd(toType); Opnd * args[]={ (Opnd*)obj, irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, toType) }; CallInst * callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_Cast, + VM_RT_CHECKCAST, lengthof(args), args, dst ); appendInsts(callInst); @@ -2965,7 +2965,7 @@ Opnd * dst=irManager.newOpnd(toType); Opnd * args[]={ (Opnd*)obj, irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, toType) }; CallInst * callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_Cast, + VM_RT_CHECKCAST, lengthof(args), args, dst ); appendInsts(callInst); @@ -3003,7 +3003,7 @@ #endif Opnd * args[]={ (Opnd*)obj, irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, type) }; CallInst * callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_IsInstanceOf, + VM_RT_INSTANCEOF, lengthof(args), args, dst ); appendInsts(callInst); @@ -3019,7 +3019,7 @@ NamedType * namedType = type->asNamedType(); Opnd * args[]={ irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_TypeRuntimeId, namedType) }; CallInst * callInst=irManager.newRuntimeHelperCallInst( - CompilationInterface::Helper_InitType, + VM_RT_INITIALIZE_CLASS, lengthof(args), args, NULL ); appendInsts(callInst); @@ -3132,7 +3132,7 @@ Opnd **hlpArgs = new (memManager) Opnd* [1]; hlpArgs[0] = irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_MethodRuntimeId, mDesc); - appendInsts(irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_MethodEntry, + appendInsts(irManager.newRuntimeHelperCallInst(VM_RT_JVMTI_METHOD_ENTER_CALLBACK, 1, (Opnd**)hlpArgs, dstOpnd)); } } @@ -3174,7 +3174,7 @@ Opnd* hlpArgs[] = { irManager.newImmOpnd(getRuntimeIdType(), Opnd::RuntimeInfo::Kind_MethodRuntimeId, mDesc), bufOpnd }; - appendInsts(irManager.newRuntimeHelperCallInst(CompilationInterface::Helper_MethodExit, + appendInsts(irManager.newRuntimeHelperCallInst(VM_RT_JVMTI_METHOD_EXIT_CALLBACK, 2, (Opnd**)hlpArgs, NULL)); } Index: vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h =================================================================== --- vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h (revision 583684) +++ vm/jitrino/src/codegenerator/ia32/Ia32InstCodeSelector.h (working copy) @@ -221,7 +221,7 @@ 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, - CompilationInterface::RuntimeHelperId callId); + VM_RT_SUPPORT callId); CG_OpndHandle* box(ObjectType * boxedType, CG_OpndHandle* val); CG_OpndHandle* unbox(Type * dstType, CG_OpndHandle* objHandle); @@ -283,7 +283,7 @@ void genReturn(); CG_OpndHandle* runtimeHelperCall(uint32 numArgs, CG_OpndHandle** args, Type *retType, - CompilationInterface::RuntimeHelperId helper, + VM_RT_SUPPORT helper, Type *typeArgument, Opnd * nonNullFirstArgTau); void genExitHelper(Opnd* retOpnd, MethodDesc* meth); @@ -445,7 +445,7 @@ uint32 switchNumTargets; PersistentInstructionId currPersistentId; Opnd * currPredOpnd; - static CompilationInterface::RuntimeHelperId + static VM_RT_SUPPORT divOpHelperIds[], remOpHelperIds[]; static uint32 _tauUnsafe; Index: vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h =================================================================== --- vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h (revision 583684) +++ vm/jitrino/src/codegenerator/ipf/include/IpfCodeSelector.h (working copy) @@ -301,7 +301,7 @@ //---------------------------------------------------------------------------// CG_OpndHandle* callvmhelper(uint32, CG_OpndHandle**, Type* - , CompilationInterface::RuntimeHelperId) { NOT_IMPLEMENTED_C("unbox") } + , VM_RT_SUPPORT) { NOT_IMPLEMENTED_C("unbox") } CG_OpndHandle* convUPtrToObject(ObjectType*, CG_OpndHandle*) { NOT_IMPLEMENTED_C("convUPtrToObject") } CG_OpndHandle* convToUPtr(PtrType*, CG_OpndHandle*) { NOT_IMPLEMENTED_C("convToUPtr") } Index: vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp =================================================================== --- vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp (revision 583684) +++ vm/jitrino/src/codegenerator/ipf/IpfInstCodeSelector.cpp (working copy) @@ -1316,7 +1316,7 @@ IPF_LOG << " tau_callintr" << endl; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_CharArrayCopy; + VM_RT_SUPPORT hId = VM_RT_CHAR_ARRAYCOPY_NO_EXC; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); RegOpnd *retOpnd = NULL; @@ -1365,9 +1365,9 @@ Opnd *helperArgs[] = { (Opnd *)exceptionObj }; - CompilationInterface::RuntimeHelperId hId; - if (createStackTrace) hId = CompilationInterface::Helper_Throw_SetStackTrace; - else hId = CompilationInterface::Helper_Throw_KeepStackTrace; + VM_RT_SUPPORT hId; + if (createStackTrace) hId = VM_RT_THROW_SET_STACK_TRACE; + else hId = VM_RT_THROW; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -1382,16 +1382,16 @@ IPF_LOG << " throwSystemException" << endl; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_Null; + VM_RT_SUPPORT hId = CompilationInterface::Helper_Null; switch (id) { case CompilationInterface::Exception_NullPointer: - hId = CompilationInterface::Helper_NullPtrException; break; + hId = VM_RT_NULL_PTR_EXCEPTION; break; case CompilationInterface::Exception_ArrayIndexOutOfBounds: - hId = CompilationInterface::Helper_ArrayBoundsException; break; + hId = VM_RT_IDX_OUT_OF_BOUNDS; break; case CompilationInterface::Exception_ArrayTypeMismatch: - hId = CompilationInterface::Helper_ElemTypeException; break; + hId = VM_RT_ARRAY_STORE_EXCEPTION; break; case CompilationInterface::Exception_DivideByZero: - hId = CompilationInterface::Helper_DivideByZeroException; break; + hId = VM_RT_DIVIDE_BY_ZERO_EXCEPTION; break; default: IPF_ERR << "unexpected id " << id << endl; } @@ -1418,7 +1418,7 @@ opndManager->newImm(opcode) }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_Throw_LinkingException; + VM_RT_SUPPORT hId = VM_RT_THROW_LINKING_EXCEPTION; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -1461,7 +1461,7 @@ cmp(CMPLT_CMP_CREL_EQ, truePred, p0, base, zero); // p2 brl.call b0 = helperAddress - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_NullPtrException; + VM_RT_SUPPORT hId = VM_RT_NULL_PTR_EXCEPTION; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); directCall(0, NULL, NULL, helperAddress, truePred, CMPLT_WH_DPNT); @@ -1482,7 +1482,7 @@ cmp(CMPLT_CMP_CREL_GE, truePred, p0, index, arrayLen); // p2 brl.call b0 = helperAddress - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_ArrayBoundsException; + VM_RT_SUPPORT hId = VM_RT_IDX_OUT_OF_BOUNDS; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); directCall(0, NULL, NULL, helperAddress, truePred, CMPLT_WH_DPNT); @@ -1503,7 +1503,7 @@ cmp(CMPLT_CMP_CREL_GT, truePred, p0, a, b); // p2 brl.call b0 = helperAddress - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_ArrayBoundsException; + VM_RT_SUPPORT hId = VM_RT_IDX_OUT_OF_BOUNDS; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); directCall(0, NULL, NULL, helperAddress, truePred, CMPLT_WH_DPNT); @@ -1524,7 +1524,7 @@ cmp(CMPLT_CMP_CREL_GEU, truePred, p0, a, b); // p2 brl.call b0 = helperAddress - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_ArrayBoundsException; + VM_RT_SUPPORT hId = VM_RT_IDX_OUT_OF_BOUNDS; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); directCall(0, NULL, NULL, helperAddress, truePred, CMPLT_WH_DPNT); @@ -1552,7 +1552,7 @@ // p0 brl.call b0, Helper_IsValidElemType // p0 mov retOpnd, r8 - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_IsValidElemType; + VM_RT_SUPPORT hId = VM_RT_AASTORE_TEST; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress1 = opndManager->newImm(address); RegOpnd *retOpnd = opndManager->newRegOpnd(OPND_G_REG, DATA_U64); @@ -1564,7 +1564,7 @@ cmp(CMPLT_CMP_CREL_EQ, truePred, p0, retOpnd, r0); // p3 brl.call b0, Helper_ElemTypeException - hId = CompilationInterface::Helper_ElemTypeException; + hId = VM_RT_ARRAY_STORE_EXCEPTION; address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress2 = opndManager->newImm(address); directCall(0, NULL, NULL, helperAddress2, truePred, CMPLT_WH_DPNT); @@ -1586,7 +1586,7 @@ cmp(CMPLT_CMP_CREL_EQ, truePred, p0, src, r0); // p2 brl.call b0 = helperAddress - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_DivideByZeroException; + VM_RT_SUPPORT hId = VM_RT_DIVIDE_BY_ZERO_EXCEPTION; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); directCall(0, NULL, NULL, helperAddress, truePred, CMPLT_WH_DPNT); @@ -1611,7 +1611,7 @@ (Opnd *)opndManager->newImm((uint64) toType->getRuntimeIdentifier()) }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_Cast; + VM_RT_SUPPORT hId = VM_RT_CHECKCAST; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); directCall(2, helperArgs, NULL, helperAddress, p0); @@ -1701,7 +1701,7 @@ }; RegOpnd *retOpnd = opndManager->newRegOpnd(OPND_G_REG, DATA_BASE); - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_LdRef; + VM_RT_SUPPORT hId = VM_RT_LDC_STRING; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -1811,7 +1811,7 @@ (Opnd *)opndManager->newImm((uint64) vtableType->getRuntimeIdentifier()) }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_LdInterface; + VM_RT_SUPPORT hId = VM_RT_GET_INTERFACE_VTABLE_VER0; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); RegOpnd *retOpnd = opndManager->newRegOpnd(toOpndKind(dstType->tag), toDataKind(dstType->tag)); @@ -1880,7 +1880,7 @@ opndManager->newImm((uint64) type->getRuntimeIdentifier()) }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_IsInstanceOf; + VM_RT_SUPPORT hId = VM_RT_INSTANCEOF; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); RegOpnd *retOpnd = opndManager->newRegOpnd(OPND_G_REG, DATA_I32); @@ -1900,7 +1900,7 @@ uint64 typeRuntimeId = (uint64) type->asNamedType()->getRuntimeIdentifier(); Opnd *helperArgs[] = { opndManager->newImm(typeRuntimeId) }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_InitType; + VM_RT_SUPPORT hId = VM_RT_INITIALIZE_CLASS; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -1919,7 +1919,7 @@ opndManager->newImm((int64) objType->getAllocationHandle()) }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_NewObj_UsingVtable; + VM_RT_SUPPORT hId = VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); OpndKind opndKind = toOpndKind(objType->tag); @@ -1943,7 +1943,7 @@ (Opnd *)numElems }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_NewVector_UsingVtable; + VM_RT_SUPPORT hId = VM_RT_NEW_VECTOR_USING_VTABLE; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); RegOpnd *retOpnd = opndManager->newRegOpnd(OPND_G_REG, DATA_BASE); @@ -1967,7 +1967,7 @@ helperArgs[i + 2] = (Opnd *)dims[numDims - 1 - i]; } - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_NewMultiArray; + VM_RT_SUPPORT hId = VM_RT_MULTIANEWARRAY_RESOLVED; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); RegOpnd *retOpnd = opndManager->newRegOpnd(OPND_G_REG, DATA_BASE); @@ -2054,7 +2054,7 @@ Opnd *helperArgs[] = { (Opnd *)obj }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_ObjMonitorEnter; + VM_RT_SUPPORT hId = VM_RT_MONITOR_ENTER_NON_NULL; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -2071,7 +2071,7 @@ Opnd *helperArgs[] = { (Opnd *)obj }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_ObjMonitorExit; + VM_RT_SUPPORT hId = VM_RT_MONITOR_EXIT_NON_NULL; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -2088,7 +2088,7 @@ uint64 typeRuntimeId = (uint64) type->getRuntimeIdentifier(); Opnd *helperArgs[] = { opndManager->newImm(typeRuntimeId) }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_TypeMonitorEnter; + VM_RT_SUPPORT hId = VM_RT_MONITOR_ENTER_STATIC; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -2105,7 +2105,7 @@ uint64 typeRuntimeId = (uint64) type->getRuntimeIdentifier(); Opnd *helperArgs[] = { opndManager->newImm(typeRuntimeId) }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_TypeMonitorExit; + VM_RT_SUPPORT hId = VM_RT_MONITOR_EXIT_STATIC; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -2921,7 +2921,7 @@ // Opnd *helperArgs[] = { (Opnd *)src1, (Opnd *)src2 }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_RemDouble; + VM_RT_SUPPORT hId = VM_RT_DREM; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -2943,7 +2943,7 @@ opndManager->newImm(refToken), opndManager->newImm((int64) enclosingMethod->getParentType()->getRuntimeIdentifier()) }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_LdRef; + VM_RT_SUPPORT hId = VM_RT_LDC_STRING; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); @@ -3036,7 +3036,7 @@ // Opnd *helperArgs[] = { (Opnd *)src1, (Opnd *)src2 }; - CompilationInterface::RuntimeHelperId hId = CompilationInterface::Helper_RemSingle; + VM_RT_SUPPORT hId = VM_RT_FREM; uint64 address = (uint64) compilationInterface.getRuntimeHelperAddress(hId); Opnd *helperAddress = opndManager->newImm(address); Index: vm/jitrino/src/codegenerator/CodeGenIntfc.h =================================================================== --- vm/jitrino/src/codegenerator/CodeGenIntfc.h (revision 583684) +++ vm/jitrino/src/codegenerator/CodeGenIntfc.h (working copy) @@ -279,7 +279,7 @@ 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, - CompilationInterface::RuntimeHelperId callId) = 0; + VM_RT_SUPPORT callId) = 0; virtual CG_OpndHandle* ldc_i4(int32 val) = 0; virtual CG_OpndHandle* ldc_i8(int64 val) = 0; Index: vm/jitrino/src/optimizer/escanalyzer.cpp =================================================================== --- vm/jitrino/src/optimizer/escanalyzer.cpp (revision 583684) +++ vm/jitrino/src/optimizer/escanalyzer.cpp (working copy) @@ -72,7 +72,7 @@ static void logMethod(MethodPtrType* mpt); static void logMethod(MethodDesc* md); -static bool isVMHelperCall(Inst* inst, CompilationInterface::RuntimeHelperId id); +static bool isVMHelperCall(Inst* inst, VM_RT_SUPPORT id); void EscapeAnalysisPass::_run(IRManager& irm) { @@ -383,19 +383,19 @@ case Op_VMHelperCall: // callvmhelper { - CompilationInterface::RuntimeHelperId callId = inst->asVMHelperCallInst()->getVMHelperId(); + VM_RT_SUPPORT callId = inst->asVMHelperCallInst()->getVMHelperId(); switch(callId) { - case CompilationInterface::Helper_GetStaticFieldAddrWithResolve: + case VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE: instrExam_processLdFieldAddr(inst); break; - case CompilationInterface::Helper_CheckCastWithResolve: + case VM_RT_CHECKCAST_WITHRESOLVE: assert(findCnGNode_op(inst->getDst()->getId())==NULL); addCnGNode_op(inst,inst->getDst()->getType(), NT_REF); exam2Insts->push_back(inst); break; - case CompilationInterface::Helper_NewObjWithResolve: - case CompilationInterface::Helper_NewArrayWithResolve: - case CompilationInterface::Helper_NewMultiArray: + case VM_RT_NEWOBJ_WITHRESOLVE: + case VM_RT_NEWARRAY_WITHRESOLVE: + case VM_RT_MULTIANEWARRAY_RESOLVED: assert(findCnGNode_op(inst->getDst()->getId())==NULL); addCnGNode_op(inst,inst->getDst()->getType(), NT_OBJECT); break; @@ -633,7 +633,7 @@ if (inst->getOpcode() == Op_AddOffset) { nType = NT_INSTFLD; } else { - assert(isVMHelperCall(inst, CompilationInterface::Helper_GetStaticFieldAddrWithResolve)); + assert(isVMHelperCall(inst, VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE)); nType = NT_STFLD; } assert(inst->getDst()->getType()->isManagedPtr()); @@ -743,12 +743,12 @@ break; case Op_VMHelperCall: { - CompilationInterface::RuntimeHelperId helperId = inst->asVMHelperCallInst()->getVMHelperId(); + VM_RT_SUPPORT helperId = inst->asVMHelperCallInst()->getVMHelperId(); switch(helperId) { - case CompilationInterface::Helper_GetStaticFieldAddrWithResolve: + case VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE: instrExam2_processLdFieldAddr(inst); break; - case CompilationInterface::Helper_CheckCastWithResolve: + case VM_RT_CHECKCAST_WITHRESOLVE: { //handling is equal to taucheckcast cgnode = findCnGNode_op(inst->getDst()->getId()); assert(cgnode!=NULL); @@ -776,7 +776,7 @@ if (type->isValue()) { Inst* srcInst = inst->getSrc(0)->getInst(); uint32 src_opcode = srcInst->getOpcode(); - if (src_opcode==Op_LdStaticAddr || isVMHelperCall(srcInst, CompilationInterface::Helper_GetStaticFieldAddrWithResolve)) { + if (src_opcode==Op_LdStaticAddr || isVMHelperCall(srcInst, VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE)) { break; } @@ -827,7 +827,7 @@ if (type->isValue()) { Inst* srcInst = inst->getSrc(1)->getInst(); uint32 src_opcode = srcInst->getOpcode(); - if (src_opcode==Op_LdStaticAddr || isVMHelperCall(srcInst, CompilationInterface::Helper_GetStaticFieldAddrWithResolve)) { + if (src_opcode==Op_LdStaticAddr || isVMHelperCall(srcInst, VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE)) { break; } cgn_src=findCnGNode_op(inst->getSrc(0)->getId()); @@ -1153,7 +1153,7 @@ EscAnalyzer::findCnGNode_fl(Inst* inst, uint32 ntype) { FieldDesc* fd1 = NULL; if (inst->asFieldAccessInst()==NULL) {// unresolved field access - assert(inst->getOpcode() == Op_AddOffset || isVMHelperCall(inst, CompilationInterface::Helper_GetStaticFieldAddrWithResolve)); + assert(inst->getOpcode() == Op_AddOffset || isVMHelperCall(inst, VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE)); } else { fd1 = inst->asFieldAccessInst()->getFieldDesc(); } @@ -1168,7 +1168,7 @@ Inst* inst2 = (Inst*)cgNode->refObj; FieldDesc* fd2 = NULL; if (inst2->asFieldAccessInst()==NULL) { - assert(inst2->getOpcode() == Op_AddOffset || isVMHelperCall(inst2, CompilationInterface::Helper_GetStaticFieldAddrWithResolve)); + assert(inst2->getOpcode() == Op_AddOffset || isVMHelperCall(inst2, VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE)); } else { fd2 = inst2->asFieldAccessInst()->getFieldDesc(); } @@ -1204,7 +1204,7 @@ assert(cgn1!=NULL); } if (cgnfrom->nodeType == NT_REF && cgnfrom->lNode == NULL) { - bool helperCall = isVMHelperCall(cgnfrom->nInst, CompilationInterface::Helper_CheckCastWithResolve); + bool helperCall = isVMHelperCall(cgnfrom->nInst, VM_RT_CHECKCAST_WITHRESOLVE); assert(cgnfrom->nInst->getOpcode()==Op_TauCast || cgnfrom->nInst->getOpcode()==Op_TauStaticCast || helperCall); cgn1 = findCnGNode_op(cgnfrom->nInst->getSrc(helperCall ? 2 : 0)->getId()); assert(cgn1!=NULL); @@ -5859,7 +5859,7 @@ Log::out() << " isOverridden: " << mdesc->isOverridden() << std::endl; } -static bool isVMHelperCall(Inst* inst, CompilationInterface::RuntimeHelperId id) { +static bool isVMHelperCall(Inst* inst, VM_RT_SUPPORT id) { VMHelperCallInst* callInst = inst->asVMHelperCallInst(); if (callInst==NULL) { return false; Index: vm/jitrino/src/optimizer/lazyexceptionopt.cpp =================================================================== --- vm/jitrino/src/optimizer/lazyexceptionopt.cpp (revision 583684) +++ vm/jitrino/src/optimizer/lazyexceptionopt.cpp (working copy) @@ -512,7 +512,7 @@ tinst = *it1; assert(tinst != NULL); tlinst=irManager.getInstFactory().makeVMHelperCall( - OpndManager::getNullOpnd(), CompilationInterface::Helper_Throw_Lazy, opcount, opnds); + OpndManager::getNullOpnd(), VM_RT_THROW_LAZY, opcount, opnds); #ifdef _DEBUG if (Log::isEnabled()) { Log::out() << " 2nd "; Index: vm/jitrino/src/optimizer/Inst.h =================================================================== --- vm/jitrino/src/optimizer/Inst.h (revision 583684) +++ vm/jitrino/src/optimizer/Inst.h (working copy) @@ -1013,8 +1013,8 @@ public: void visit(InstFormatVisitor& visitor) {visitor.accept(this);} bool isVMHelperCallInst() const { return true; } - CompilationInterface::RuntimeHelperId getVMHelperId() const {return vmHelperId;} - bool isThrowLazy() const {return vmHelperId == CompilationInterface::Helper_Throw_Lazy;} + VM_RT_SUPPORT getVMHelperId() const {return vmHelperId;} + bool isThrowLazy() const {return vmHelperId == VM_RT_THROW_LAZY;} private: virtual void handlePrintEscape(::std::ostream&, char code) const; friend class InstFactory; @@ -1024,7 +1024,7 @@ Opnd* dst, uint32 nArgs, Opnd** args_, - CompilationInterface::RuntimeHelperId id) + VM_RT_SUPPORT id) : Inst(op, mod, type, dst, nArgs), vmHelperId(id) { args = args_; @@ -1042,7 +1042,7 @@ args[srcIndex] = src; } Opnd** args; - CompilationInterface::RuntimeHelperId vmHelperId; + VM_RT_SUPPORT vmHelperId; }; @@ -1137,7 +1137,7 @@ Opnd* tauNullChecked, Opnd* tauTypesChecked, uint32 numArgs, Opnd** args); Inst* makeJitHelperCall(Opnd* dst, JitHelperCallId id, uint32 numArgs, Opnd** args); - Inst* makeVMHelperCall(Opnd* dst, CompilationInterface::RuntimeHelperId id, uint32 numArgs, + Inst* makeVMHelperCall(Opnd* dst, VM_RT_SUPPORT id, uint32 numArgs, Opnd** args); @@ -1519,7 +1519,7 @@ Opnd* dst, uint32 nArgs, Opnd** args_, - CompilationInterface::RuntimeHelperId id); + VM_RT_SUPPORT id); PhiInst* makePhiInst(Type::Tag type, Opnd* dst, uint32 nArgs, Opnd** args_); Index: vm/jitrino/src/optimizer/IRBuilder.h =================================================================== --- vm/jitrino/src/optimizer/IRBuilder.h (revision 583684) +++ vm/jitrino/src/optimizer/IRBuilder.h (working copy) @@ -169,7 +169,7 @@ uint32 numArgs, Opnd* args[]); - Opnd* genVMHelperCall(CompilationInterface::RuntimeHelperId helperId, + Opnd* genVMHelperCall(VM_RT_SUPPORT helperId, Type* returnType, uint32 numArgs, Opnd* args[]); Index: vm/jitrino/src/optimizer/Inst.cpp =================================================================== --- vm/jitrino/src/optimizer/Inst.cpp (revision 583684) +++ vm/jitrino/src/optimizer/Inst.cpp (working copy) @@ -1606,7 +1606,7 @@ Opnd* dst, uint32 nArgs, Opnd** args_, - CompilationInterface::RuntimeHelperId id) { + VM_RT_SUPPORT id) { VMHelperCallInst * inst = new (memManager) VMHelperCallInst(op, mod, type, dst, nArgs, args_, id); inst->id = numInsts++; @@ -2043,7 +2043,7 @@ } Inst* -InstFactory::makeVMHelperCall(Opnd* dst, CompilationInterface::RuntimeHelperId id, uint32 numArgs, Opnd** args) { +InstFactory::makeVMHelperCall(Opnd* dst, VM_RT_SUPPORT id, uint32 numArgs, Opnd** args) { Type::Tag returnType = dst->isNull()? Type::Void : dst->getType()->tag; args = copyOpnds(args, numArgs); return makeVMHelperCallInst(Op_VMHelperCall, Modifier(Exception_Sometimes), returnType, dst, numArgs, args, id); Index: vm/jitrino/src/optimizer/IRBuilder.cpp =================================================================== --- vm/jitrino/src/optimizer/IRBuilder.cpp (revision 583684) +++ vm/jitrino/src/optimizer/IRBuilder.cpp (working copy) @@ -1270,7 +1270,7 @@ } if (callAddrOpnd == NULL) { - CompilationInterface::RuntimeHelperId vmHelperId = CompilationInterface::Helper_Null; + VM_RT_SUPPORT vmHelperId = VM_RT_UNKNOWN; MemoryManager& mm = irManager->getMemoryManager(); Opnd* clsOpnd = createTypeOpnd(ch); Opnd* idxOpnd = genLdConstant((int)cpIndex); @@ -1281,20 +1281,20 @@ helperArgs[2] = NULL; switch(bc) { case OPCODE_INVOKESTATIC: - vmHelperId = CompilationInterface::Helper_GetInvokeStaticAddrWithResolve; + vmHelperId = VM_RT_GET_INVOKESTATIC_ADDR_WITHRESOLVE; numHelperArgs = 2; break; case OPCODE_INVOKEVIRTUAL: - vmHelperId = CompilationInterface::Helper_GetInvokeVirtualAddrWithResolve; + vmHelperId = VM_RT_GET_INVOKEVIRTUAL_ADDR_WITHRESOLVE; helperArgs[2] = args[0]; numHelperArgs = 3; break; case OPCODE_INVOKESPECIAL: - vmHelperId = CompilationInterface::Helper_GetInvokeSpecialAddrWithResolve; + vmHelperId = VM_RT_GET_INVOKE_SPECIAL_ADDR_WITHRESOLVE; numHelperArgs = 2; break; case OPCODE_INVOKEINTERFACE: - vmHelperId = CompilationInterface::Helper_GetInvokeInterfaceAddrWithResolve; + vmHelperId = VM_RT_GET_INVOKEINTERFACE_ADDR_WITHRESOLVE; helperArgs[2] = args[0]; numHelperArgs = 3; break; @@ -1440,7 +1440,7 @@ } Opnd* -IRBuilder::genVMHelperCall(CompilationInterface::RuntimeHelperId helperId, +IRBuilder::genVMHelperCall(VM_RT_SUPPORT helperId, Type* returnType, uint32 numArgs, Opnd* args[]) { @@ -2001,7 +2001,7 @@ args[0] = createTypeOpnd(enclClass); args[1] = genLdConstant((int)cpIndex); args[2] = genLdConstant((int)putfield?1:0); - Opnd* offsetOpnd = genVMHelperCall(CompilationInterface::Helper_GetNonStaticFieldOffsetWithResolve, + Opnd* offsetOpnd = genVMHelperCall(VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE, typeManager->getInt32Type(), 3, args); insertHash(Op_VMHelperCall, opcode, base->getId(), cpIndex, dst->getInst()); @@ -2052,7 +2052,7 @@ args[0] = createTypeOpnd(enclClass); args[1] = genLdConstant((int)cpIndex); args[2] = genLdConstant((int)putfield?1:0); - appendInst(instFactory->makeVMHelperCall(dst, CompilationInterface::Helper_GetStaticFieldAddrWithResolve, 3, args)); + appendInst(instFactory->makeVMHelperCall(dst, VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE, 3, args)); insertHash(Op_VMHelperCall, OPCODE_GETSTATIC, cpIndex, dst->getInst()); return dst; } @@ -2786,7 +2786,7 @@ Opnd** args = new (irManager->getMemoryManager()) Opnd*[2]; args[0]=clsOpnd; args[1]=idxOpnd; - Opnd* res = genVMHelperCall(CompilationInterface::Helper_NewObjWithResolve, typeManager->getUnresolvedObjectType(), 2, args); + Opnd* res = genVMHelperCall(VM_RT_NEWOBJ_WITHRESOLVE, typeManager->getUnresolvedObjectType(), 2, args); return res; } @@ -2800,7 +2800,7 @@ args[1]=idxOpnd; args[2]=numElems; Type* resType = typeManager->getArrayType(elemType); - Opnd* res = genVMHelperCall(CompilationInterface::Helper_NewArrayWithResolve, resType, 3, args); + Opnd* res = genVMHelperCall(VM_RT_NEWARRAY_WITHRESOLVE, resType, 3, args); return res; } @@ -2838,7 +2838,7 @@ Opnd** args = new (irManager->getMemoryManager()) Opnd*[2]; args[0] = enclClsOpnd; args[1] = idxOpnd; - Opnd* clsOpnd = genVMHelperCall(CompilationInterface::Helper_InitializeClassWithResolve, + Opnd* clsOpnd = genVMHelperCall(VM_RT_INITIALIZE_CLASS_WITHRESOLVE, typeManager->getUnmanagedPtrType(typeManager->getInt8Type()), 2, args); @@ -2850,7 +2850,7 @@ for (uint32 i=0; igetId(), cpIndex, dst->getInst()); return dst; } @@ -3074,7 +3074,7 @@ args[0] = createTypeOpnd(enclClass); args[1] = genLdConstant((int)cpIndex); args[2] = src; - dst = genVMHelperCall(CompilationInterface::Helper_InstanceOfWithResolve, typeManager->getInt32Type(), 3, args); + dst = genVMHelperCall(VM_RT_INSTANCEOF_WITHRESOLVE, typeManager->getInt32Type(), 3, args); insertHash(Op_VMHelperCall, OPCODE_INSTANCEOF, src->getId(), cpIndex, dst->getInst()); return dst; } Index: vm/jitrino/src/optimizer/CodeSelectors.cpp =================================================================== --- vm/jitrino/src/optimizer/CodeSelectors.cpp (revision 583684) +++ vm/jitrino/src/optimizer/CodeSelectors.cpp (working copy) @@ -902,7 +902,7 @@ case Op_VMHelperCall: { VMHelperCallInst* call = inst->asVMHelperCallInst(); - CompilationInterface::RuntimeHelperId callId = call->getVMHelperId(); + VM_RT_SUPPORT callId = call->getVMHelperId(); cgInst = instructionCallback.callvmhelper(inst->getNumSrcOperands(), genCallArgs(call,0), Index: vm/jitrino/src/optimizer/memoryopt.cpp =================================================================== --- vm/jitrino/src/optimizer/memoryopt.cpp (revision 583684) +++ vm/jitrino/src/optimizer/memoryopt.cpp (working copy) @@ -1409,8 +1409,8 @@ case Op_VMHelperCall: { VMHelperCallInst* callInst = addri->asVMHelperCallInst(); - assert(callInst->getVMHelperId() == CompilationInterface::Helper_GetNonStaticFieldOffsetWithResolve - || callInst->getVMHelperId() == CompilationInterface::Helper_GetStaticFieldAddrWithResolve); + assert(callInst->getVMHelperId() == VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE + || callInst->getVMHelperId() == VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE); Opnd* enclClass = callInst->getSrc(0); Opnd* cpIdx = callInst->getSrc(1); return findOrInsertAlias(getUnresolvedObjectField(0, enclClass, cpIdx)); Index: vm/jitrino/src/vm/drl/DrlVMInterface.cpp =================================================================== --- vm/jitrino/src/vm/drl/DrlVMInterface.cpp (revision 583684) +++ vm/jitrino/src/vm/drl/DrlVMInterface.cpp (working copy) @@ -492,119 +492,43 @@ return type; } -VM_RT_SUPPORT CompilationInterface::translateHelperId(RuntimeHelperId runtimeHelperId) { - VM_RT_SUPPORT vmHelperId = (VM_RT_SUPPORT)-1; - switch (runtimeHelperId) { - case Helper_NewObj_UsingVtable: vmHelperId = VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE; break; - case Helper_NewVector_UsingVtable: vmHelperId = VM_RT_NEW_VECTOR_USING_VTABLE; break; - case Helper_NewMultiArray: vmHelperId = VM_RT_MULTIANEWARRAY_RESOLVED; break; - case Helper_LdInterface: vmHelperId = VM_RT_GET_INTERFACE_VTABLE_VER0; break; - case Helper_LdRef: vmHelperId = VM_RT_LDC_STRING; break; - case Helper_ObjMonitorEnter: vmHelperId = VM_RT_MONITOR_ENTER_NON_NULL; break; - case Helper_ObjMonitorExit: vmHelperId = VM_RT_MONITOR_EXIT_NON_NULL; break; - case Helper_TypeMonitorEnter: vmHelperId = VM_RT_MONITOR_ENTER_STATIC; break; - case Helper_TypeMonitorExit: vmHelperId = VM_RT_MONITOR_EXIT_STATIC; break; - case Helper_Cast: vmHelperId = VM_RT_CHECKCAST; break; - case Helper_IsInstanceOf: vmHelperId = VM_RT_INSTANCEOF; break; - case Helper_InitType: vmHelperId = VM_RT_INITIALIZE_CLASS; break; - case Helper_IsValidElemType: vmHelperId = VM_RT_AASTORE_TEST; break; - case Helper_Throw_KeepStackTrace: vmHelperId = VM_RT_THROW; break; - case Helper_Throw_SetStackTrace: vmHelperId = VM_RT_THROW_SET_STACK_TRACE; break; - case Helper_Throw_Lazy: vmHelperId = VM_RT_THROW_LAZY; break; - case Helper_NullPtrException: vmHelperId = VM_RT_NULL_PTR_EXCEPTION; break; - case Helper_ArrayBoundsException: vmHelperId = VM_RT_IDX_OUT_OF_BOUNDS; break; - case Helper_ElemTypeException: vmHelperId = VM_RT_ARRAY_STORE_EXCEPTION; break; - case Helper_DivideByZeroException: vmHelperId = VM_RT_DIVIDE_BY_ZERO_EXCEPTION; break; - case Helper_Throw_LinkingException: vmHelperId = VM_RT_THROW_LINKING_EXCEPTION; break; - case Helper_EnableThreadSuspension: vmHelperId = VM_RT_GC_SAFE_POINT; break; - case Helper_GetTLSBase: vmHelperId = VM_RT_GC_GET_TLS_BASE; break; - case Helper_CharArrayCopy: vmHelperId = VM_RT_CHAR_ARRAYCOPY_NO_EXC; break; - case Helper_DivI32: vmHelperId = VM_RT_IDIV; break; - case Helper_DivU32: assert(0); break; - case Helper_DivI64: vmHelperId = VM_RT_LDIV; break; - case Helper_DivU64: vmHelperId = VM_RT_ULDIV; break; - case Helper_DivSingle: vmHelperId = VM_RT_FDIV; break; - case Helper_DivDouble: vmHelperId = VM_RT_DDIV; break; - case Helper_RemI32: vmHelperId = VM_RT_IREM; break; - case Helper_RemU32: assert(0); break; - case Helper_RemI64: vmHelperId = VM_RT_LREM; break; - case Helper_RemU64: assert(0); break; - case Helper_RemSingle: vmHelperId = VM_RT_FREM; break; - case Helper_RemDouble: vmHelperId = VM_RT_DREM; break; - case Helper_MulI64: vmHelperId = VM_RT_LMUL; break; - case Helper_ShlI64: vmHelperId = VM_RT_LSHL; break; - case Helper_ShrI64: vmHelperId = VM_RT_LSHR; break; - case Helper_ShruI64: vmHelperId = VM_RT_LUSHR; break; - case Helper_ConvStoI32: vmHelperId = VM_RT_F2I; break; - case Helper_ConvStoI64: vmHelperId = VM_RT_F2L; break; - case Helper_ConvDtoI32: vmHelperId = VM_RT_D2I; break; - case Helper_ConvDtoI64: vmHelperId = VM_RT_D2L; break; - case Helper_MethodEntry: vmHelperId = VM_RT_JVMTI_METHOD_ENTER_CALLBACK; break; - case Helper_MethodExit: vmHelperId = VM_RT_JVMTI_METHOD_EXIT_CALLBACK; break; - case Helper_WriteBarrier: vmHelperId = VM_RT_GC_HEAP_WRITE_REF; break; - case Helper_NewObjWithResolve: vmHelperId=VM_RT_NEWOBJ_WITHRESOLVE; break; - case Helper_NewArrayWithResolve: vmHelperId=VM_RT_NEWARRAY_WITHRESOLVE; break; - case Helper_GetNonStaticFieldOffsetWithResolve: vmHelperId=VM_RT_GET_NONSTATIC_FIELD_OFFSET_WITHRESOLVE; break; - case Helper_GetStaticFieldAddrWithResolve: vmHelperId=VM_RT_GET_STATIC_FIELD_ADDR_WITHRESOLVE; break; - case Helper_CheckCastWithResolve: vmHelperId=VM_RT_CHECKCAST_WITHRESOLVE; break; - case Helper_InstanceOfWithResolve: vmHelperId=VM_RT_INSTANCEOF_WITHRESOLVE; break; - case Helper_GetInvokeStaticAddrWithResolve: vmHelperId=VM_RT_GET_INVOKESTATIC_ADDR_WITHRESOLVE; break; - case Helper_GetInvokeInterfaceAddrWithResolve: vmHelperId=VM_RT_GET_INVOKEINTERFACE_ADDR_WITHRESOLVE; break; - case Helper_GetInvokeVirtualAddrWithResolve: vmHelperId=VM_RT_GET_INVOKEVIRTUAL_ADDR_WITHRESOLVE; break; - case Helper_GetInvokeSpecialAddrWithResolve: vmHelperId=VM_RT_GET_INVOKE_SPECIAL_ADDR_WITHRESOLVE; break; - case Helper_InitializeClassWithResolve: vmHelperId=VM_RT_INITIALIZE_CLASS_WITHRESOLVE; break; +const char* +CompilationInterface::getRuntimeHelperName(VM_RT_SUPPORT id){ + return vm_helper_get_name(id); +} - - default: - assert(0); - } - return vmHelperId; +VM_RT_SUPPORT CompilationInterface::str2rid( const char * helperName ) { + return vm_helper_get_by_name(helperName); } void* -CompilationInterface::getRuntimeHelperAddress(RuntimeHelperId runtimeHelperId) { - VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId); - return vm_get_rt_support_addr(drlHelperId); +CompilationInterface::getRuntimeHelperAddress(VM_RT_SUPPORT id) { + return vm_get_rt_support_addr(id); } void* -CompilationInterface::getRuntimeHelperAddressForType(RuntimeHelperId runtimeHelperId, Type* type) { - VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId); +CompilationInterface::getRuntimeHelperAddressForType(VM_RT_SUPPORT id, Type* type) { Class_Handle handle = NULL; if (type != NULL && type->isNamedType()) handle = (Class_Handle) ((NamedType *)type)->getVMTypeHandle(); - void* addr = vm_get_rt_support_addr_optimized(drlHelperId, handle); + void* addr = vm_get_rt_support_addr_optimized(id, handle); assert(addr != NULL); return addr; } -CompilationInterface::VmCallingConvention -CompilationInterface::getRuntimeHelperCallingConvention(RuntimeHelperId id) { - switch(id) { - case Helper_NewMultiArray: - case Helper_WriteBarrier: - return CallingConvention_Cdecl; - case Helper_ShlI64: - case Helper_ShrI64: - case Helper_ShruI64: - case Helper_Throw_Lazy: - case Helper_Throw_LinkingException: - return CallingConvention_Drl; - default: - return CallingConvention_Stdcall; - } +HELPER_CALLING_CONVENTION +CompilationInterface::getRuntimeHelperCallingConvention(VM_RT_SUPPORT id) { + return vm_helper_get_calling_convention(id); } bool -CompilationInterface::isInterruptible(RuntimeHelperId runtimeHelperId) { - VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId); - return INTERRUPTIBLE_ALWAYS == vm_helper_get_interruptibility_kind(drlHelperId); +CompilationInterface::isInterruptible(VM_RT_SUPPORT id) { + return INTERRUPTIBLE_ALWAYS == vm_helper_get_interruptibility_kind(id); } bool -CompilationInterface::mayBeInterruptible(RuntimeHelperId runtimeHelperId) { - VM_RT_SUPPORT drlHelperId = translateHelperId(runtimeHelperId); - return INTERRUPTIBLE_NEVER != vm_helper_get_interruptibility_kind(drlHelperId); +CompilationInterface::mayBeInterruptible(VM_RT_SUPPORT id) { + return INTERRUPTIBLE_NEVER != vm_helper_get_interruptibility_kind(id); } bool Index: vm/jitrino/src/vm/VMInterface.cpp =================================================================== --- vm/jitrino/src/vm/VMInterface.cpp (revision 583684) +++ vm/jitrino/src/vm/VMInterface.cpp (working copy) @@ -1,144 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include -#include "VMInterface.h" -#include "PlatformDependant.h" - -namespace Jitrino { - -/* -The following struct and array contains a mapping between RuntimeHelperId -and its string representation. -The array must be - ordered by RuntimeHelperId - must cover all available helpers -The id field exists only in debug build and is excluded from the release -bundle. It's used to control whether the array is arranged properly. -*/ -#ifdef _DEBUG -#define DECL_HELPER_ITEM(a) { CompilationInterface::Helper_##a, #a } -#else -#define DECL_HELPER_ITEM(a) { #a } -#endif - -static struct { -#ifdef _DEBUG - CompilationInterface::RuntimeHelperId id; -#endif - const char * name; -} -runtime_helpers_names[] = { - DECL_HELPER_ITEM(Null), - DECL_HELPER_ITEM(NewObj_UsingVtable), - DECL_HELPER_ITEM(NewVector_UsingVtable), - DECL_HELPER_ITEM(NewObj), - DECL_HELPER_ITEM(NewVector), - DECL_HELPER_ITEM(NewMultiArray), - DECL_HELPER_ITEM(LdInterface), - DECL_HELPER_ITEM(LdRef), - DECL_HELPER_ITEM(ObjMonitorEnter), - DECL_HELPER_ITEM(ObjMonitorExit), - DECL_HELPER_ITEM(TypeMonitorEnter), - DECL_HELPER_ITEM(TypeMonitorExit), - DECL_HELPER_ITEM(Cast), - DECL_HELPER_ITEM(IsInstanceOf), - DECL_HELPER_ITEM(InitType), - DECL_HELPER_ITEM(IsValidElemType), - DECL_HELPER_ITEM(Throw_KeepStackTrace), - DECL_HELPER_ITEM(Throw_SetStackTrace), - DECL_HELPER_ITEM(Throw_Lazy), - DECL_HELPER_ITEM(EndCatch), - DECL_HELPER_ITEM(NullPtrException), - DECL_HELPER_ITEM(ArrayBoundsException), - DECL_HELPER_ITEM(ElemTypeException), - DECL_HELPER_ITEM(DivideByZeroException), - DECL_HELPER_ITEM(Throw_LinkingException), - DECL_HELPER_ITEM(CharArrayCopy), - DECL_HELPER_ITEM(DivI32), - DECL_HELPER_ITEM(DivU32), - DECL_HELPER_ITEM(DivI64), - DECL_HELPER_ITEM(DivU64), - DECL_HELPER_ITEM(DivSingle), - DECL_HELPER_ITEM(DivDouble), - DECL_HELPER_ITEM(RemI32), - DECL_HELPER_ITEM(RemU32), - DECL_HELPER_ITEM(RemI64), - DECL_HELPER_ITEM(RemU64), - DECL_HELPER_ITEM(RemSingle), - DECL_HELPER_ITEM(RemDouble), - DECL_HELPER_ITEM(MulI64), - DECL_HELPER_ITEM(ShlI64), - DECL_HELPER_ITEM(ShrI64), - DECL_HELPER_ITEM(ShruI64), - DECL_HELPER_ITEM(ConvStoI32), - DECL_HELPER_ITEM(ConvStoI64), - DECL_HELPER_ITEM(ConvDtoI32), - DECL_HELPER_ITEM(ConvDtoI64), - DECL_HELPER_ITEM(EnableThreadSuspension), - DECL_HELPER_ITEM(GetTLSBase), - DECL_HELPER_ITEM(MethodEntry), - DECL_HELPER_ITEM(MethodExit), - DECL_HELPER_ITEM(WriteBarrier), - DECL_HELPER_ITEM(NewObjWithResolve), - DECL_HELPER_ITEM(NewArrayWithResolve), - DECL_HELPER_ITEM(GetNonStaticFieldOffsetWithResolve), - DECL_HELPER_ITEM(GetStaticFieldAddrWithResolve), - DECL_HELPER_ITEM(CheckCastWithResolve), - DECL_HELPER_ITEM(InstanceOfWithResolve), - DECL_HELPER_ITEM(GetInvokeStaticAddrWithResolve), - DECL_HELPER_ITEM(GetInvokeInterfaceAddrWithResolve), - DECL_HELPER_ITEM(GetInvokeVirtualAddrWithResolve), - DECL_HELPER_ITEM(GetInvokeSpecialAddrWithResolve), - DECL_HELPER_ITEM(InitializeClassWithResolve) -#undef DECL_HELPER_ITEM -}; -static const unsigned runtime_helpers_names_count = sizeof(runtime_helpers_names)/sizeof(runtime_helpers_names[0]); - -#ifdef _DEBUG -static inline void checkArray(void) { - static bool doCheck = true; - if( !doCheck ) return; - - doCheck = false; - // all helpers must be covered - for( size_t i=0; i helperId ); - return runtime_helpers_names[helperId].name; -} - -CompilationInterface::RuntimeHelperId CompilationInterface::str2rid( const char * helperName ) { - checkArray(); - for( size_t i = 0; i*/, .../* params*/, ClassHandle) - Helper_EndCatch, - Helper_NullPtrException, // f() - Helper_ArrayBoundsException,// f() - Helper_ElemTypeException, // f() - Helper_DivideByZeroException, // f() - Helper_Throw_LinkingException, // f(uint32 ConstPoolNdx, void* classRuntimeId, uint32 opcode) - Helper_CharArrayCopy, // = f(char[] src, uint32 srcPos, char[] dst, uint32 dstPos, uint32 len) - Helper_DivI32, // int32 z = f(int32 x, int32 y) - Helper_DivU32, // uint32 z = f(uint32 x, uint32 y) - Helper_DivI64, // int64 z = f(int64 x, int64 y) - Helper_DivU64, // uint64 z = f(uint64 x, uint64 y) - Helper_DivSingle, // float z = f(float x, float y) - Helper_DivDouble, // double z = f(double x, double y) - Helper_RemI32, // int32 z = f(int32 x, int32 y) - Helper_RemU32, // uint32 z = f(uint32 x, uint32 y) - Helper_RemI64, // int64 z = f(int64 x, int64 y) - Helper_RemU64, // uint64 z = f(uint64 x, uint64 y) - Helper_RemSingle, // float z = f(float x, float y) - Helper_RemDouble, // double z = f(double x, double y) - Helper_MulI64, // int64 z = f(int64 x, int64 y) - Helper_ShlI64, // int64 z = f - Helper_ShrI64, // int64 z = f - Helper_ShruI64, // int64 z = f - Helper_ConvStoI32, // int32 x = f(float x) - Helper_ConvStoI64, // int64 x = f(float x) - Helper_ConvDtoI32, // int32 x = f(double x) - Helper_ConvDtoI64, // int64 x = f(double x) - Helper_EnableThreadSuspension,// f() - Helper_GetTLSBase, // int * = f() - Helper_MethodEntry, // f(MethodHandle) - Helper_MethodExit, // f(MethodHandle, void* ret_value) - Helper_WriteBarrier, - Helper_NewObjWithResolve, //f(class_handle, cp_index) - Helper_NewArrayWithResolve, //f(class_handle, cp_index, length) - Helper_GetNonStaticFieldOffsetWithResolve, //f(class_handle, cp_index) - Helper_GetStaticFieldAddrWithResolve, //f(class_handle, cp_index) - Helper_CheckCastWithResolve, //f(class_handle, cp_index, obj) - Helper_InstanceOfWithResolve, //f(class_handle, cp_index, obj) - Helper_GetInvokeStaticAddrWithResolve, //f(class_handle, cp_index) - Helper_GetInvokeInterfaceAddrWithResolve, //f(class_handle, cp_index, obj) - Helper_GetInvokeVirtualAddrWithResolve, //f(class_handle, cp_index, obj) - Helper_GetInvokeSpecialAddrWithResolve, //f(class_handle, cp_index) - Helper_InitializeClassWithResolve, //f(class_handle, cp_index) - Num_Helpers - }; - enum VmCallingConvention { - CallingConvention_Drl = 0, - CallingConvention_Stdcall, - CallingConvention_Cdecl, - Num_CallingConvention - }; - - - static const char* getRuntimeHelperName(RuntimeHelperId helperId); + static const char* getRuntimeHelperName(VM_RT_SUPPORT helperId); /** - * Returns RuntimeHelperId by its string representation. Name comparison - * is case-sensitive. - * If the helperName is unknown, then Helper_Null is returned. + * Returns helper ID by its string representation. Name comparison + * is case-insensitive. + * If the helperName is unknown, then VM_RT_UNKNOWN is returned. */ - static RuntimeHelperId str2rid( const char * helperName ); + static VM_RT_SUPPORT str2rid( const char * helperName ); - VmCallingConvention getRuntimeHelperCallingConvention(RuntimeHelperId id); - bool isInterruptible(RuntimeHelperId id); - bool mayBeInterruptible(RuntimeHelperId id); - void* getRuntimeHelperAddress(RuntimeHelperId); - void* getRuntimeHelperAddressForType(RuntimeHelperId, Type*); + HELPER_CALLING_CONVENTION getRuntimeHelperCallingConvention(VM_RT_SUPPORT id); + bool isInterruptible(VM_RT_SUPPORT id); + bool mayBeInterruptible(VM_RT_SUPPORT id); + void* getRuntimeHelperAddress(VM_RT_SUPPORT); + void* getRuntimeHelperAddressForType(VM_RT_SUPPORT, Type*); Type* getFieldType(Class_Handle enclClass, uint32 cpIndex); @@ -526,7 +450,6 @@ */ CompilationContext* compilationContext; - VM_RT_SUPPORT translateHelperId(RuntimeHelperId runtimeHelperId); JIT_Handle getJitHandle() const; MethodDesc* getMethodDesc(Method_Handle method, JIT_Handle jit); Index: vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp =================================================================== --- vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp (revision 583684) +++ vm/jitrino/src/translator/java/JavaByteCodeTranslator.cpp (working copy) @@ -3539,60 +3539,60 @@ if (!strcmp(mname,"getTlsBaseAddress")) { assert(numArgs == 0); - Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_GetTLSBase, resType, numArgs, srcOpnds); + Opnd* res = irBuilder.genVMHelperCall(VM_RT_GC_GET_TLS_BASE, resType, numArgs, srcOpnds); pushOpnd(res); return true; } if (!strcmp(mname,"newResolvedUsingAllocHandleAndSize")) { assert(numArgs == 2); - Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_NewObj_UsingVtable, resType, numArgs, srcOpnds); + Opnd* res = irBuilder.genVMHelperCall(VM_RT_NEW_RESOLVED_USING_VTABLE_AND_SIZE, resType, numArgs, srcOpnds); pushOpnd(res); return true; } if (!strcmp(mname,"newVectorUsingAllocHandle")) { assert(numArgs == 2); - Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_NewVector_UsingVtable, resType, numArgs, srcOpnds); + Opnd* res = irBuilder.genVMHelperCall(VM_RT_NEW_VECTOR_USING_VTABLE, resType, numArgs, srcOpnds); pushOpnd(res); return true; } if (!strcmp(mname,"monitorEnter")) { assert(numArgs == 1); - irBuilder.genVMHelperCall(CompilationInterface::Helper_ObjMonitorEnter, resType, numArgs, srcOpnds); + irBuilder.genVMHelperCall(VM_RT_MONITOR_ENTER_NON_NULL, resType, numArgs, srcOpnds); return true; } if (!strcmp(mname,"monitorExit")) { assert(numArgs == 1); - irBuilder.genVMHelperCall(CompilationInterface::Helper_ObjMonitorExit, resType, numArgs, srcOpnds); + irBuilder.genVMHelperCall(VM_RT_MONITOR_EXIT_NON_NULL, resType, numArgs, srcOpnds); return true; } if (!strcmp(mname,"writeBarrier")) { assert(numArgs == 3); - irBuilder.genVMHelperCall(CompilationInterface::Helper_WriteBarrier, resType, numArgs, srcOpnds); + irBuilder.genVMHelperCall(VM_RT_GC_HEAP_WRITE_REF, resType, numArgs, srcOpnds); return true; } if (!strcmp(mname,"getInterfaceVTable")) { assert(numArgs == 2); - Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_LdInterface, resType, numArgs, srcOpnds); + Opnd* res = irBuilder.genVMHelperCall(VM_RT_GET_INTERFACE_VTABLE_VER0, resType, numArgs, srcOpnds); pushOpnd(res); return true; } if (!strcmp(mname,"checkCast")) { assert(numArgs == 2); - Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_Cast, resType, numArgs, srcOpnds); + Opnd* res = irBuilder.genVMHelperCall(VM_RT_CHECKCAST, resType, numArgs, srcOpnds); pushOpnd(res); return true; } if (!strcmp(mname,"instanceOf")) { assert(numArgs == 2); - Opnd* res = irBuilder.genVMHelperCall(CompilationInterface::Helper_IsInstanceOf, resType, numArgs, srcOpnds); + Opnd* res = irBuilder.genVMHelperCall(VM_RT_INSTANCEOF, resType, numArgs, srcOpnds); pushOpnd(res); return true; }