diff options
author | Brian Sullivan <briansul@microsoft.com> | 2018-03-22 12:04:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-22 12:04:43 -0700 |
commit | c520d29042aa09cbb583f492e56461e3166aef8a (patch) | |
tree | c8f76101dad4cbf720d69bab9b4ecedc81ea0b62 /src | |
parent | d67a99436216ce7379d3c42dc8940d7c02eb3c0f (diff) | |
parent | aed9c214814cb201a57728fbf24a4e78e39354d3 (diff) | |
download | coreclr-c520d29042aa09cbb583f492e56461e3166aef8a.tar.gz coreclr-c520d29042aa09cbb583f492e56461e3166aef8a.tar.bz2 coreclr-c520d29042aa09cbb583f492e56461e3166aef8a.zip |
Merge pull request #17112 from briansull/rollback-14481
Rollback Stack probing change - PR #14481
Diffstat (limited to 'src')
-rw-r--r-- | src/jit/codegencommon.cpp | 45 |
1 files changed, 15 insertions, 30 deletions
diff --git a/src/jit/codegencommon.cpp b/src/jit/codegencommon.cpp index 2c605c9a69..4a479af777 100644 --- a/src/jit/codegencommon.cpp +++ b/src/jit/codegencommon.cpp @@ -6324,9 +6324,7 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pIni } #endif // !_TARGET_XARCH_ -#if CPU_LOAD_STORE_ARCH instGen_Set_Reg_To_Zero(EA_PTRSIZE, initReg); -#endif // CPU_LOAD_STORE_ARCH // // Can't have a label inside the ReJIT padding area @@ -6387,53 +6385,40 @@ void CodeGen::genAllocLclFrame(unsigned frameSize, regNumber initReg, bool* pIni // The encoding differs based on the architecture and what register is // used (namely, using RAX has a smaller encoding). // - // For x86 - // lea eax, [esp - frameSize] // loop: - // lea esp, [esp - pageSize] 7 - // test [esp], eax 3 - // cmp esp, eax 2 + // For x86 + // test [esp + eax], eax 3 + // sub eax, 0x1000 5 + // cmp EAX, -frameSize 5 // jge loop 2 - // lea rsp, [rbp + frameSize] // // For AMD64 using RAX - // lea rax, [rsp - frameSize] - // loop: - // lea rsp, [rsp - pageSize] 8 - // test [rsp], rax 4 - // cmp rsp, rax 3 + // test [rsp + rax], rax 4 + // sub rax, 0x1000 6 + // cmp rax, -frameSize 6 // jge loop 2 - // lea rsp, [rax + frameSize] // // For AMD64 using RBP - // lea rbp, [rsp - frameSize] - // loop: - // lea rsp, [rsp - pageSize] 8 - // test [rsp], rbp 4 - // cmp rsp, rbp 3 + // test [rsp + rbp], rbp 4 + // sub rbp, 0x1000 7 + // cmp rbp, -frameSize 7 // jge loop 2 - // lea rsp, [rbp + frameSize] - - int sPageSize = (int)pageSize; - - getEmitter()->emitIns_R_AR(INS_lea, EA_PTRSIZE, initReg, REG_SPBASE, -((ssize_t)frameSize)); // get frame border - getEmitter()->emitIns_R_AR(INS_lea, EA_PTRSIZE, REG_SPBASE, REG_SPBASE, -sPageSize); - getEmitter()->emitIns_R_AR(INS_TEST, EA_PTRSIZE, initReg, REG_SPBASE, 0); - inst_RV_RV(INS_cmp, REG_SPBASE, initReg); + getEmitter()->emitIns_R_ARR(INS_TEST, EA_PTRSIZE, initReg, REG_SPBASE, initReg, 0); + inst_RV_IV(INS_sub, initReg, pageSize, EA_PTRSIZE); + inst_RV_IV(INS_cmp, initReg, -((ssize_t)frameSize), EA_PTRSIZE); int bytesForBackwardJump; #ifdef _TARGET_AMD64_ assert((initReg == REG_EAX) || (initReg == REG_EBP)); // We use RBP as initReg for EH funclets. - bytesForBackwardJump = -17; + bytesForBackwardJump = ((initReg == REG_EAX) ? -18 : -20); #else // !_TARGET_AMD64_ assert(initReg == REG_EAX); - bytesForBackwardJump = -14; + bytesForBackwardJump = -15; #endif // !_TARGET_AMD64_ inst_IV(INS_jge, bytesForBackwardJump); // Branch backwards to start of loop - getEmitter()->emitIns_R_AR(INS_lea, EA_PTRSIZE, REG_SPBASE, initReg, frameSize); // restore stack pointer #endif // !CPU_LOAD_STORE_ARCH *pInitRegZeroed = false; // The initReg does not contain zero |