Title: [280470] trunk/Source/_javascript_Core
Revision
280470
Author
[email protected]
Date
2021-07-30 01:41:25 -0700 (Fri, 30 Jul 2021)

Log Message

[JSC] Use UCPURegister argument to remove zero extension in JIT code
https://bugs.webkit.org/show_bug.cgi?id=228625

Reviewed by Robin Morisset.

Yarr JIT code emits zeroExtend32ToWord for some arguments, but this is not necessary if
argument is defined as UCPURegister. In that case, caller guarantees that top 32bits are
cleared.

* yarr/YarrJIT.cpp:
* yarr/YarrJIT.h:

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (280469 => 280470)


--- trunk/Source/_javascript_Core/ChangeLog	2021-07-30 08:29:29 UTC (rev 280469)
+++ trunk/Source/_javascript_Core/ChangeLog	2021-07-30 08:41:25 UTC (rev 280470)
@@ -1,3 +1,17 @@
+2021-07-30  Yusuke Suzuki  <[email protected]>
+
+        [JSC] Use UCPURegister argument to remove zero extension in JIT code
+        https://bugs.webkit.org/show_bug.cgi?id=228625
+
+        Reviewed by Robin Morisset.
+
+        Yarr JIT code emits zeroExtend32ToWord for some arguments, but this is not necessary if
+        argument is defined as UCPURegister. In that case, caller guarantees that top 32bits are
+        cleared.
+
+        * yarr/YarrJIT.cpp:
+        * yarr/YarrJIT.h:
+
 2021-07-29  Myles C. Maxfield  <[email protected]>
 
         Stop building WebGPU and the WHLSL compiler to decrease binary size

Modified: trunk/Source/_javascript_Core/yarr/YarrJIT.cpp (280469 => 280470)


--- trunk/Source/_javascript_Core/yarr/YarrJIT.cpp	2021-07-30 08:29:29 UTC (rev 280469)
+++ trunk/Source/_javascript_Core/yarr/YarrJIT.cpp	2021-07-30 08:41:25 UTC (rev 280470)
@@ -3972,9 +3972,6 @@
             push(X86Registers::r14);
             push(X86Registers::r15);
         }
-        // The ABI doesn't guarantee the upper bits are zero on unsigned arguments, so clear them ourselves.
-        zeroExtend32ToWord(index, index);
-        zeroExtend32ToWord(length, length);
 #if OS(WINDOWS)
         if (m_compileMode == JITCompileMode::IncludeSubpatterns)
             loadPtr(Address(X86Registers::ebp, 6 * sizeof(void*)), output);
@@ -3991,10 +3988,6 @@
             move(TrustedImm32(0xd800), leadingSurrogateTag);
             move(TrustedImm32(0xdc00), trailingSurrogateTag);
         }
-
-        // The ABI doesn't guarantee the upper bits are zero on unsigned arguments, so clear them ourselves.
-        zeroExtend32ToWord(index, index);
-        zeroExtend32ToWord(length, length);
 #elif CPU(ARM_THUMB2)
         push(ARMRegisters::r4);
         push(ARMRegisters::r5);

Modified: trunk/Source/_javascript_Core/yarr/YarrJIT.h (280469 => 280470)


--- trunk/Source/_javascript_Core/yarr/YarrJIT.h	2021-07-30 08:29:29 UTC (rev 280469)
+++ trunk/Source/_javascript_Core/yarr/YarrJIT.h	2021-07-30 08:41:25 UTC (rev 280470)
@@ -103,7 +103,7 @@
 };
 
 #if CPU(ARM64E)
-extern "C" EncodedMatchResult vmEntryToYarrJIT(const void* input, unsigned start, unsigned length, int* output, MatchingContextHolder* matchingContext, const void* codePtr);
+extern "C" EncodedMatchResult vmEntryToYarrJIT(const void* input, UCPURegister start, UCPURegister length, int* output, MatchingContextHolder* matchingContext, const void* codePtr);
 extern "C" void vmEntryToYarrJITAfter(void);
 #endif
 
@@ -111,10 +111,10 @@
     WTF_MAKE_FAST_ALLOCATED;
     WTF_MAKE_NONCOPYABLE(YarrCodeBlock);
 
-    using YarrJITCode8 = EncodedMatchResult (*)(const LChar* input, unsigned start, unsigned length, int* output, MatchingContextHolder& matchingContext) YARR_CALL;
-    using YarrJITCode16 = EncodedMatchResult (*)(const UChar* input, unsigned start, unsigned length, int* output, MatchingContextHolder& matchingContext) YARR_CALL;
-    using YarrJITCodeMatchOnly8 = EncodedMatchResult (*)(const LChar* input, unsigned start, unsigned length, void*, MatchingContextHolder& matchingContext) YARR_CALL;
-    using YarrJITCodeMatchOnly16 = EncodedMatchResult (*)(const UChar* input, unsigned start, unsigned length, void*, MatchingContextHolder& matchingContext) YARR_CALL;
+    using YarrJITCode8 = EncodedMatchResult (*)(const LChar* input, UCPURegister start, UCPURegister length, int* output, MatchingContextHolder& matchingContext) YARR_CALL;
+    using YarrJITCode16 = EncodedMatchResult (*)(const UChar* input, UCPURegister start, UCPURegister length, int* output, MatchingContextHolder& matchingContext) YARR_CALL;
+    using YarrJITCodeMatchOnly8 = EncodedMatchResult (*)(const LChar* input, UCPURegister start, UCPURegister length, void*, MatchingContextHolder& matchingContext) YARR_CALL;
+    using YarrJITCodeMatchOnly16 = EncodedMatchResult (*)(const UChar* input, UCPURegister start, UCPURegister length, void*, MatchingContextHolder& matchingContext) YARR_CALL;
 
 public:
     YarrCodeBlock() = default;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to