summaryrefslogtreecommitdiffstats
path: root/js/src/vm/TypeInference.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/vm/TypeInference.cpp')
-rw-r--r--js/src/vm/TypeInference.cpp114
1 files changed, 53 insertions, 61 deletions
diff --git a/js/src/vm/TypeInference.cpp b/js/src/vm/TypeInference.cpp
index 88327b47e..2b1fa0e3b 100644
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -2670,14 +2670,6 @@ ObjectGroup::updateNewPropertyTypes(ExclusiveContext* cx, JSObject* objArg, jsid
if (shape)
UpdatePropertyType(cx, types, obj, shape, false);
}
-
- if (obj->watched()) {
- /*
- * Mark the property as non-data, to inhibit optimizations on it
- * and avoid bypassing the watchpoint handler.
- */
- types->setNonDataProperty(cx);
- }
}
void
@@ -3622,42 +3614,42 @@ struct DestroyTypeNewScript
} // namespace
-bool DPAConstraintInfo::finishConstraints(JSContext* cx, ObjectGroup* group) {
- for (const ProtoConstraint& constraint : protoConstraints_) {
- ObjectGroup* protoGroup = constraint.proto->group();
-
- // Note: we rely on the group's type information being unchanged since
- // AddClearDefiniteGetterSetterForPrototypeChain.
-
- bool unknownProperties = protoGroup->unknownProperties();
- MOZ_RELEASE_ASSERT(!unknownProperties);
-
- HeapTypeSet* protoTypes =
- protoGroup->getProperty(cx, constraint.proto, constraint.id);
- MOZ_RELEASE_ASSERT(protoTypes);
-
- MOZ_ASSERT(!protoTypes->nonDataProperty());
- MOZ_ASSERT(!protoTypes->nonWritableProperty());
-
- if (!protoTypes->addConstraint(
- cx,
- cx->typeLifoAlloc().new_<TypeConstraintClearDefiniteGetterSetter>(
- group))) {
- ReportOutOfMemory(cx);
- return false;
- }
- }
-
- for (const InliningConstraint& constraint : inliningConstraints_) {
- if (!AddClearDefiniteFunctionUsesInScript(cx, group, constraint.caller,
- constraint.callee)) {
- ReportOutOfMemory(cx);
- return false;
- }
- }
-
- return true;
-}
+bool DPAConstraintInfo::finishConstraints(JSContext* cx, ObjectGroup* group) {
+ for (const ProtoConstraint& constraint : protoConstraints_) {
+ ObjectGroup* protoGroup = constraint.proto->group();
+
+ // Note: we rely on the group's type information being unchanged since
+ // AddClearDefiniteGetterSetterForPrototypeChain.
+
+ bool unknownProperties = protoGroup->unknownProperties();
+ MOZ_RELEASE_ASSERT(!unknownProperties);
+
+ HeapTypeSet* protoTypes =
+ protoGroup->getProperty(cx, constraint.proto, constraint.id);
+ MOZ_RELEASE_ASSERT(protoTypes);
+
+ MOZ_ASSERT(!protoTypes->nonDataProperty());
+ MOZ_ASSERT(!protoTypes->nonWritableProperty());
+
+ if (!protoTypes->addConstraint(
+ cx,
+ cx->typeLifoAlloc().new_<TypeConstraintClearDefiniteGetterSetter>(
+ group))) {
+ ReportOutOfMemory(cx);
+ return false;
+ }
+ }
+
+ for (const InliningConstraint& constraint : inliningConstraints_) {
+ if (!AddClearDefiniteFunctionUsesInScript(cx, group, constraint.caller,
+ constraint.callee)) {
+ ReportOutOfMemory(cx);
+ return false;
+ }
+ }
+
+ return true;
+}
bool
TypeNewScript::maybeAnalyze(JSContext* cx, ObjectGroup* group, bool* regenerate, bool force)
@@ -3826,13 +3818,13 @@ TypeNewScript::maybeAnalyze(JSContext* cx, ObjectGroup* group, bool* regenerate,
// The definite properties analysis found exactly the properties that
// are held in common by the preliminary objects. No further analysis
// is needed.
-
- if (!constraintInfo.finishConstraints(cx, group)) {
- return false;
- }
- if (!group->newScript()) {
- return true;
- }
+
+ if (!constraintInfo.finishConstraints(cx, group)) {
+ return false;
+ }
+ if (!group->newScript()) {
+ return true;
+ }
group->addDefiniteProperties(cx, templateObject()->lastProperty());
@@ -3854,16 +3846,16 @@ TypeNewScript::maybeAnalyze(JSContext* cx, ObjectGroup* group, bool* regenerate,
initialFlags);
if (!initialGroup)
return false;
-
- // Add the constraints. Use the initialGroup as group referenced by the
- // constraints because that's the group that will have the TypeNewScript
- // associated with it. See the detachNewScript and setNewScript calls below.
- if (!constraintInfo.finishConstraints(cx, initialGroup)) {
- return false;
- }
- if (!group->newScript()) {
- return true;
- }
+
+ // Add the constraints. Use the initialGroup as group referenced by the
+ // constraints because that's the group that will have the TypeNewScript
+ // associated with it. See the detachNewScript and setNewScript calls below.
+ if (!constraintInfo.finishConstraints(cx, initialGroup)) {
+ return false;
+ }
+ if (!group->newScript()) {
+ return true;
+ }
initialGroup->addDefiniteProperties(cx, templateObject()->lastProperty());
group->addDefiniteProperties(cx, prefixShape);