Ignore:
Timestamp:
Sep 18, 2013, 12:25:52 AM (12 years ago)
Author:
[email protected]
Message:

Unreviewed, rolling out r156019 and r156020.
http://trac.webkit.org/changeset/156019
http://trac.webkit.org/changeset/156020
https://bugs.webkit.org/show_bug.cgi?id=121540

Broke tests (Requested by ap on #webkit).

Source/JavaScriptCore:

  • assembler/MacroAssemblerX86_64.h:
  • assembler/X86Assembler.h:
  • bytecode/DataFormat.h:

(JSC::dataFormatToString):

  • bytecode/ExitKind.cpp:

(JSC::exitKindToString):

  • bytecode/ExitKind.h:
  • bytecode/OperandsInlines.h:

(JSC::::dumpInContext):

  • bytecode/SpeculatedType.cpp:

(JSC::dumpSpeculation):
(JSC::speculationToAbbreviatedString):
(JSC::speculationFromValue):

  • bytecode/SpeculatedType.h:

(JSC::isInt32SpeculationForArithmetic):
(JSC::isInt48Speculation):
(JSC::isMachineIntSpeculationForArithmetic):
(JSC::isInt48AsDoubleSpeculation):
(JSC::isRealNumberSpeculation):
(JSC::isNumberSpeculation):
(JSC::isNumberSpeculationExpectingDefined):

  • bytecode/ValueRecovery.h:

(JSC::ValueRecovery::inGPR):
(JSC::ValueRecovery::displacedInJSStack):
(JSC::ValueRecovery::isAlreadyInJSStack):
(JSC::ValueRecovery::gpr):
(JSC::ValueRecovery::virtualRegister):
(JSC::ValueRecovery::dumpInContext):

  • dfg/DFGAbstractInterpreter.h:

(JSC::DFG::AbstractInterpreter::needsTypeCheck):
(JSC::DFG::AbstractInterpreter::filterByType):

  • dfg/DFGAbstractInterpreterInlines.h:

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

  • dfg/DFGAbstractValue.cpp:

(JSC::DFG::AbstractValue::set):
(JSC::DFG::AbstractValue::checkConsistency):

  • dfg/DFGAbstractValue.h:

(JSC::DFG::AbstractValue::validateType):

  • dfg/DFGArrayMode.cpp:

(JSC::DFG::ArrayMode::refine):

  • dfg/DFGAssemblyHelpers.h:

(JSC::DFG::AssemblyHelpers::unboxDouble):

  • dfg/DFGByteCodeParser.cpp:

(JSC::DFG::ByteCodeParser::makeSafe):

  • dfg/DFGCSEPhase.cpp:

(JSC::DFG::CSEPhase::canonicalize):
(JSC::DFG::CSEPhase::pureCSE):
(JSC::DFG::CSEPhase::getByValLoadElimination):
(JSC::DFG::CSEPhase::performNodeCSE):

  • dfg/DFGClobberize.h:

(JSC::DFG::clobberize):

  • dfg/DFGCommon.h:
  • dfg/DFGFixupPhase.cpp:

(JSC::DFG::FixupPhase::run):
(JSC::DFG::FixupPhase::fixupNode):
(JSC::DFG::FixupPhase::fixupSetLocalsInBlock):
(JSC::DFG::FixupPhase::observeUseKindOnNode):
(JSC::DFG::FixupPhase::fixEdge):
(JSC::DFG::FixupPhase::injectInt32ToDoubleNode):
(JSC::DFG::FixupPhase::attemptToMakeIntegerAdd):

  • dfg/DFGFlushFormat.cpp:

(WTF::printInternal):

  • dfg/DFGFlushFormat.h:

(JSC::DFG::resultFor):
(JSC::DFG::useKindFor):

  • dfg/DFGGenerationInfo.h:

(JSC::DFG::GenerationInfo::initInt32):
(JSC::DFG::GenerationInfo::fillInt32):

  • dfg/DFGGraph.cpp:

(JSC::DFG::Graph::dump):

  • dfg/DFGGraph.h:

(JSC::DFG::Graph::addShouldSpeculateMachineInt):
(JSC::DFG::Graph::mulShouldSpeculateMachineInt):
(JSC::DFG::Graph::negateShouldSpeculateMachineInt):

  • dfg/DFGInPlaceAbstractState.cpp:

(JSC::DFG::InPlaceAbstractState::mergeStateAtTail):

  • dfg/DFGJITCode.cpp:

(JSC::DFG::JITCode::reconstruct):

  • dfg/DFGMinifiedNode.h:

(JSC::DFG::belongsInMinifiedGraph):
(JSC::DFG::MinifiedNode::hasChild):

  • dfg/DFGNode.h:

(JSC::DFG::Node::shouldSpeculateNumber):
(JSC::DFG::Node::shouldSpeculateNumberExpectingDefined):
(JSC::DFG::Node::canSpeculateInt48):

  • dfg/DFGNodeFlags.h:

(JSC::DFG::nodeCanSpeculateInt48):

  • dfg/DFGNodeType.h:

(JSC::DFG::forwardRewiringSelectionScore):

  • dfg/DFGOSRExitCompiler.cpp:

(JSC::DFG::shortOperandsDump):

  • dfg/DFGOSRExitCompiler64.cpp:

(JSC::DFG::OSRExitCompiler::compileExit):

  • dfg/DFGPredictionPropagationPhase.cpp:

(JSC::DFG::PredictionPropagationPhase::speculatedDoubleTypeForPrediction):
(JSC::DFG::PredictionPropagationPhase::propagate):
(JSC::DFG::PredictionPropagationPhase::doDoubleVoting):

  • dfg/DFGSafeToExecute.h:

(JSC::DFG::SafeToExecuteEdge::operator()):
(JSC::DFG::safeToExecute):

  • dfg/DFGSilentRegisterSavePlan.h:
  • dfg/DFGSpeculativeJIT.cpp:

(JSC::DFG::SpeculativeJIT::silentSavePlanForGPR):
(JSC::DFG::SpeculativeJIT::silentFill):
(JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
(JSC::DFG::SpeculativeJIT::compileInlineStart):
(JSC::DFG::SpeculativeJIT::compileDoublePutByVal):
(JSC::DFG::SpeculativeJIT::compileValueToInt32):
(JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
(JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
(JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
(JSC::DFG::SpeculativeJIT::compileAdd):
(JSC::DFG::SpeculativeJIT::compileArithSub):
(JSC::DFG::SpeculativeJIT::compileArithNegate):
(JSC::DFG::SpeculativeJIT::compileArithMul):
(JSC::DFG::SpeculativeJIT::compare):
(JSC::DFG::SpeculativeJIT::compileStrictEq):
(JSC::DFG::SpeculativeJIT::speculateNumber):
(JSC::DFG::SpeculativeJIT::speculateRealNumber):
(JSC::DFG::SpeculativeJIT::speculate):

  • dfg/DFGSpeculativeJIT.h:

(JSC::DFG::SpeculativeJIT::canReuse):
(JSC::DFG::SpeculativeJIT::isFilled):
(JSC::DFG::SpeculativeJIT::isFilledDouble):
(JSC::DFG::SpeculativeJIT::use):
(JSC::DFG::SpeculativeJIT::boxDouble):
(JSC::DFG::SpeculativeJIT::isKnownInteger):
(JSC::DFG::SpeculativeJIT::isKnownCell):
(JSC::DFG::SpeculativeJIT::isKnownNotNumber):
(JSC::DFG::SpeculativeJIT::int32Result):
(JSC::DFG::SpeculativeJIT::initConstantInfo):
(JSC::DFG::SpeculativeJIT::isInteger):
(JSC::DFG::SpeculativeJIT::generationInfoFromVirtualRegister):

  • dfg/DFGSpeculativeJIT32_64.cpp:

(JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGSpeculativeJIT64.cpp:

(JSC::DFG::SpeculativeJIT::fillJSValue):
(JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
(JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
(JSC::DFG::SpeculativeJIT::fillSpeculateCell):
(JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
(JSC::DFG::SpeculativeJIT::compile):

  • dfg/DFGUseKind.cpp:

(WTF::printInternal):

  • dfg/DFGUseKind.h:

(JSC::DFG::typeFilterFor):
(JSC::DFG::isNumerical):

  • dfg/DFGValueSource.cpp:

(JSC::DFG::ValueSource::dump):

  • dfg/DFGValueSource.h:

(JSC::DFG::dataFormatToValueSourceKind):
(JSC::DFG::valueSourceKindToDataFormat):
(JSC::DFG::ValueSource::forFlushFormat):
(JSC::DFG::ValueSource::valueRecovery):

  • dfg/DFGVariableAccessData.h:

(JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
(JSC::DFG::VariableAccessData::flushFormat):

  • ftl/FTLCArgumentGetter.cpp:

(JSC::FTL::CArgumentGetter::loadNextAndBox):

  • ftl/FTLCArgumentGetter.h:
  • ftl/FTLCapabilities.cpp:

(JSC::FTL::canCompile):

  • ftl/FTLExitValue.cpp:

(JSC::FTL::ExitValue::dumpInContext):

  • ftl/FTLExitValue.h:
  • ftl/FTLIntrinsicRepository.h:
  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::LowerDFGToLLVM::createPhiVariables):
(JSC::FTL::LowerDFGToLLVM::compileNode):
(JSC::FTL::LowerDFGToLLVM::compileUpsilon):
(JSC::FTL::LowerDFGToLLVM::compilePhi):
(JSC::FTL::LowerDFGToLLVM::compileSetLocal):
(JSC::FTL::LowerDFGToLLVM::compileAdd):
(JSC::FTL::LowerDFGToLLVM::compileArithSub):
(JSC::FTL::LowerDFGToLLVM::compileArithMul):
(JSC::FTL::LowerDFGToLLVM::compileArithNegate):
(JSC::FTL::LowerDFGToLLVM::compilePutByVal):
(JSC::FTL::LowerDFGToLLVM::compileCompareEq):
(JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq):
(JSC::FTL::LowerDFGToLLVM::compileCompareLess):
(JSC::FTL::LowerDFGToLLVM::compileCompareLessEq):
(JSC::FTL::LowerDFGToLLVM::compileCompareGreater):
(JSC::FTL::LowerDFGToLLVM::compileCompareGreaterEq):
(JSC::FTL::LowerDFGToLLVM::lowInt32):
(JSC::FTL::LowerDFGToLLVM::lowCell):
(JSC::FTL::LowerDFGToLLVM::lowBoolean):
(JSC::FTL::LowerDFGToLLVM::lowDouble):
(JSC::FTL::LowerDFGToLLVM::lowJSValue):
(JSC::FTL::LowerDFGToLLVM::speculateRealNumber):
(JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock):
(JSC::FTL::LowerDFGToLLVM::emitOSRExitCall):
(JSC::FTL::LowerDFGToLLVM::addExitArgumentForNode):
(JSC::FTL::LowerDFGToLLVM::setInt32):

  • ftl/FTLOSRExitCompiler.cpp:

(JSC::FTL::compileStub):

  • ftl/FTLOutput.h:

(JSC::FTL::Output::mulWithOverflow32):

  • ftl/FTLValueFormat.cpp:

(WTF::printInternal):

  • ftl/FTLValueFormat.h:
  • ftl/FTLValueSource.cpp:

(JSC::FTL::ValueSource::dump):

  • ftl/FTLValueSource.h:
  • interpreter/Register.h:
  • runtime/Arguments.cpp:

(JSC::Arguments::tearOffForInlineCallFrame):

  • runtime/IndexingType.cpp:

(JSC::leastUpperBoundOfIndexingTypeAndType):

  • runtime/JSCJSValue.h:
  • runtime/JSCJSValueInlines.h:

Source/WTF:

  • wtf/PrintStream.h:

Tools:

  • Scripts/run-jsc-stress-tests:

LayoutTests:

  • js/regress/large-int-captured-expected.txt: Removed.
  • js/regress/large-int-captured.html: Removed.
  • js/regress/large-int-expected.txt: Removed.
  • js/regress/large-int-neg-expected.txt: Removed.
  • js/regress/large-int-neg.html: Removed.
  • js/regress/large-int.html: Removed.
  • js/regress/marsaglia-larger-ints-expected.txt: Removed.
  • js/regress/marsaglia-larger-ints.html: Removed.
  • js/regress/script-tests/large-int-captured.js: Removed.
  • js/regress/script-tests/large-int-neg.js: Removed.
  • js/regress/script-tests/large-int.js: Removed.
  • js/regress/script-tests/marsaglia-larger-ints.js: Removed.
File:
1 edited

Legend:

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

    r156019 r156029  
    6565        }
    6666       
    67         for (BlockIndex blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex)
    68             fixupUntypedSetLocalsInBlock(m_graph.block(blockIndex));
    69        
    7067        return true;
    7168    }
     
    9693        case SetLocal: {
    9794            // This gets handled by fixupSetLocalsInBlock().
    98             return;
     95            break;
    9996        }
    10097           
     
    128125            }
    129126           
    130             if (node->child1()->shouldSpeculateMachineInt()) {
    131                 fixEdge<MachineIntUse>(node->child1());
    132                 break;
    133             }
    134            
    135127            if (node->child1()->shouldSpeculateNumber()) {
    136128                fixEdge<NumberUse>(node->child1());
     
    206198                break;
    207199            }
    208             if (m_graph.negateShouldSpeculateMachineInt(node)) {
    209                 fixEdge<MachineIntUse>(node->child1());
    210                 break;
    211             }
    212200            fixEdge<NumberUse>(node->child1());
    213201            break;
     
    218206                fixEdge<Int32Use>(node->child1());
    219207                fixEdge<Int32Use>(node->child2());
    220                 break;
    221             }
    222             if (m_graph.mulShouldSpeculateMachineInt(node)) {
    223                 fixEdge<MachineIntUse>(node->child1());
    224                 fixEdge<MachineIntUse>(node->child2());
    225208                break;
    226209            }
     
    318301                break;
    319302            }
    320             if (enableInt52()
    321                 && Node::shouldSpeculateMachineInt(node->child1().node(), node->child2().node())) {
    322                 fixEdge<MachineIntUse>(node->child1());
    323                 fixEdge<MachineIntUse>(node->child2());
    324                 break;
    325             }
    326303            if (Node::shouldSpeculateNumber(node->child1().node(), node->child2().node())) {
    327304                fixEdge<NumberUse>(node->child1());
     
    377354                fixEdge<Int32Use>(node->child1());
    378355                fixEdge<Int32Use>(node->child2());
    379                 break;
    380             }
    381             if (enableInt52()
    382                 && Node::shouldSpeculateMachineInt(node->child1().node(), node->child2().node())) {
    383                 fixEdge<MachineIntUse>(node->child1());
    384                 fixEdge<MachineIntUse>(node->child2());
    385356                break;
    386357            }
     
    506477                fixEdge<Int32Use>(child2);
    507478                fixEdge<Int32Use>(child3);
    508                 if (child3->prediction() & SpecInt52)
    509                     fixEdge<MachineIntUse>(child3);
    510                 else
    511                     fixEdge<Int32Use>(child3);
    512479                break;
    513480            case Array::Double:
     
    527494                if (child3->shouldSpeculateInt32())
    528495                    fixEdge<Int32Use>(child3);
    529                 else if (child3->shouldSpeculateMachineInt())
    530                     fixEdge<MachineIntUse>(child3);
    531496                else
    532497                    fixEdge<NumberUse>(child3);
     
    883848        case CheckTierUpAtReturn:
    884849        case CheckTierUpAndOSREnter:
    885         case Int52ToDouble:
    886         case Int52ToValue:
    887850            RELEASE_ASSERT_NOT_REACHED();
    888851            break;
     
    12271190                fixEdge<Int32Use>(node->child1());
    12281191                break;
    1229             case FlushedInt52:
    1230                 fixEdge<MachineIntUse>(node->child1());
    1231                 break;
    12321192            case FlushedCell:
    12331193                fixEdge<CellUse>(node->child1());
     
    12401200                break;
    12411201            }
    1242         }
    1243         m_insertionSet.execute(block);
    1244     }
    1245    
    1246     void fixupUntypedSetLocalsInBlock(BasicBlock* block)
    1247     {
    1248         if (!block)
    1249             return;
    1250         ASSERT(block->isReachable);
    1251         m_block = block;
    1252         for (m_indexInBlock = 0; m_indexInBlock < block->size(); ++m_indexInBlock) {
    1253             Node* node = m_currentNode = block->at(m_indexInBlock);
    1254             if (node->op() != SetLocal)
    1255                 continue;
    1256            
    1257             if (node->child1().useKind() == UntypedUse)
    1258                 fixEdge<UntypedUse>(node->child1());
    12591202        }
    12601203        m_insertionSet.execute(block);
     
    13621305            return;
    13631306       
    1364         // FIXME: The way this uses alwaysUnboxSimplePrimitives() is suspicious.
    1365         // https://bugs.webkit.org/show_bug.cgi?id=121518
    1366        
    13671307        VariableAccessData* variable = node->variableAccessData();
    13681308        switch (useKind) {
     
    13801320            if (alwaysUnboxSimplePrimitives()
    13811321                || isBooleanSpeculation(variable->prediction()))
    1382                 m_profitabilityChanged |= variable->mergeIsProfitableToUnbox(true);
    1383             break;
    1384         case MachineIntUse:
    1385             if (isMachineIntSpeculation(variable->prediction()))
    13861322                m_profitabilityChanged |= variable->mergeIsProfitableToUnbox(true);
    13871323            break;
     
    14121348    void fixEdge(Edge& edge, SpeculationDirection direction = BackwardSpeculation)
    14131349    {
    1414         if (isDouble(useKind)) {
    1415             if (edge->shouldSpeculateInt32ForArithmetic()) {
    1416                 injectInt32ToDoubleNode(edge, useKind, direction);
    1417                 return;
    1418             }
    1419            
    1420             if (enableInt52() && edge->shouldSpeculateMachineInt()) {
    1421                 // Make all double uses of int52 values have an intermediate Int52ToDouble.
    1422                 // This is for the same reason as Int52ToValue (see below) except that
    1423                 // Int8ToDouble will convert int52's that fit in an int32 into a double
    1424                 // rather than trying to create a boxed int32 like Int52ToValue does.
    1425                
    1426                 Node* result = m_insertionSet.insertNode(
    1427                     m_indexInBlock, SpecInt52AsDouble, Int52ToDouble,
    1428                     m_currentNode->codeOrigin, Edge(edge.node(), NumberUse));
    1429                 edge = Edge(result, useKind);
    1430                 return;
    1431             }
    1432         }
    1433        
    1434         if (enableInt52() && useKind != MachineIntUse
    1435             && edge->shouldSpeculateMachineInt() && !edge->shouldSpeculateInt32()) {
    1436             // We make all non-int52 uses of int52 values have an intermediate Int52ToValue
    1437             // node to ensure that we handle this properly:
    1438             //
    1439             // a: SomeInt52
    1440             // b: ArithAdd(@a, ...)
    1441             // c: Call(..., @a)
    1442             // d: ArithAdd(@a, ...)
    1443             //
    1444             // Without an intermediate node and just labeling the uses, we will get:
    1445             //
    1446             // a: SomeInt52
    1447             // b: ArithAdd(Int52:@a, ...)
    1448             // c: Call(..., Untyped:@a)
    1449             // d: ArithAdd(Int52:@a, ...)
    1450             //
    1451             // And now the c->Untyped:@a edge will box the value of @a into a double. This
    1452             // is bad, because now the d->Int52:@a edge will either have to do double-to-int
    1453             // conversions, or will have to OSR exit unconditionally. Alternatively we could
    1454             // have the c->Untyped:@a edge box the value by copying rather than in-place.
    1455             // But these boxings are also costly so this wouldn't be great.
    1456             //
    1457             // The solution we use is to always have non-Int52 uses of predicted Int52's use
    1458             // an intervening Int52ToValue node:
    1459             //
    1460             // a: SomeInt52
    1461             // b: ArithAdd(Int52:@a, ...)
    1462             // x: Int52ToValue(Int52:@a)
    1463             // c: Call(..., Untyped:@x)
    1464             // d: ArithAdd(Int52:@a, ...)
    1465             //
    1466             // Note that even if we had multiple non-int52 uses of @a, the multiple
    1467             // Int52ToValue's would get CSE'd together. So the boxing would only happen once.
    1468             // At the same time, @a would continue to be represented as a native int52.
    1469             //
    1470             // An alternative would have been to insert ToNativeInt52 nodes on int52 uses of
    1471             // int52's. This would have handled the above example but would fall over for:
    1472             //
    1473             // a: SomeInt52
    1474             // b: Call(..., @a)
    1475             // c: ArithAdd(@a, ...)
    1476             //
    1477             // But the solution we use handles the above gracefully.
    1478            
    1479             Node* result = m_insertionSet.insertNode(
    1480                 m_indexInBlock, SpecInt52, Int52ToValue,
    1481                 m_currentNode->codeOrigin, Edge(edge.node(), UntypedUse));
    1482             edge = Edge(result, useKind);
     1350        if (isDouble(useKind) && edge->shouldSpeculateInt32ForArithmetic()) {
     1351            injectInt32ToDoubleNode(edge, useKind, direction);
    14831352            return;
    14841353        }
    14851354       
    14861355        observeUseKindOnNode<useKind>(edge.node());
    1487        
    14881356        edge.setUseKind(useKind);
    14891357    }
     
    15111379    {
    15121380        Node* result = m_insertionSet.insertNode(
    1513             m_indexInBlock, SpecInt52AsDouble, Int32ToDouble,
     1381            m_indexInBlock, SpecInt48, Int32ToDouble,
    15141382            m_currentNode->codeOrigin, Edge(edge.node(), NumberUse));
    15151383        if (direction == ForwardSpeculation)
     
    15671435    {
    15681436        AddSpeculationMode mode = m_graph.addSpeculationMode(node);
    1569         if (mode != DontSpeculateInt32) {
    1570             truncateConstantsIfNecessary(node, mode);
    1571             fixEdge<Int32Use>(node->child1());
    1572             fixEdge<Int32Use>(node->child2());
    1573             return true;
    1574         }
    1575        
    1576         if (m_graph.addShouldSpeculateMachineInt(node)) {
    1577             fixEdge<MachineIntUse>(node->child1());
    1578             fixEdge<MachineIntUse>(node->child2());
    1579             return true;
    1580         }
    1581        
    1582         return false;
     1437        if (mode == DontSpeculateInt32)
     1438            return false;
     1439       
     1440        truncateConstantsIfNecessary(node, mode);
     1441        fixEdge<Int32Use>(node->child1());
     1442        fixEdge<Int32Use>(node->child2());
     1443        return true;
    15831444    }
    15841445   
Note: See TracChangeset for help on using the changeset viewer.