Changeset 90533 in webkit


Ignore:
Timestamp:
Jul 6, 2011 9:04:29 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

2011-07-06 Filip Pizlo <fpizlo@apple.com>

DFG JIT implementation of op_call results in regressions on sunspider
controlflow-recursive.
https://bugs.webkit.org/show_bug.cgi?id=64039

Reviewed by Gavin Barraclough.

  • dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::isSmallInt32Constant): (JSC::DFG::ByteCodeParser::parseBlock):
  • dfg/DFGSpeculativeJIT.h: (JSC::DFG::SpeculativeJIT::isInteger):
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r90529 r90533  
     12011-07-06  Filip Pizlo  <fpizlo@apple.com>
     2
     3        DFG JIT implementation of op_call results in regressions on sunspider
     4        controlflow-recursive.
     5        https://bugs.webkit.org/show_bug.cgi?id=64039
     6
     7        Reviewed by Gavin Barraclough.
     8
     9        * dfg/DFGByteCodeParser.cpp:
     10        (JSC::DFG::ByteCodeParser::isSmallInt32Constant):
     11        (JSC::DFG::ByteCodeParser::parseBlock):
     12        * dfg/DFGSpeculativeJIT.h:
     13        (JSC::DFG::SpeculativeJIT::isInteger):
     14
    1152011-07-06  Filip Pizlo  <fpizlo@apple.com>
    216
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r90529 r90533  
    254254    {
    255255        return isJSConstant(nodeIndex) && valueOfJSConstant(nodeIndex).isInt32();
     256    }
     257    bool isSmallInt32Constant(NodeIndex nodeIndex)
     258    {
     259        if (!isJSConstant(nodeIndex))
     260            return false;
     261        JSValue value = valueOfJSConstant(nodeIndex);
     262        if (!value.isInt32())
     263            return false;
     264        int32_t intValue = value.asInt32();
     265        return intValue >= -5 && intValue <= 5;
    256266    }
    257267    bool isDoubleConstant(NodeIndex nodeIndex)
     
    676686            // If both operands can statically be determined to the numbers, then this is an arithmetic add.
    677687            // Otherwise, we must assume this may be performing a concatenation to a string.
    678             if (m_graph[op1].hasNumericResult() && m_graph[op2].hasNumericResult())
     688            if (m_graph[op1].hasNumericResult() && m_graph[op2].hasNumericResult()) {
     689                if (isSmallInt32Constant(op1) || isSmallInt32Constant(op2)) {
     690                    predictInt32(op1);
     691                    predictInt32(op2);
     692                }
    679693                set(currentInstruction[1].u.operand, addToGraph(ArithAdd, toNumber(op1), toNumber(op2)));
    680             else
     694            } else
    681695                set(currentInstruction[1].u.operand, addToGraph(ValueAdd, op1, op2));
    682696            NEXT_OPCODE(op_add);
     
    687701            NodeIndex op1 = getToNumber(currentInstruction[2].u.operand);
    688702            NodeIndex op2 = getToNumber(currentInstruction[3].u.operand);
     703            if (isSmallInt32Constant(op1) || isSmallInt32Constant(op2)) {
     704                predictInt32(op1);
     705                predictInt32(op2);
     706            }
    689707            set(currentInstruction[1].u.operand, addToGraph(ArithSub, op1, op2));
    690708            NEXT_OPCODE(op_sub);
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r90423 r90533  
    167167        VirtualRegister virtualRegister = node.virtualRegister();
    168168        GenerationInfo& info = m_generationInfo[virtualRegister];
    169 
    170         return (info.registerFormat() | DataFormatJS) == DataFormatJSInteger;
     169       
     170        return (info.registerFormat() | DataFormatJS) == DataFormatJSInteger
     171            || (info.spillFormat() | DataFormatJS) == DataFormatJSInteger;
    171172    }
    172173
Note: See TracChangeset for help on using the changeset viewer.