Skip to content

Commit

Permalink
[MERGE #3578 @meg-gupta] Dont update valueInfo of bytecode constants
Browse files Browse the repository at this point in the history
Merge pull request #3578 from meg-gupta:dontupdateconstantvalinfo
  • Loading branch information
Test262 Automation Script committed Aug 31, 2017
2 parents 1262d2e + da02036 commit 0df53e5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/Backend/GlobOpt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2834,6 +2834,11 @@ GlobOpt::OptTagChecks(IR::Instr *instr)
Value *value = CurrentBlockData()->FindValue(stackSym);
if (value)
{
ValueInfo *valInfo = value->GetValueInfo();
if (valInfo->GetSymStore() && valInfo->GetSymStore()->IsStackSym() && valInfo->GetSymStore()->AsStackSym()->IsFromByteCodeConstantTable())
{
return false;
}
ValueType valueType = value->GetValueInfo()->Type();
if (instr->m_opcode == Js::OpCode::BailOnNotObject)
{
Expand Down Expand Up @@ -12474,6 +12479,8 @@ GlobOpt::ChangeValueType(
!valueInfo->IsArrayValueInfo() ||
newValueType.IsObject() && newValueType.GetObjectType() == valueInfo->GetObjectType());

Assert(!valueInfo->GetSymStore() || !valueInfo->GetSymStore()->IsStackSym() || !valueInfo->GetSymStore()->AsStackSym()->IsFromByteCodeConstantTable());

ValueInfo *const newValueInfo =
preserveSubclassInfo
? valueInfo->Copy(alloc)
Expand Down
8 changes: 8 additions & 0 deletions lib/Backend/GlobOptFields.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3220,6 +3220,14 @@ GlobOpt::UpdateObjPtrValueType(IR::Opnd * opnd, IR::Instr * instr)
return;
}

ValueInfo *objValueInfo = objVal->GetValueInfo();

// It is possible for a valueInfo to be not definite and still have a byteCodeConstant as symStore, this is because we conservatively copy valueInfo in prePass
if (objValueInfo->GetSymStore() && objValueInfo->GetSymStore()->IsStackSym() && objValueInfo->GetSymStore()->AsStackSym()->IsFromByteCodeConstantTable())
{
return;
}

// Verify that the types we're checking for here have been locked so that the type ID's can't be changed
// without changing the type.
if (!propertySymOpnd->HasObjectTypeSym())
Expand Down

0 comments on commit 0df53e5

Please sign in to comment.