Setting whether a function body's native entry point is used should be BGJIT_STATS agnostic
See ScriptFunction constructor. Only the background-jit-stats related updates should be made inside the BGJIT_STATS macro scope
@rajatd can you provide more detail here. Are you referring to this? https://github.com/Microsoft/ChakraCore/blob/86c3d097852d39cf01bc3568a333406e434c0c9a/lib/Runtime/Library/ScriptFunction.cpp#L66-L67
What's the impact of not having https://github.com/Microsoft/ChakraCore/blob/86c3d097852d39cf01bc3568a333406e434c0c9a/lib/Runtime/Library/ScriptFunction.cpp#L69 in retail build?
//cc @kfarnung @dilijev
It has to do with a heuristic that if the parent function of a loop body is jitted, dont jit the loop body. That heuristic will be broken if we dont set m_nativeEntryPointUsed to true