Title: [198021] releases/WebKitGTK/webkit-2.12/Source/_javascript_Core
Revision
198021
Author
[email protected]
Date
2016-03-11 08:20:25 -0800 (Fri, 11 Mar 2016)

Log Message

Merge r197695 - [JSC] Improve and64() and or64() with immediate on x86
https://bugs.webkit.org/show_bug.cgi?id=155104

Reviewed by Geoffrey Garen.

GetButterflyReadOnly was doing:
    movq 0x8(%rbx), %r9
    movq $0xfffffffffffffffc, %r11
    andq %r11, %r9
There is no need for the move to load the immediate,
andq sign extend its immediate.

With this patch, we have:
    movq 0x8(%rbx), %r9
    andq $0xfffffffffffffffc, %r9

* assembler/MacroAssemblerX86_64.h:
(JSC::MacroAssemblerX86_64::and64):
(JSC::MacroAssemblerX86_64::or64):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog (198020 => 198021)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog	2016-03-11 15:54:35 UTC (rev 198020)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/ChangeLog	2016-03-11 16:20:25 UTC (rev 198021)
@@ -1,5 +1,27 @@
 2016-03-07  Benjamin Poulain  <[email protected]>
 
+        [JSC] Improve and64() and or64() with immediate on x86
+        https://bugs.webkit.org/show_bug.cgi?id=155104
+
+        Reviewed by Geoffrey Garen.
+
+        GetButterflyReadOnly was doing:
+            movq 0x8(%rbx), %r9
+            movq $0xfffffffffffffffc, %r11
+            andq %r11, %r9
+        There is no need for the move to load the immediate,
+        andq sign extend its immediate.
+
+        With this patch, we have:
+            movq 0x8(%rbx), %r9
+            andq $0xfffffffffffffffc, %r9
+
+        * assembler/MacroAssemblerX86_64.h:
+        (JSC::MacroAssemblerX86_64::and64):
+        (JSC::MacroAssemblerX86_64::or64):
+
+2016-03-07  Benjamin Poulain  <[email protected]>
+
         [JSC] Simplify the overflow check of ArithAbs
         https://bugs.webkit.org/show_bug.cgi?id=155063
 

Modified: releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/assembler/MacroAssemblerX86_64.h (198020 => 198021)


--- releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/assembler/MacroAssemblerX86_64.h	2016-03-11 15:54:35 UTC (rev 198020)
+++ releases/WebKitGTK/webkit-2.12/Source/_javascript_Core/assembler/MacroAssemblerX86_64.h	2016-03-11 16:20:25 UTC (rev 198021)
@@ -345,6 +345,12 @@
 
     void and64(TrustedImmPtr imm, RegisterID srcDest)
     {
+        intptr_t intValue = imm.asIntptr();
+        if (intValue <= std::numeric_limits<int32_t>::max()
+            && intValue >= std::numeric_limits<int32_t>::min()) {
+            and64(TrustedImm32(static_cast<int32_t>(intValue)), srcDest);
+            return;
+        }
         move(imm, scratchRegister());
         and64(scratchRegister(), srcDest);
     }
@@ -487,10 +493,15 @@
         m_assembler.orq_rr(src, dest);
     }
 
-    void or64(TrustedImm64 imm, RegisterID dest)
+    void or64(TrustedImm64 imm, RegisterID srcDest)
     {
+        if (imm.m_value <= std::numeric_limits<int32_t>::max()
+            && imm.m_value >= std::numeric_limits<int32_t>::min()) {
+            or64(TrustedImm32(static_cast<int32_t>(imm.m_value)), srcDest);
+            return;
+        }
         move(imm, scratchRegister());
-        or64(scratchRegister(), dest);
+        or64(scratchRegister(), srcDest);
     }
 
     void or64(TrustedImm32 imm, RegisterID dest)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to