Ignore:
Timestamp:
Sep 10, 2015, 4:07:08 PM (10 years ago)
Author:
[email protected]
Message:

Structure should be able to tell you if it had ever been a dictionary
https://bugs.webkit.org/show_bug.cgi?id=149047

Reviewed by Mark Lam.

Introduces the hasBeenDictionary flag to Structure, which tells you if this structure or
any of its ancestors is a dictionary. We already implicitly tracked this for DFG
watchpoint optimizations, so this is mainly just decoupling that existing logic from
watchpoints. Having Structure::hasBeenDictionary() enables some of the heuristics in the
property type inference work (https://bugs.webkit.org/show_bug.cgi?id=148610).

  • runtime/Structure.cpp:

(JSC::Structure::Structure):
(JSC::Structure::toDictionaryTransition):
(JSC::Structure::dump):

  • runtime/Structure.h:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/runtime/Structure.cpp

    r188978 r189596  
    209209    setHasRareData(false);
    210210    setTransitionWatchpointIsLikelyToBeFired(false);
     211    setHasBeenDictionary(false);
    211212 
    212213    ASSERT(inlineCapacity <= JSFinalObject::maxInlineCapacity());
     
    240241    setHasRareData(false);
    241242    setTransitionWatchpointIsLikelyToBeFired(false);
     243    setHasBeenDictionary(false);
    242244 
    243245    TypeInfo typeInfo = TypeInfo(CellType, StructureFlags);
     
    269271    setStaticFunctionsReified(previous->staticFunctionsReified());
    270272    setHasRareData(false);
     273    setHasBeenDictionary(previous->hasBeenDictionary());
    271274 
    272275    TypeInfo typeInfo = previous->typeInfo();
     
    538541    transition->setDictionaryKind(kind);
    539542    transition->pin();
    540     transition->setTransitionWatchpointIsLikelyToBeFired(true);
     543    transition->setHasBeenDictionary(true);
    541544
    542545    transition->checkOffsetConsistency();
     
    11571160    switch (dictionaryKind()) {
    11581161    case NoneDictionaryKind:
     1162        if (hasBeenDictionary())
     1163            out.print(", Has been dictionary");
    11591164        break;
    11601165    case CachedDictionaryKind:
     
    11651170        break;
    11661171    }
     1172
     1173    if (transitionWatchpointSetIsStillValid())
     1174        out.print(", Leaf");
     1175    else if (transitionWatchpointIsLikelyToBeFired())
     1176        out.print(", Shady leaf");
    11671177   
    11681178    out.print("]");
Note: See TracChangeset for help on using the changeset viewer.