summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRama Krishnan Raghupathy <ramarag@microsoft.com>2016-04-15 18:37:16 -0700
committerRama Krishnan Raghupathy <ramarag@microsoft.com>2016-04-27 14:32:57 -0700
commitdfca8c96878395a388d02a2f313120ab5510298a (patch)
tree546cac888c56504e06b7754b97bfb406df08141f
parent5df671e6fbdaa8c356c9032b03cdb21e2c0e32be (diff)
downloadcoreclr-dfca8c96878395a388d02a2f313120ab5510298a.tar.gz
coreclr-dfca8c96878395a388d02a2f313120ab5510298a.tar.bz2
coreclr-dfca8c96878395a388d02a2f313120ab5510298a.zip
Arm64:Fxing up VM helper Table in mscorlib NI
-rw-r--r--src/inc/corcompile.h7
-rw-r--r--src/vm/arm64/cgencpu.h5
-rw-r--r--src/vm/codeman.cpp2
-rw-r--r--src/vm/dynamicmethod.cpp2
-rw-r--r--src/vm/jitinterface.cpp4
-rw-r--r--src/zap/zaprelocs.cpp4
6 files changed, 13 insertions, 11 deletions
diff --git a/src/inc/corcompile.h b/src/inc/corcompile.h
index 02fd018506..a375f0c284 100644
--- a/src/inc/corcompile.h
+++ b/src/inc/corcompile.h
@@ -932,10 +932,13 @@ struct CORCOMPILE_DEPENDENCY
/*********************************************************************************/
// Flags used to encode HelperTable
-
+#if defined(_TARGET_ARM64_)
+#define HELPER_TABLE_ENTRY_LEN 16
+#else
#define HELPER_TABLE_ENTRY_LEN 8
-#define HELPER_TABLE_ALIGN 8
+#endif //defined(_TARGET_ARM64_)
+#define HELPER_TABLE_ALIGN 8
#define CORCOMPILE_HELPER_PTR 0x80000000 // The entry is pointer to the helper (jump thunk otherwise)
// The layout of this struct is required to be
diff --git a/src/vm/arm64/cgencpu.h b/src/vm/arm64/cgencpu.h
index 0024512917..9ac7d49ba3 100644
--- a/src/vm/arm64/cgencpu.h
+++ b/src/vm/arm64/cgencpu.h
@@ -191,9 +191,10 @@ inline BOOL ClrFlushInstructionCache(LPCVOID pCodeAddr, size_t sizeOfCode)
}
//------------------------------------------------------------------------
-inline void emitJump(UINT32* pCode, LPVOID target)
+inline void emitJump(LPBYTE pBuffer, LPVOID target)
{
LIMITED_METHOD_CONTRACT;
+ UINT32* pCode = (UINT32*)pBuffer;
// We require 8-byte alignment so the LDR instruction is aligned properly
_ASSERTE(((UINT_PTR)pCode & 7) == 0);
@@ -246,7 +247,7 @@ inline BOOL isBackToBackJump(PCODE pBuffer)
inline void emitBackToBackJump(LPBYTE pBuffer, LPVOID target)
{
WRAPPER_NO_CONTRACT;
- emitJump((UINT32*)pBuffer, target);
+ emitJump(pBuffer, target);
}
//------------------------------------------------------------------------
diff --git a/src/vm/codeman.cpp b/src/vm/codeman.cpp
index e625bca06c..3aa49c1b12 100644
--- a/src/vm/codeman.cpp
+++ b/src/vm/codeman.cpp
@@ -2093,7 +2093,7 @@ HeapList* LoaderCodeHeap::CreateCodeHeap(CodeHeapRequestInfo *pInfo, LoaderHeap
));
#ifdef _WIN64
- emitJump(pHp->CLRPersonalityRoutine, (void *)ProcessCLRException);
+ emitJump((LPBYTE)pHp->CLRPersonalityRoutine, (void *)ProcessCLRException);
#endif
pCodeHeap.SuppressRelease();
diff --git a/src/vm/dynamicmethod.cpp b/src/vm/dynamicmethod.cpp
index 2d4d4be379..3eec125247 100644
--- a/src/vm/dynamicmethod.cpp
+++ b/src/vm/dynamicmethod.cpp
@@ -376,7 +376,7 @@ HeapList* HostCodeHeap::CreateCodeHeap(CodeHeapRequestInfo *pInfo, EEJitManager
pHp->bFull = FALSE;
pHp->cBlocks = 0;
#ifdef _WIN64
- emitJump(pHp->CLRPersonalityRoutine, (void *)ProcessCLRException);
+ emitJump((LPBYTE)pHp->CLRPersonalityRoutine, (void *)ProcessCLRException);
#endif
// zero the ref count as now starts the real counter
diff --git a/src/vm/jitinterface.cpp b/src/vm/jitinterface.cpp
index 46542482ba..e3755f3d28 100644
--- a/src/vm/jitinterface.cpp
+++ b/src/vm/jitinterface.cpp
@@ -12474,9 +12474,7 @@ void Module::LoadHelperTable()
#if defined(_TARGET_AMD64_)
*curEntry = X86_INSTR_JMP_REL32;
- *(INT32 *)(curEntry + 1) = rel32UsingJumpStub((INT32 *)(curEntry + 1), pfnHelper, NULL, GetLoaderAllocator());
-#elif defined (_TARGET_ARM64_)
- _ASSERTE(!"ARM64:NYI");
+ *(INT32 *)(curEntry + 1) = rel32UsingJumpStub((INT32 *)(curEntry + 1), pfnHelper, NULL, GetLoaderAllocator());
#else // all other platforms
emitJump(curEntry, (LPVOID)pfnHelper);
_ASSERTE(HELPER_TABLE_ENTRY_LEN >= JUMP_ALLOCATE_SIZE);
diff --git a/src/zap/zaprelocs.cpp b/src/zap/zaprelocs.cpp
index c3ee2a9c84..dd21b09632 100644
--- a/src/zap/zaprelocs.cpp
+++ b/src/zap/zaprelocs.cpp
@@ -112,12 +112,12 @@ void ZapBaseRelocs::WriteReloc(PVOID pSrc, int offset, ZapNode * pTarget, int ta
{
TADDR pSite = (TADDR)m_pImage->GetBaseAddress() + rva;
- INT64 relOffset = (INT64)(pActualTarget - (pSite + sizeof(INT64)));
+ INT32 relOffset = (INT32)(pActualTarget - pSite);
if (!FitsInRel28(relOffset))
{
ThrowHR(COR_E_OVERFLOW);
}
- PutArm64Rel28((UINT32 *)pLocation,(INT32)relOffset);
+ PutArm64Rel28((UINT32 *)pLocation,relOffset);
}
return;
#endif