Title: [251336] branches/safari-608-branch/Source/_javascript_Core
Revision
251336
Author
bshaf...@apple.com
Date
2019-10-20 10:32:45 -0700 (Sun, 20 Oct 2019)

Log Message

Cherry-pick r250629. rdar://problem/56280996

    FTL OSR exit shouldn't bother updating get_by_id array profiles that have changed modes
    https://bugs.webkit.org/show_bug.cgi?id=202493

    Reviewed by Saam Barati.

    I added this optimization for DFG but forgot to do it for the FTL
    at the same time. This patch rectifies that.

    * ftl/FTLOSRExitCompiler.cpp:
    (JSC::FTL::compileStub):

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

Modified Paths

Diff

Modified: branches/safari-608-branch/Source/_javascript_Core/ChangeLog (251335 => 251336)


--- branches/safari-608-branch/Source/_javascript_Core/ChangeLog	2019-10-20 17:32:43 UTC (rev 251335)
+++ branches/safari-608-branch/Source/_javascript_Core/ChangeLog	2019-10-20 17:32:45 UTC (rev 251336)
@@ -1,5 +1,35 @@
 2019-10-15  Kocsen Chung  <kocsen_ch...@apple.com>
 
+        Cherry-pick r250629. rdar://problem/56280996
+
+    FTL OSR exit shouldn't bother updating get_by_id array profiles that have changed modes
+    https://bugs.webkit.org/show_bug.cgi?id=202493
+    
+    Reviewed by Saam Barati.
+    
+    I added this optimization for DFG but forgot to do it for the FTL
+    at the same time. This patch rectifies that.
+    
+    * ftl/FTLOSRExitCompiler.cpp:
+    (JSC::FTL::compileStub):
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@250629 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-10-02  Keith Miller  <keith_mil...@apple.com>
+
+            FTL OSR exit shouldn't bother updating get_by_id array profiles that have changed modes
+            https://bugs.webkit.org/show_bug.cgi?id=202493
+
+            Reviewed by Saam Barati.
+
+            I added this optimization for DFG but forgot to do it for the FTL
+            at the same time. This patch rectifies that.
+
+            * ftl/FTLOSRExitCompiler.cpp:
+            (JSC::FTL::compileStub):
+
+2019-10-15  Kocsen Chung  <kocsen_ch...@apple.com>
+
         Cherry-pick r250585. rdar://problem/56280995
 
     ObjectAllocationSinkingPhase shouldn't insert hints for allocations which are no longer valid

Modified: branches/safari-608-branch/Source/_javascript_Core/ftl/FTLOSRExitCompiler.cpp (251335 => 251336)


--- branches/safari-608-branch/Source/_javascript_Core/ftl/FTLOSRExitCompiler.cpp	2019-10-20 17:32:43 UTC (rev 251335)
+++ branches/safari-608-branch/Source/_javascript_Core/ftl/FTLOSRExitCompiler.cpp	2019-10-20 17:32:45 UTC (rev 251336)
@@ -28,6 +28,7 @@
 
 #if ENABLE(FTL_JIT)
 
+#include "BytecodeStructs.h"
 #include "DFGOSRExitCompilerCommon.h"
 #include "DFGOSRExitPreparation.h"
 #include "FTLExitArgumentForOperand.h"
@@ -248,7 +249,15 @@
         
         if (exit.m_kind == BadCache || exit.m_kind == BadIndexingType) {
             CodeOrigin codeOrigin = exit.m_codeOriginForExitProfile;
-            if (ArrayProfile* arrayProfile = jit.baselineCodeBlockFor(codeOrigin)->getArrayProfile(codeOrigin.bytecodeIndex())) {
+            CodeBlock* codeBlock = jit.baselineCodeBlockFor(codeOrigin);
+            if (ArrayProfile* arrayProfile = codeBlock->getArrayProfile(codeOrigin.bytecodeIndex())) {
+                const Instruction* instruction = codeBlock->instructions().at(codeOrigin.bytecodeIndex()).ptr();
+                CCallHelpers::Jump skipProfile;
+                if (instruction->is<OpGetById>()) {
+                    auto& metadata = instruction->as<OpGetById>().metadata(codeBlock);
+                    skipProfile = jit.branch8(CCallHelpers::NotEqual, CCallHelpers::AbsoluteAddress(&metadata.m_modeMetadata.mode), CCallHelpers::TrustedImm32(static_cast<uint8_t>(GetByIdMode::ArrayLength)));
+                }
+
                 jit.load32(MacroAssembler::Address(GPRInfo::regT0, JSCell::structureIDOffset()), GPRInfo::regT1);
                 jit.store32(GPRInfo::regT1, arrayProfile->addressOfLastSeenStructureID());
 
@@ -266,6 +275,9 @@
                 jit.lshift32(GPRInfo::regT1, GPRInfo::regT2);
                 storeArrayModes.link(&jit);
                 jit.or32(GPRInfo::regT2, MacroAssembler::AbsoluteAddress(arrayProfile->addressOfArrayModes()));
+
+                if (skipProfile.isSet())
+                    skipProfile.link(&jit);
             }
         }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to