Title: [191978] trunk/Source/_javascript_Core
Revision
191978
Author
mark....@apple.com
Date
2015-11-03 14:13:52 -0800 (Tue, 03 Nov 2015)

Log Message

Fix some inefficiencies in the baseline usage of JITAddGenerator.
https://bugs.webkit.org/show_bug.cgi?id=150850

Reviewed by Michael Saboff.

1. emit_op_add() was loading the operands twice.  Removed the redundant load.
2. The snippet may decide that it wants to go the slow path route all the time.
   In that case, emit_op_add will end up emitting a branch to an out of line
   slow path followed by some dead code to store the result of the fast path
   on to the stack.
   We now check if the snippet determined that there's no fast path, and just
   emit the slow path inline, and skip the dead store of the fast path result.

* jit/JITArithmetic.cpp:
(JSC::JIT::emit_op_add):

Modified Paths

Diff

Modified: trunk/Source/_javascript_Core/ChangeLog (191977 => 191978)


--- trunk/Source/_javascript_Core/ChangeLog	2015-11-03 22:03:48 UTC (rev 191977)
+++ trunk/Source/_javascript_Core/ChangeLog	2015-11-03 22:13:52 UTC (rev 191978)
@@ -1,3 +1,21 @@
+2015-11-03  Mark Lam  <mark....@apple.com>
+
+        Fix some inefficiencies in the baseline usage of JITAddGenerator.
+        https://bugs.webkit.org/show_bug.cgi?id=150850
+
+        Reviewed by Michael Saboff.
+
+        1. emit_op_add() was loading the operands twice.  Removed the redundant load.
+        2. The snippet may decide that it wants to go the slow path route all the time.
+           In that case, emit_op_add will end up emitting a branch to an out of line
+           slow path followed by some dead code to store the result of the fast path
+           on to the stack.
+           We now check if the snippet determined that there's no fast path, and just
+           emit the slow path inline, and skip the dead store of the fast path result.
+
+        * jit/JITArithmetic.cpp:
+        (JSC::JIT::emit_op_add):
+
 2015-11-03  Filip Pizlo  <fpi...@apple.com>
 
         B3::LowerToAir should do copy propagation

Modified: trunk/Source/_javascript_Core/jit/JITArithmetic.cpp (191977 => 191978)


--- trunk/Source/_javascript_Core/jit/JITArithmetic.cpp	2015-11-03 22:03:48 UTC (rev 191977)
+++ trunk/Source/_javascript_Core/jit/JITArithmetic.cpp	2015-11-03 22:13:52 UTC (rev 191978)
@@ -932,9 +932,6 @@
     FPRReg scratchFPR = fpRegT2;
 #endif
 
-    emitGetVirtualRegister(op1, leftRegs);
-    emitGetVirtualRegister(op2, rightRegs);
-
     bool leftIsConstInt32 = isOperandConstantInt(op1);
     bool rightIsConstInt32 = isOperandConstantInt(op2);
     JITAddGenerator::OperandsConstness operandsConstness;
@@ -968,10 +965,17 @@
         fpRegT0, fpRegT1, scratchGPR, scratchFPR);
 
     gen.generateFastPath(*this);
-    gen.endJumpList().link(this);
-    emitPutVirtualRegister(result, resultRegs);
 
-    addSlowCase(gen.slowPathJumpList());
+    if (!gen.endJumpList().empty()) {
+        gen.endJumpList().link(this);
+        emitPutVirtualRegister(result, resultRegs);
+        
+        addSlowCase(gen.slowPathJumpList());
+    } else {
+        gen.slowPathJumpList().link(this);
+        JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_add);
+        slowPathCall.call();
+    }
 }
 
 void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to