Ignore:
Timestamp:
Dec 22, 2011, 9:47:17 PM (13 years ago)
Author:
[email protected]
Message:

DFG should not speculate array even when predictions say that the base is not an array
https://bugs.webkit.org/show_bug.cgi?id=75160
<rdar://problem/10622646>
<rdar://problem/10622649>

Reviewed by Oliver Hunt.

Added the ability to call slow path when the base is known to not be an array.
Also rationalized the logic for deciding when the index is not an int, and
cleaned up the logic for deciding when to speculate typed array.

Neutral for the most part, with odd speed-ups and slow-downs. The slow-downs can
likely be mitigated by having the notion of a polymorphic array access, where we
try, but don't speculate, to access the array one way before either trying some
other ways or calling slow path.

  • bytecode/PredictedType.h:

(JSC::isActionableMutableArrayPrediction):
(JSC::isActionableArrayPrediction):

  • dfg/DFGAbstractState.cpp:

(JSC::DFG::AbstractState::execute):

  • dfg/DFGNode.h:

(JSC::DFG::Node::shouldSpeculateInt8Array):
(JSC::DFG::Node::shouldSpeculateInt16Array):
(JSC::DFG::Node::shouldSpeculateInt32Array):
(JSC::DFG::Node::shouldSpeculateUint8Array):
(JSC::DFG::Node::shouldSpeculateUint16Array):
(JSC::DFG::Node::shouldSpeculateUint32Array):
(JSC::DFG::Node::shouldSpeculateFloat32Array):
(JSC::DFG::Node::shouldSpeculateFloat64Array):

  • dfg/DFGPropagator.cpp:

(JSC::DFG::Propagator::byValIsPure):

  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::compileGetIndexedPropertyStorage):

  • 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/DFGNode.h

    r103255 r103604  
    932932    bool shouldSpeculateInt8Array()
    933933    {
    934         return prediction() == PredictInt8Array;
     934        return isInt8ArrayPrediction(prediction());
    935935    }
    936936   
    937937    bool shouldSpeculateInt16Array()
    938938    {
    939         return prediction() == PredictInt16Array;
     939        return isInt16ArrayPrediction(prediction());
    940940    }
    941941   
    942942    bool shouldSpeculateInt32Array()
    943943    {
    944         return prediction() == PredictInt32Array;
     944        return isInt32ArrayPrediction(prediction());
    945945    }
    946946   
    947947    bool shouldSpeculateUint8Array()
    948948    {
    949         return prediction() == PredictUint8Array;
     949        return isUint8ArrayPrediction(prediction());
    950950    }
    951951   
    952952    bool shouldSpeculateUint16Array()
    953953    {
    954         return prediction() == PredictUint16Array;
     954        return isUint16ArrayPrediction(prediction());
    955955    }
    956956   
    957957    bool shouldSpeculateUint32Array()
    958958    {
    959         return prediction() == PredictUint32Array;
     959        return isUint32ArrayPrediction(prediction());
    960960    }
    961961   
     
    963963    {
    964964#if CPU(X86) || CPU(X86_64)
    965         return !!(prediction() & PredictFloat32Array);
     965        return isFloat32ArrayPrediction(prediction());
    966966#else
    967967        return false;
     
    971971    bool shouldSpeculateFloat64Array()
    972972    {
    973         return prediction() == PredictFloat64Array;
     973        return isFloat64ArrayPrediction(prediction());
    974974    }
    975975   
Note: See TracChangeset for help on using the changeset viewer.