From e69300f4c06684b90f93ea9dfa1ce98c0b71626d Mon Sep 17 00:00:00 2001 From: Sergey Andreenko Date: Tue, 19 Dec 2017 19:31:52 -0800 Subject: [PATCH] if getter is under #ifdef, then the setter should be either. (#15581) Signed-off-by: Sergey Andreenko --- src/jit/compiler.h | 17 ++++++++--------- src/jit/morph.cpp | 12 +++++++----- 2 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/jit/compiler.h b/src/jit/compiler.h index 1fd5d83..813f344 100644 --- a/src/jit/compiler.h +++ b/src/jit/compiler.h @@ -1412,33 +1412,32 @@ public: } #endif // FEATURE_FIXED_OUT_ARGS +#if defined(UNIX_X86_ABI) void ComputeStackAlignment(unsigned curStackLevelInBytes) { -#if defined(UNIX_X86_ABI) padStkAlign = AlignmentPad(curStackLevelInBytes, STACK_ALIGN); -#endif // defined(UNIX_X86_ABI) } - void SetStkSizeBytes(unsigned newStkSizeBytes) + unsigned GetStkAlign() { -#if defined(UNIX_X86_ABI) - stkSizeBytes = newStkSizeBytes; -#endif // defined(UNIX_X86_ABI) + return padStkAlign; } -#if defined(UNIX_X86_ABI) - unsigned GetStkAlign() + void SetStkSizeBytes(unsigned newStkSizeBytes) { - return padStkAlign; + stkSizeBytes = newStkSizeBytes; } + unsigned GetStkSizeBytes() const { return stkSizeBytes; } + bool IsStkAlignmentDone() const { return alignmentDone; } + void SetStkAlignmentDone() { alignmentDone = true; diff --git a/src/jit/morph.cpp b/src/jit/morph.cpp index fbe3758..bdf8ba7 100644 --- a/src/jit/morph.cpp +++ b/src/jit/morph.cpp @@ -4498,7 +4498,9 @@ GenTreeCall* Compiler::fgMorphArgs(GenTreeCall* call) } assert(fgPtrArgCntCur >= genPtrArgCntSav); +#if defined(UNIX_X86_ABI) call->fgArgInfo->SetStkSizeBytes((fgPtrArgCntCur - genPtrArgCntSav) * TARGET_POINTER_SIZE); +#endif // UNIX_X86_ABI /* The call will pop all the arguments we pushed */ @@ -5889,31 +5891,31 @@ BasicBlock* Compiler::fgSetRngChkTargetInner(SpecialCodeKind kind, bool delay, u { delay = false; -#ifdef _TARGET_X86_ +#if !FEATURE_FIXED_OUT_ARGS // we need to initialize this field if (fgGlobalMorph && (stkDepth != nullptr)) { *stkDepth = fgPtrArgCntCur; } -#endif // _TARGET_X86_ +#endif // !FEATURE_FIXED_OUT_ARGS } if (!opts.compDbgCode) { if (delay || compIsForInlining()) { -#ifdef _TARGET_X86_ +#if !FEATURE_FIXED_OUT_ARGS // We delay this until after loop-oriented range check analysis. For now we merely store the current stack // level in the tree node. if (stkDepth != nullptr) { *stkDepth = fgPtrArgCntCur; } -#endif // _TARGET_X86_ +#endif // !FEATURE_FIXED_OUT_ARGS } else { -#ifdef _TARGET_X86_ +#if !FEATURE_FIXED_OUT_ARGS // fgPtrArgCntCur is only valid for global morph or if we walk full stmt. noway_assert(fgGlobalMorph || (stkDepth != nullptr)); const unsigned theStkDepth = fgGlobalMorph ? fgPtrArgCntCur : *stkDepth; -- 2.7.4