Skip to content

Commit

Permalink
isStillValidAssumingImpurePropertyWatchpoint AbsenceOfSetEffect shoul…
Browse files Browse the repository at this point in the history
…d check special property first

https://bugs.webkit.org/show_bug.cgi?id=266985
rdar://120375878

Reviewed by Justin Michaud.

* Source/JavaScriptCore/bytecode/PropertyCondition.cpp:
(JSC::PropertyCondition::isStillValidAssumingImpurePropertyWatchpoint const):

Canonical link: https://commits.webkit.org/272614@main
  • Loading branch information
hyjorc1 committed Jan 3, 2024
1 parent 47204e7 commit 153c053
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Source/JavaScriptCore/bytecode/PropertyCondition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,12 @@ bool PropertyCondition::isStillValidAssumingImpurePropertyWatchpoint(
return false;
}

if (structure->typeInfo().overridesPut() && JSObject::mightBeSpecialProperty(structure->vm(), structure->typeInfo().type(), uid())) {
if (PropertyConditionInternal::verbose)
dataLog("Invalid because its put() override may treat ", uid(), " property as special non-structure one.\n");
return false;
}

unsigned currentAttributes;
PropertyOffset currentOffset = structure->get(structure->vm(), concurrency, uid(), currentAttributes);
if (currentOffset != invalidOffset) {
Expand All @@ -186,10 +192,6 @@ bool PropertyCondition::isStillValidAssumingImpurePropertyWatchpoint(
}
return false;
}
} else if (structure->typeInfo().overridesPut() && JSObject::mightBeSpecialProperty(structure->vm(), structure->typeInfo().type(), uid())) {
if (PropertyConditionInternal::verbose)
dataLog("Invalid because its put() override may treat ", uid(), " property as special non-structure one.\n");
return false;
} else if (structure->hasNonReifiedStaticProperties()) {
if (auto entry = structure->findPropertyHashEntry(uid())) {
if (entry->value->attributes() & PropertyAttribute::ReadOnlyOrAccessorOrCustomAccessorOrValue) {
Expand Down

0 comments on commit 153c053

Please sign in to comment.