Title: [281768] branches/safari-612-branch
Revision
281768
Author
[email protected]
Date
2021-08-30 10:43:49 -0700 (Mon, 30 Aug 2021)

Log Message

Cherry-pick r281665. rdar://problem/82528295

    r281485 was not sufficient in where it called disablePeepholeOptimization
    https://bugs.webkit.org/show_bug.cgi?id=229582
    <rdar://82346980>

    Reviewed by Yusuke Suzuki.

    JSTests:

    * stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite-2.js: Added.
    (foo):

    Source/_javascript_Core:

    r281485 accidentally deleted a place where we called disablePeepholeOptimization
    that was necessary. Basically, after we seek where the current instruction
    in BytecodeGenerator is, we need to disablePeepholeOptimization.

    * bytecompiler/BytecodeGenerator.cpp:
    (JSC::ForInContext::finalize):

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281665 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Added Paths

Diff

Modified: branches/safari-612-branch/JSTests/ChangeLog (281767 => 281768)


--- branches/safari-612-branch/JSTests/ChangeLog	2021-08-30 17:43:45 UTC (rev 281767)
+++ branches/safari-612-branch/JSTests/ChangeLog	2021-08-30 17:43:49 UTC (rev 281768)
@@ -1,5 +1,43 @@
 2021-08-30  Russell Epstein  <[email protected]>
 
+        Cherry-pick r281665. rdar://problem/82528295
+
+    r281485 was not sufficient in where it called disablePeepholeOptimization
+    https://bugs.webkit.org/show_bug.cgi?id=229582
+    <rdar://82346980>
+    
+    Reviewed by Yusuke Suzuki.
+    
+    JSTests:
+    
+    * stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite-2.js: Added.
+    (foo):
+    
+    Source/_javascript_Core:
+    
+    r281485 accidentally deleted a place where we called disablePeepholeOptimization
+    that was necessary. Basically, after we seek where the current instruction
+    in BytecodeGenerator is, we need to disablePeepholeOptimization.
+    
+    * bytecompiler/BytecodeGenerator.cpp:
+    (JSC::ForInContext::finalize):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-08-26  Saam Barati  <[email protected]>
+
+            r281485 was not sufficient in where it called disablePeepholeOptimization
+            https://bugs.webkit.org/show_bug.cgi?id=229582
+            <rdar://82346980>
+
+            Reviewed by Yusuke Suzuki.
+
+            * stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite-2.js: Added.
+            (foo):
+
+2021-08-30  Russell Epstein  <[email protected]>
+
         Cherry-pick r281485. rdar://problem/82535418
 
     Disable peephole optimizations in the byte code generator after rewriting instructions for for-in

Added: branches/safari-612-branch/JSTests/stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite-2.js (0 => 281768)


--- branches/safari-612-branch/JSTests/stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite-2.js	                        (rev 0)
+++ branches/safari-612-branch/JSTests/stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite-2.js	2021-08-30 17:43:49 UTC (rev 281768)
@@ -0,0 +1,12 @@
+function foo() {
+    for (var c in b) {
+        if (b.hasOwnProperty(c)) {
+            var e = b[c];
+            c = "str";
+        }
+    }
+}
+
+try {
+    foo();
+} catch { }

Modified: branches/safari-612-branch/Source/_javascript_Core/ChangeLog (281767 => 281768)


--- branches/safari-612-branch/Source/_javascript_Core/ChangeLog	2021-08-30 17:43:45 UTC (rev 281767)
+++ branches/safari-612-branch/Source/_javascript_Core/ChangeLog	2021-08-30 17:43:49 UTC (rev 281768)
@@ -1,5 +1,47 @@
 2021-08-30  Russell Epstein  <[email protected]>
 
+        Cherry-pick r281665. rdar://problem/82528295
+
+    r281485 was not sufficient in where it called disablePeepholeOptimization
+    https://bugs.webkit.org/show_bug.cgi?id=229582
+    <rdar://82346980>
+    
+    Reviewed by Yusuke Suzuki.
+    
+    JSTests:
+    
+    * stress/for-in-disable-bytecode-generator-peephole-optimizations-after-rewrite-2.js: Added.
+    (foo):
+    
+    Source/_javascript_Core:
+    
+    r281485 accidentally deleted a place where we called disablePeepholeOptimization
+    that was necessary. Basically, after we seek where the current instruction
+    in BytecodeGenerator is, we need to disablePeepholeOptimization.
+    
+    * bytecompiler/BytecodeGenerator.cpp:
+    (JSC::ForInContext::finalize):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281665 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-08-26  Saam Barati  <[email protected]>
+
+            r281485 was not sufficient in where it called disablePeepholeOptimization
+            https://bugs.webkit.org/show_bug.cgi?id=229582
+            <rdar://82346980>
+
+            Reviewed by Yusuke Suzuki.
+
+            r281485 accidentally deleted a place where we called disablePeepholeOptimization
+            that was necessary. Basically, after we seek where the current instruction
+            in BytecodeGenerator is, we need to disablePeepholeOptimization.
+
+            * bytecompiler/BytecodeGenerator.cpp:
+            (JSC::ForInContext::finalize):
+
+2021-08-30  Russell Epstein  <[email protected]>
+
         Cherry-pick r281485. rdar://problem/82535418
 
     Disable peephole optimizations in the byte code generator after rewriting instructions for for-in

Modified: branches/safari-612-branch/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp (281767 => 281768)


--- branches/safari-612-branch/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2021-08-30 17:43:45 UTC (rev 281767)
+++ branches/safari-612-branch/Source/_javascript_Core/bytecompiler/BytecodeGenerator.cpp	2021-08-30 17:43:49 UTC (rev 281768)
@@ -5386,6 +5386,7 @@
         auto end = branchInstIndex + instruction->size();
 
         generator.m_writer.seek(branchInstIndex);
+        generator.disablePeepholeOptimization();
 
         OpJmp::emit(&generator, BoundLabel(static_cast<int>(newBranchTarget) - static_cast<int>(branchInstIndex)));
 
@@ -5393,9 +5394,8 @@
             OpNop::emit<OpcodeSize::Narrow>(&generator);
     }
 
+    generator.m_writer.seek(generator.m_writer.size());
     generator.disablePeepholeOptimization(); // We might've just changed the last bytecode that was emitted.
-
-    generator.m_writer.seek(generator.m_writer.size());
 }
 
 void StaticPropertyAnalysis::record()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to