diff options
author | Geoff Norton <grompf@gmail.com> | 2015-07-28 15:40:23 +0000 |
---|---|---|
committer | Geoff Norton <grompf@gmail.com> | 2015-07-28 15:42:19 +0000 |
commit | 8c4e60054ddb42298f3eebaf20c970d665474ae3 (patch) | |
tree | ecf994d997a28e620c0e5a42bbaa32d089e14c35 | |
parent | 16c43e35d1a9a858374757ccf0484a50afdb0b69 (diff) | |
download | coreclr-8c4e60054ddb42298f3eebaf20c970d665474ae3.tar.gz coreclr-8c4e60054ddb42298f3eebaf20c970d665474ae3.tar.bz2 coreclr-8c4e60054ddb42298f3eebaf20c970d665474ae3.zip |
[aarch64] Enable the interpreter on linux as well
-rw-r--r-- | src/inc/switches.h | 2 | ||||
-rw-r--r-- | src/vm/interpreter.cpp | 36 | ||||
-rw-r--r-- | src/vm/interpreter.h | 36 |
3 files changed, 31 insertions, 43 deletions
diff --git a/src/inc/switches.h b/src/inc/switches.h index f6fec8309b..b298b5563b 100644 --- a/src/inc/switches.h +++ b/src/inc/switches.h @@ -262,7 +262,7 @@ #define FEATURE_STACK_SAMPLING #endif // defined (ALLOW_SXS_JIT) -#if defined(_TARGET_ARM64_) && !defined(FEATURE_CORECLR) +#if defined(_TARGET_ARM64_) #define FEATURE_INTERPRETER #endif // defined(_TARGET_ARM64_) diff --git a/src/vm/interpreter.cpp b/src/vm/interpreter.cpp index 614bb87645..fac99ecca6 100644 --- a/src/vm/interpreter.cpp +++ b/src/vm/interpreter.cpp @@ -42,22 +42,22 @@ static CorInfoType asCorInfoType(CORINFO_CLASS_HANDLE clsHnd) InterpreterMethodInfo::InterpreterMethodInfo(CEEInfo* comp, CORINFO_METHOD_INFO* methInfo) : m_method(methInfo->ftn), m_module(methInfo->scope), + m_jittedCode(0), m_ILCode(methInfo->ILCode), m_ILCodeEnd(methInfo->ILCode + methInfo->ILCodeSize), m_maxStack(methInfo->maxStack), - m_numArgs(methInfo->args.numArgs), - m_flags(0), - m_argDescs(NULL), - m_numLocals(methInfo->locals.numArgs), - m_returnType(methInfo->args.retType), - m_invocations(0), - m_jittedCode(0), #if INTERP_PROFILE m_totIlInstructionsExeced(0), m_maxIlInstructionsExeced(0), #endif m_ehClauseCount(methInfo->EHcount), m_varArgHandleArgNum(NO_VA_ARGNUM), + m_numArgs(methInfo->args.numArgs), + m_numLocals(methInfo->locals.numArgs), + m_flags(0), + m_argDescs(NULL), + m_returnType(methInfo->args.retType), + m_invocations(0), m_methodCache(NULL) { // Overflow sanity check. (Can ILCodeSize ever be zero?) @@ -431,7 +431,7 @@ InterpreterMethodInfo::~InterpreterMethodInfo() { if (m_methodCache != NULL) { - delete m_methodCache; + delete reinterpret_cast<ILOffsetToItemCache*>(m_methodCache); } } @@ -534,7 +534,7 @@ void Interpreter::ArgState::AddArg(unsigned canonIndex, short numSlots, bool noR argOffsets[canonIndex] = offset.Value(); #if defined(_ARM_) || defined(_ARM64_) callerArgStackSlots += numSlots; -#endif; +#endif } #endif // !_AMD64_ } @@ -1063,7 +1063,7 @@ CorJitResult Interpreter::GenerateInterpreterStub(CEEInfo* comp, // for instance a VT with two float fields will have the same size as a VT with 1 double field. (ARM64TODO: Verify it) // It works on ARM because the overlapping layout of the floating point registers // but it won't work on ARM64. - cHFAVars = (comp->getHFAType(info->args.retTypeClass) == ELEMENT_TYPE_R4) ? HFARetTypeSize/sizeof(float) : HFARetTypeSize/sizeof(double); + cHFAVars = (CorInfoTypeIsFloatingPoint(comp->getHFAType(info->args.retTypeClass))) ? HFARetTypeSize/sizeof(float) : HFARetTypeSize/sizeof(double); #endif } @@ -1816,14 +1816,6 @@ enum OPCODE_2BYTE { #undef OPDEF }; -#ifdef _DEBUG -static const char* getMethodName(CEEInfo* info, CORINFO_METHOD_HANDLE meth, const char** pClsName) -{ - GCX_PREEMP(); - return info->getMethodName(meth, pClsName); -} -#endif // _DEBUG - // Optimize the interpreter loop for speed. #ifdef _MSC_VER #pragma optimize("t", on) @@ -4825,10 +4817,6 @@ void Interpreter::BinaryArithOvfOp() } break; - case CORINFO_TYPE_SHIFTED_CLASS: - VerificationError("Can't do binary arithmetic overflow operation on object references."); - break; - default: _ASSERTE_MSG(false, "Non-stack-normal type on stack."); } @@ -5099,7 +5087,7 @@ void Interpreter::ShiftOpWork(unsigned op1idx, CorInfoType cit2) res = (static_cast<UT>(val)) >> shiftAmt; } } - else if (cit2 = CORINFO_TYPE_NATIVEINT) + else if (cit2 == CORINFO_TYPE_NATIVEINT) { NativeInt shiftAmt = OpStackGet<NativeInt>(op2idx); if (op == CEE_SHL) @@ -5932,7 +5920,7 @@ void Interpreter::NewObj() { void* dest = LargeStructOperandStackPush(sz); memcpy(dest, tempDest, sz); - delete[] tempDest; + delete[] reinterpret_cast<BYTE*>(tempDest); OpStackSet<void*>(m_curStackHt, dest); } else diff --git a/src/vm/interpreter.h b/src/vm/interpreter.h index 6ecaded9e3..3a6f410810 100644 --- a/src/vm/interpreter.h +++ b/src/vm/interpreter.h @@ -77,7 +77,7 @@ bool IsStackNormalType(CorInfoType cit); CorInfoType CorInfoTypeStackNormalize(CorInfoType cit); // Returns the (byte) size of "cit". Requires that "cit" is not a CORINFO_TYPE_VALUECLASS. -inline size_t CorInfoTypeSize(CorInfoType cit); +size_t CorInfoTypeSize(CorInfoType cit); // Returns true iff "cit" is an unsigned integral type. bool CorInfoTypeIsUnsigned(CorInfoType cit); @@ -101,7 +101,7 @@ inline size_t CorInfoTypeStackNormalSize(CorInfoType cit) return CorInfoTypeSize(cit); } -inline getClassSize(CORINFO_CLASS_HANDLE clsHnd) +inline size_t getClassSize(CORINFO_CLASS_HANDLE clsHnd) { TypeHandle VMClsHnd(clsHnd); return VMClsHnd.GetSize(); @@ -778,32 +778,31 @@ public: // operand type stack. Interpreter(InterpreterMethodInfo* methInfo_, bool directCall_, BYTE* ilArgs_, void* stubContext_, BYTE* frameMemory) : m_methInfo(methInfo_), + m_interpCeeInfo(methInfo_->m_method), + m_ILCodePtr(methInfo_->m_ILCode), m_directCall(directCall_), m_ilArgs(ilArgs_), m_stubContext(stubContext_), - m_ILCodePtr(methInfo_->m_ILCode), - m_curStackHt(0), - m_interpCeeInfo(methInfo_->m_method), + m_orOfPushedInterpreterTypes(0), m_largeStructOperandStack(NULL), m_largeStructOperandStackHt(0), m_largeStructOperandStackAllocSize(0), - m_thisArg(NULL), - m_securityObject(TADDR(NULL)), - m_args(NULL), - m_argsSize(0), - m_structRetValITPtr(NULL), - m_callThisArg(NULL), - m_orOfPushedInterpreterTypes(0), - m_preciseGenericsContext(NULL), - m_functionPointerStack(NULL), - m_genericsCtxtArg(NULL), - m_inFlightException(NULL), + m_curStackHt(0), + m_leaveInfoStack(), m_filterNextScan(0), m_filterHandlerOffset(0), m_filterExcILOffset(0), + m_inFlightException(NULL), + m_thisArg(NULL), #ifdef USE_CHECKED_OBJECTREFS m_retBufArg(NULL), // Initialize to NULL so we can safely declare protected. #endif // USE_CHECKED_OBJECTREFS + m_genericsCtxtArg(NULL), + m_securityObject(TADDR(NULL)), + m_args(NULL), + m_argsSize(0), + m_callThisArg(NULL), + m_structRetValITPtr(NULL), #ifndef DACCESS_COMPILE // Means "uninitialized" m_thisExecCache(UninitExecCache), @@ -811,7 +810,8 @@ public: m_constrainedFlag(false), m_readonlyFlag(false), m_locAllocData(NULL), - m_leaveInfoStack() + m_preciseGenericsContext(NULL), + m_functionPointerStack(NULL) { // We must zero the locals. memset(frameMemory, 0, methInfo_->LocalMemSize() + sizeof(GSCookie)); @@ -1604,7 +1604,7 @@ private: { for (unsigned i = 0; i < m_locAllocCurIdx; i++) { - delete[] m_locAllocs[i]; + delete[] reinterpret_cast<char*>(m_locAllocs[i]); } } delete[] m_locAllocs; |