Ignore:
Timestamp:
May 13, 2015, 4:57:17 PM (10 years ago)
Author:
[email protected]
Message:

Creating a new blank document in icloud pages causes an AI error: Abstract value (CellBytecodedoubleBoolOther, TOP, TOP) for double node has type outside SpecFullDouble.
https://bugs.webkit.org/show_bug.cgi?id=144856

Reviewed by Benjamin Poulain.

First I made fixTypeForRepresentation() print out better diagnostics when it dies.

Then I fixed the bug: Node::convertToIdentityOn(Node*) needs to make sure that when it
converts to a representation-changing node, it needs to use one of the UseKinds that such
a node expects. For example, DoubleRep(UntypedUse:) doesn't make sense; it needs to be
something like DoubleRep(NumberUse:) since it will speculate that the input is a number.

  • dfg/DFGAbstractInterpreter.h:

(JSC::DFG::AbstractInterpreter::setBuiltInConstant):

  • dfg/DFGAbstractInterpreterInlines.h:

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

  • dfg/DFGAbstractValue.cpp:

(JSC::DFG::AbstractValue::fixTypeForRepresentation):

  • dfg/DFGAbstractValue.h:
  • dfg/DFGInPlaceAbstractState.cpp:

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

  • dfg/DFGNode.cpp:

(JSC::DFG::Node::convertToIdentityOn):

  • tests/stress/cloned-arguments-get-by-val-double-array.js: Added.

(foo):

File:
1 edited

Legend:

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

    r183548 r184318  
    137137}
    138138
    139 void AbstractValue::fixTypeForRepresentation(NodeFlags representation)
     139void AbstractValue::fixTypeForRepresentation(Graph& graph, NodeFlags representation, Node* node)
    140140{
    141141    if (representation == NodeResultDouble) {
     
    149149            m_type |= SpecInt52AsDouble;
    150150        }
    151         if (m_type & ~SpecFullDouble) {
    152             startCrashing();
    153             dataLog("Abstract value ", *this, " for double node has type outside SpecFullDouble.\n");
    154             CRASH();
    155         }
     151        if (m_type & ~SpecFullDouble)
     152            DFG_CRASH(graph, node, toCString("Abstract value ", *this, " for double node has type outside SpecFullDouble.\n").data());
    156153    } else if (representation == NodeResultInt52) {
    157154        if (m_type & SpecInt52AsDouble) {
     
    159156            m_type |= SpecInt52;
    160157        }
    161         if (m_type & ~SpecMachineInt) {
    162             startCrashing();
    163             dataLog("Abstract value ", *this, " for int52 node has type outside SpecMachineInt.\n");
    164             CRASH();
    165         }
     158        if (m_type & ~SpecMachineInt)
     159            DFG_CRASH(graph, node, toCString("Abstract value ", *this, " for int52 node has type outside SpecMachineInt.\n").data());
    166160    } else {
    167161        if (m_type & SpecInt52) {
     
    169163            m_type |= SpecInt52AsDouble;
    170164        }
    171         if (m_type & ~SpecBytecodeTop) {
    172             startCrashing();
    173             dataLog("Abstract value ", *this, " for value node has type outside SpecBytecodeTop.\n");
    174             CRASH();
    175         }
    176     }
    177    
    178     checkConsistency();
    179 }
    180 
    181 void AbstractValue::fixTypeForRepresentation(Node* node)
    182 {
    183     fixTypeForRepresentation(node->result());
     165        if (m_type & ~SpecBytecodeTop)
     166            DFG_CRASH(graph, node, toCString("Abstract value ", *this, " for value node has type outside SpecBytecodeTop.\n").data());
     167    }
     168   
     169    checkConsistency();
     170}
     171
     172void AbstractValue::fixTypeForRepresentation(Graph& graph, Node* node)
     173{
     174    fixTypeForRepresentation(graph, node->result(), node);
    184175}
    185176
Note: See TracChangeset for help on using the changeset viewer.