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/dfg/DFGArrayMode.cpp

    r183450 r183615  
    152152ArrayMode ArrayMode::refine(
    153153    Graph& graph, Node* node,
    154     SpeculatedType base, SpeculatedType index, SpeculatedType value,
    155     NodeFlags flags) const
     154    SpeculatedType base, SpeculatedType index, SpeculatedType value) const
    156155{
    157156    if (!base || !index) {
     
    198197       
    199198    case Array::Double:
    200         if (flags & NodeBytecodeUsesAsInt)
    201             return withTypeAndConversion(Array::Contiguous, Array::RageConvert);
    202199        if (!value || isFullNumberSpeculation(value))
    203200            return *this;
     
    205202       
    206203    case Array::Contiguous:
    207         if (doesConversion() && (flags & NodeBytecodeUsesAsInt))
    208             return withConversion(Array::RageConvert);
    209204        return *this;
    210205
     
    580575    case Array::Convert:
    581576        return "Convert";
    582     case Array::RageConvert:
    583         return "RageConvert";
    584577    default:
    585578        return "Unknown!";
Note: See TracChangeset for help on using the changeset viewer.