Title: [185158] trunk/Source/_javascript_Core
Revision
185158
Author
[email protected]
Date
2015-06-03 11:48:41 -0700 (Wed, 03 Jun 2015)

Log Message

Improve test coverage for changes made in 145527
https://bugs.webkit.org/show_bug.cgi?id=145578

Reviewed by Geoffrey Garen.

Added more complexity to poly-setter-combo.js stress test to create more turmoil in the
polymorphic get-by-id / put-by-id with getters and setters to exercise the code change in
https://bugs.webkit.org/show_bug.cgi?id=145527.  By changing the objects that the main test
function sees, we are able to test those paths.  Verified with temporary logging code.

* tests/stress/poly-setter-combo.js:
(Cons2):
(Cons3):
(Cons4):
(foo):
(test):
(runTestWithConstructors):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (185157 => 185158)


--- trunk/Source/_javascript_Core/ChangeLog	2015-06-03 18:44:57 UTC (rev 185157)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-06-03 18:48:41 UTC (rev 185158)
@@ -1,3 +1,23 @@
+2015-06-03  Michael Saboff  <[email protected]>
+
+        Improve test coverage for changes made in 145527
+        https://bugs.webkit.org/show_bug.cgi?id=145578
+
+        Reviewed by Geoffrey Garen.
+
+        Added more complexity to poly-setter-combo.js stress test to create more turmoil in the
+        polymorphic get-by-id / put-by-id with getters and setters to exercise the code change in
+        https://bugs.webkit.org/show_bug.cgi?id=145527.  By changing the objects that the main test
+        function sees, we are able to test those paths.  Verified with temporary logging code.
+
+        * tests/stress/poly-setter-combo.js:
+        (Cons2):
+        (Cons3):
+        (Cons4):
+        (foo):
+        (test):
+        (runTestWithConstructors):
+
 2015-06-02  Mark Lam  <[email protected]>
 
         Gardening: fix broken CLoop build.

Modified: trunk/Source/_javascript_Core/tests/stress/poly-setter-combo.js (185157 => 185158)


--- trunk/Source/_javascript_Core/tests/stress/poly-setter-combo.js	2015-06-03 18:44:57 UTC (rev 185157)
+++ trunk/Source/_javascript_Core/tests/stress/poly-setter-combo.js	2015-06-03 18:48:41 UTC (rev 185158)
@@ -3,13 +3,31 @@
 Cons1.prototype.f = 42;
 
 function Cons2() {
+    this._values = []
 }
 Cons2.prototype.__defineSetter__("f", function(value) {
     counter++;
     this._f = value;
+    this._values[value] = 1;
 });
 Cons2.prototype.__defineGetter__("f", function() { return this._f; });
 
+function Cons3() {
+}
+Cons3.prototype.f = 42;
+Cons3.prototype.g = 43;
+
+function Cons4() {
+    this._values = []
+}
+Cons4.prototype.g = 16;
+Cons4.prototype.__defineSetter__("f", function(value) {
+    counter++;
+    this._f = value;
+    this._values[value] = 1;
+});
+Cons4.prototype.__defineGetter__("f", function() { return this._f; });
+
 function foo(o, value) {
     o.f = value;
     return o.f;
@@ -27,17 +45,33 @@
         throw new Error("Bad counter value: " + counter);
 }
 
-for (var i = 0; i < 100000; ++i) {
-    test(new Cons1(), i, counter);
-    test(new Cons2(), i, counter + 1);
-    
-    var o = {};
-    o.__defineSetter__("f", function(value) {
-        this._f = value;
-        counter++;
-    });
-    o.__defineGetter__("f", function() { return this._f; });
-    test(o, i, counter + 1);
+function runTestWithConstructors(constructor1, constructor2) {
+    for (var i = 0; i < 5000; ++i) {
+        test(new constructor1(), i, counter);
+        test(new constructor2(), i, counter + 1);
 
-    test({f: 42}, i, counter);
+        var o = {};
+        o.__defineGetter__("f", function() {
+            counter++;
+            return 84;
+        });
+        test(o, 84, counter + 1);
+
+        var o = {};
+        o.__defineSetter__("f", function(value) {
+            this._f = value;
+            counter++;
+        });
+        o.__defineGetter__("f", function() { return this._f; });
+        test(o, i, counter + 1);
+
+        test({f: 42}, i, counter);
+    }
 }
+
+for (var i = 0; i < 2; ++i) {
+    runTestWithConstructors(Cons1, Cons2);
+    runTestWithConstructors(Cons3, Cons2);
+    runTestWithConstructors(Cons1, Cons4);
+    runTestWithConstructors(Cons3, Cons4);
+}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to