Permalink
Browse files

[MERGE #5800 @pleath] Force new type check when object ptr copy prop …

…creates a mismatch

Merge pull request #5800 from pleath:mismatch

We used to disable objtypespec altogether for the given object pointer in such a case, but that's no longer necessary now that we don't share inline caches. Failure to objtypespec was exposed by a cross-site function type-sharing unit test.
  • Loading branch information...
pleath committed Nov 8, 2018
2 parents 573adb7 + 2c91a28 commit d2f8c410b4669a3ccffeaa44d07915b1f64969b1
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/Backend/GlobOptFields.cpp
@@ -1851,7 +1851,13 @@ GlobOpt::CopyPropPropertySymObj(IR::SymOpnd *symOpnd, IR::Instr *instr)
bool shouldOptimize = CompareCurrentTypesWithExpectedTypes(newValueInfo, propertySymOpnd);
if (!shouldOptimize)
{
propertySymOpnd->SetTypeCheckSeqCandidate(false);
// Force a new type check here. We used to disable optimization for this symbol, but that's
// no longer necessary now that inline caches are not shared.
BVSparse<JitArenaAllocator> *liveFields = this->currentBlock->globOptData.liveFields;
if (liveFields)
{
liveFields->Clear(newTypeSym->m_id);
}
}
}

0 comments on commit d2f8c41

Please sign in to comment.