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/ftl/FTLLowerDFGToLLVM.cpp

    r156019 r156029  
    152152                    type = m_out.int32;
    153153                    break;
    154                 case NodeResultInt52:
    155                     type = m_out.int64;
    156                     break;
    157154                case NodeResultBoolean:
    158155                    type = m_out.boolean;
     
    243240            break;
    244241        case JSConstant:
     242            compileJSConstant();
    245243            break;
    246244        case WeakJSConstant:
     
    464462            m_out.set(lowInt32(m_node->child1()), destination);
    465463            break;
    466         case MachineIntUse:
    467             m_out.set(lowInt52(m_node->child1()), destination);
    468             break;
    469464        case BooleanUse:
    470465            m_out.set(lowBoolean(m_node->child1()), destination);
     
    492487        case NodeResultInt32:
    493488            setInt32(m_out.get(source));
    494             break;
    495         case NodeResultInt52:
    496             setInt52(m_out.get(source));
    497489            break;
    498490        case NodeResultBoolean:
     
    600592        }
    601593           
    602         case FlushedInt52: {
    603             LValue value = lowInt52(m_node->child1());
    604             m_out.store64(value, addressFor(variable->local()));
    605             m_valueSources.operand(variable->local()) = ValueSource(Int52InJSStack);
    606             return;
    607         }
    608            
    609594        case FlushedCell: {
    610595            LValue value = lowCell(m_node->child1());
     
    671656        }
    672657           
    673         case MachineIntUse: {
    674             if (!m_state.forNode(m_node->child1()).couldBeType(SpecInt52)
    675                 && !m_state.forNode(m_node->child2()).couldBeType(SpecInt52)) {
    676                 Int52Kind kind;
    677                 LValue left = lowWhicheverInt52(m_node->child1(), kind);
    678                 LValue right = lowInt52(m_node->child2(), kind);
    679                 setInt52(m_out.add(left, right), kind);
    680                 break;
    681             }
    682            
    683             LValue left = lowInt52(m_node->child1());
    684             LValue right = lowInt52(m_node->child2());
    685             LValue result = m_out.addWithOverflow64(left, right);
    686             speculate(Int52Overflow, noValue(), 0, m_out.extractValue(result, 1));
    687             setInt52(m_out.extractValue(result, 0));
    688             break;
    689         }
    690            
    691658        case NumberUse: {
    692659            setDouble(
     
    716683            speculate(Overflow, noValue(), 0, m_out.extractValue(result, 1));
    717684            setInt32(m_out.extractValue(result, 0));
    718             break;
    719         }
    720            
    721         case MachineIntUse: {
    722             if (!m_state.forNode(m_node->child1()).couldBeType(SpecInt52)
    723                 && !m_state.forNode(m_node->child2()).couldBeType(SpecInt52)) {
    724                 Int52Kind kind;
    725                 LValue left = lowWhicheverInt52(m_node->child1(), kind);
    726                 LValue right = lowInt52(m_node->child2(), kind);
    727                 setInt52(m_out.sub(left, right), kind);
    728                 break;
    729             }
    730            
    731             LValue left = lowInt52(m_node->child1());
    732             LValue right = lowInt52(m_node->child2());
    733             LValue result = m_out.subWithOverflow64(left, right);
    734             speculate(Int52Overflow, noValue(), 0, m_out.extractValue(result, 1));
    735             setInt52(m_out.extractValue(result, 0));
    736685            break;
    737686        }
     
    779728           
    780729            setInt32(result);
    781             break;
    782         }
    783            
    784         case MachineIntUse: {
    785             Int52Kind kind;
    786             LValue left = lowWhicheverInt52(m_node->child1(), kind);
    787             LValue right = lowInt52(m_node->child2(), opposite(kind));
    788            
    789             LValue overflowResult = m_out.mulWithOverflow64(left, right);
    790             speculate(Int52Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1));
    791             LValue result = m_out.extractValue(overflowResult, 0);
    792            
    793             if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags())) {
    794                 LBasicBlock slowCase = FTL_NEW_BLOCK(m_out, ("ArithMul slow case"));
    795                 LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("ArithMul continuation"));
    796                
    797                 m_out.branch(m_out.notZero64(result), continuation, slowCase);
    798                
    799                 LBasicBlock lastNext = m_out.appendTo(slowCase, continuation);
    800                 speculate(NegativeZero, noValue(), 0, m_out.lessThan(left, m_out.int64Zero));
    801                 speculate(NegativeZero, noValue(), 0, m_out.lessThan(right, m_out.int64Zero));
    802                 m_out.jump(continuation);
    803                 m_out.appendTo(continuation, lastNext);
    804             }
    805            
    806             setInt52(result);
    807730            break;
    808731        }
     
    11071030           
    11081031            setInt32(result);
    1109             break;
    1110         }
    1111            
    1112         case MachineIntUse: {
    1113             if (!m_state.forNode(m_node->child1()).couldBeType(SpecInt52)) {
    1114                 Int52Kind kind;
    1115                 LValue value = lowWhicheverInt52(m_node->child1(), kind);
    1116                 LValue result = m_out.neg(value);
    1117                 if (!bytecodeCanIgnoreNegativeZero(m_node->arithNodeFlags()))
    1118                     speculate(NegativeZero, noValue(), 0, m_out.isZero64(result));
    1119                 setInt52(result, kind);
    1120                 break;
    1121             }
    1122            
    1123             LValue value = lowInt52(m_node->child1());
    1124             LValue overflowResult = m_out.subWithOverflow64(m_out.int64Zero, value);
    1125             speculate(Int52Overflow, noValue(), 0, m_out.extractValue(overflowResult, 1));
    1126             LValue result = m_out.extractValue(overflowResult, 0);
    1127             speculate(NegativeZero, noValue(), 0, m_out.isZero64(result));
    1128             setInt52(result);
    11291032            break;
    11301033        }
     
    15711474               
    15721475                FTL_TYPE_CHECK(
    1573                     doubleValue(value), child3, SpecFullRealNumber,
     1476                    doubleValue(value), child3, SpecRealNumber,
    15741477                    m_out.doubleNotEqualOrUnordered(value, value));
    15751478               
     
    18061709    {
    18071710        if (m_node->isBinaryUseKind(Int32Use)
    1808             || m_node->isBinaryUseKind(MachineIntUse)
    18091711            || m_node->isBinaryUseKind(NumberUse)
    18101712            || m_node->isBinaryUseKind(ObjectUse)) {
     
    18301732            setBoolean(
    18311733                m_out.equal(lowInt32(m_node->child1()), lowInt32(m_node->child2())));
    1832             return;
    1833         }
    1834        
    1835         if (m_node->isBinaryUseKind(MachineIntUse)) {
    1836             Int52Kind kind;
    1837             LValue left = lowWhicheverInt52(m_node->child1(), kind);
    1838             LValue right = lowInt52(m_node->child2(), kind);
    1839             setBoolean(m_out.equal(left, right));
    18401734            return;
    18411735        }
     
    18891783        }
    18901784       
    1891         if (m_node->isBinaryUseKind(MachineIntUse)) {
    1892             Int52Kind kind;
    1893             LValue left = lowWhicheverInt52(m_node->child1(), kind);
    1894             LValue right = lowInt52(m_node->child2(), kind);
    1895             setBoolean(m_out.lessThan(left, right));
    1896             return;
    1897         }
    1898        
    18991785        if (m_node->isBinaryUseKind(NumberUse)) {
    19001786            setBoolean(
     
    19111797            setBoolean(
    19121798                m_out.lessThanOrEqual(lowInt32(m_node->child1()), lowInt32(m_node->child2())));
    1913             return;
    1914         }
    1915        
    1916         if (m_node->isBinaryUseKind(MachineIntUse)) {
    1917             Int52Kind kind;
    1918             LValue left = lowWhicheverInt52(m_node->child1(), kind);
    1919             LValue right = lowInt52(m_node->child2(), kind);
    1920             setBoolean(m_out.lessThanOrEqual(left, right));
    19211799            return;
    19221800        }
     
    19401818        }
    19411819       
    1942         if (m_node->isBinaryUseKind(MachineIntUse)) {
    1943             Int52Kind kind;
    1944             LValue left = lowWhicheverInt52(m_node->child1(), kind);
    1945             LValue right = lowInt52(m_node->child2(), kind);
    1946             setBoolean(m_out.greaterThan(left, right));
    1947             return;
    1948         }
    1949        
    19501820        if (m_node->isBinaryUseKind(NumberUse)) {
    19511821            setBoolean(
     
    19641834                m_out.greaterThanOrEqual(
    19651835                    lowInt32(m_node->child1()), lowInt32(m_node->child2())));
    1966             return;
    1967         }
    1968        
    1969         if (m_node->isBinaryUseKind(MachineIntUse)) {
    1970             Int52Kind kind;
    1971             LValue left = lowWhicheverInt52(m_node->child1(), kind);
    1972             LValue right = lowInt52(m_node->child2(), kind);
    1973             setBoolean(m_out.greaterThanOrEqual(left, right));
    19741836            return;
    19751837        }
     
    24912353        ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || (edge.useKind() == Int32Use || edge.useKind() == KnownInt32Use));
    24922354       
    2493         if (edge->hasConstant()) {
    2494             JSValue value = m_graph.valueOfJSConstant(edge.node());
    2495             if (!value.isInt32()) {
    2496                 terminate(Uncountable);
    2497                 return m_out.int32Zero;
    2498             }
    2499             return m_out.constInt32(value.asInt32());
    2500         }
    2501        
    25022355        LoweredNodeValue value = m_int32Values.get(edge.node());
    25032356        if (isValid(value))
    25042357            return value.value();
    2505        
    2506         value = m_strictInt52Values.get(edge.node());
    2507         if (isValid(value))
    2508             return strictInt52ToInt32(edge, value.value());
    2509        
    2510         value = m_int52Values.get(edge.node());
    2511         if (isValid(value))
    2512             return strictInt52ToInt32(edge, int52ToStrictInt52(value.value()));
    25132358       
    25142359        value = m_jsValueValues.get(edge.node());
     
    25272372    }
    25282373   
    2529     enum Int52Kind { StrictInt52, Int52 };
    2530     LValue lowInt52(Edge edge, Int52Kind kind, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    2531     {
    2532         ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == MachineIntUse);
    2533        
    2534         if (edge->hasConstant()) {
    2535             JSValue value = m_graph.valueOfJSConstant(edge.node());
    2536             if (!value.isMachineInt()) {
    2537                 terminate(Uncountable);
    2538                 return m_out.int64Zero;
    2539             }
    2540             int64_t result = value.asMachineInt();
    2541             if (kind == Int52)
    2542                 result <<= JSValue::int52ShiftAmount;
    2543             return m_out.constInt64(result);
    2544         }
    2545        
    2546         LoweredNodeValue value;
    2547        
    2548         switch (kind) {
    2549         case Int52:
    2550             value = m_int52Values.get(edge.node());
    2551             if (isValid(value))
    2552                 return value.value();
    2553            
    2554             value = m_strictInt52Values.get(edge.node());
    2555             if (isValid(value))
    2556                 return strictInt52ToInt52(value.value());
    2557             break;
    2558            
    2559         case StrictInt52:
    2560             value = m_strictInt52Values.get(edge.node());
    2561             if (isValid(value))
    2562                 return value.value();
    2563            
    2564             value = m_int52Values.get(edge.node());
    2565             if (isValid(value))
    2566                 return int52ToStrictInt52(value.value());
    2567             break;
    2568         }
    2569        
    2570         value = m_int32Values.get(edge.node());
    2571         if (isValid(value)) {
    2572             return setInt52WithStrictValue(
    2573                 edge.node(), m_out.signExt(value.value(), m_out.int64), kind);
    2574         }
    2575        
    2576         RELEASE_ASSERT(!(m_state.forNode(edge).m_type & SpecInt52));
    2577        
    2578         value = m_jsValueValues.get(edge.node());
    2579         if (isValid(value)) {
    2580             LValue boxedResult = value.value();
    2581             FTL_TYPE_CHECK(
    2582                 jsValueValue(boxedResult), edge, SpecMachineInt, isNotInt32(boxedResult));
    2583             return setInt52WithStrictValue(
    2584                 edge.node(), m_out.signExt(unboxInt32(boxedResult), m_out.int64), kind);
    2585         }
    2586        
    2587         RELEASE_ASSERT(!(m_state.forNode(edge).m_type & SpecMachineInt));
    2588         terminate(Uncountable);
    2589         return m_out.int64Zero;
    2590     }
    2591    
    2592     LValue lowInt52(Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    2593     {
    2594         return lowInt52(edge, Int52, mode);
    2595     }
    2596    
    2597     LValue lowStrictInt52(Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    2598     {
    2599         return lowInt52(edge, StrictInt52, mode);
    2600     }
    2601    
    2602     bool betterUseStrictInt52(Node* node)
    2603     {
    2604         return !isValid(m_int52Values.get(node));
    2605     }
    2606     bool betterUseStrictInt52(Edge edge)
    2607     {
    2608         return betterUseStrictInt52(edge.node());
    2609     }
    2610     template<typename T>
    2611     Int52Kind bestInt52Kind(T node)
    2612     {
    2613         return betterUseStrictInt52(node) ? StrictInt52 : Int52;
    2614     }
    2615     Int52Kind opposite(Int52Kind kind)
    2616     {
    2617         switch (kind) {
    2618         case Int52:
    2619             return StrictInt52;
    2620         case StrictInt52:
    2621             return Int52;
    2622         }
    2623         RELEASE_ASSERT_NOT_REACHED();
    2624     }
    2625    
    2626     LValue lowWhicheverInt52(Edge edge, Int52Kind& kind, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    2627     {
    2628         kind = bestInt52Kind(edge);
    2629         return lowInt52(edge, kind, mode);
    2630     }
    2631    
    26322374    LValue lowCell(Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    26332375    {
    26342376        ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || isCell(edge.useKind()));
    2635        
    2636         if (edge->op() == JSConstant) {
    2637             JSValue value = m_graph.valueOfJSConstant(edge.node());
    2638             if (!value.isCell()) {
    2639                 terminate(Uncountable);
    2640                 return m_out.intPtrZero;
    2641             }
    2642             return m_out.constIntPtr(value.asCell());
    2643         }
    26442377       
    26452378        LoweredNodeValue value = m_jsValueValues.get(edge.node());
     
    26862419    {
    26872420        ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == BooleanUse);
    2688        
    2689         if (edge->hasConstant()) {
    2690             JSValue value = m_graph.valueOfJSConstant(edge.node());
    2691             if (!value.isBoolean()) {
    2692                 terminate(Uncountable);
    2693                 return m_out.booleanFalse;
    2694             }
    2695             return m_out.constBool(value.asBoolean());
    2696         }
    26972421       
    26982422        LoweredNodeValue value = m_booleanValues.get(edge.node());
     
    27192443        ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || isDouble(edge.useKind()));
    27202444       
    2721         if (edge->hasConstant()) {
    2722             JSValue value = m_graph.valueOfJSConstant(edge.node());
    2723             if (!value.isNumber()) {
    2724                 terminate(Uncountable);
    2725                 return m_out.doubleZero;
    2726             }
    2727             return m_out.constDouble(value.asNumber());
    2728         }
    2729        
    27302445        LoweredNodeValue value = m_doubleValues.get(edge.node());
    27312446        if (isValid(value))
     
    27392454        }
    27402455       
    2741         value = m_strictInt52Values.get(edge.node());
    2742         if (isValid(value))
    2743             return strictInt52ToDouble(edge, value.value());
    2744        
    2745         value = m_int52Values.get(edge.node());
    2746         if (isValid(value))
    2747             return strictInt52ToDouble(edge, int52ToStrictInt52(value.value()));
    2748        
    27492456        value = m_jsValueValues.get(edge.node());
    27502457        if (isValid(value)) {
     
    27662473           
    27672474            FTL_TYPE_CHECK(
    2768                 jsValueValue(boxedResult), edge, SpecFullNumber, isCellOrMisc(boxedResult));
     2475                jsValueValue(boxedResult), edge, SpecNumber, isCellOrMisc(boxedResult));
    27692476           
    27702477            ValueFromBlock unboxedDouble = m_out.anchor(unboxDouble(boxedResult));
     
    27792486        }
    27802487       
    2781         RELEASE_ASSERT(!(m_state.forNode(edge).m_type & SpecFullNumber));
     2488        RELEASE_ASSERT(!(m_state.forNode(edge).m_type & SpecNumber));
    27822489        terminate(Uncountable);
    27832490        return m_out.doubleZero;
     
    27872494    {
    27882495        ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == UntypedUse);
    2789        
    2790         if (edge->hasConstant())
    2791             return m_out.constInt64(JSValue::encode(m_graph.valueOfJSConstant(edge.node())));
    27922496       
    27932497        LoweredNodeValue value = m_jsValueValues.get(edge.node());
     
    28022506        }
    28032507       
    2804         value = m_strictInt52Values.get(edge.node());
    2805         if (isValid(value))
    2806             return strictInt52ToJSValue(value.value());
    2807        
    2808         value = m_int52Values.get(edge.node());
    2809         if (isValid(value))
    2810             return strictInt52ToJSValue(int52ToStrictInt52(value.value()));
    2811        
    28122508        value = m_booleanValues.get(edge.node());
    28132509        if (isValid(value)) {
     
    28372533        setStorage(edge.node(), result);
    28382534        return result;
    2839     }
    2840    
    2841     LValue strictInt52ToInt32(Edge edge, LValue value)
    2842     {
    2843         LValue result = m_out.castToInt32(value);
    2844         FTL_TYPE_CHECK(
    2845             noValue(), edge, SpecInt32,
    2846             m_out.notEqual(m_out.signExt(result, m_out.int64), value));
    2847         setInt32(edge.node(), result);
    2848         return result;
    2849     }
    2850    
    2851     LValue strictInt52ToDouble(Edge edge, LValue value)
    2852     {
    2853         LValue result = m_out.intToDouble(value);
    2854         setDouble(edge.node(), result);
    2855         return result;
    2856     }
    2857    
    2858     LValue strictInt52ToJSValue(LValue value)
    2859     {
    2860         LBasicBlock isInt32 = FTL_NEW_BLOCK(m_out, ("strictInt52ToJSValue isInt32 case"));
    2861         LBasicBlock isDouble = FTL_NEW_BLOCK(m_out, ("strictInt52ToJSValue isDouble case"));
    2862         LBasicBlock continuation = FTL_NEW_BLOCK(m_out, ("strictInt52ToJSValue continuation"));
    2863        
    2864         Vector<ValueFromBlock, 2> results;
    2865            
    2866         LValue int32Value = m_out.castToInt32(value);
    2867         m_out.branch(
    2868             m_out.equal(m_out.signExt(int32Value, m_out.int64), value),
    2869             isInt32, isDouble);
    2870        
    2871         LBasicBlock lastNext = m_out.appendTo(isInt32, isDouble);
    2872        
    2873         results.append(m_out.anchor(boxInt32(int32Value)));
    2874         m_out.jump(continuation);
    2875        
    2876         m_out.appendTo(isDouble, continuation);
    2877        
    2878         results.append(m_out.anchor(boxDouble(m_out.intToDouble(value))));
    2879         m_out.jump(continuation);
    2880        
    2881         m_out.appendTo(continuation, lastNext);
    2882         return m_out.phi(m_out.int64, results);
    2883     }
    2884    
    2885     LValue setInt52WithStrictValue(Node* node, LValue value, Int52Kind kind)
    2886     {
    2887         switch (kind) {
    2888         case StrictInt52:
    2889             setStrictInt52(node, value);
    2890             return value;
    2891            
    2892         case Int52:
    2893             value = strictInt52ToInt52(value);
    2894             setInt52(node, value);
    2895             return value;
    2896         }
    2897        
    2898         RELEASE_ASSERT_NOT_REACHED();
    2899         return 0;
    2900     }
    2901 
    2902     LValue strictInt52ToInt52(LValue value)
    2903     {
    2904         return m_out.shl(value, m_out.constInt64(JSValue::int52ShiftAmount));
    2905     }
    2906    
    2907     LValue int52ToStrictInt52(LValue value)
    2908     {
    2909         return m_out.aShr(value, m_out.constInt64(JSValue::int52ShiftAmount));
    29102535    }
    29112536   
     
    31702795        LValue value = lowDouble(edge);
    31712796        FTL_TYPE_CHECK(
    3172             doubleValue(value), edge, SpecFullRealNumber,
     2797            doubleValue(value), edge, SpecRealNumber,
    31732798            m_out.doubleNotEqualOrUnordered(value, value));
    31742799    }
     
    31782803        lowBoolean(edge);
    31792804    }
    3180    
     2805
    31812806    bool masqueradesAsUndefinedWatchpointIsStillValid()
    31822807    {
     
    33092934                break;
    33102935               
    3311             case FlushedInt52:
    3312                 m_valueSources[i] = ValueSource(Int52InJSStack);
    3313                 break;
    3314                
    33152936            case FlushedDouble:
    33162937                m_valueSources[i] = ValueSource(DoubleInJSStack);
     
    34153036            case Int32InJSStack:
    34163037                exit.m_values[i] = ExitValue::inJSStackAsInt32();
    3417                 break;
    3418             case Int52InJSStack:
    3419                 exit.m_values[i] = ExitValue::inJSStackAsInt52();
    34203038                break;
    34213039            case DoubleInJSStack:
     
    35223140        }
    35233141       
    3524         value = m_int52Values.get(node);
    3525         if (isValid(value)) {
    3526             addExitArgument(exit, arguments, index, ValueFormatInt52, value.value());
    3527             return;
    3528         }
    3529        
    3530         value = m_strictInt52Values.get(node);
    3531         if (isValid(value)) {
    3532             addExitArgument(exit, arguments, index, ValueFormatStrictInt52, value.value());
    3533             return;
    3534         }
    3535        
    35363142        value = m_booleanValues.get(node);
    35373143        if (isValid(value)) {
     
    36373243        m_int32Values.set(node, LoweredNodeValue(value, m_highBlock));
    36383244    }
    3639     void setInt52(Node* node, LValue value)
    3640     {
    3641         m_int52Values.set(node, LoweredNodeValue(value, m_highBlock));
    3642     }
    3643     void setStrictInt52(Node* node, LValue value)
    3644     {
    3645         m_strictInt52Values.set(node, LoweredNodeValue(value, m_highBlock));
    3646     }
    3647     void setInt52(Node* node, LValue value, Int52Kind kind)
    3648     {
    3649         switch (kind) {
    3650         case Int52:
    3651             setInt52(node, value);
    3652             return;
    3653            
    3654         case StrictInt52:
    3655             setStrictInt52(node, value);
    3656             return;
    3657         }
    3658        
    3659         RELEASE_ASSERT_NOT_REACHED();
    3660     }
    36613245    void setJSValue(Node* node, LValue value)
    36623246    {
     
    36793263    {
    36803264        setInt32(m_node, value);
    3681     }
    3682     void setInt52(LValue value)
    3683     {
    3684         setInt52(m_node, value);
    3685     }
    3686     void setStrictInt52(LValue value)
    3687     {
    3688         setStrictInt52(m_node, value);
    3689     }
    3690     void setInt52(LValue value, Int52Kind kind)
    3691     {
    3692         setInt52(m_node, value, kind);
    36933265    }
    36943266    void setJSValue(LValue value)
     
    37713343   
    37723344    HashMap<Node*, LoweredNodeValue> m_int32Values;
    3773     HashMap<Node*, LoweredNodeValue> m_strictInt52Values;
    3774     HashMap<Node*, LoweredNodeValue> m_int52Values;
    37753345    HashMap<Node*, LoweredNodeValue> m_jsValueValues;
    37763346    HashMap<Node*, LoweredNodeValue> m_booleanValues;
Note: See TracChangeset for help on using the changeset viewer.