Skip to content

Commit 906f833

Browse files
committed
[MERGE #6464 @rajeshpeter] ChakraCore Servicing Update for 2020.06B
Merge pull request #6464 from rajeshpeter:servicing/2006 CVE-2020-1219] Js::PathTypeHandlerBase::SetPrototype should protect against the case where the instance's type is changed as a side-effect of calling newPrototype->GetInternalProperty. Intl.js should not refer directly to the global Intl property, as this may have been modified by the user in such a way that Intl initialization has side-effects. Created an Intl property on the interface object whose value is the built-in Intl object and refer to that in Intl.js instead. [CVE-2020-1073] Non-optimized StFld that may change the object's type may be undetected in the loop prepass, resulting in bad AdjustObjType downstream. If the dead store pass detects a final type that's live across a non-optimized StFld, mark the StFld to use a helper that will return true if the object's type is changed, and bail out if the helper returns true. Also ensures there is no type transition live across InitClassMember.
2 parents 5ed2985 + 52f4143 commit 906f833

22 files changed

+24360
-24087
lines changed

Diff for: Build/NuGet/.pack-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.11.19
1+
1.11.20

Diff for: lib/Backend/BackwardPass.cpp

+43
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,7 @@ BackwardPass::MergeSuccBlocksInfo(BasicBlock * block)
935935
blockSucc->couldRemoveNegZeroBailoutForDef = nullptr;
936936
}
937937
}
938+
this->CombineTypeIDsWithFinalType(block, blockSucc);
938939
}
939940

940941
if (blockSucc->noImplicitCallUses != nullptr)
@@ -4733,6 +4734,7 @@ BackwardPass::ProcessNewScObject(IR::Instr* instr)
47334734
#else
47344735
block->stackSymToFinalType->Clear(objSym->m_id);
47354736
#endif
4737+
this->ClearTypeIDWithFinalType(objSym->m_id, block);
47364738
}
47374739
}
47384740

@@ -5208,6 +5210,10 @@ BackwardPass::MayPropertyBeWrittenTo(Js::PropertyId propertyId)
52085210
void
52095211
BackwardPass::ProcessPropertySymOpndUse(IR::PropertySymOpnd * opnd)
52105212
{
5213+
if (opnd == this->currentInstr->GetDst() && this->HasTypeIDWithFinalType(this->currentBlock))
5214+
{
5215+
opnd->SetCantChangeType(true);
5216+
}
52115217

52125218
// If this operand doesn't participate in the type check sequence it's a pass-through.
52135219
// We will not set any bits on the operand and we will ignore them when lowering.
@@ -5440,6 +5446,7 @@ BackwardPass::TrackObjTypeSpecProperties(IR::PropertySymOpnd *opnd, BasicBlock *
54405446
this->currentInstr->ChangeEquivalentToMonoTypeCheckBailOut();
54415447
}
54425448
bucket->SetMonoGuardType(nullptr);
5449+
this->ClearTypeIDWithFinalType(objSym->m_id, block);
54435450
}
54445451

54455452
if (!opnd->IsTypeAvailable())
@@ -5641,6 +5648,7 @@ BackwardPass::TrackAddPropertyTypes(IR::PropertySymOpnd *opnd, BasicBlock *block
56415648
}
56425649

56435650
pBucket->SetInitialType(typeWithoutProperty);
5651+
this->SetTypeIDWithFinalType(propertySym->m_stackSym->m_id, block);
56445652

56455653
if (!PHASE_OFF(Js::ObjTypeSpecStorePhase, this->func))
56465654
{
@@ -5728,6 +5736,7 @@ BackwardPass::TrackAddPropertyTypes(IR::PropertySymOpnd *opnd, BasicBlock *block
57285736
#else
57295737
block->stackSymToFinalType->Clear(propertySym->m_stackSym->m_id);
57305738
#endif
5739+
this->ClearTypeIDWithFinalType(propertySym->m_stackSym->m_id, block);
57315740
}
57325741
}
57335742

@@ -5933,6 +5942,40 @@ BackwardPass::ForEachAddPropertyCacheBucket(Fn fn)
59335942
NEXT_HASHTABLE_ENTRY;
59345943
}
59355944

5945+
void
5946+
BackwardPass::SetTypeIDWithFinalType(int symID, BasicBlock *block)
5947+
{
5948+
BVSparse<JitArenaAllocator> *bv = block->EnsureTypeIDsWithFinalType(this->tempAlloc);
5949+
bv->Set(symID);
5950+
}
5951+
5952+
void
5953+
BackwardPass::ClearTypeIDWithFinalType(int symID, BasicBlock *block)
5954+
{
5955+
BVSparse<JitArenaAllocator> *bv = block->typeIDsWithFinalType;
5956+
if (bv != nullptr)
5957+
{
5958+
bv->Clear(symID);
5959+
}
5960+
}
5961+
5962+
bool
5963+
BackwardPass::HasTypeIDWithFinalType(BasicBlock *block) const
5964+
{
5965+
return block->typeIDsWithFinalType != nullptr && !block->typeIDsWithFinalType->IsEmpty();
5966+
}
5967+
5968+
void
5969+
BackwardPass::CombineTypeIDsWithFinalType(BasicBlock *block, BasicBlock *blockSucc)
5970+
{
5971+
BVSparse<JitArenaAllocator> *bvSucc = blockSucc->typeIDsWithFinalType;
5972+
if (bvSucc != nullptr && !bvSucc->IsEmpty())
5973+
{
5974+
BVSparse<JitArenaAllocator> *bv = block->EnsureTypeIDsWithFinalType(this->tempAlloc);
5975+
bv->Or(bvSucc);
5976+
}
5977+
}
5978+
59365979
bool
59375980
BackwardPass::TransitionUndoesObjectHeaderInlining(AddPropertyCacheBucket *data) const
59385981
{

Diff for: lib/Backend/BackwardPass.h

+5
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@ class BackwardPass
149149
void InsertTypeTransitionsAtPotentialKills();
150150
bool TransitionUndoesObjectHeaderInlining(AddPropertyCacheBucket *data) const;
151151

152+
void SetTypeIDWithFinalType(int symId, BasicBlock *block);
153+
void ClearTypeIDWithFinalType(int symId, BasicBlock *block);
154+
bool HasTypeIDWithFinalType(BasicBlock *block) const;
155+
void CombineTypeIDsWithFinalType(BasicBlock *block, BasicBlock *blockSucc);
156+
152157
template<class Fn> void ForEachAddPropertyCacheBucket(Fn fn);
153158
static ObjTypeGuardBucket MergeGuardedProperties(ObjTypeGuardBucket bucket1, ObjTypeGuardBucket bucket2);
154159
static ObjWriteGuardBucket MergeWriteGuards(ObjWriteGuardBucket bucket1, ObjWriteGuardBucket bucket2);

Diff for: lib/Backend/FlowGraph.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -3399,6 +3399,16 @@ BasicBlock::CreateLoopTopBailOutInfo(GlobOpt * globOpt)
33993399
return bailOutInfo;
34003400
}
34013401

3402+
BVSparse<JitArenaAllocator> *
3403+
BasicBlock::EnsureTypeIDsWithFinalType(JitArenaAllocator *alloc)
3404+
{
3405+
if (typeIDsWithFinalType == nullptr)
3406+
{
3407+
typeIDsWithFinalType = JitAnew(alloc, BVSparse<JitArenaAllocator>, alloc);
3408+
}
3409+
return typeIDsWithFinalType;
3410+
}
3411+
34023412
IR::Instr *
34033413
FlowGraph::RemoveInstr(IR::Instr *instr, GlobOpt * globOpt)
34043414
{

Diff for: lib/Backend/FlowGraph.h

+4
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,8 @@ class BasicBlock
349349
bool IsLandingPad();
350350
BailOutInfo * CreateLoopTopBailOutInfo(GlobOpt * globOpt);
351351

352+
BVSparse<JitArenaAllocator> *EnsureTypeIDsWithFinalType(JitArenaAllocator *alloc);
353+
352354
// GlobOpt Stuff
353355
public:
354356
bool PathDepBranchFolding(GlobOpt* globOptState);
@@ -400,6 +402,7 @@ class BasicBlock
400402
HashTable<AddPropertyCacheBucket> * stackSymToFinalType;
401403
HashTable<ObjTypeGuardBucket> * stackSymToGuardedProperties; // Dead store pass only
402404
HashTable<ObjWriteGuardBucket> * stackSymToWriteGuardsMap; // Backward pass only
405+
BVSparse<JitArenaAllocator> * typeIDsWithFinalType;
403406
BVSparse<JitArenaAllocator> * noImplicitCallUses;
404407
BVSparse<JitArenaAllocator> * noImplicitCallNoMissingValuesUses;
405408
BVSparse<JitArenaAllocator> * noImplicitCallNativeArrayUses;
@@ -443,6 +446,7 @@ class BasicBlock
443446
stackSymToFinalType(nullptr),
444447
stackSymToGuardedProperties(nullptr),
445448
stackSymToWriteGuardsMap(nullptr),
449+
typeIDsWithFinalType(nullptr),
446450
noImplicitCallUses(nullptr),
447451
noImplicitCallNoMissingValuesUses(nullptr),
448452
noImplicitCallNativeArrayUses(nullptr),

Diff for: lib/Backend/GlobOptFields.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,7 @@ GlobOpt::ProcessFieldKills(IR::Instr *instr, BVSparse<JitArenaAllocator> *bv, bo
392392

393393
case Js::OpCode::InitSetFld:
394394
case Js::OpCode::InitGetFld:
395+
case Js::OpCode::InitClassMember:
395396
case Js::OpCode::InitClassMemberGet:
396397
case Js::OpCode::InitClassMemberSet:
397398
sym = instr->GetDst()->AsSymOpnd()->m_sym;

Diff for: lib/Backend/JnHelperMethodList.h

+11
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,17 @@ HELPERCALLCHK(Op_PatchPutValueWithThisPtrNoLocalFastPathPolymorphic, ((void (*)(
254254
HELPERCALLCHK(Op_PatchPutRootValueNoLocalFastPath, ((void (*)(Js::FunctionBody *const, Js::InlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutRootValueNoLocalFastPath<true, Js::InlineCache>), AttrCanThrow)
255255
HELPERCALLCHK(Op_PatchPutRootValueNoLocalFastPathPolymorphic, ((void (*)(Js::FunctionBody *const, Js::PolymorphicInlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutRootValueNoLocalFastPath<true, Js::PolymorphicInlineCache>), AttrCanThrow)
256256

257+
HELPERCALLCHK(Op_PatchInitValueCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::InlineCache *const, const Js::InlineCacheIndex, Js::RecyclableObject*, Js::PropertyId, Js::Var))Js::JavascriptOperators::PatchInitValueCantChangeType<Js::InlineCache>), AttrCanThrow)
258+
HELPERCALLCHK(Op_PatchInitValuePolymorphicCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::PolymorphicInlineCache *const, const Js::InlineCacheIndex, Js::RecyclableObject*, Js::PropertyId, Js::Var))Js::JavascriptOperators::PatchInitValueCantChangeType<Js::PolymorphicInlineCache>), AttrCanThrow)
259+
HELPERCALLCHK(Op_PatchPutValueCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::InlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutValueCantChangeType<Js::InlineCache>), AttrCanThrow)
260+
HELPERCALLCHK(Op_PatchPutValueWithThisPtrCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::InlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutValueWithThisPtrCantChangeType<Js::InlineCache>), AttrCanThrow)
261+
HELPERCALLCHK(Op_PatchPutValuePolymorphicCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::PolymorphicInlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutValueCantChangeType<Js::PolymorphicInlineCache>), AttrCanThrow)
262+
HELPERCALLCHK(Op_PatchPutValueWithThisPtrPolymorphicCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::PolymorphicInlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutValueWithThisPtrCantChangeType<Js::PolymorphicInlineCache>), AttrCanThrow)
263+
HELPERCALLCHK(Op_PatchPutValueNoLocalFastPathCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::InlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutValueNoLocalFastPathCantChangeType<Js::InlineCache>), AttrCanThrow)
264+
HELPERCALLCHK(Op_PatchPutValueWithThisPtrNoLocalFastPathCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::InlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutValueWithThisPtrNoLocalFastPathCantChangeType<Js::InlineCache>), AttrCanThrow)
265+
HELPERCALLCHK(Op_PatchPutValueNoLocalFastPathPolymorphicCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::PolymorphicInlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutValueNoLocalFastPathCantChangeType<Js::PolymorphicInlineCache>), AttrCanThrow)
266+
HELPERCALLCHK(Op_PatchPutValueWithThisPtrNoLocalFastPathPolymorphicCantChangeType, ((bool (*)(Js::FunctionBody *const, Js::PolymorphicInlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutValueWithThisPtrNoLocalFastPathCantChangeType<Js::PolymorphicInlineCache>), AttrCanThrow)
267+
257268
HELPERCALLCHK(Op_PatchInitValueCheckLayout, ((bool (*)(Js::FunctionBody *const, Js::InlineCache *const, const Js::InlineCacheIndex, Js::RecyclableObject*, Js::PropertyId, Js::Var))Js::JavascriptOperators::PatchInitValueCheckLayout<Js::InlineCache>), AttrCanThrow)
258269
HELPERCALLCHK(Op_PatchInitValuePolymorphicCheckLayout, ((bool (*)(Js::FunctionBody *const, Js::PolymorphicInlineCache *const, const Js::InlineCacheIndex, Js::RecyclableObject*, Js::PropertyId, Js::Var))Js::JavascriptOperators::PatchInitValueCheckLayout<Js::PolymorphicInlineCache>), AttrCanThrow)
259270
HELPERCALLCHK(Op_PatchPutValueCheckLayout, ((bool (*)(Js::FunctionBody *const, Js::InlineCache *const, const Js::InlineCacheIndex, Js::Var, Js::PropertyId, Js::Var, Js::PropertyOperationFlags))Js::JavascriptOperators::PatchPutValueCheckLayout<Js::InlineCache>), AttrCanThrow)

Diff for: lib/Backend/Lower.cpp

+112-37
Original file line numberDiff line numberDiff line change
@@ -7112,48 +7112,14 @@ Lowerer::LowerStFld(
71127112
if (dst->AsSymOpnd()->IsPropertySymOpnd())
71137113
{
71147114
propertySymOpnd = dst->AsPropertySymOpnd();
7115-
if (stFldInstr->HasBailOutInfo() && !propertySymOpnd->IsTypeCheckSeqCandidate() && propertySymOpnd->TypeCheckRequired())
7115+
if (stFldInstr->HasBailOutInfo() && !propertySymOpnd->IsTypeCheckSeqCandidate() &&
7116+
(propertySymOpnd->CantChangeType() || propertySymOpnd->TypeCheckRequired()))
71167117
{
71177118
IR::Instr * instrBailTarget = stFldInstr->ShareBailOut();
71187119
LowerBailTarget(instrBailTarget);
71197120
doCheckLayout = true;
71207121
bailOutInfo = stFldInstr->GetBailOutInfo();
7121-
switch (helperMethod)
7122-
{
7123-
case IR::HelperOp_PatchPutValue:
7124-
helperMethod = IR::HelperOp_PatchPutValueCheckLayout;
7125-
break;
7126-
case IR::HelperOp_PatchPutValuePolymorphic:
7127-
helperMethod = IR::HelperOp_PatchPutValuePolymorphicCheckLayout;
7128-
break;
7129-
case IR::HelperOp_PatchPutValueNoLocalFastPath:
7130-
helperMethod = IR::HelperOp_PatchPutValueNoLocalFastPathCheckLayout;
7131-
break;
7132-
case IR::HelperOp_PatchPutValueNoLocalFastPathPolymorphic:
7133-
helperMethod = IR::HelperOp_PatchPutValueNoLocalFastPathPolymorphicCheckLayout;
7134-
break;
7135-
case IR::HelperOp_PatchPutValueWithThisPtr:
7136-
helperMethod = IR::HelperOp_PatchPutValueWithThisPtrCheckLayout;
7137-
break;
7138-
case IR::HelperOp_PatchPutValueWithThisPtrPolymorphic:
7139-
helperMethod = IR::HelperOp_PatchPutValueWithThisPtrPolymorphicCheckLayout;
7140-
break;
7141-
case IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPath:
7142-
helperMethod = IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathCheckLayout;
7143-
break;
7144-
case IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathPolymorphic:
7145-
helperMethod = IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathPolymorphicCheckLayout;
7146-
break;
7147-
case IR::HelperOp_PatchInitValue:
7148-
helperMethod = IR::HelperOp_PatchInitValueCheckLayout;
7149-
break;
7150-
case IR::HelperOp_PatchInitValuePolymorphic:
7151-
helperMethod = IR::HelperOp_PatchInitValuePolymorphicCheckLayout;
7152-
break;
7153-
default:
7154-
AssertOrFailFast(false);
7155-
break;
7156-
}
7122+
MapStFldHelper(propertySymOpnd, helperMethod, polymorphicHelperMethod);
71577123
}
71587124
}
71597125

@@ -7221,6 +7187,115 @@ Lowerer::LowerStFld(
72217187
return instrPrev;
72227188
}
72237189

7190+
void
7191+
Lowerer::MapStFldHelper(IR::PropertySymOpnd * propertySymOpnd, IR::JnHelperMethod &helperMethod, IR::JnHelperMethod &polymorphicHelperMethod)
7192+
{
7193+
Assert(propertySymOpnd->CantChangeType() || propertySymOpnd->TypeCheckRequired());
7194+
7195+
if (propertySymOpnd->CantChangeType())
7196+
{
7197+
switch (helperMethod)
7198+
{
7199+
case IR::HelperOp_PatchPutValue:
7200+
helperMethod = IR::HelperOp_PatchPutValueCantChangeType;
7201+
polymorphicHelperMethod = IR::HelperOp_PatchPutValuePolymorphicCantChangeType;
7202+
break;
7203+
case IR::HelperOp_PatchPutValuePolymorphic:
7204+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchPutValuePolymorphicCantChangeType;
7205+
break;
7206+
case IR::HelperOp_PatchPutValueNoLocalFastPath:
7207+
helperMethod = IR::HelperOp_PatchPutValueNoLocalFastPathCantChangeType;
7208+
polymorphicHelperMethod = IR::HelperOp_PatchPutValueNoLocalFastPathPolymorphicCantChangeType;
7209+
break;
7210+
case IR::HelperOp_PatchPutValueNoLocalFastPathPolymorphic:
7211+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchPutValueNoLocalFastPathPolymorphicCantChangeType;
7212+
break;
7213+
case IR::HelperOp_PatchPutValueWithThisPtr:
7214+
helperMethod = IR::HelperOp_PatchPutValueWithThisPtrCantChangeType;
7215+
polymorphicHelperMethod = IR::HelperOp_PatchPutValueWithThisPtrPolymorphicCantChangeType;
7216+
break;
7217+
case IR::HelperOp_PatchPutValueWithThisPtrPolymorphic:
7218+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchPutValueWithThisPtrPolymorphicCantChangeType;
7219+
break;
7220+
case IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPath:
7221+
helperMethod = IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathCantChangeType;
7222+
polymorphicHelperMethod = IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathPolymorphicCantChangeType;
7223+
break;
7224+
case IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathPolymorphic:
7225+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathPolymorphicCantChangeType;
7226+
break;
7227+
case IR::HelperOp_PatchInitValue:
7228+
helperMethod = IR::HelperOp_PatchInitValueCantChangeType;
7229+
polymorphicHelperMethod = IR::HelperOp_PatchInitValuePolymorphicCantChangeType;
7230+
break;
7231+
case IR::HelperOp_PatchInitValuePolymorphic:
7232+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchInitValuePolymorphicCantChangeType;
7233+
break;
7234+
case IR::HelperOp_PatchPutRootValue:
7235+
case IR::HelperOp_PatchPutRootValuePolymorphic:
7236+
case IR::HelperOp_PatchPutRootValueNoLocalFastPath:
7237+
case IR::HelperOp_PatchPutRootValueNoLocalFastPathPolymorphic:
7238+
// No helper method change is needed here, because the global object doesn't participate in final type opt, so it can't alias
7239+
// an object that does.
7240+
break;
7241+
default:
7242+
AssertOrFailFast(false);
7243+
break;
7244+
}
7245+
}
7246+
else
7247+
{
7248+
switch (helperMethod)
7249+
{
7250+
case IR::HelperOp_PatchPutValue:
7251+
helperMethod = IR::HelperOp_PatchPutValueCheckLayout;
7252+
polymorphicHelperMethod = IR::HelperOp_PatchPutValuePolymorphicCheckLayout;
7253+
break;
7254+
case IR::HelperOp_PatchPutValuePolymorphic:
7255+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchPutValuePolymorphicCheckLayout;
7256+
break;
7257+
case IR::HelperOp_PatchPutValueNoLocalFastPath:
7258+
helperMethod = IR::HelperOp_PatchPutValueNoLocalFastPathCheckLayout;
7259+
polymorphicHelperMethod = IR::HelperOp_PatchPutValueNoLocalFastPathPolymorphicCheckLayout;
7260+
break;
7261+
case IR::HelperOp_PatchPutValueNoLocalFastPathPolymorphic:
7262+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchPutValueNoLocalFastPathPolymorphicCheckLayout;
7263+
break;
7264+
case IR::HelperOp_PatchPutValueWithThisPtr:
7265+
helperMethod = IR::HelperOp_PatchPutValueWithThisPtrCheckLayout;
7266+
polymorphicHelperMethod = IR::HelperOp_PatchPutValueWithThisPtrPolymorphicCheckLayout;
7267+
break;
7268+
case IR::HelperOp_PatchPutValueWithThisPtrPolymorphic:
7269+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchPutValueWithThisPtrPolymorphicCheckLayout;
7270+
break;
7271+
case IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPath:
7272+
helperMethod = IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathCheckLayout;
7273+
polymorphicHelperMethod = IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathPolymorphicCheckLayout;
7274+
break;
7275+
case IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathPolymorphic:
7276+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchPutValueWithThisPtrNoLocalFastPathPolymorphicCheckLayout;
7277+
break;
7278+
case IR::HelperOp_PatchInitValue:
7279+
helperMethod = IR::HelperOp_PatchInitValueCheckLayout;
7280+
polymorphicHelperMethod = IR::HelperOp_PatchInitValuePolymorphicCheckLayout;
7281+
break;
7282+
case IR::HelperOp_PatchInitValuePolymorphic:
7283+
helperMethod = polymorphicHelperMethod = IR::HelperOp_PatchInitValuePolymorphicCheckLayout;
7284+
break;
7285+
case IR::HelperOp_PatchPutRootValue:
7286+
case IR::HelperOp_PatchPutRootValuePolymorphic:
7287+
case IR::HelperOp_PatchPutRootValueNoLocalFastPath:
7288+
case IR::HelperOp_PatchPutRootValueNoLocalFastPathPolymorphic:
7289+
// No helper method change is needed here, because the global object doesn't participate in final type opt, so it can't alias
7290+
// an object that does.
7291+
break;
7292+
default:
7293+
AssertOrFailFast(false);
7294+
break;
7295+
}
7296+
}
7297+
}
7298+
72247299
IR::Instr* Lowerer::GenerateCompleteStFld(IR::Instr* instr, bool emitFastPath, IR::JnHelperMethod monoHelperAfterFastPath, IR::JnHelperMethod polyHelperAfterFastPath,
72257300
IR::JnHelperMethod monoHelperWithoutFastPath, IR::JnHelperMethod polyHelperWithoutFastPath, bool withPutFlags, Js::PropertyOperationFlags flags)
72267301
{

0 commit comments

Comments
 (0)