Skip to content

Commit

Permalink
[1.8>1.9] [MERGE #4661 @agarwal-sandeep] OS#15659337: Try to allocate…
Browse files Browse the repository at this point in the history
… JIT code in PreReservedSegment even if CFG is not enabled

Merge pull request #4661 from agarwal-sandeep:vso15659337

This speeds up stack walking IsNativeAddress checks when CFG is not enabled.
  • Loading branch information
agarwal-sandeep committed Feb 9, 2018
2 parents aec9a9c + 30bef33 commit c50dfa8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions lib/Backend/Func.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,7 @@ bool Func::CanAllocInPreReservedHeapPageSegment ()
{
#ifdef _CONTROL_FLOW_GUARD
return PHASE_FORCE1(Js::PreReservedHeapAllocPhase) || (!PHASE_OFF1(Js::PreReservedHeapAllocPhase) &&
!IsJitInDebugMode() && GetThreadContextInfo()->IsCFGEnabled()
//&& !GetScriptContext()->IsScriptContextInDebugMode()
!IsJitInDebugMode()
#if _M_IX86
&& m_workItem->GetJitMode() == ExecutionMode::FullJit

Expand Down
2 changes: 1 addition & 1 deletion lib/Common/Memory/SectionAllocWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -868,7 +868,7 @@ LPVOID PreReservedSectionAllocWrapper::AllocPages(LPVOID lpAddress, DECLSPEC_GUA
size_t dwSize = pageCount * AutoSystemInfo::PageSize;

AssertMsg(isCustomHeapAllocation, "PreReservation used for allocations other than CustomHeap?");
AssertMsg(AutoSystemInfo::Data.IsCFGEnabled() || PHASE_FORCE1(Js::PreReservedHeapAllocPhase), "PreReservation without CFG ?");

Assert(dwSize != 0);

{
Expand Down
2 changes: 1 addition & 1 deletion lib/Common/Memory/VirtualAllocWrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ LPVOID PreReservedVirtualAllocWrapper::AllocPages(LPVOID lpAddress, size_t pageC
size_t dwSize = pageCount * AutoSystemInfo::PageSize;

AssertMsg(isCustomHeapAllocation, "PreReservation used for allocations other than CustomHeap?");
AssertMsg(AutoSystemInfo::Data.IsCFGEnabled() || PHASE_FORCE1(Js::PreReservedHeapAllocPhase), "PreReservation without CFG ?");

Assert(dwSize != 0);

{
Expand Down

0 comments on commit c50dfa8

Please sign in to comment.