diff options
author | sergey ignatov <sergign60@mail.ru> | 2018-01-19 17:28:38 +0300 |
---|---|---|
committer | Jan Kotas <jkotas@microsoft.com> | 2018-01-19 06:28:38 -0800 |
commit | f1c732878777092468ef8da8cd61aa8ec0922948 (patch) | |
tree | 383e438542036b88cb97be109af7a90e57c2165d /src | |
parent | 38cf93013c1dd1efc7137a6f4930cab7cc653411 (diff) | |
download | coreclr-f1c732878777092468ef8da8cd61aa8ec0922948.tar.gz coreclr-f1c732878777092468ef8da8cd61aa8ec0922948.tar.bz2 coreclr-f1c732878777092468ef8da8cd61aa8ec0922948.zip |
[armel tizen] Fixed CoreRT issue #4626 unwinding support (#15913)
Diffstat (limited to 'src')
-rw-r--r-- | src/jit/compiler.h | 4 | ||||
-rw-r--r-- | src/jit/unwind.cpp | 21 | ||||
-rw-r--r-- | src/jit/unwindamd64.cpp | 2 | ||||
-rw-r--r-- | src/jit/unwindarm.cpp | 8 |
4 files changed, 22 insertions, 13 deletions
diff --git a/src/jit/compiler.h b/src/jit/compiler.h index 7f2f3b8530..bc039df25e 100644 --- a/src/jit/compiler.h +++ b/src/jit/compiler.h @@ -7377,9 +7377,9 @@ private: #if defined(_TARGET_UNIX_) int mapRegNumToDwarfReg(regNumber reg); void createCfiCode(FuncInfoDsc* func, UCHAR codeOffset, UCHAR opcode, USHORT dwarfReg, INT offset = 0); - void unwindPushCFI(regNumber reg); + void unwindPushPopCFI(regNumber reg); void unwindBegPrologCFI(); - void unwindPushMaskCFI(regMaskTP regMask, bool isFloat); + void unwindPushPopMaskCFI(regMaskTP regMask, bool isFloat); void unwindAllocStackCFI(unsigned size); void unwindSetFrameRegCFI(regNumber reg, unsigned offset); void unwindEmitFuncCFI(FuncInfoDsc* func, void* pHotCode, void* pColdCode); diff --git a/src/jit/unwind.cpp b/src/jit/unwind.cpp index 643f15a39f..773339d502 100644 --- a/src/jit/unwind.cpp +++ b/src/jit/unwind.cpp @@ -126,16 +126,25 @@ void Compiler::createCfiCode(FuncInfoDsc* func, UCHAR codeOffset, UCHAR cfiOpcod func->cfiCodes->push_back(cfiEntry); } -void Compiler::unwindPushCFI(regNumber reg) +void Compiler::unwindPushPopCFI(regNumber reg) { +#if defined(_TARGET_ARM_) + assert(compGeneratingEpilog); +#else assert(compGeneratingProlog); +#endif FuncInfoDsc* func = funCurrentFunc(); - unsigned int cbProlog = unwindGetCurrentOffset(func); - noway_assert((BYTE)cbProlog == cbProlog); + unsigned int cbProlog = 0; + if (compGeneratingProlog) + { + cbProlog = unwindGetCurrentOffset(func); + noway_assert((BYTE)cbProlog == cbProlog); + + createCfiCode(func, cbProlog, CFI_ADJUST_CFA_OFFSET, DWARF_REG_ILLEGAL, REGSIZE_BYTES == 8 ? 8 : 4); + } - createCfiCode(func, cbProlog, CFI_ADJUST_CFA_OFFSET, DWARF_REG_ILLEGAL, REGSIZE_BYTES == 8 ? 8 : 4); if ((RBM_CALLEE_SAVED & genRegMask(reg)) #if defined(UNIX_AMD64_ABI) #if ETW_EBP_FRAMED @@ -183,7 +192,7 @@ void Compiler::unwindBegPrologCFI() #endif // FEATURE_EH_FUNCLETS } -void Compiler::unwindPushMaskCFI(regMaskTP regMask, bool isFloat) +void Compiler::unwindPushPopMaskCFI(regMaskTP regMask, bool isFloat) { regMaskTP regBit = isFloat ? genRegMask(REG_FP_FIRST) : 1; @@ -197,7 +206,7 @@ void Compiler::unwindPushMaskCFI(regMaskTP regMask, bool isFloat) if (regBit & regMask) { - unwindPushCFI(regNum); + unwindPushPopCFI(regNum); } } } diff --git a/src/jit/unwindamd64.cpp b/src/jit/unwindamd64.cpp index d4c077e4ec..a0cbfb1a10 100644 --- a/src/jit/unwindamd64.cpp +++ b/src/jit/unwindamd64.cpp @@ -209,7 +209,7 @@ void Compiler::unwindPush(regNumber reg) #ifdef UNIX_AMD64_ABI if (generateCFIUnwindCodes()) { - unwindPushCFI(reg); + unwindPushPopCFI(reg); } else #endif // UNIX_AMD64_ABI diff --git a/src/jit/unwindarm.cpp b/src/jit/unwindarm.cpp index 8c01648700..9bb07ec0e2 100644 --- a/src/jit/unwindarm.cpp +++ b/src/jit/unwindarm.cpp @@ -371,7 +371,6 @@ void Compiler::unwindPushMaskInt(regMaskTP maskInt) #if defined(_TARGET_UNIX_) if (generateCFIUnwindCodes()) { - unwindPushMaskCFI(maskInt, false); return; } #endif // _TARGET_UNIX_ @@ -388,7 +387,6 @@ void Compiler::unwindPushMaskFloat(regMaskTP maskFloat) #if defined(_TARGET_UNIX_) if (generateCFIUnwindCodes()) { - unwindPushMaskCFI(maskFloat, true); return; } #endif // _TARGET_UNIX_ @@ -401,6 +399,7 @@ void Compiler::unwindPopMaskInt(regMaskTP maskInt) #if defined(_TARGET_UNIX_) if (generateCFIUnwindCodes()) { + unwindPushPopMaskCFI(maskInt, false); return; } #endif // _TARGET_UNIX_ @@ -429,6 +428,7 @@ void Compiler::unwindPopMaskFloat(regMaskTP maskFloat) #if defined(_TARGET_UNIX_) if (generateCFIUnwindCodes()) { + unwindPushPopMaskCFI(maskFloat, true); return; } #endif // _TARGET_UNIX_ @@ -443,7 +443,7 @@ void Compiler::unwindAllocStack(unsigned size) #if defined(_TARGET_UNIX_) if (generateCFIUnwindCodes()) { - if (compGeneratingProlog) + if (compGeneratingEpilog) { unwindAllocStackCFI(size); } @@ -497,7 +497,7 @@ void Compiler::unwindSetFrameReg(regNumber reg, unsigned offset) #if defined(_TARGET_UNIX_) if (generateCFIUnwindCodes()) { - if (compGeneratingProlog) + if (compGeneratingEpilog) { unwindSetFrameRegCFI(reg, offset); } |