Ignore:
Timestamp:
Sep 29, 2009, 1:28:00 PM (16 years ago)
Author:
[email protected]
Message:

Standardized an optimization for adding non-numbers.

Patch by Geoffrey Garen <[email protected]> on 2009-09-29
Reviewed by Sam Weinig.

SunSpider says maybe a tiny speedup.

  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_add):
(JSC::JIT::emitSlow_op_add):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/jit/JITArithmetic.cpp

    r48830 r48895  
    567567    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
    568568
     569    if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) {
     570        JITStubCall stubCall(this, cti_op_add);
     571        stubCall.addArgument(op1);
     572        stubCall.addArgument(op2);
     573        stubCall.call(dst);
     574        return;
     575    }
     576
    569577    JumpList notInt32Op1;
    570578    JumpList notInt32Op2;
     
    630638    unsigned op2 = currentInstruction[3].u.operand;
    631639    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
     640
     641    if (!types.first().mightBeNumber() || !types.second().mightBeNumber())
     642        return;
    632643
    633644    unsigned op;
     
    20272038    unsigned op1 = currentInstruction[2].u.operand;
    20282039    unsigned op2 = currentInstruction[3].u.operand;
     2040    OperandTypes types = OperandTypes::fromInt(currentInstruction[4].u.operand);
     2041
     2042    if (!types.first().mightBeNumber() || !types.second().mightBeNumber())
     2043        return;
    20292044
    20302045    if (isOperandConstantImmediateInt(op1) || isOperandConstantImmediateInt(op2)) {
     
    23842399    unsigned op2 = currentInstruction[3].u.operand;
    23852400
     2401    if (!types.first().mightBeNumber() || !types.second().mightBeNumber()) {
     2402        JITStubCall stubCall(this, cti_op_add);
     2403        stubCall.addArgument(op1);
     2404        stubCall.addArgument(op2);
     2405        stubCall.call(dst);
     2406        return;
     2407    }
     2408
    23862409    if (isOperandConstantImmediateInt(op1)) {
    23872410        emitGetVirtualRegister(op2, regT0);
     
    24142437    unsigned op1 = currentInstruction[2].u.operand;
    24152438    unsigned op2 = currentInstruction[3].u.operand;
     2439
     2440    if (!types.first().mightBeNumber() || !types.second().mightBeNumber())
     2441        return;
    24162442
    24172443    if (isOperandConstantImmediateInt(op1)) {
Note: See TracChangeset for help on using the changeset viewer.