Title: [201610] trunk/Source/_javascript_Core
Revision
201610
Author
[email protected]
Date
2016-06-02 12:36:59 -0700 (Thu, 02 Jun 2016)

Log Message

ObjectPropertyCondition should have a isStillValidAssumingImpurePropertyWatchpoint function
https://bugs.webkit.org/show_bug.cgi?id=158308

Reviewed by Filip Pizlo.

Recently, structureEnsuresValidityAssumingImpurePropertyWatchpoint was converted to check
what should be isStillValidAssumingImpurePropertyWatchpoint. This patch fixes the API so
it should work as expected. This patch also changes generateConditions in
ObjectPropertyConditionSet to use isStillValidAssumingImpurePropertyWatchpoint.

* bytecode/ObjectPropertyCondition.cpp:
(JSC::ObjectPropertyCondition::structureEnsuresValidityAssumingImpurePropertyWatchpoint):
(JSC::ObjectPropertyCondition::isStillValidAssumingImpurePropertyWatchpoint):
* bytecode/ObjectPropertyCondition.h:
* bytecode/ObjectPropertyConditionSet.cpp:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (201609 => 201610)


--- trunk/Source/_javascript_Core/ChangeLog	2016-06-02 19:21:53 UTC (rev 201609)
+++ trunk/Source/_javascript_Core/ChangeLog	2016-06-02 19:36:59 UTC (rev 201610)
@@ -1,3 +1,21 @@
+2016-06-02  Keith Miller  <[email protected]>
+
+        ObjectPropertyCondition should have a isStillValidAssumingImpurePropertyWatchpoint function
+        https://bugs.webkit.org/show_bug.cgi?id=158308
+
+        Reviewed by Filip Pizlo.
+
+        Recently, structureEnsuresValidityAssumingImpurePropertyWatchpoint was converted to check
+        what should be isStillValidAssumingImpurePropertyWatchpoint. This patch fixes the API so
+        it should work as expected. This patch also changes generateConditions in
+        ObjectPropertyConditionSet to use isStillValidAssumingImpurePropertyWatchpoint.
+
+        * bytecode/ObjectPropertyCondition.cpp:
+        (JSC::ObjectPropertyCondition::structureEnsuresValidityAssumingImpurePropertyWatchpoint):
+        (JSC::ObjectPropertyCondition::isStillValidAssumingImpurePropertyWatchpoint):
+        * bytecode/ObjectPropertyCondition.h:
+        * bytecode/ObjectPropertyConditionSet.cpp:
+
 2016-06-02  Filip Pizlo  <[email protected]>
 
         Make it harder to accidentally pass an integer to a locker.

Modified: trunk/Source/_javascript_Core/bytecode/ObjectPropertyCondition.cpp (201609 => 201610)


--- trunk/Source/_javascript_Core/bytecode/ObjectPropertyCondition.cpp	2016-06-02 19:21:53 UTC (rev 201609)
+++ trunk/Source/_javascript_Core/bytecode/ObjectPropertyCondition.cpp	2016-06-02 19:36:59 UTC (rev 201610)
@@ -49,7 +49,7 @@
 bool ObjectPropertyCondition::structureEnsuresValidityAssumingImpurePropertyWatchpoint(
     Structure* structure) const
 {
-    return m_condition.isStillValidAssumingImpurePropertyWatchpoint(structure, m_object);
+    return m_condition.isStillValidAssumingImpurePropertyWatchpoint(structure);
 }
 
 bool ObjectPropertyCondition::structureEnsuresValidityAssumingImpurePropertyWatchpoint() const
@@ -73,6 +73,20 @@
     return validityRequiresImpurePropertyWatchpoint(m_object->structure());
 }
 
+bool ObjectPropertyCondition::isStillValidAssumingImpurePropertyWatchpoint(Structure* structure) const
+{
+    return m_condition.isStillValidAssumingImpurePropertyWatchpoint(structure, m_object);
+}
+
+bool ObjectPropertyCondition::isStillValidAssumingImpurePropertyWatchpoint() const
+{
+    if (!*this)
+        return false;
+
+    return isStillValidAssumingImpurePropertyWatchpoint(m_object->structure());
+}
+
+
 bool ObjectPropertyCondition::isStillValid(Structure* structure) const
 {
     return m_condition.isStillValid(structure, m_object);

Modified: trunk/Source/_javascript_Core/bytecode/ObjectPropertyCondition.h (201609 => 201610)


--- trunk/Source/_javascript_Core/bytecode/ObjectPropertyCondition.h	2016-06-02 19:21:53 UTC (rev 201609)
+++ trunk/Source/_javascript_Core/bytecode/ObjectPropertyCondition.h	2016-06-02 19:36:59 UTC (rev 201610)
@@ -186,6 +186,11 @@
     bool validityRequiresImpurePropertyWatchpoint(Structure*) const;
     bool validityRequiresImpurePropertyWatchpoint() const;
 
+    // Checks if the condition still holds setting aside the need for an impure property watchpoint.
+    // Validity might still require watchpoints on the object.
+    bool isStillValidAssumingImpurePropertyWatchpoint(Structure*) const;
+    bool isStillValidAssumingImpurePropertyWatchpoint() const;
+
     // Checks if the condition still holds. May conservatively return false, if the object and
     // structure alone don't guarantee the condition. Note that this may return true if the
     // condition still requires some watchpoints on the object in addition to checking the

Modified: trunk/Source/_javascript_Core/bytecode/ObjectPropertyConditionSet.cpp (201609 => 201610)


--- trunk/Source/_javascript_Core/bytecode/ObjectPropertyConditionSet.cpp	2016-06-02 19:21:53 UTC (rev 201609)
+++ trunk/Source/_javascript_Core/bytecode/ObjectPropertyConditionSet.cpp	2016-06-02 19:36:59 UTC (rev 201610)
@@ -213,7 +213,7 @@
         return ObjectPropertyCondition();
     }
 
-    if (!result.structureEnsuresValidityAssumingImpurePropertyWatchpoint()) {
+    if (!result.isStillValidAssumingImpurePropertyWatchpoint()) {
         if (verbose)
             dataLog("Failed to create condition: ", result, "\n");
         return ObjectPropertyCondition();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to