Skip to content
This repository has been archived by the owner on Oct 15, 2020. It is now read-only.

Commit

Permalink
[Merge chakra-core/ChakraCore@0df53e5b62] [MERGE #3578 @meg-gupta] Do…
Browse files Browse the repository at this point in the history
…nt update valueInfo of bytecode constants

Merge pull request #3578 from meg-gupta:dontupdateconstantvalinfo
  • Loading branch information
chakrabot authored and MSLaguana committed Sep 25, 2017
1 parent bc8df9e commit fc18b99
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions deps/chakrashim/core/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 deps/chakrashim/core/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 fc18b99

Please sign in to comment.