Skip to content

Commit ddfb8f8

Browse files
committed
[MERGE chakra-core#2467 @LouisLaf] Globopt bug fix.
Merge pull request chakra-core#2467 from LouisLaf:type_bug Don't load type spcialized values from arrays when type-spec is disabled.
2 parents 7bfaf94 + bee7554 commit ddfb8f8

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

lib/Backend/GlobOpt.cpp

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8159,6 +8159,21 @@ GlobOpt::ValueNumberLdElemDst(IR::Instr **pInstr, Value *srcVal)
81598159

81608160
IntArrayCommon:
81618161
Assert(dst->IsRegOpnd());
8162+
if (!this->DoAggressiveIntTypeSpec())
8163+
{
8164+
if (!dstVal)
8165+
{
8166+
if (srcVal)
8167+
{
8168+
dstVal = this->ValueNumberTransferDst(instr, srcVal);
8169+
}
8170+
else
8171+
{
8172+
dstVal = NewGenericValue(profiledElementType, dst);
8173+
}
8174+
}
8175+
return dstVal;
8176+
}
81628177
TypeSpecializeIntDst(instr, instr->m_opcode, nullptr, nullptr, nullptr, bailOutKind, newMin, newMax, &dstVal);
81638178
toType = TyInt32;
81648179
break;
@@ -8171,6 +8186,21 @@ GlobOpt::ValueNumberLdElemDst(IR::Instr **pInstr, Value *srcVal)
81718186
case ObjectType::Float64MixedArray:
81728187
Float64Array:
81738188
Assert(dst->IsRegOpnd());
8189+
if (!this->DoFloatTypeSpec())
8190+
{
8191+
if (!dstVal)
8192+
{
8193+
if (srcVal)
8194+
{
8195+
dstVal = this->ValueNumberTransferDst(instr, srcVal);
8196+
}
8197+
else
8198+
{
8199+
dstVal = NewGenericValue(profiledElementType, dst);
8200+
}
8201+
}
8202+
return dstVal;
8203+
}
81748204
TypeSpecializeFloatDst(instr, nullptr, nullptr, nullptr, &dstVal);
81758205
toType = TyFloat64;
81768206
break;

0 commit comments

Comments
 (0)