Skip to content

Commit 036fe50

Browse files
Taylor Wolldilijev
Taylor Woll
authored andcommitted
Merge unreleased/rs3 to release/1.7
1 parent 83b1218 commit 036fe50

File tree

118 files changed

+2143
-1257
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

118 files changed

+2143
-1257
lines changed

.gitattributes

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,9 @@
33
test/**/*.js -crlf
44
test/es6/HTMLComments.js binary diff=cpp
55
*.wasm binary
6+
*.cpp text eol=lf diff=cpp
7+
*.h text eol=lf diff=cpp
8+
*.inl text eol=lf diff=cpp
9+
*.vcproj text eol=crlf diff=xml
10+
*.vcxproj text eol=crlf diff=xml
11+
*.sln text eol=crlf diff=xml

Build/Common.Build.ProjectConfiguration.props

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,19 @@
4242
<Platform>ARM</Platform>
4343
</ProjectConfiguration>
4444
</ItemGroup>
45+
<ItemGroup Label="ProjectConfigurations">
46+
<ProjectConfiguration Include="Debug|CHPE">
47+
<Configuration>Debug</Configuration>
48+
<Platform>CHPE</Platform>
49+
</ProjectConfiguration>
50+
<ProjectConfiguration Include="Test|CHPE">
51+
<Configuration>Test</Configuration>
52+
<Platform>CHPE</Platform>
53+
</ProjectConfiguration>
54+
<ProjectConfiguration Include="Release|CHPE">
55+
<Configuration>Release</Configuration>
56+
<Platform>CHPE</Platform>
57+
</ProjectConfiguration>
58+
</ItemGroup>
4559
</Project>
4660

Build/Common.Build.props

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
<!-- ======== sources.inc ======== -->
3030
<!-- generates SAL annotations for our interface -->
3131
<AdditionalOptions>%(AdditionalOptions) -sal_local</AdditionalOptions>
32-
3332
<PreprocessorDefinitions>%(PreprocessorDefinitions);WINVER=$(Win32_WinNTVersion)</PreprocessorDefinitions>
3433
</Midl>
3534
<ClCompile>
@@ -54,11 +53,11 @@
5453
<RuntimeTypeInfo>false</RuntimeTypeInfo>
5554
<!-- /Zi -->
5655
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
57-
<DebugInformationFormat Condition="'$(MultiProcessorCompilation)' == 'true'">OldStyle</DebugInformationFormat>
56+
<DebugInformationFormat Condition="'%(MultiProcessorCompilation)' == 'true'">OldStyle</DebugInformationFormat>
5857
<!-- /EHsc- -->
5958
<ExceptionHandling>SyncCThrow</ExceptionHandling>
6059
<!-- /Gz -->
61-
<CallingConvention Condition="'$(Platform)'=='Win32'">StdCall</CallingConvention>
60+
<CallingConvention Condition="'$(Platform)'=='Win32' or '$(Platform)'=='chpe'">StdCall</CallingConvention>
6261
<!-- /Zp8 -->
6362
<StructMemberAlignment>8Bytes</StructMemberAlignment>
6463
<!-- /GS -->
@@ -132,7 +131,8 @@
132131
<ItemDefinitionGroup Condition="'$(OptimizedBuild)'=='true' AND '$(ENABLE_CODECOVERAGE)'!='true'">
133132
<ClCompile>
134133
<Optimization>MaxSpeed</Optimization>
135-
<WholeProgramOptimization>true</WholeProgramOptimization>
134+
<!-- HYB-TODO: When a CHPE toolchain arrives that supports LTCG, remove this condition. -->
135+
<WholeProgramOptimization Condition="'$(Platform)' != 'chpe'">true</WholeProgramOptimization>
136136
</ClCompile>
137137
</ItemDefinitionGroup>
138138

@@ -162,7 +162,7 @@
162162
<LinkTimeCodeGeneration Condition="'$(PlatformToolset)'!='v120' AND '$(TF_BUILD)'==''">UseFastLinkTimeCodeGeneration</LinkTimeCodeGeneration>
163163
</Link>
164164
<Lib>
165-
<LinkTimeCodeGeneration>true</LinkTimeCodeGeneration>
165+
<LinkTimeCodeGeneration Condition="'$(Platform)' != 'chpe'">true</LinkTimeCodeGeneration>
166166
</Lib>
167167
</ItemDefinitionGroup>
168168
<ItemGroup Condition="'$(ConfigurationType)'=='DynamicLibrary' OR '$(ConfigurationType)'=='Application'">

bin/GCStress/GCStress.vcxproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<?xml version="1.0" encoding="utf-8"?>
1+
<?xml version="1.0" encoding="utf-8"?>
22
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
33
<Import Condition="'$(ChakraBuildPathImported)'!='true'" Project="$(SolutionDir)Chakra.Build.Paths.props" />
44
<Import Project="$(BuildConfigPropsPath)Chakra.Build.ProjectConfiguration.props" />

bin/GCStress/StubExternalApi.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,4 @@ HRESULT MemProtectHeapSynchronizeWithCollector(void * heapHandle) { return E_NOT
112112
void MemProtectHeapSetDisableConcurrentThreadExitedCheck(void * heapHandle) {};
113113
#endif
114114

115-
#if DBG && defined(RECYCLER_VERIFY_MARK)
116-
bool IsLikelyRuntimeFalseReference(char* objectStartAddress, size_t offset,
117-
const char* typeName)
118-
{
119-
return false;
120-
}
121-
#endif
115+
IMPLEMENT_STUB_IsLikelyRuntimeFalseReference()

bin/NativeTests/MemoryPolicyTest.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,20 @@ namespace MemoryPolicyTests
7979

8080
TEST_CASE("MemoryPolicyTest_UnboundedMemory", "[MemoryPolicyTest]")
8181
{
82-
BasicTest(JsRuntimeAttributeNone, "UnboundedMemory.js");
83-
BasicTest(JsRuntimeAttributeDisableBackgroundWork, "UnboundedMemory.js");
82+
BasicTest(JsRuntimeAttributeDisableFatalOnOOM, "UnboundedMemory.js");
83+
BasicTest((JsRuntimeAttributes)(JsRuntimeAttributeDisableBackgroundWork | JsRuntimeAttributeDisableFatalOnOOM), "UnboundedMemory.js");
8484
}
8585

8686
TEST_CASE("MemoryPolicyTest_ArrayTest", "[MemoryPolicyTest]")
8787
{
88-
BasicTest(JsRuntimeAttributeNone, "arrayTest.js");
89-
BasicTest(JsRuntimeAttributeDisableBackgroundWork, "arrayTest.js");
88+
BasicTest(JsRuntimeAttributeDisableFatalOnOOM, "arrayTest.js");
89+
BasicTest((JsRuntimeAttributes)(JsRuntimeAttributeDisableBackgroundWork | JsRuntimeAttributeDisableFatalOnOOM), "arrayTest.js");
9090
}
9191

9292
TEST_CASE("MemoryPolicyTest_ArrayBuffer", "[MemoryPolicyTest]")
9393
{
94-
BasicTest(JsRuntimeAttributeNone, "arraybuffer.js");
95-
BasicTest(JsRuntimeAttributeDisableBackgroundWork, "arraybuffer.js");
94+
BasicTest(JsRuntimeAttributeDisableFatalOnOOM, "arraybuffer.js");
95+
BasicTest((JsRuntimeAttributes)(JsRuntimeAttributeDisableBackgroundWork | JsRuntimeAttributeDisableFatalOnOOM), "arraybuffer.js");
9696
}
9797

9898
void OOSTest(JsRuntimeAttributes attributes)

jenkins/check_eol.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ fi
1515
ERRFILE=check_eol.sh.err
1616
rm -f $ERRFILE
1717

18-
git diff --name-only `git merge-base origin/master HEAD` HEAD | grep -v -E "(test/.*\\.js|\\.cmd|\\.baseline|\\.wasm)" | xargs -I % ./jenkins/check_file_eol.sh %
18+
git diff --name-only `git merge-base origin/master HEAD` HEAD | grep -v -E "(test/.*\\.js|\\.cmd|\\.baseline|\\.wasm|\\.vcxproj|\\.vcproj|\\.sln)" | xargs -I % ./jenkins/check_file_eol.sh %
1919

2020
if [ -e $ERRFILE ]; then # if error file exists then there were errors
2121
>&2 echo "--------------" # leading >&2 means echo to stderr

lib/Backend/BailOut.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1228,6 +1228,10 @@ BailOutRecord::BailOutFromLoopBodyInlinedCommon(Js::JavascriptCallStackLayout *
12281228
uint32 bailOutOffset, void * returnAddress, IR::BailOutKind bailOutKind, Js::Var branchValue)
12291229
{
12301230
Assert(bailOutRecord->parent != nullptr);
1231+
// This isn't strictly necessary if there's no allocations on this path, but because such an
1232+
// issue would be hard to notice and introduce some significant issues, we can do this copy.
1233+
// The problem from not doing this and then doing an allocation before RestoreValues is that
1234+
// the GC doesn't check the BailOutRegisterSaveSpace.
12311235
Js::Var registerSaves[BailOutRegisterSaveSlotCount];
12321236
js_memcpy_s(registerSaves, sizeof(registerSaves), (Js::Var *)layout->functionObject->GetScriptContext()->GetThreadContext()->GetBailOutRegisterSaveSpace(),
12331237
sizeof(registerSaves));
@@ -2951,7 +2955,6 @@ void GlobalBailOutRecordDataTable::AddOrUpdateRow(JitArenaAllocator *allocator,
29512955
if(rowToUpdate->offset == offset &&
29522956
rowToUpdate->isInt == (unsigned)isInt &&
29532957
rowToUpdate->isFloat == (unsigned)isFloat &&
2954-
29552958
#ifdef ENABLE_SIMDJS
29562959
// SIMD_JS
29572960
rowToUpdate->isSimd128F4 == (unsigned) isSimd128F4 &&

lib/Backend/Func.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -725,7 +725,7 @@ static const unsigned __int64 c_debugFillPattern8 = 0xcececececececece;
725725
bool hasThrow : 1;
726726
bool hasUnoptimizedArgumentsAccess : 1; // True if there are any arguments access beyond the simple case of this.apply pattern
727727
bool m_canDoInlineArgsOpt : 1;
728-
bool applyTargetInliningRemovedArgumentsAccess :1;
728+
bool applyTargetInliningRemovedArgumentsAccess : 1;
729729
bool isGetterSetter : 1;
730730
const bool isInlinedConstructor: 1;
731731
bool hasImplicitCalls: 1;

lib/Backend/GlobOpt.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14702,6 +14702,7 @@ GlobOpt::OptArraySrc(IR::Instr * *const instrRef)
1470214702
IR::Opnd* lowerBound = baseOwnerIndir->GetIndexOpnd()
1470314703
? static_cast<IR::Opnd *>(baseOwnerIndir->GetIndexOpnd())
1470414704
: IR::IntConstOpnd::New(baseOwnerIndir->GetOffset(), TyInt32, instr->m_func);
14705+
1470514706
lowerBound->SetIsJITOptimizedReg(true);
1470614707
IR::Opnd* upperBound = IR::RegOpnd::New(headSegmentLengthSym, headSegmentLengthSym->GetType(), instr->m_func);
1470714708
upperBound->SetIsJITOptimizedReg(true);

lib/Backend/GlobOptBlockData.cpp

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,18 +1052,18 @@ GlobOptBlockData::MergeValueInfo(
10521052
ValueInfo *const toDataValueInfo = toDataVal->GetValueInfo();
10531053
ValueInfo *const fromDataValueInfo = fromDataVal->GetValueInfo();
10541054

1055-
// Same value
1056-
if (toDataValueInfo == fromDataValueInfo)
1057-
{
1058-
return toDataValueInfo;
1059-
}
1060-
10611055
if (toDataValueInfo->IsJsType() || fromDataValueInfo->IsJsType())
10621056
{
10631057
Assert(toDataValueInfo->IsJsType() && fromDataValueInfo->IsJsType());
10641058
return this->MergeJsTypeValueInfo(toDataValueInfo->AsJsType(), fromDataValueInfo->AsJsType(), isLoopBackEdge, sameValueNumber);
10651059
}
10661060

1061+
// Same value
1062+
if (toDataValueInfo == fromDataValueInfo)
1063+
{
1064+
return toDataValueInfo;
1065+
}
1066+
10671067
ValueType newValueType(toDataValueInfo->Type().Merge(fromDataValueInfo->Type()));
10681068
if (newValueType.IsLikelyInt())
10691069
{
@@ -1118,8 +1118,6 @@ GlobOptBlockData::MergeValueInfo(
11181118
JsTypeValueInfo*
11191119
GlobOptBlockData::MergeJsTypeValueInfo(JsTypeValueInfo * toValueInfo, JsTypeValueInfo * fromValueInfo, bool isLoopBackEdge, bool sameValueNumber)
11201120
{
1121-
Assert(toValueInfo != fromValueInfo);
1122-
11231121
// On loop back edges we must be conservative and only consider type values which are invariant throughout the loop.
11241122
// That's because in dead store pass we can't correctly track object pointer assignments (o = p), and we may not
11251123
// be able to register correct type checks for the right properties upstream. If we ever figure out how to enhance
@@ -1129,6 +1127,11 @@ GlobOptBlockData::MergeJsTypeValueInfo(JsTypeValueInfo * toValueInfo, JsTypeValu
11291127
return nullptr;
11301128
}
11311129

1130+
if (toValueInfo == fromValueInfo)
1131+
{
1132+
return toValueInfo;
1133+
}
1134+
11321135
const JITTypeHolder toType = toValueInfo->GetJsType();
11331136
const JITTypeHolder fromType = fromValueInfo->GetJsType();
11341137
const JITTypeHolder mergedType = toType == fromType ? toType : JITTypeHolder(nullptr);

lib/Backend/IR.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4639,4 +4639,3 @@ Instr::DumpRange(Instr *instrEnd)
46394639
#endif
46404640

46414641
} // namespace IR
4642-

lib/Backend/IR.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,8 @@ class Instr
151151
ignoreOverflowBitCount(32),
152152
isCtorCall(false),
153153
isCallInstrProtectedByNoProfileBailout(false),
154-
hasSideEffects(false)
154+
hasSideEffects(false),
155+
isNonFastPathFrameDisplay(false)
155156
{
156157
}
157158
public:

lib/Backend/IRBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#pragma prefast(disable:28652, "Prefast complains that the OR are causing the compiler to emit dynamic initializers and the variable to be allocated in read/write mem...")
1111

1212
static const IR::BailOutKind c_debuggerBailOutKindForCall =
13-
IR::BailOutForceByFlag | IR::BailOutStackFrameBase | IR::BailOutBreakPointInFunction | IR::BailOutLocalValueChanged | IR::BailOutIgnoreException;
13+
IR::BailOutForceByFlag | IR::BailOutStackFrameBase | IR::BailOutBreakPointInFunction | IR::BailOutLocalValueChanged | IR::BailOutIgnoreException | IR::BailOutStep;
1414
static const IR::BailOutKind c_debuggerBaseBailOutKindForHelper = IR::BailOutIgnoreException | IR::BailOutForceByFlag;
1515

1616
#pragma prefast(pop)

lib/Backend/IRBuilder.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,20 +87,23 @@ class IRBuilder
8787
{
8888
auto loopCount = func->GetJITFunctionBody()->GetLoopCount();
8989
if (loopCount > 0) {
90-
m_saveLoopImplicitCallFlags = (IR::Opnd**)func->m_alloc->Alloc(sizeof(IR::Opnd*) * loopCount);
9190
#if DBG
92-
memset(m_saveLoopImplicitCallFlags, 0, sizeof(IR::Opnd*) * loopCount);
91+
m_saveLoopImplicitCallFlags = AnewArrayZ(func->m_alloc, IR::Opnd*, loopCount);
92+
#else
93+
m_saveLoopImplicitCallFlags = AnewArray(func->m_alloc, IR::Opnd*, loopCount);
9394
#endif
9495
}
9596

9697
// Note: use original byte code without debugging probes, so that we don't jit BPs inserted by the user.
9798
func->m_workItem->InitializeReader(&m_jnReader, &m_statementReader, func->m_alloc);
9899
};
99100

100-
~IRBuilder() {
101+
~IRBuilder()
102+
{
101103
Assert(m_func->GetJITFunctionBody()->GetLoopCount() == 0 || m_saveLoopImplicitCallFlags);
102-
if (m_saveLoopImplicitCallFlags) {
103-
m_func->m_alloc->Free(m_saveLoopImplicitCallFlags, sizeof(IR::Opnd*) * m_func->GetJITFunctionBody()->GetLoopCount());
104+
if (m_saveLoopImplicitCallFlags)
105+
{
106+
AdeleteArray(m_func->m_alloc, m_func->GetJITFunctionBody()->GetLoopCount(), m_saveLoopImplicitCallFlags);
104107
}
105108
}
106109

lib/Backend/Inline.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1716,7 +1716,7 @@ Inline::TryOptimizeCallInstrWithFixedMethod(IR::Instr *callInstr, const Function
17161716
else
17171717
{
17181718
// We patch later for constructor inlining.
1719-
Assert(
1719+
AssertOrFailFast(
17201720
callInstr->m_opcode == Js::OpCode::NewScObject ||
17211721
callInstr->m_opcode == Js::OpCode::NewScObjArray);
17221722
}
@@ -3759,7 +3759,7 @@ void Inline::InlineDOMGetterSetterFunction(IR::Instr *ldFldInstr, const Function
37593759
// type-specific optimizations. Otherwise, this optimization to reduce calls into the host will also
37603760
// result in relatively more expensive calls in the runtime.
37613761
tmpDst->SetValueType(ldFldInstr->GetDst()->GetValueType());
3762-
3762+
37633763
IR::Opnd * callInstrDst = ldFldInstr->UnlinkDst();
37643764
ldFldInstr->SetDst(tmpDst);
37653765

lib/Backend/InterpreterThunkEmitter.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ const BYTE InterpreterThunkEmitter::StackAllocSize = 0x28;
2525
// Hence, we allocate 0x28 bytes of stack space for the callee to use. The callee uses 8 bytes to push the first
2626
// argument and the rest 0x20 ensures alignment is correct.
2727
//
28-
const BYTE InterpreterThunkEmitter::InterpreterThunk[] = {
28+
const BYTE InterpreterThunkEmitter::InterpreterThunk[INTERPRETER_THUNK_SIZE] = {
2929
0x48, 0x89, 0x54, 0x24, 0x10, // mov qword ptr [rsp+10h],rdx
3030
0x48, 0x89, 0x4C, 0x24, 0x08, // mov qword ptr [rsp+8],rcx
3131
0x4C, 0x89, 0x44, 0x24, 0x18, // mov qword ptr [rsp+18h],r8
@@ -69,7 +69,7 @@ const BYTE InterpreterThunkEmitter::ThunkAddressOffset = 61;
6969
const BYTE InterpreterThunkEmitter::PrologSize = 60;
7070
const BYTE InterpreterThunkEmitter::StackAllocSize = 0x0;
7171

72-
const BYTE InterpreterThunkEmitter::InterpreterThunk[] = {
72+
const BYTE InterpreterThunkEmitter::InterpreterThunk[INTERPRETER_THUNK_SIZE] = {
7373
0x55, // push rbp // Prolog - setup the stack frame
7474
0x48, 0x89, 0xe5, // mov rbp, rsp
7575
0x48, 0x8b, 0x47, 0x00, // mov rax, qword ptr [rdi + FunctionInfoOffset]
@@ -106,7 +106,7 @@ const BYTE InterpreterThunkEmitter::CallBlockStartAddressInstrOffset = 42;
106106
const BYTE InterpreterThunkEmitter::CallThunkSizeInstrOffset = 54;
107107
const BYTE InterpreterThunkEmitter::ErrorOffset = 64;
108108

109-
const BYTE InterpreterThunkEmitter::InterpreterThunk[] = {
109+
const BYTE InterpreterThunkEmitter::InterpreterThunk[INTERPRETER_THUNK_SIZE] = {
110110
0x0F, 0xB4, // push {r0-r3}
111111
0x2D, 0xE9, 0x00, 0x48, // push {r11,lr}
112112
0xEB, 0x46, // mov r11,sp
@@ -152,7 +152,7 @@ const BYTE InterpreterThunkEmitter::DynamicThunkAddressOffset = 32;
152152
const BYTE InterpreterThunkEmitter::ThunkAddressOffset = 36;
153153

154154
//TODO: saravind :Implement Range Check for ARM64
155-
const BYTE InterpreterThunkEmitter::InterpreterThunk[] = {
155+
const BYTE InterpreterThunkEmitter::InterpreterThunk[INTERPRETER_THUNK_SIZE] = {
156156
0xFD, 0x7B, 0xBB, 0xA9, //stp fp, lr, [sp, #-80]! ;Prologue
157157
0xFD, 0x03, 0x00, 0x91, //mov fp, sp ;update frame pointer to the stack pointer
158158
0xE0, 0x07, 0x01, 0xA9, //stp x0, x1, [sp, #16] ;Prologue again; save all registers
@@ -191,7 +191,7 @@ const BYTE InterpreterThunkEmitter::ThunkSizeOffset = 26;
191191
const BYTE InterpreterThunkEmitter::ErrorOffset = 33;
192192
const BYTE InterpreterThunkEmitter::ThunkAddressOffset = 44;
193193

194-
const BYTE InterpreterThunkEmitter::InterpreterThunk[] = {
194+
const BYTE InterpreterThunkEmitter::InterpreterThunk[INTERPRETER_THUNK_SIZE] = {
195195
0x55, // push ebp ;Prolog - setup the stack frame
196196
0x8B, 0xEC, // mov ebp,esp
197197
0x8B, 0x45, 0x08, // mov eax, dword ptr [ebp+8]
@@ -547,7 +547,7 @@ void InterpreterThunkEmitter::EncodeInterpreterThunk(
547547
__in const DWORD epilogSize,
548548
__in const intptr_t interpreterThunk)
549549
{
550-
_Analysis_assume_(thunkSize == HeaderSize());
550+
_Analysis_assume_(thunkSize == INTERPRETER_THUNK_SIZE);
551551
// Encode MOVW
552552
DWORD lowerThunkBits = (uint32)interpreterThunk & 0x0000FFFF;
553553
DWORD movW = EncodeMove(/*Opcode*/ 0x0000F240, /*register*/1, lowerThunkBits);
@@ -621,7 +621,7 @@ void InterpreterThunkEmitter::EncodeInterpreterThunk(
621621
{
622622
int addrOffset = ThunkAddressOffset;
623623

624-
_Analysis_assume_(thunkSize == HeaderSize());
624+
_Analysis_assume_(thunkSize == INTERPRETER_THUNK_SIZE);
625625
AssertMsg(thunkSize == HeaderSize(), "Mismatch in the size of the InterpreterHeaderThunk and the thunkSize used in this API (EncodeInterpreterThunk)");
626626

627627
// Following 4 MOV Instrs are to move the 64-bit address of the InterpreterThunk address into register x1.

lib/Backend/InterpreterThunkEmitter.h

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,20 @@ class InterpreterThunkEmitter
8181
static const BYTE CallBlockStartAddressInstrOffset;
8282
static const BYTE CallThunkSizeInstrOffset;
8383
#endif
84-
static const BYTE InterpreterThunk[];
84+
#ifdef _M_X64
85+
#ifdef _WIN32
86+
#define INTERPRETER_THUNK_SIZE 96
87+
#else // Sys V AMD64
88+
#define INTERPRETER_THUNK_SIZE 72
89+
#endif
90+
#elif defined(_M_ARM)
91+
#define INTERPRETER_THUNK_SIZE 72
92+
#elif defined(_M_ARM64)
93+
#define INTERPRETER_THUNK_SIZE 60
94+
#else
95+
#define INTERPRETER_THUNK_SIZE 56
96+
#endif
97+
static const BYTE InterpreterThunk[INTERPRETER_THUNK_SIZE];
8598

8699
// Call buffer includes a call to the inner interpreter thunk and eventual jump to the epilog
87100
static const BYTE JmpOffset;

lib/Backend/JnHelperMethod.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
extern "C"
88
{
99
#ifdef _M_IX86
10-
void __cdecl _chkstk(int);
10+
DECLSPEC_CHPE_GUEST void __cdecl _chkstk(int);
1111
#else
1212
void __cdecl __chkstk(int);
1313
#endif

lib/Backend/LinearScan.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,11 +222,10 @@ LinearScan::RegAlloc()
222222
}
223223

224224
this->SetSrcRegs(instr);
225+
this->EndDeadLifetimes(instr);
225226

226227
this->CheckOpHelper(instr);
227228

228-
this->EndDeadLifetimes(instr);
229-
230229
this->KillImplicitRegs(instr);
231230

232231
this->AllocateNewLifetimes(instr);

0 commit comments

Comments
 (0)