Skip to content

Commit d4ac98e

Browse files
committed
Merge branch 'master' into pr/yongqu/module
2 parents 2977201 + 9b49b23 commit d4ac98e

File tree

18 files changed

+119
-51
lines changed

18 files changed

+119
-51
lines changed

bin/GCStress/GCStress.vcxproj

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,29 +36,29 @@
3636
<ClCompile Include="GCStress.cpp" />
3737
<ClCompile Include="RecyclerTestObject.cpp" />
3838
<ClCompile Include="stdafx.cpp" />
39-
<ClCompile Include="StubExternalAPI.cpp" />
39+
<ClCompile Include="StubExternalApi.cpp" />
4040
</ItemGroup>
4141
<ItemGroup>
42-
<ProjectReference Include="..\..\lib\common\common\Chakra.Common.Common.vcxproj">
42+
<ProjectReference Include="..\..\lib\Common\Common\Chakra.Common.Common.vcxproj">
4343
<Project>{bb4153ff-ac3e-4734-b562-cc23812df31b}</Project>
4444
</ProjectReference>
45-
<ProjectReference Include="..\..\lib\common\core\Chakra.Common.Core.vcxproj">
45+
<ProjectReference Include="..\..\lib\Common\Core\Chakra.Common.Core.vcxproj">
4646
<Project>{cc4153ff-ac3e-4734-b562-cc23812df31b}</Project>
4747
</ProjectReference>
48-
<ProjectReference Include="..\..\lib\common\DataStructures\Chakra.Common.DataStructures.vcxproj">
48+
<ProjectReference Include="..\..\lib\Common\DataStructures\Chakra.Common.DataStructures.vcxproj">
4949
<Project>{5643d42a-c38d-4d82-9662-58470b3ac9f7}</Project>
5050
</ProjectReference>
51-
<ProjectReference Include="..\..\lib\common\Exceptions\Chakra.Common.Exceptions.vcxproj">
51+
<ProjectReference Include="..\..\lib\Common\Exceptions\Chakra.Common.Exceptions.vcxproj">
5252
<Project>{fd8eec40-4141-448a-bf4b-1589fbe4f60d}</Project>
5353
</ProjectReference>
54-
<ProjectReference Include="..\..\lib\common\Memory\Chakra.Common.Memory.vcxproj">
54+
<ProjectReference Include="..\..\lib\Common\Memory\Chakra.Common.Memory.vcxproj">
5555
<Project>{bb4153ff-ac3e-4734-b562-ff23812df31b}</Project>
5656
</ProjectReference>
5757
</ItemGroup>
5858
<ItemGroup>
5959
<ClInclude Include="GCStress.h" />
6060
<ClInclude Include="RecyclerTestObject.h" />
61-
<ClInclude Include="StdAfx.h" />
61+
<ClInclude Include="stdafx.h" />
6262
<ClInclude Include="WeightedTable.h" />
6363
</ItemGroup>
6464
<Import Project="$(BuildConfigPropsPath)Chakra.Build.targets" Condition="exists('$(BuildConfigPropsPath)Chakra.Build.targets')" />

bin/GCStress/GCStress.vcxproj.filters

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<ClCompile Include="stdafx.cpp">
2525
<Filter>Source Files</Filter>
2626
</ClCompile>
27-
<ClCompile Include="StubExternalAPI.cpp">
27+
<ClCompile Include="StubExternalApi.cpp">
2828
<Filter>Source Files</Filter>
2929
</ClCompile>
3030
</ItemGroup>
@@ -35,7 +35,7 @@
3535
<ClInclude Include="RecyclerTestObject.h">
3636
<Filter>Header Files</Filter>
3737
</ClInclude>
38-
<ClInclude Include="StdAfx.h">
38+
<ClInclude Include="stdafx.h">
3939
<Filter>Header Files</Filter>
4040
</ClInclude>
4141
<ClInclude Include="WeightedTable.h">

bin/GCStress/StubExternalAPI.cpp renamed to bin/GCStress/StubExternalApi.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.
44
//-------------------------------------------------------------------------------------------------------
55
#include "Common.h"
6-
#include "commoninl.h" // TODO: Try to remove this later
6+
#include "CommonInl.h" // TODO: Try to remove this later
77

8-
#include "core\ConfigParser.h"
8+
#include "Core/ConfigParser.h"
99

1010
// TODO: REMOVE
1111
__forceinline void js_memcpy_s(__bcount(sizeInBytes) void *dst, size_t sizeInBytes, __in_bcount(count) const void *src, size_t count)
1212
{
1313
Assert((count) <= (sizeInBytes));
1414
if ((count) <= (sizeInBytes))
1515
memcpy((dst), (src), (count));
16-
else
16+
else
1717
ReportFatalException(NULL, E_FAIL, Fatal_Internal_Error, 2);
1818
}
1919

File renamed without changes.
File renamed without changes.
File renamed without changes.

bin/ch/ch.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
</ResourceCompile>
4949
</ItemGroup>
5050
<ItemGroup>
51-
<ClInclude Include="chakrartinterface.h" />
51+
<ClInclude Include="ChakraRtInterface.h" />
5252
<ClInclude Include="Helpers.h" />
5353
<ClInclude Include="HostConfigFlags.h" />
5454
<ClInclude Include="HostConfigFlagsList.h" />
@@ -58,7 +58,7 @@
5858
</ItemGroup>
5959
<ItemGroup>
6060
<ClCompile Include="ch.cpp" />
61-
<ClCompile Include="chakrartinterface.cpp" />
61+
<ClCompile Include="ChakraRtInterface.cpp" />
6262
<ClCompile Include="CodexAssert.cpp" />
6363
<ClCompile Include="Helpers.cpp" />
6464
<ClCompile Include="HostConfigFlags.cpp" />

bin/ch/stdafx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ if (!(exp)) \
7373
typedef void * Var;
7474

7575
#include "TestHooks.h"
76-
#include "chakrartinterface.h"
76+
#include "ChakraRtInterface.h"
7777
#include "Helpers.h"
7878
#include "HostConfigFlags.h"
7979
#include "MessageQueue.h"

lib/Backend/BackwardPass.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,10 +1069,17 @@ BackwardPass::MergeGuardedProperties(ObjTypeGuardBucket bucket1, ObjTypeGuardBuc
10691069

10701070
ObjTypeGuardBucket bucket;
10711071
bucket.SetGuardedPropertyOps(mergedPropertyOps);
1072-
if (bucket1.NeedsMonoCheck() || bucket2.NeedsMonoCheck())
1072+
Js::Type *monoGuardType = bucket1.GetMonoGuardType();
1073+
if (monoGuardType != nullptr)
10731074
{
1074-
bucket.SetNeedsMonoCheck(true);
1075+
Assert(!bucket2.NeedsMonoCheck() || monoGuardType == bucket2.GetMonoGuardType());
10751076
}
1077+
else
1078+
{
1079+
monoGuardType = bucket2.GetMonoGuardType();
1080+
}
1081+
bucket.SetMonoGuardType(monoGuardType);
1082+
10761083
return bucket;
10771084
}
10781085

@@ -3988,7 +3995,8 @@ BackwardPass::TrackObjTypeSpecProperties(IR::PropertySymOpnd *opnd, BasicBlock *
39883995
if (opnd->NeedsMonoCheck())
39893996
{
39903997
Assert(opnd->IsMono());
3991-
bucket->SetNeedsMonoCheck(true);
3998+
Js::Type *monoGuardType = opnd->HasInitialType() ? opnd->GetInitialType() : opnd->GetType();
3999+
bucket->SetMonoGuardType(monoGuardType);
39924000
}
39934001

39944002
if (opnd->NeedsPrimaryTypeCheck())
@@ -4013,11 +4021,10 @@ BackwardPass::TrackObjTypeSpecProperties(IR::PropertySymOpnd *opnd, BasicBlock *
40134021
{
40144022
// Some instr protected by this one requires a monomorphic type check. (E.g., final type opt,
40154023
// fixed field not loaded from prototype.)
4016-
Assert(opnd->IsMono());
4017-
opnd->SetMustDoMonoCheck(true);
4024+
opnd->SetMonoGuardType(bucket->GetMonoGuardType());
40184025
this->currentInstr->ChangeEquivalentToMonoTypeCheckBailOut();
40194026
}
4020-
bucket->SetNeedsMonoCheck(false);
4027+
bucket->SetMonoGuardType(nullptr);
40214028
}
40224029

40234030
bucket->SetGuardedPropertyOps(nullptr);

lib/Backend/FlowGraph.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,28 +71,29 @@ class ObjTypeGuardBucket
7171
{
7272
private:
7373
BVSparse<JitArenaAllocator>* guardedPropertyOps;
74-
bool needsMonoCheck;
74+
Js::Type * monoGuardType;
7575

7676
public:
77-
ObjTypeGuardBucket() : guardedPropertyOps(nullptr), needsMonoCheck(false) {}
77+
ObjTypeGuardBucket() : guardedPropertyOps(nullptr), monoGuardType(nullptr) {}
7878

79-
ObjTypeGuardBucket(BVSparse<JitArenaAllocator>* guardedPropertyOps) : needsMonoCheck(false)
79+
ObjTypeGuardBucket(BVSparse<JitArenaAllocator>* guardedPropertyOps) : monoGuardType(nullptr)
8080
{
8181
this->guardedPropertyOps = (guardedPropertyOps != nullptr ? guardedPropertyOps->CopyNew() : nullptr);
8282
}
8383

8484
void Copy(ObjTypeGuardBucket *pNew) const
8585
{
8686
pNew->guardedPropertyOps = this->guardedPropertyOps ? this->guardedPropertyOps->CopyNew() : nullptr;
87-
pNew->needsMonoCheck = this->needsMonoCheck;
87+
pNew->monoGuardType = this->monoGuardType;
8888
}
8989

9090
BVSparse<JitArenaAllocator> *GetGuardedPropertyOps() const { return this->guardedPropertyOps; }
9191
void SetGuardedPropertyOps(BVSparse<JitArenaAllocator> *guardedPropertyOps) { this->guardedPropertyOps = guardedPropertyOps; }
9292
void AddToGuardedPropertyOps(uint propertyOpId) { Assert(this->guardedPropertyOps != nullptr); this->guardedPropertyOps->Set(propertyOpId); }
9393

94-
bool NeedsMonoCheck() const { return this->needsMonoCheck; }
95-
void SetNeedsMonoCheck(bool value) { this->needsMonoCheck = value; }
94+
bool NeedsMonoCheck() const { return this->monoGuardType != nullptr; }
95+
void SetMonoGuardType(Js::Type *type) { this->monoGuardType = type; }
96+
Js::Type * GetMonoGuardType() const { return this->monoGuardType; }
9697

9798
#if DBG_DUMP
9899
void Dump() const;

0 commit comments

Comments
 (0)