Ignore:
Timestamp:
Sep 10, 2013, 2:55:45 PM (12 years ago)
Author:
[email protected]
Message:

Introduce a SpecInt48 type and be more careful about what we mean by "Top"
https://bugs.webkit.org/show_bug.cgi?id=121116

Reviewed by Oliver Hunt.

SpecInt48 will mean that we have something that would be a double if it was a JSValue,
but it's profitable to represent it as something other than a double.

SpecInt48AsDouble means that it has a value that could have been represented like
SpecInt48, but we're making a heuristic decision not to do it.

  • bytecode/SpeculatedType.h:

(JSC::isInt48Speculation):

  • dfg/DFGAbstractInterpreterInlines.h:

(JSC::DFG::::executeEffects):
(JSC::DFG::::clobberCapturedVars):

  • dfg/DFGAbstractValue.cpp:

(JSC::DFG::AbstractValue::filter):

  • dfg/DFGAbstractValue.h:

(JSC::DFG::AbstractValue::makeHeapTop):
(JSC::DFG::AbstractValue::makeBytecodeTop):
(JSC::DFG::AbstractValue::isHeapTop):
(JSC::DFG::AbstractValue::heapTop):
(JSC::DFG::AbstractValue::validateType):
(JSC::DFG::AbstractValue::validate):
(JSC::DFG::AbstractValue::makeTop):

  • dfg/DFGInPlaceAbstractState.cpp:

(JSC::DFG::InPlaceAbstractState::initialize):

  • dfg/DFGJITCompiler.h:

(JSC::DFG::JITCompiler::noticeOSREntry):

  • dfg/DFGUseKind.h:

(JSC::DFG::typeFilterFor):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractValue.h

    r153296 r155480  
    6363    bool operator!() const { return isClear(); }
    6464   
    65     void makeTop()
    66     {
    67         m_type |= SpecTop; // The state may have included SpecEmpty, in which case we want this to become SpecEmptyOrTop.
    68         m_arrayModes = ALL_ARRAY_MODES;
    69         m_currentKnownStructure.makeTop();
    70         m_futurePossibleStructure.makeTop();
    71         m_value = JSValue();
    72         checkConsistency();
     65    void makeHeapTop()
     66    {
     67        makeTop(SpecHeapTop);
     68    }
     69   
     70    void makeBytecodeTop()
     71    {
     72        makeTop(SpecBytecodeTop);
    7373    }
    7474   
     
    9090    }
    9191   
    92     bool isTop() const
    93     {
    94         return m_type == SpecTop && m_currentKnownStructure.isTop() && m_futurePossibleStructure.isTop();
     92    bool isHeapTop() const
     93    {
     94        return (m_type | SpecHeapTop) == m_type && m_currentKnownStructure.isTop() && m_futurePossibleStructure.isTop();
    9595    }
    9696   
     
    105105    }
    106106   
    107     static AbstractValue top()
     107    static AbstractValue heapTop()
    108108    {
    109109        AbstractValue result;
    110         result.makeTop();
     110        result.makeHeapTop();
    111111        return result;
    112112    }
     
    196196    bool validateType(JSValue value) const
    197197    {
    198         if (isTop())
     198        if (isHeapTop())
    199199            return true;
    200200       
     
    212212    bool validate(JSValue value) const
    213213    {
    214         if (isTop())
     214        if (isHeapTop())
    215215            return true;
    216216       
     
    364364    }
    365365   
     366    void makeTop(SpeculatedType top)
     367    {
     368        m_type |= top;
     369        m_arrayModes = ALL_ARRAY_MODES;
     370        m_currentKnownStructure.makeTop();
     371        m_futurePossibleStructure.makeTop();
     372        m_value = JSValue();
     373        checkConsistency();
     374    }
     375   
    366376    void setFuturePossibleStructure(Graph&, Structure* structure);
    367377
Note: See TracChangeset for help on using the changeset viewer.