Ignore:
Timestamp:
Dec 8, 2015, 4:30:18 PM (10 years ago)
Author:
[email protected]
Message:

Factoring out common DFG code for bitwise and shift operators.
https://bugs.webkit.org/show_bug.cgi?id=152019

Reviewed by Michael Saboff.

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileBitwiseOp):
(JSC::DFG::SpeculativeJIT::compileShiftOp):

  • dfg/DFGSpeculativeJIT.h:
  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::compile):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r193766 r193795  
    21452145    case BitOr:
    21462146    case BitXor:
    2147         if (node->child1()->isInt32Constant()) {
    2148             SpeculateInt32Operand op2(this, node->child2());
    2149             GPRTemporary result(this, Reuse, op2);
    2150 
    2151             bitOp(op, node->child1()->asInt32(), op2.gpr(), result.gpr());
    2152 
    2153             int32Result(result.gpr(), node);
    2154         } else if (node->child2()->isInt32Constant()) {
    2155             SpeculateInt32Operand op1(this, node->child1());
    2156             GPRTemporary result(this, Reuse, op1);
    2157 
    2158             bitOp(op, node->child2()->asInt32(), op1.gpr(), result.gpr());
    2159 
    2160             int32Result(result.gpr(), node);
    2161         } else {
    2162             SpeculateInt32Operand op1(this, node->child1());
    2163             SpeculateInt32Operand op2(this, node->child2());
    2164             GPRTemporary result(this, Reuse, op1, op2);
    2165 
    2166             GPRReg reg1 = op1.gpr();
    2167             GPRReg reg2 = op2.gpr();
    2168             bitOp(op, reg1, reg2, result.gpr());
    2169 
    2170             int32Result(result.gpr(), node);
    2171         }
     2147        compileBitwiseOp(node);
    21722148        break;
    21732149
     
    21752151    case BitLShift:
    21762152    case BitURShift:
    2177         if (node->child2()->isInt32Constant()) {
    2178             SpeculateInt32Operand op1(this, node->child1());
    2179             GPRTemporary result(this, Reuse, op1);
    2180 
    2181             shiftOp(op, op1.gpr(), node->child2()->asInt32() & 0x1f, result.gpr());
    2182 
    2183             int32Result(result.gpr(), node);
    2184         } else {
    2185             // Do not allow shift amount to be used as the result, MacroAssembler does not permit this.
    2186             SpeculateInt32Operand op1(this, node->child1());
    2187             SpeculateInt32Operand op2(this, node->child2());
    2188             GPRTemporary result(this, Reuse, op1);
    2189 
    2190             GPRReg reg1 = op1.gpr();
    2191             GPRReg reg2 = op2.gpr();
    2192             shiftOp(op, reg1, reg2, result.gpr());
    2193 
    2194             int32Result(result.gpr(), node);
    2195         }
     2153        compileShiftOp(node);
    21962154        break;
    21972155
Note: See TracChangeset for help on using the changeset viewer.