|
Lines 6188-6203
PropertyReadNeedsTypeBarrier(CompilerCon
|
Link Here
|
---|
|
6188 |
// We also need a barrier if the object is a proxy, because then all bets |
6188 |
// We also need a barrier if the object is a proxy, because then all bets |
6189 |
// are off, just as if it has unknown properties. |
6189 |
// are off, just as if it has unknown properties. |
6190 |
if (key->unknownProperties() || observed->empty() || |
6190 |
if (key->unknownProperties() || observed->empty() || |
6191 |
key->clasp()->isProxy()) |
6191 |
key->clasp()->isProxy()) |
6192 |
{ |
6192 |
{ |
6193 |
return BarrierKind::TypeSet; |
6193 |
return BarrierKind::TypeSet; |
6194 |
} |
6194 |
} |
6195 |
|
6195 |
|
|
|
6196 |
if (!name && IsTypedArrayClass(key->clasp())) { |
6197 |
Scalar::Type arrayType = Scalar::Type(key->clasp() - &TypedArrayObject::classes[0]); |
6198 |
MIRType type = MIRTypeForTypedArrayRead(arrayType, true); |
6199 |
if (observed->mightBeMIRType(type)) |
6200 |
return BarrierKind::NoBarrier; |
6201 |
return BarrierKind::TypeSet; |
6202 |
} |
6203 |
|
6196 |
jsid id = name ? NameToId(name) : JSID_VOID; |
6204 |
jsid id = name ? NameToId(name) : JSID_VOID; |
6197 |
HeapTypeSetKey property = key->property(id); |
6205 |
HeapTypeSetKey property = key->property(id); |
6198 |
if (property.maybeTypes()) { |
6206 |
if (property.maybeTypes()) { |
6199 |
if (!TypeSetIncludes(observed, MIRType::Value, property.maybeTypes())) { |
6207 |
if (!TypeSetIncludes(observed, MIRType::Value, property.maybeTypes())) { |
6200 |
// If all possible objects have been observed, we don't have to |
6208 |
// If all possible objects have been observed, we don't have to |
6201 |
// guard on the specific object types. |
6209 |
// guard on the specific object types. |
6202 |
if (property.maybeTypes()->objectsAreSubset(observed)) { |
6210 |
if (property.maybeTypes()->objectsAreSubset(observed)) { |
6203 |
property.freeze(constraints); |
6211 |
property.freeze(constraints); |