Changeset 191978 in webkit


Ignore:
Timestamp:
Nov 3, 2015 2:13:52 PM (8 years ago)
Author:
mark.lam@apple.com
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):

Location:
trunk/Source/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r191977 r191978  
     12015-11-03  Mark Lam  <mark.lam@apple.com>
     2
     3        Fix some inefficiencies in the baseline usage of JITAddGenerator.
     4        https://bugs.webkit.org/show_bug.cgi?id=150850
     5
     6        Reviewed by Michael Saboff.
     7
     8        1. emit_op_add() was loading the operands twice.  Removed the redundant load.
     9        2. The snippet may decide that it wants to go the slow path route all the time.
     10           In that case, emit_op_add will end up emitting a branch to an out of line
     11           slow path followed by some dead code to store the result of the fast path
     12           on to the stack.
     13           We now check if the snippet determined that there's no fast path, and just
     14           emit the slow path inline, and skip the dead store of the fast path result.
     15
     16        * jit/JITArithmetic.cpp:
     17        (JSC::JIT::emit_op_add):
     18
    1192015-11-03  Filip Pizlo  <fpizlo@apple.com>
    220
  • trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp

    r191905 r191978  
    933933#endif
    934934
    935     emitGetVirtualRegister(op1, leftRegs);
    936     emitGetVirtualRegister(op2, rightRegs);
    937 
    938935    bool leftIsConstInt32 = isOperandConstantInt(op1);
    939936    bool rightIsConstInt32 = isOperandConstantInt(op2);
     
    969966
    970967    gen.generateFastPath(*this);
    971     gen.endJumpList().link(this);
    972     emitPutVirtualRegister(result, resultRegs);
    973 
    974     addSlowCase(gen.slowPathJumpList());
     968
     969    if (!gen.endJumpList().empty()) {
     970        gen.endJumpList().link(this);
     971        emitPutVirtualRegister(result, resultRegs);
     972       
     973        addSlowCase(gen.slowPathJumpList());
     974    } else {
     975        gen.slowPathJumpList().link(this);
     976        JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_add);
     977        slowPathCall.call();
     978    }
    975979}
    976980
Note: See TracChangeset for help on using the changeset viewer.