@@ -2200,7 +2200,7 @@ GlobOpt::FinishOptPropOp(IR::Instr *instr, IR::PropertySymOpnd *opnd, BasicBlock
2200
2200
isObjTypeSpecialized = ProcessPropOpInTypeCheckSeq<true >(instr, opnd, block, updateExistingValue, emitsTypeCheckOut, changesTypeValueOut, &isObjTypeChecked);
2201
2201
}
2202
2202
2203
- if (opnd == instr->GetDst () && this ->objectTypeSyms && !isObjTypeChecked )
2203
+ if (opnd == instr->GetDst () && this ->objectTypeSyms )
2204
2204
{
2205
2205
if (block == nullptr )
2206
2206
{
@@ -2210,26 +2210,29 @@ GlobOpt::FinishOptPropOp(IR::Instr *instr, IR::PropertySymOpnd *opnd, BasicBlock
2210
2210
// This is a property store that may change the layout of the object that it stores to. This means that
2211
2211
// it may change any aliased object. Do two things to address this:
2212
2212
// - Add all object types in this function to the set that may have had a property added. This will prevent
2213
- // final type optimization across this instruction.
2213
+ // final type optimization across this instruction. (Only needed here for non-specialized stores.)
2214
2214
// - Kill all type symbols that currently hold object-header-inlined types. Any of them may have their layout
2215
2215
// changed by the addition of a property.
2216
2216
2217
2217
SymID opndId = opnd->HasObjectTypeSym () ? opnd->GetObjectTypeSym ()->m_id : -1 ;
2218
- if (block->globOptData .maybeWrittenTypeSyms == nullptr )
2219
- {
2220
- block->globOptData .maybeWrittenTypeSyms = JitAnew (this ->alloc , BVSparse<JitArenaAllocator>, this ->alloc );
2221
- }
2222
- if (isObjTypeSpecialized)
2218
+ if (!isObjTypeChecked)
2223
2219
{
2224
- // The current object will be protected by a type check, unless no further accesses to it are
2225
- // protected by this access.
2226
- Assert (this ->objectTypeSyms ->Test (opndId));
2227
- this ->objectTypeSyms ->Clear (opndId);
2228
- }
2229
- block->globOptData .maybeWrittenTypeSyms ->Or (this ->objectTypeSyms );
2230
- if (isObjTypeSpecialized)
2231
- {
2232
- this ->objectTypeSyms ->Set (opndId);
2220
+ if (block->globOptData .maybeWrittenTypeSyms == nullptr )
2221
+ {
2222
+ block->globOptData .maybeWrittenTypeSyms = JitAnew (this ->alloc , BVSparse<JitArenaAllocator>, this ->alloc );
2223
+ }
2224
+ if (isObjTypeSpecialized)
2225
+ {
2226
+ // The current object will be protected by a type check, unless no further accesses to it are
2227
+ // protected by this access.
2228
+ Assert (this ->objectTypeSyms ->Test (opndId));
2229
+ this ->objectTypeSyms ->Clear (opndId);
2230
+ }
2231
+ block->globOptData .maybeWrittenTypeSyms ->Or (this ->objectTypeSyms );
2232
+ if (isObjTypeSpecialized)
2233
+ {
2234
+ this ->objectTypeSyms ->Set (opndId);
2235
+ }
2233
2236
}
2234
2237
2235
2238
if (!isObjTypeSpecialized || opnd->ChangesObjectLayout ())
0 commit comments