Changeset 90065 in webkit


Ignore:
Timestamp:
Jun 29, 2011 4:50:12 PM (13 years ago)
Author:
barraclough@apple.com
Message:

https://bugs.webkit.org/show_bug.cgi?id=63669
DFG JIT - fix spectral-norm regression

Reviewed by Geoff Garen.

The problem is a mis-speculation leading to us falling off the speculative path.
Make the speculation logic slightly smarter, don't predict int if one of the
operands is already loaded as a double (we use this logic already for compares).

  • dfg/DFGSpeculativeJIT.cpp:

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

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::shouldSpeculateInteger):

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r90063 r90065  
     12011-06-29  Gavin Barraclough  <barraclough@apple.com>
     2
     3        Reviewed by Geoff Garen.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=63669
     6        DFG JIT - fix spectral-norm regression
     7
     8        The problem is a mis-speculation leading to us falling off the speculative path.
     9        Make the speculation logic slightly smarter, don't predict int if one of the
     10        operands is already loaded as a double (we use this logic already for compares).
     11
     12        * dfg/DFGSpeculativeJIT.cpp:
     13        (JSC::DFG::SpeculativeJIT::compile):
     14        * dfg/DFGSpeculativeJIT.h:
     15        (JSC::DFG::SpeculativeJIT::shouldSpeculateInteger):
     16
    1172011-06-29  Filip Pizlo  <fpizlo@apple.com>
    218
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r89961 r90065  
    562562    case ValueAdd:
    563563    case ArithAdd: {
    564         if (isInteger(node.child1) || isInteger(node.child2)) {
     564        if (shouldSpeculateInteger(node.child1, node.child2)) {
    565565            if (isInt32Constant(node.child1)) {
    566566                int32_t imm1 = valueOfInt32Constant(node.child1);
     
    618618
    619619    case ArithSub: {
    620         if (isInteger(node.child1) || isInteger(node.child2)) {
     620        if (shouldSpeculateInteger(node.child1, node.child2)) {
    621621            if (isInt32Constant(node.child2)) {
    622622                SpeculateIntegerOperand op1(this, node.child1);
     
    639639            break;
    640640        }
     641
    641642        SpeculateDoubleOperand op1(this, node.child1);
    642643        SpeculateDoubleOperand op2(this, node.child2);
     
    652653
    653654    case ArithMul: {
    654         if (isInteger(node.child1) && isInteger(node.child2)) {
     655        if (shouldSpeculateInteger(node.child1, node.child2)) {
    655656            SpeculateIntegerOperand op1(this, node.child1);
    656657            SpeculateIntegerOperand op2(this, node.child2);
     
    669670            break;
    670671        }
     672
    671673        SpeculateDoubleOperand op1(this, node.child1);
    672674        SpeculateDoubleOperand op2(this, node.child2);
     
    745747            ASSERT(node.adjustedRefCount() == 1);
    746748
    747             if (compareIsInteger(node.child1, node.child2))
     749            if (shouldSpeculateInteger(node.child1, node.child2))
    748750                compilePeepHoleIntegerBranch(node, branchNodeIndex, JITCompiler::LessThan);
    749751            else
     
    777779            ASSERT(node.adjustedRefCount() == 1);
    778780
    779             if (compareIsInteger(node.child1, node.child2))
     781            if (shouldSpeculateInteger(node.child1, node.child2))
    780782                compilePeepHoleIntegerBranch(node, branchNodeIndex, JITCompiler::LessThanOrEqual);
    781783            else
     
    809811            ASSERT(node.adjustedRefCount() == 1);
    810812
    811             if (compareIsInteger(node.child1, node.child2))
     813            if (shouldSpeculateInteger(node.child1, node.child2))
    812814                compilePeepHoleIntegerBranch(node, branchNodeIndex, JITCompiler::Equal);
    813815            else
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r89961 r90065  
    180180    }
    181181
    182     bool compareIsInteger(NodeIndex op1, NodeIndex op2)
     182    bool shouldSpeculateInteger(NodeIndex op1, NodeIndex op2)
    183183    {
    184184        return !(isDataFormatDouble(op1) || isDataFormatDouble(op2)) && (isInteger(op1) || isInteger(op2));
Note: See TracChangeset for help on using the changeset viewer.