Title: [151405] branches/dfgFourthTier
Revision
151405
Author
[email protected]
Date
2013-06-10 14:50:01 -0700 (Mon, 10 Jun 2013)

Log Message

Source/_javascript_Core: Marge trunk r146653.

    2013-03-22  Filip Pizlo  <[email protected]>
    
    DFG folding of PutById to SimpleReplace should consider the specialized function case
    https://bugs.webkit.org/show_bug.cgi?id=113093
    
    Reviewed by Geoffrey Garen and Mark Hahnenberg.
    
    * bytecode/PutByIdStatus.cpp:
    (JSC::PutByIdStatus::computeFor):

LayoutTests: Merge trunk r146653.

    2013-03-22  Filip Pizlo  <[email protected]>
    
    DFG folding of PutById to SimpleReplace should consider the specialized function case
    https://bugs.webkit.org/show_bug.cgi?id=113093
    
    Reviewed by Geoffrey Garen and Mark Hahnenberg.
    
    * fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function-expected.txt: Added.
    * fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.html: Added.
    * fast/js/jsc-test-list:
    * fast/js/script-tests/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.js: Added.
    (foo):
    (baz):
    (fuzz):

Modified Paths

Added Paths

Diff

Modified: branches/dfgFourthTier/LayoutTests/ChangeLog (151404 => 151405)


--- branches/dfgFourthTier/LayoutTests/ChangeLog	2013-06-10 21:36:51 UTC (rev 151404)
+++ branches/dfgFourthTier/LayoutTests/ChangeLog	2013-06-10 21:50:01 UTC (rev 151405)
@@ -1,3 +1,22 @@
+2013-06-09  Filip Pizlo  <[email protected]>
+
+        Merge trunk r146653.
+
+    2013-03-22  Filip Pizlo  <[email protected]>
+    
+            DFG folding of PutById to SimpleReplace should consider the specialized function case
+            https://bugs.webkit.org/show_bug.cgi?id=113093
+    
+            Reviewed by Geoffrey Garen and Mark Hahnenberg.
+    
+            * fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function-expected.txt: Added.
+            * fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.html: Added.
+            * fast/js/jsc-test-list:
+            * fast/js/script-tests/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.js: Added.
+            (foo):
+            (baz):
+            (fuzz):
+    
 2013-06-10  Geoffrey Garen  <[email protected]>
 
         Unreviewd, rolled out

Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function-expected.txt (0 => 151405)


--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function-expected.txt	                        (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function-expected.txt	2013-06-10 21:50:01 UTC (rev 151405)
@@ -0,0 +1,9 @@
+Checks that the DFG CFA does the right things if it proves that a put_by_id is a simple replace when storing to a specialized function property.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+Passed some tests silently.
+
+TEST COMPLETE
+

Added: branches/dfgFourthTier/LayoutTests/fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.html (0 => 151405)


--- branches/dfgFourthTier/LayoutTests/fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.html	                        (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.html	2013-06-10 21:50:01 UTC (rev 151405)
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+</head>
+<body>
+<script src=""
+<script src=""
+</body>
+</html>

Modified: branches/dfgFourthTier/LayoutTests/fast/js/jsc-test-list (151404 => 151405)


--- branches/dfgFourthTier/LayoutTests/fast/js/jsc-test-list	2013-06-10 21:36:51 UTC (rev 151404)
+++ branches/dfgFourthTier/LayoutTests/fast/js/jsc-test-list	2013-06-10 21:50:01 UTC (rev 151405)
@@ -98,6 +98,7 @@
 fast/js/dfg-branch-not-fail
 fast/js/dfg-captured-var-get-local
 fast/js/dfg-cfa-merge-with-dead-use-at-tail
+fast/js/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function
 fast/js/dfg-cfg-simplify-eliminate-set-local-type-check-then-branch-not-null
 fast/js/dfg-cfg-simplify-eliminate-set-local-type-check-then-branch-not-null-and-decrement
 fast/js/dfg-cfg-simplify-eliminate-set-local-type-check-then-typeof

Modified: branches/dfgFourthTier/LayoutTests/fast/js/resources/js-test-pre.js (151404 => 151405)


--- branches/dfgFourthTier/LayoutTests/fast/js/resources/js-test-pre.js	2013-06-10 21:36:51 UTC (rev 151404)
+++ branches/dfgFourthTier/LayoutTests/fast/js/resources/js-test-pre.js	2013-06-10 21:50:01 UTC (rev 151405)
@@ -576,6 +576,9 @@
 {
     var numberOfCompiles = "compiles" in argument ? argument.compiles : 1;
     
+    if (!("f" in argument))
+        throw new Error("dfgCompiled called with invalid argument.");
+    
     if (argument.f instanceof Array) {
         for (var i = 0; i < argument.f.length; ++i) {
             if (testRunner.numberOfDFGCompiles(argument.f[i]) < numberOfCompiles)

Added: branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.js (0 => 151405)


--- branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.js	                        (rev 0)
+++ branches/dfgFourthTier/LayoutTests/fast/js/script-tests/dfg-cfa-prove-put-by-id-simple-when-storing-to-specialized-function.js	2013-06-10 21:50:01 UTC (rev 151405)
@@ -0,0 +1,37 @@
+description(
+"Checks that the DFG CFA does the right things if it proves that a put_by_id is a simple replace when storing to a specialized function property."
+);
+
+silentTestPass = true;
+
+function foo(o, v) {
+    o.func = v;
+}
+
+// Warm up foo's put_by_id to make it look polymorphic.
+for (var i = 0; i < 100; ++i)
+    foo(i % 2 ? {a: 1} : {b: 2});
+
+function bar(f) {
+    foo(this, f);
+    return this.func();
+}
+
+function baz() {
+    return "baz";
+}
+
+noInline(bar);
+noInline(baz);
+
+while (!dfgCompiled({f:bar}))
+    shouldBe("bar.call({func:baz}, baz)", "\"baz\"");
+
+function fuzz() {
+    return "fuzz";
+}
+
+noInline(fuzz);
+
+shouldBe("bar.call({func:baz}, fuzz)", "\"fuzz\"");
+

Modified: branches/dfgFourthTier/Source/_javascript_Core/ChangeLog (151404 => 151405)


--- branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-06-10 21:36:51 UTC (rev 151404)
+++ branches/dfgFourthTier/Source/_javascript_Core/ChangeLog	2013-06-10 21:50:01 UTC (rev 151405)
@@ -1,3 +1,17 @@
+2013-06-09  Filip Pizlo  <[email protected]>
+
+        Marge trunk r146653.
+
+    2013-03-22  Filip Pizlo  <[email protected]>
+    
+            DFG folding of PutById to SimpleReplace should consider the specialized function case
+            https://bugs.webkit.org/show_bug.cgi?id=113093
+    
+            Reviewed by Geoffrey Garen and Mark Hahnenberg.
+    
+            * bytecode/PutByIdStatus.cpp:
+            (JSC::PutByIdStatus::computeFor):
+    
 2013-06-10  Geoffrey Garen  <[email protected]>
 
         Unreviewd, rolled out

Modified: branches/dfgFourthTier/Source/_javascript_Core/bytecode/PutByIdStatus.cpp (151404 => 151405)


--- branches/dfgFourthTier/Source/_javascript_Core/bytecode/PutByIdStatus.cpp	2013-06-10 21:36:51 UTC (rev 151404)
+++ branches/dfgFourthTier/Source/_javascript_Core/bytecode/PutByIdStatus.cpp	2013-06-10 21:50:01 UTC (rev 151405)
@@ -160,12 +160,16 @@
         return PutByIdStatus(TakesSlowPath);
     
     unsigned attributes;
-    JSCell* specificValueIgnored;
-    PropertyOffset offset = structure->getConcurrently(
-        vm, uid, attributes, specificValueIgnored);
+    JSCell* specificValue;
+    PropertyOffset offset = structure->getConcurrently(vm, uid, attributes, specificValue);
     if (isValidOffset(offset)) {
         if (attributes & (Accessor | ReadOnly))
             return PutByIdStatus(TakesSlowPath);
+        if (specificValue) {
+            // We need the PutById slow path to verify that we're storing the right value into
+            // the specialized slot.
+            return PutByIdStatus(TakesSlowPath);
+        }
         return PutByIdStatus(SimpleReplace, structure, 0, 0, offset);
     }
     
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to