Ignore:
Timestamp:
Sep 19, 2012, 3:36:44 PM (13 years ago)
Author:
[email protected]
Message:

DFG should not assume that a ByVal access is generic just because it was unprofiled
https://bugs.webkit.org/show_bug.cgi?id=97088

Reviewed by Geoffrey Garen.

We were not disambiguating between "Undecided" in the sense that the array profile
has no useful information versus "Undecided" in the sense that the array profile
knows that the access has not executed. That's an important distinction, since
the former form of "Undecided" means that we should consult value profiling, while
the latter means that we should force exit unless the value profiling indicates
that the access must be generic (base is not cell or property is not int).

  • dfg/DFGAbstractState.cpp:

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

  • dfg/DFGArrayMode.cpp:

(JSC::DFG::fromObserved):
(JSC::DFG::refineArrayMode):
(JSC::DFG::modeAlreadyChecked):
(JSC::DFG::modeToString):

  • dfg/DFGArrayMode.h:

(JSC::DFG::canCSEStorage):
(JSC::DFG::modeIsSpecific):
(JSC::DFG::modeSupportsLength):
(JSC::DFG::benefitsFromStructureCheck):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGArrayMode.cpp

    r129045 r129053  
    3737    switch (profile->observedArrayModes()) {
    3838    case 0:
    39         return Array::Undecided;
     39        return Array::Unprofiled;
    4040    case asArrayModes(NonArray):
    4141        if (action == Array::Write && !profile->mayInterceptIndexedAccesses())
     
    8888        return Array::Generic;
    8989   
     90    if (arrayMode == Array::Unprofiled) {
     91        // If the indexing type wasn't recorded in the array profile but the values are
     92        // base=cell property=int, then we know that this access didn't execute.
     93        return Array::ForceExit;
     94    }
     95   
    9096    if (arrayMode != Array::Undecided)
    9197        return arrayMode;
     
    199205       
    200206    case Array::Undecided:
     207    case Array::Unprofiled:
    201208        break;
    202209    }
     
    211218    case Array::Undecided:
    212219        return "Undecided";
     220    case Array::Unprofiled:
     221        return "Unprofiled";
    213222    case Array::Generic:
    214223        return "Generic";
Note: See TracChangeset for help on using the changeset viewer.