Ignore:
Timestamp:
Apr 29, 2015, 9:40:55 PM (10 years ago)
Author:
[email protected]
Message:

[JSC] Remove RageConvert array conversion
https://bugs.webkit.org/show_bug.cgi?id=144433

Patch by Benjamin Poulain <[email protected]> on 2015-04-29
Reviewed by Filip Pizlo.

RageConvert was causing a subtle bug that was hitting the Kraken crypto tests
pretty hard:
-The indexing types shows that the array access varies between Int32 and DoubleArray.
-ArrayMode::fromObserved() decided to use the most generic type: DoubleArray.

An Arrayify node would convert the Int32 to that type.

-Somewhere, a GetByVal or PutByVal would have the flag NodeBytecodeUsesAsInt. That

node would use RageConvert instead of Convert.

-The Arrayify for that GetByVal with RageConvert would not convert the array to

Contiguous.

-All the following array access that do not have the flag NodeBytecodeUsesAsInt would

now expect a DoubleArray and always get a Contiguous Array. The CheckStructure
fail systematically and we never get to run the later code.

Getting rid of RageConvert fixes the problem and does not seems to have any
negative side effect on other benchmarks.

The improvments on Kraken are:

-stanford-crypto-aes: definitely 1.0915x faster.
-stanford-crypto-pbkdf2: definitely 1.2446x faster.
-stanford-crypto-sha256-iterative: definitely 1.0544x faster.

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::AbstractInterpreter<AbstractStateType>::executeEffects):

  • dfg/DFGArrayMode.cpp:

(JSC::DFG::ArrayMode::refine):
(JSC::DFG::arrayConversionToString):

  • dfg/DFGArrayMode.h:
  • dfg/DFGArrayifySlowPathGenerator.h:
  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::fixupNode):

  • dfg/DFGOperations.cpp:
  • dfg/DFGOperations.h:
  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::propagate):

  • dfg/DFGTypeCheckHoistingPhase.cpp:

(JSC::DFG::TypeCheckHoistingPhase::identifyRedundantStructureChecks):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::compileArrayifyToStructure):

  • runtime/JSObject.cpp:

(JSC::JSObject::convertDoubleToContiguous):
(JSC::JSObject::ensureContiguousSlow):
(JSC::JSObject::genericConvertDoubleToContiguous): Deleted.
(JSC::JSObject::rageConvertDoubleToContiguous): Deleted.
(JSC::JSObject::rageEnsureContiguousSlow): Deleted.

  • runtime/JSObject.h:

(JSC::JSObject::rageEnsureContiguous): Deleted.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/JSObject.h

    r183458 r183615  
    690690        return ensureContiguousSlow(vm);
    691691    }
    692        
    693     // Same as ensureContiguous(), except that if the indexed storage is in
    694     // double mode, then it does a rage conversion to contiguous: it
    695     // attempts to convert each double to an int32.
    696     ContiguousJSValues rageEnsureContiguous(VM& vm)
    697     {
    698         if (LIKELY(hasContiguous(indexingType())))
    699             return m_butterfly->contiguous();
    700            
    701         return rageEnsureContiguousSlow(vm);
    702     }
    703        
     692
    704693    // Ensure that the object is in a mode where it has array storage. Use
    705694    // this if you're about to perform actions that would have required the
     
    798787   
    799788    ContiguousJSValues convertDoubleToContiguous(VM&);
    800     ContiguousJSValues rageConvertDoubleToContiguous(VM&);
    801789    ArrayStorage* convertDoubleToArrayStorage(VM&, NonPropertyTransition);
    802790    ArrayStorage* convertDoubleToArrayStorage(VM&);
     
    984972    ContiguousDoubles ensureDoubleSlow(VM&);
    985973    ContiguousJSValues ensureContiguousSlow(VM&);
    986     ContiguousJSValues rageEnsureContiguousSlow(VM&);
    987974    JS_EXPORT_PRIVATE ArrayStorage* ensureArrayStorageSlow(VM&);
    988    
    989     enum DoubleToContiguousMode { EncodeValueAsDouble, RageConvertDoubleToValue };
    990     template<DoubleToContiguousMode mode>
    991     ContiguousJSValues genericConvertDoubleToContiguous(VM&);
    992     ContiguousJSValues ensureContiguousSlow(VM&, DoubleToContiguousMode);
    993    
     975
    994976protected:
    995977    CopyWriteBarrier<Butterfly> m_butterfly;
Note: See TracChangeset for help on using the changeset viewer.