Title: [294642] trunk
Revision
294642
Author
[email protected]
Date
2022-05-23 08:35:21 -0700 (Mon, 23 May 2022)

Log Message

Unskip JSTests/stress/shadow-realm-import-value.js on ARMv7 and MIPS
https://bugs.webkit.org/show_bug.cgi?id=240662

        Reviewed by Yusuke Suzuki.

        Fix tag and payload being swapped in the resultRegs object.

        Also updated some places that can use JSRInfo::returnValueJSR instead
        of manually writing the GPR order.

        Patch by Geza Lore and Mikhail R. Gadelha.

        * jit/ThunkGenerators.cpp:
        (JSC::boundFunctionCallGenerator):
        (JSC::remoteFunctionCallGenerator):

Canonical link: https://commits.webkit.org/250866@main

Modified Paths

Diff

Modified: trunk/JSTests/stress/shadow-realm-import-value.js (294641 => 294642)


--- trunk/JSTests/stress/shadow-realm-import-value.js	2022-05-23 15:02:52 UTC (rev 294641)
+++ trunk/JSTests/stress/shadow-realm-import-value.js	2022-05-23 15:35:21 UTC (rev 294642)
@@ -1,4 +1,3 @@
-//@ skip if ["mips", "arm"].include?($architecture)
 //@ requireOptions("--useShadowRealm=1")
 
 var abort = $vm.abort;

Modified: trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp (294641 => 294642)


--- trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2022-05-23 15:02:52 UTC (rev 294641)
+++ trunk/Source/_javascript_Core/dfg/DFGSpeculativeJIT.cpp	2022-05-23 15:35:21 UTC (rev 294642)
@@ -2150,11 +2150,9 @@
             }
 
             m_jit.popToRestore(GPRInfo::regT0);
-#if USE(JSVALUE64)
-            JSValueRegs resultRegs(GPRInfo::returnValueGPR);
-#else
-            JSValueRegs resultRegs(GPRInfo::returnValueGPR2, GPRInfo::returnValueGPR);
-#endif
+
+            constexpr JSValueRegs resultRegs = JSRInfo::returnValueJSR;
+
             m_jit.moveValue(baselineCodeBlock->globalObject(), resultRegs);
             m_jit.emitRestoreCalleeSaves();
             m_jit.emitFunctionEpilogue();

Modified: trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp (294641 => 294642)


--- trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp	2022-05-23 15:02:52 UTC (rev 294641)
+++ trunk/Source/_javascript_Core/jit/ThunkGenerators.cpp	2022-05-23 15:35:21 UTC (rev 294642)
@@ -1296,9 +1296,8 @@
     jit.storePtr(CCallHelpers::TrustedImmPtr(nullptr), CCallHelpers::addressFor(CallFrameSlot::codeBlock));
     jit.store32(CCallHelpers::TrustedImm32(0), CCallHelpers::tagFor(CallFrameSlot::argumentCountIncludingThis));
 
-    unsigned extraStackNeeded = 0;
-    if (unsigned stackMisalignment = sizeof(CallerFrameAndPC) % stackAlignmentBytes())
-        extraStackNeeded = stackAlignmentBytes() - stackMisalignment;
+    constexpr unsigned stackMisalignment = sizeof(CallerFrameAndPC) % stackAlignmentBytes();
+    constexpr unsigned extraStackNeeded = stackMisalignment ? stackAlignmentBytes() - stackMisalignment : 0;
     
     // We need to forward all of the arguments that we were passed. We aren't allowed to do a tail
     // call here as far as I can tell. At least not so long as the generic path doesn't do a tail
@@ -1430,9 +1429,8 @@
     jit.storePtr(CCallHelpers::TrustedImmPtr(nullptr), CCallHelpers::addressFor(CallFrameSlot::codeBlock));
     jit.store32(CCallHelpers::TrustedImm32(0), CCallHelpers::tagFor(CallFrameSlot::argumentCountIncludingThis));
 
-    unsigned extraStackNeeded = 0;
-    if (unsigned stackMisalignment = sizeof(CallerFrameAndPC) % stackAlignmentBytes())
-        extraStackNeeded = stackAlignmentBytes() - stackMisalignment;
+    constexpr unsigned stackMisalignment = sizeof(CallerFrameAndPC) % stackAlignmentBytes();
+    constexpr unsigned extraStackNeeded = stackMisalignment ? stackAlignmentBytes() - stackMisalignment : 0;
 
     // We need to forward all of the arguments that we were passed. We aren't allowed to do a tail
     // call here as far as I can tell. At least not so long as the generic path doesn't do a tail
@@ -1593,11 +1591,7 @@
     jit.call(GPRInfo::regT2, JSEntryPtrTag);
 
     // Wrap return value
-#if USE(JSVALUE64)
-    JSValueRegs resultRegs(GPRInfo::returnValueGPR);
-#else
-    JSValueRegs resultRegs(GPRInfo::returnValueGPR, GPRInfo::returnValueGPR2);
-#endif
+    constexpr JSValueRegs resultRegs = JSRInfo::returnValueJSR;
 
     CCallHelpers::JumpList resultIsPrimitive;
     resultIsPrimitive.append(jit.branchIfNotCell(resultRegs));

Modified: trunk/Source/_javascript_Core/llint/LLIntThunks.cpp (294641 => 294642)


--- trunk/Source/_javascript_Core/llint/LLIntThunks.cpp	2022-05-23 15:02:52 UTC (rev 294641)
+++ trunk/Source/_javascript_Core/llint/LLIntThunks.cpp	2022-05-23 15:35:21 UTC (rev 294642)
@@ -232,11 +232,7 @@
         jit.loadPtr(CCallHelpers::Address(GPRInfo::regT0, PreciseAllocation::offsetOfWeakSet() + WeakSet::offsetOfVM() - PreciseAllocation::headerSize()), GPRInfo::regT0);
 
         loadedCase.link(&jit);
-#if USE(JSVALUE64)
-        jit.loadValue(CCallHelpers::Address(GPRInfo::regT0, VM::offsetOfEncodedHostCallReturnValue()), JSValueRegs { GPRInfo::returnValueGPR });
-#else
-        jit.loadValue(CCallHelpers::Address(GPRInfo::regT0, VM::offsetOfEncodedHostCallReturnValue()), JSValueRegs { GPRInfo::returnValueGPR2, GPRInfo::returnValueGPR });
-#endif
+        jit.loadValue(CCallHelpers::Address(GPRInfo::regT0, VM::offsetOfEncodedHostCallReturnValue()), JSRInfo::returnValueJSR);
         jit.emitFunctionEpilogue();
         jit.ret();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to