⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 156029 in webkit


Ignore:
Timestamp:
Sep 18, 2013, 12:25:52 AM (13 years ago)
Author:
commit-queue@webkit.org
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.
Location:
trunk
Files:
12 deleted
69 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r156022 r156029  
     12013-09-18  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r156019 and r156020.
     4        http://trac.webkit.org/changeset/156019
     5        http://trac.webkit.org/changeset/156020
     6        https://bugs.webkit.org/show_bug.cgi?id=121540
     7
     8        Broke tests (Requested by ap on #webkit).
     9
     10        * js/regress/large-int-captured-expected.txt: Removed.
     11        * js/regress/large-int-captured.html: Removed.
     12        * js/regress/large-int-expected.txt: Removed.
     13        * js/regress/large-int-neg-expected.txt: Removed.
     14        * js/regress/large-int-neg.html: Removed.
     15        * js/regress/large-int.html: Removed.
     16        * js/regress/marsaglia-larger-ints-expected.txt: Removed.
     17        * js/regress/marsaglia-larger-ints.html: Removed.
     18        * js/regress/script-tests/large-int-captured.js: Removed.
     19        * js/regress/script-tests/large-int-neg.js: Removed.
     20        * js/regress/script-tests/large-int.js: Removed.
     21        * js/regress/script-tests/marsaglia-larger-ints.js: Removed.
     22
    1232013-09-17  Zoltan Horvath  <zoltan@webkit.org>
    224
  • trunk/Source/JavaScriptCore/ChangeLog

    r156020 r156029  
     12013-09-18  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r156019 and r156020.
     4        http://trac.webkit.org/changeset/156019
     5        http://trac.webkit.org/changeset/156020
     6        https://bugs.webkit.org/show_bug.cgi?id=121540
     7
     8        Broke tests (Requested by ap on #webkit).
     9
     10        * assembler/MacroAssemblerX86_64.h:
     11        * assembler/X86Assembler.h:
     12        * bytecode/DataFormat.h:
     13        (JSC::dataFormatToString):
     14        * bytecode/ExitKind.cpp:
     15        (JSC::exitKindToString):
     16        * bytecode/ExitKind.h:
     17        * bytecode/OperandsInlines.h:
     18        (JSC::::dumpInContext):
     19        * bytecode/SpeculatedType.cpp:
     20        (JSC::dumpSpeculation):
     21        (JSC::speculationToAbbreviatedString):
     22        (JSC::speculationFromValue):
     23        * bytecode/SpeculatedType.h:
     24        (JSC::isInt32SpeculationForArithmetic):
     25        (JSC::isInt48Speculation):
     26        (JSC::isMachineIntSpeculationForArithmetic):
     27        (JSC::isInt48AsDoubleSpeculation):
     28        (JSC::isRealNumberSpeculation):
     29        (JSC::isNumberSpeculation):
     30        (JSC::isNumberSpeculationExpectingDefined):
     31        * bytecode/ValueRecovery.h:
     32        (JSC::ValueRecovery::inGPR):
     33        (JSC::ValueRecovery::displacedInJSStack):
     34        (JSC::ValueRecovery::isAlreadyInJSStack):
     35        (JSC::ValueRecovery::gpr):
     36        (JSC::ValueRecovery::virtualRegister):
     37        (JSC::ValueRecovery::dumpInContext):
     38        * dfg/DFGAbstractInterpreter.h:
     39        (JSC::DFG::AbstractInterpreter::needsTypeCheck):
     40        (JSC::DFG::AbstractInterpreter::filterByType):
     41        * dfg/DFGAbstractInterpreterInlines.h:
     42        (JSC::DFG::::executeEffects):
     43        * dfg/DFGAbstractValue.cpp:
     44        (JSC::DFG::AbstractValue::set):
     45        (JSC::DFG::AbstractValue::checkConsistency):
     46        * dfg/DFGAbstractValue.h:
     47        (JSC::DFG::AbstractValue::validateType):
     48        * dfg/DFGArrayMode.cpp:
     49        (JSC::DFG::ArrayMode::refine):
     50        * dfg/DFGAssemblyHelpers.h:
     51        (JSC::DFG::AssemblyHelpers::unboxDouble):
     52        * dfg/DFGByteCodeParser.cpp:
     53        (JSC::DFG::ByteCodeParser::makeSafe):
     54        * dfg/DFGCSEPhase.cpp:
     55        (JSC::DFG::CSEPhase::canonicalize):
     56        (JSC::DFG::CSEPhase::pureCSE):
     57        (JSC::DFG::CSEPhase::getByValLoadElimination):
     58        (JSC::DFG::CSEPhase::performNodeCSE):
     59        * dfg/DFGClobberize.h:
     60        (JSC::DFG::clobberize):
     61        * dfg/DFGCommon.h:
     62        * dfg/DFGFixupPhase.cpp:
     63        (JSC::DFG::FixupPhase::run):
     64        (JSC::DFG::FixupPhase::fixupNode):
     65        (JSC::DFG::FixupPhase::fixupSetLocalsInBlock):
     66        (JSC::DFG::FixupPhase::observeUseKindOnNode):
     67        (JSC::DFG::FixupPhase::fixEdge):
     68        (JSC::DFG::FixupPhase::injectInt32ToDoubleNode):
     69        (JSC::DFG::FixupPhase::attemptToMakeIntegerAdd):
     70        * dfg/DFGFlushFormat.cpp:
     71        (WTF::printInternal):
     72        * dfg/DFGFlushFormat.h:
     73        (JSC::DFG::resultFor):
     74        (JSC::DFG::useKindFor):
     75        * dfg/DFGGenerationInfo.h:
     76        (JSC::DFG::GenerationInfo::initInt32):
     77        (JSC::DFG::GenerationInfo::fillInt32):
     78        * dfg/DFGGraph.cpp:
     79        (JSC::DFG::Graph::dump):
     80        * dfg/DFGGraph.h:
     81        (JSC::DFG::Graph::addShouldSpeculateMachineInt):
     82        (JSC::DFG::Graph::mulShouldSpeculateMachineInt):
     83        (JSC::DFG::Graph::negateShouldSpeculateMachineInt):
     84        * dfg/DFGInPlaceAbstractState.cpp:
     85        (JSC::DFG::InPlaceAbstractState::mergeStateAtTail):
     86        * dfg/DFGJITCode.cpp:
     87        (JSC::DFG::JITCode::reconstruct):
     88        * dfg/DFGMinifiedNode.h:
     89        (JSC::DFG::belongsInMinifiedGraph):
     90        (JSC::DFG::MinifiedNode::hasChild):
     91        * dfg/DFGNode.h:
     92        (JSC::DFG::Node::shouldSpeculateNumber):
     93        (JSC::DFG::Node::shouldSpeculateNumberExpectingDefined):
     94        (JSC::DFG::Node::canSpeculateInt48):
     95        * dfg/DFGNodeFlags.h:
     96        (JSC::DFG::nodeCanSpeculateInt48):
     97        * dfg/DFGNodeType.h:
     98        (JSC::DFG::forwardRewiringSelectionScore):
     99        * dfg/DFGOSRExitCompiler.cpp:
     100        (JSC::DFG::shortOperandsDump):
     101        * dfg/DFGOSRExitCompiler64.cpp:
     102        (JSC::DFG::OSRExitCompiler::compileExit):
     103        * dfg/DFGPredictionPropagationPhase.cpp:
     104        (JSC::DFG::PredictionPropagationPhase::speculatedDoubleTypeForPrediction):
     105        (JSC::DFG::PredictionPropagationPhase::propagate):
     106        (JSC::DFG::PredictionPropagationPhase::doDoubleVoting):
     107        * dfg/DFGSafeToExecute.h:
     108        (JSC::DFG::SafeToExecuteEdge::operator()):
     109        (JSC::DFG::safeToExecute):
     110        * dfg/DFGSilentRegisterSavePlan.h:
     111        * dfg/DFGSpeculativeJIT.cpp:
     112        (JSC::DFG::SpeculativeJIT::silentSavePlanForGPR):
     113        (JSC::DFG::SpeculativeJIT::silentFill):
     114        (JSC::DFG::SpeculativeJIT::compilePeepHoleBranch):
     115        (JSC::DFG::SpeculativeJIT::compileInlineStart):
     116        (JSC::DFG::SpeculativeJIT::compileDoublePutByVal):
     117        (JSC::DFG::SpeculativeJIT::compileValueToInt32):
     118        (JSC::DFG::SpeculativeJIT::compileInt32ToDouble):
     119        (JSC::DFG::SpeculativeJIT::compileGetByValOnIntTypedArray):
     120        (JSC::DFG::SpeculativeJIT::compilePutByValForIntTypedArray):
     121        (JSC::DFG::SpeculativeJIT::compileAdd):
     122        (JSC::DFG::SpeculativeJIT::compileArithSub):
     123        (JSC::DFG::SpeculativeJIT::compileArithNegate):
     124        (JSC::DFG::SpeculativeJIT::compileArithMul):
     125        (JSC::DFG::SpeculativeJIT::compare):
     126        (JSC::DFG::SpeculativeJIT::compileStrictEq):
     127        (JSC::DFG::SpeculativeJIT::speculateNumber):
     128        (JSC::DFG::SpeculativeJIT::speculateRealNumber):
     129        (JSC::DFG::SpeculativeJIT::speculate):
     130        * dfg/DFGSpeculativeJIT.h:
     131        (JSC::DFG::SpeculativeJIT::canReuse):
     132        (JSC::DFG::SpeculativeJIT::isFilled):
     133        (JSC::DFG::SpeculativeJIT::isFilledDouble):
     134        (JSC::DFG::SpeculativeJIT::use):
     135        (JSC::DFG::SpeculativeJIT::boxDouble):
     136        (JSC::DFG::SpeculativeJIT::isKnownInteger):
     137        (JSC::DFG::SpeculativeJIT::isKnownCell):
     138        (JSC::DFG::SpeculativeJIT::isKnownNotNumber):
     139        (JSC::DFG::SpeculativeJIT::int32Result):
     140        (JSC::DFG::SpeculativeJIT::initConstantInfo):
     141        (JSC::DFG::SpeculativeJIT::isInteger):
     142        (JSC::DFG::SpeculativeJIT::generationInfoFromVirtualRegister):
     143        * dfg/DFGSpeculativeJIT32_64.cpp:
     144        (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
     145        (JSC::DFG::SpeculativeJIT::compile):
     146        * dfg/DFGSpeculativeJIT64.cpp:
     147        (JSC::DFG::SpeculativeJIT::fillJSValue):
     148        (JSC::DFG::SpeculativeJIT::fillSpeculateInt32Internal):
     149        (JSC::DFG::SpeculativeJIT::fillSpeculateDouble):
     150        (JSC::DFG::SpeculativeJIT::fillSpeculateCell):
     151        (JSC::DFG::SpeculativeJIT::fillSpeculateBoolean):
     152        (JSC::DFG::SpeculativeJIT::compile):
     153        * dfg/DFGUseKind.cpp:
     154        (WTF::printInternal):
     155        * dfg/DFGUseKind.h:
     156        (JSC::DFG::typeFilterFor):
     157        (JSC::DFG::isNumerical):
     158        * dfg/DFGValueSource.cpp:
     159        (JSC::DFG::ValueSource::dump):
     160        * dfg/DFGValueSource.h:
     161        (JSC::DFG::dataFormatToValueSourceKind):
     162        (JSC::DFG::valueSourceKindToDataFormat):
     163        (JSC::DFG::ValueSource::forFlushFormat):
     164        (JSC::DFG::ValueSource::valueRecovery):
     165        * dfg/DFGVariableAccessData.h:
     166        (JSC::DFG::VariableAccessData::shouldUseDoubleFormatAccordingToVote):
     167        (JSC::DFG::VariableAccessData::flushFormat):
     168        * ftl/FTLCArgumentGetter.cpp:
     169        (JSC::FTL::CArgumentGetter::loadNextAndBox):
     170        * ftl/FTLCArgumentGetter.h:
     171        * ftl/FTLCapabilities.cpp:
     172        (JSC::FTL::canCompile):
     173        * ftl/FTLExitValue.cpp:
     174        (JSC::FTL::ExitValue::dumpInContext):
     175        * ftl/FTLExitValue.h:
     176        * ftl/FTLIntrinsicRepository.h:
     177        * ftl/FTLLowerDFGToLLVM.cpp:
     178        (JSC::FTL::LowerDFGToLLVM::createPhiVariables):
     179        (JSC::FTL::LowerDFGToLLVM::compileNode):
     180        (JSC::FTL::LowerDFGToLLVM::compileUpsilon):
     181        (JSC::FTL::LowerDFGToLLVM::compilePhi):
     182        (JSC::FTL::LowerDFGToLLVM::compileSetLocal):
     183        (JSC::FTL::LowerDFGToLLVM::compileAdd):
     184        (JSC::FTL::LowerDFGToLLVM::compileArithSub):
     185        (JSC::FTL::LowerDFGToLLVM::compileArithMul):
     186        (JSC::FTL::LowerDFGToLLVM::compileArithNegate):
     187        (JSC::FTL::LowerDFGToLLVM::compilePutByVal):
     188        (JSC::FTL::LowerDFGToLLVM::compileCompareEq):
     189        (JSC::FTL::LowerDFGToLLVM::compileCompareStrictEq):
     190        (JSC::FTL::LowerDFGToLLVM::compileCompareLess):
     191        (JSC::FTL::LowerDFGToLLVM::compileCompareLessEq):
     192        (JSC::FTL::LowerDFGToLLVM::compileCompareGreater):
     193        (JSC::FTL::LowerDFGToLLVM::compileCompareGreaterEq):
     194        (JSC::FTL::LowerDFGToLLVM::lowInt32):
     195        (JSC::FTL::LowerDFGToLLVM::lowCell):
     196        (JSC::FTL::LowerDFGToLLVM::lowBoolean):
     197        (JSC::FTL::LowerDFGToLLVM::lowDouble):
     198        (JSC::FTL::LowerDFGToLLVM::lowJSValue):
     199        (JSC::FTL::LowerDFGToLLVM::speculateRealNumber):
     200        (JSC::FTL::LowerDFGToLLVM::initializeOSRExitStateForBlock):
     201        (JSC::FTL::LowerDFGToLLVM::emitOSRExitCall):
     202        (JSC::FTL::LowerDFGToLLVM::addExitArgumentForNode):
     203        (JSC::FTL::LowerDFGToLLVM::setInt32):
     204        * ftl/FTLOSRExitCompiler.cpp:
     205        (JSC::FTL::compileStub):
     206        * ftl/FTLOutput.h:
     207        (JSC::FTL::Output::mulWithOverflow32):
     208        * ftl/FTLValueFormat.cpp:
     209        (WTF::printInternal):
     210        * ftl/FTLValueFormat.h:
     211        * ftl/FTLValueSource.cpp:
     212        (JSC::FTL::ValueSource::dump):
     213        * ftl/FTLValueSource.h:
     214        * interpreter/Register.h:
     215        * runtime/Arguments.cpp:
     216        (JSC::Arguments::tearOffForInlineCallFrame):
     217        * runtime/IndexingType.cpp:
     218        (JSC::leastUpperBoundOfIndexingTypeAndType):
     219        * runtime/JSCJSValue.h:
     220        * runtime/JSCJSValueInlines.h:
     221
    12222013-09-17  Filip Pizlo  <fpizlo@apple.com>
    2223
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h

    r156019 r156029  
    231231    }
    232232   
    233     void rshift64(TrustedImm32 imm, RegisterID dest)
    234     {
    235         m_assembler.sarq_i8r(imm.m_value, dest);
    236     }
    237    
    238     void mul64(RegisterID src, RegisterID dest)
    239     {
    240         m_assembler.imulq_rr(src, dest);
    241     }
    242    
    243233    void neg64(RegisterID dest)
    244234    {
    … …  
    541531    }
    542532
    543     Jump branchMul64(ResultCondition cond, RegisterID src, RegisterID dest)
    544     {
    545         mul64(src, dest);
    546         if (cond != Overflow)
    547             m_assembler.testq_rr(dest, dest);
    548         return Jump(m_assembler.jCC(x86Condition(cond)));
    549     }
    550 
    551533    Jump branchSub64(ResultCondition cond, TrustedImm32 imm, RegisterID dest)
    552534    {
    … …  
    565547        move(src1, dest);
    566548        return branchSub64(cond, src2, dest);
    567     }
    568 
    569     Jump branchNeg64(ResultCondition cond, RegisterID srcDest)
    570     {
    571         neg64(srcDest);
    572         return Jump(m_assembler.jCC(x86Condition(cond)));
    573549    }
    574550
    … …  
    618594        MacroAssemblerX86Common::move(TrustedImmPtr(address.m_ptr), scratchRegister);
    619595        return MacroAssemblerX86Common::branchTest8(cond, Address(scratchRegister), mask);
    620     }
    621 
    622     void convertInt64ToDouble(RegisterID src, FPRegisterID dest)
    623     {
    624         m_assembler.cvtsi2sdq_rr(src, dest);
    625596    }
    626597
  • trunk/Source/JavaScriptCore/assembler/X86Assembler.h

    r156019 r156029  
    830830        }
    831831    }
    832 #endif // CPU(X86_64)
     832#endif
    833833
    834834    void imull_rr(RegisterID src, RegisterID dst)
    … …  
    836836        m_formatter.twoByteOp(OP2_IMUL_GvEv, dst, src);
    837837    }
    838 
    839 #if CPU(X86_64)
    840     void imulq_rr(RegisterID src, RegisterID dst)
    841     {
    842         m_formatter.twoByteOp64(OP2_IMUL_GvEv, dst, src);
    843     }
    844 #endif // CPU(X86_64)
    845838
    846839    void imull_mr(int offset, RegisterID base, RegisterID dst)
    … …  
    16181611        m_formatter.twoByteOp(OP2_CVTSI2SD_VsdEd, (RegisterID)dst, src);
    16191612    }
    1620 
    1621 #if CPU(X86_64)
    1622     void cvtsi2sdq_rr(RegisterID src, XMMRegisterID dst)
    1623     {
    1624         m_formatter.prefix(PRE_SSE_F2);
    1625         m_formatter.twoByteOp64(OP2_CVTSI2SD_VsdEd, (RegisterID)dst, src);
    1626     }
    1627 #endif
    16281613
    16291614    void cvtsi2sd_mr(int offset, RegisterID base, XMMRegisterID dst)
  • trunk/Source/JavaScriptCore/bytecode/DataFormat.h

    r156019 r156029  
    4040    DataFormatNone = 0,
    4141    DataFormatInt32 = 1,
    42     DataFormatInt52 = 2, // Int52's are left-shifted by 16 by default.
    43     DataFormatStrictInt52 = 3, // "Strict" Int52 means it's not shifted.
    44     DataFormatDouble = 4,
    45     DataFormatBoolean = 5,
    46     DataFormatCell = 6,
    47     DataFormatStorage = 7,
     42    DataFormatDouble = 2,
     43    DataFormatBoolean = 3,
     44    DataFormatCell = 4,
     45    DataFormatStorage = 5,
    4846    DataFormatJS = 8,
    4947    DataFormatJSInt32 = DataFormatJS | DataFormatInt32,
    … …  
    6765    case DataFormatInt32:
    6866        return "Int32";
    69     case DataFormatInt52:
    70         return "Int52";
    71     case DataFormatStrictInt52:
    72         return "StrictInt52";
    7367    case DataFormatDouble:
    7468        return "Double";
  • trunk/Source/JavaScriptCore/bytecode/ExitKind.cpp

    r156019 r156029  
    5353    case NegativeZero:
    5454        return "NegativeZero";
    55     case Int52Overflow:
    56         return "Int52Overflow";
     55    case Int48Overflow:
     56        return "Int48Overflow";
    5757    case StoreToHole:
    5858        return "StoreToHole";
  • trunk/Source/JavaScriptCore/bytecode/ExitKind.h

    r156019 r156029  
    3939    Overflow, // We exited because of overflow.
    4040    NegativeZero, // We exited because we encountered negative zero.
    41     Int52Overflow, // We exited because of an Int52 overflow.
     41    Int48Overflow, // We exited because of an Int48 overflow.
    4242    StoreToHole, // We had a store to a hole.
    4343    LoadFromHole, // We had a load from a hole.
  • trunk/Source/JavaScriptCore/bytecode/OperandsInlines.h

    r156019 r156029  
    4444        if (Traits::isEmptyForDump(local(localIndex)))
    4545            continue;
    46         out.print(comma, "loc", localIndex, ":", inContext(local(localIndex), context));
     46        out.print(comma, "r", localIndex, ":", inContext(local(localIndex), context));
    4747    }
    4848}
  • trunk/Source/JavaScriptCore/bytecode/SpeculatedType.cpp

    r156019 r156029  
    155155   
    156156    if (value & SpecInt32)
    157         myOut.print("Int32");
     157        myOut.print("Int");
    158158    else
    159159        isTop = false;
    160160   
    161     if (value & SpecInt52)
    162         myOut.print("Int52");
    163        
    164161    if ((value & SpecDouble) == SpecDouble)
    165162        myOut.print("Double");
    166163    else {
    167         if (value & SpecInt52AsDouble)
    168             myOut.print("Int52asdouble");
     164        if (value & SpecInt48AsDouble)
     165            myOut.print("Int48asdouble");
     166        else
     167            isTop = false;
     168       
     169        if (value & SpecInt48)
     170            myOut.print("Int48");
    169171        else
    170172            isTop = false;
    … …  
    242244    if (isInt32Speculation(prediction))
    243245        return "<Int32>";
    244     if (isInt52AsDoubleSpeculation(prediction))
    245         return "<Int52AsDouble>";
    246     if (isInt52Speculation(prediction))
    247         return "<Int52>";
    248     if (isMachineIntSpeculation(prediction))
    249         return "<MachineInt>";
     246    if (isInt48AsDoubleSpeculation(prediction))
     247        return "<Int48AsDouble>";
     248    if (isInt48Speculation(prediction))
     249        return "<Int48>";
    250250    if (isDoubleSpeculation(prediction))
    251251        return "<Double>";
    252     if (isFullNumberSpeculation(prediction))
     252    if (isNumberSpeculation(prediction))
    253253        return "<Number>";
    254254    if (isBooleanSpeculation(prediction))
    … …  
    346346    if (value.isDouble()) {
    347347        double number = value.asNumber();
    348         if (number != number)
    349             return SpecDoubleNaN;
    350         if (value.isMachineInt())
    351             return SpecInt52AsDouble;
    352         return SpecNonIntAsDouble;
     348        if (number == number) {
     349            int64_t asInt64 = static_cast<int64_t>(number);
     350            if (asInt64 == number && (asInt64 || !std::signbit(number))
     351                && asInt64 < (static_cast<int64_t>(1) << 47)
     352                && asInt64 >= -(static_cast<int64_t>(1) << 47)) {
     353                return SpecInt48AsDouble;
     354            }
     355            return SpecNonIntAsDouble;
     356        }
     357        return SpecDoubleNaN;
    353358    }
    354359    if (value.isCell())
  • trunk/Source/JavaScriptCore/bytecode/SpeculatedType.h

    r156019 r156029  
    3939
    4040typedef uint32_t SpeculatedType;
    41 static const SpeculatedType SpecNone               = 0x00000000; // We don't know anything yet.
    42 static const SpeculatedType SpecFinalObject        = 0x00000001; // It's definitely a JSFinalObject.
    43 static const SpeculatedType SpecArray              = 0x00000002; // It's definitely a JSArray.
    44 static const SpeculatedType SpecFunction           = 0x00000008; // It's definitely a JSFunction or one of its subclasses.
    45 static const SpeculatedType SpecInt8Array          = 0x00000010; // It's definitely an Int8Array or one of its subclasses.
    46 static const SpeculatedType SpecInt16Array         = 0x00000020; // It's definitely an Int16Array or one of its subclasses.
    47 static const SpeculatedType SpecInt32Array         = 0x00000040; // It's definitely an Int32Array or one of its subclasses.
    48 static const SpeculatedType SpecUint8Array         = 0x00000080; // It's definitely an Uint8Array or one of its subclasses.
    49 static const SpeculatedType SpecUint8ClampedArray  = 0x00000100; // It's definitely an Uint8ClampedArray or one of its subclasses.
    50 static const SpeculatedType SpecUint16Array        = 0x00000200; // It's definitely an Uint16Array or one of its subclasses.
    51 static const SpeculatedType SpecUint32Array        = 0x00000400; // It's definitely an Uint32Array or one of its subclasses.
    52 static const SpeculatedType SpecFloat32Array       = 0x00000800; // It's definitely an Uint16Array or one of its subclasses.
    53 static const SpeculatedType SpecFloat64Array       = 0x00001000; // It's definitely an Uint16Array or one of its subclasses.
    54 static const SpeculatedType SpecTypedArrayView     = SpecInt8Array | SpecInt16Array | SpecInt32Array | SpecUint8Array | SpecUint8ClampedArray | SpecUint16Array | SpecUint32Array | SpecFloat32Array | SpecFloat64Array;
    55 static const SpeculatedType SpecArguments          = 0x00002000; // It's definitely an Arguments object.
    56 static const SpeculatedType SpecStringObject       = 0x00004000; // It's definitely a StringObject.
    57 static const SpeculatedType SpecObjectOther        = 0x00008000; // It's definitely an object but not JSFinalObject, JSArray, or JSFunction.
    58 static const SpeculatedType SpecObject             = 0x0000ffff; // Bitmask used for testing for any kind of object prediction.
    59 static const SpeculatedType SpecStringIdent        = 0x00010000; // It's definitely a JSString, and it's an identifier.
    60 static const SpeculatedType SpecStringVar          = 0x00020000; // It's definitely a JSString, and it's not an identifier.
    61 static const SpeculatedType SpecString             = 0x00030000; // It's definitely a JSString.
    62 static const SpeculatedType SpecCellOther          = 0x00040000; // It's definitely a JSCell but not a subclass of JSObject and definitely not a JSString.
    63 static const SpeculatedType SpecCell               = 0x0007ffff; // It's definitely a JSCell.
    64 static const SpeculatedType SpecInt32              = 0x00800000; // It's definitely an Int32.
    65 static const SpeculatedType SpecInt52              = 0x01000000; // It's definitely an Int52 and we intend it to unbox it.
    66 static const SpeculatedType SpecMachineInt         = 0x01800000; // It's something that we can do machine int arithmetic on.
    67 static const SpeculatedType SpecInt52AsDouble      = 0x02000000; // It's definitely an Int52 and it's inside a double.
    68 static const SpeculatedType SpecInteger            = 0x03800000; // It's definitely some kind of integer.
    69 static const SpeculatedType SpecNonIntAsDouble     = 0x04000000; // It's definitely not an Int52 but it's a real number and it's a double.
    70 static const SpeculatedType SpecDoubleReal         = 0x06000000; // It's definitely a non-NaN double.
    71 static const SpeculatedType SpecDoubleNaN          = 0x08000000; // It's definitely a NaN.
    72 static const SpeculatedType SpecDouble             = 0x0e000000; // It's either a non-NaN or a NaN double.
    73 static const SpeculatedType SpecBytecodeRealNumber = 0x06800000; // It's either an Int32 or a DoubleReal.
    74 static const SpeculatedType SpecFullRealNumber     = 0x07800000; // It's either an Int32 or a DoubleReal, or a Int52.
    75 static const SpeculatedType SpecBytecodeNumber     = 0x0e800000; // It's either an Int32 or a Double.
    76 static const SpeculatedType SpecFullNumber         = 0x0f800000; // It's either an Int32, Int52, or a Double.
    77 static const SpeculatedType SpecBoolean            = 0x10000000; // It's definitely a Boolean.
    78 static const SpeculatedType SpecOther              = 0x20000000; // It's definitely none of the above.
    79 static const SpeculatedType SpecHeapTop            = 0x3effffff; // It can be any of the above, except for SpecInt52.
    80 static const SpeculatedType SpecEmpty              = 0x40000000; // It's definitely an empty value marker.
    81 static const SpeculatedType SpecBytecodeTop        = 0x7effffff; // It can be any of the above, except for SpecInt52.
    82 static const SpeculatedType SpecFullTop            = 0x7fffffff; // It can be any of the above plus anything the DFG chooses.
     41static const SpeculatedType SpecNone              = 0x00000000; // We don't know anything yet.
     42static const SpeculatedType SpecFinalObject       = 0x00000001; // It's definitely a JSFinalObject.
     43static const SpeculatedType SpecArray             = 0x00000002; // It's definitely a JSArray.
     44static const SpeculatedType SpecFunction          = 0x00000008; // It's definitely a JSFunction or one of its subclasses.
     45static const SpeculatedType SpecInt8Array         = 0x00000010; // It's definitely an Int8Array or one of its subclasses.
     46static const SpeculatedType SpecInt16Array        = 0x00000020; // It's definitely an Int16Array or one of its subclasses.
     47static const SpeculatedType SpecInt32Array        = 0x00000040; // It's definitely an Int32Array or one of its subclasses.
     48static const SpeculatedType SpecUint8Array        = 0x00000080; // It's definitely an Uint8Array or one of its subclasses.
     49static const SpeculatedType SpecUint8ClampedArray = 0x00000100; // It's definitely an Uint8ClampedArray or one of its subclasses.
     50static const SpeculatedType SpecUint16Array       = 0x00000200; // It's definitely an Uint16Array or one of its subclasses.
     51static const SpeculatedType SpecUint32Array       = 0x00000400; // It's definitely an Uint32Array or one of its subclasses.
     52static const SpeculatedType SpecFloat32Array      = 0x00000800; // It's definitely an Uint16Array or one of its subclasses.
     53static const SpeculatedType SpecFloat64Array      = 0x00001000; // It's definitely an Uint16Array or one of its subclasses.
     54static const SpeculatedType SpecTypedArrayView    = SpecInt8Array | SpecInt16Array | SpecInt32Array | SpecUint8Array | SpecUint8ClampedArray | SpecUint16Array | SpecUint32Array | SpecFloat32Array | SpecFloat64Array;
     55static const SpeculatedType SpecArguments         = 0x00002000; // It's definitely an Arguments object.
     56static const SpeculatedType SpecStringObject      = 0x00004000; // It's definitely a StringObject.
     57static const SpeculatedType SpecObjectOther       = 0x00008000; // It's definitely an object but not JSFinalObject, JSArray, or JSFunction.
     58static const SpeculatedType SpecObject            = 0x0000ffff; // Bitmask used for testing for any kind of object prediction.
     59static const SpeculatedType SpecStringIdent       = 0x00010000; // It's definitely a JSString, and it's an identifier.
     60static const SpeculatedType SpecStringVar         = 0x00020000; // It's definitely a JSString, and it's not an identifier.
     61static const SpeculatedType SpecString            = 0x00030000; // It's definitely a JSString.
     62static const SpeculatedType SpecCellOther         = 0x00040000; // It's definitely a JSCell but not a subclass of JSObject and definitely not a JSString.
     63static const SpeculatedType SpecCell              = 0x0007ffff; // It's definitely a JSCell.
     64static const SpeculatedType SpecInt32             = 0x00800000; // It's definitely an Int32.
     65static const SpeculatedType SpecInt48             = 0x01000000; // It's definitely an Int48, it's inside a double, but it doesn't need to be.
     66static const SpeculatedType SpecMachineInt        = 0x01800000; // It's something that we can do machine int arithmetic on.
     67static const SpeculatedType SpecInt48AsDouble     = 0x02000000; // It's definitely an Int48 and it's inside a double.
     68static const SpeculatedType SpecInteger           = 0x03800000; // It's definitely some kind of integer.
     69static const SpeculatedType SpecNonIntAsDouble    = 0x04000000; // It's definitely not an Int48 but it's a real number and it's a double.
     70static const SpeculatedType SpecDoubleReal        = 0x07000000; // It's definitely a non-NaN double.
     71static const SpeculatedType SpecDoubleNaN         = 0x08000000; // It's definitely a NaN.
     72static const SpeculatedType SpecDouble            = 0x0f000000; // It's either a non-NaN or a NaN double.
     73static const SpeculatedType SpecRealNumber        = 0x07800000; // It's either an Int32 or a DoubleReal.
     74static const SpeculatedType SpecNumber            = 0x0f800000; // It's either an Int32 or a Double.
     75static const SpeculatedType SpecBoolean           = 0x10000000; // It's definitely a Boolean.
     76static const SpeculatedType SpecOther             = 0x20000000; // It's definitely none of the above.
     77static const SpeculatedType SpecHeapTop           = 0x3fffffff; // It can be any of the above.
     78static const SpeculatedType SpecEmpty             = 0x40000000; // It's definitely an empty value marker.
     79static const SpeculatedType SpecBytecodeTop       = 0x7fffffff; // It can be any of the above.
     80static const SpeculatedType SpecFullTop           = 0x7fffffff; // It can be any of the above plus anything the DFG chooses.
    8381
    8482typedef bool (*SpeculatedTypeChecker)(SpeculatedType);
    … …  
    243241inline bool isInt32SpeculationForArithmetic(SpeculatedType value)
    244242{
    245     return !(value & (SpecDouble | SpecInt52));
     243    return !(value & SpecDouble);
    246244}
    247245
    … …  
    251249}
    252250
    253 inline bool isInt52Speculation(SpeculatedType value)
    254 {
    255     return value == SpecInt52;
     251inline bool isInt48Speculation(SpeculatedType value)
     252{
     253    return value == SpecInt48;
    256254}
    257255
    … …  
    268266inline bool isMachineIntSpeculationForArithmetic(SpeculatedType value)
    269267{
    270     return !(value & SpecDouble);
    271 }
    272 
    273 inline bool isInt52AsDoubleSpeculation(SpeculatedType value)
    274 {
    275     return value == SpecInt52AsDouble;
     268    return !(value & (SpecDouble & ~SpecMachineInt));
     269}
     270
     271inline bool isInt48AsDoubleSpeculation(SpeculatedType value)
     272{
     273    return value == SpecInt48AsDouble;
    276274}
    277275
    … …  
    296294}
    297295
    298 inline bool isBytecodeRealNumberSpeculation(SpeculatedType value)
    299 {
    300     return !!(value & SpecBytecodeRealNumber) && !(value & ~SpecBytecodeRealNumber);
    301 }
    302 
    303 inline bool isFullRealNumberSpeculation(SpeculatedType value)
    304 {
    305     return !!(value & SpecFullRealNumber) && !(value & ~SpecFullRealNumber);
    306 }
    307 
    308 inline bool isBytecodeNumberSpeculation(SpeculatedType value)
    309 {
    310     return !!(value & SpecBytecodeNumber) && !(value & ~SpecBytecodeNumber);
    311 }
    312 
    313 inline bool isFullNumberSpeculation(SpeculatedType value)
    314 {
    315     return !!(value & SpecFullNumber) && !(value & ~SpecFullNumber);
    316 }
    317 
    318 inline bool isBytecodeNumberSpeculationExpectingDefined(SpeculatedType value)
    319 {
    320     return isBytecodeNumberSpeculation(value & ~SpecOther);
    321 }
    322 
    323 inline bool isFullNumberSpeculationExpectingDefined(SpeculatedType value)
    324 {
    325     return isFullNumberSpeculation(value & ~SpecOther);
     296inline bool isRealNumberSpeculation(SpeculatedType value)
     297{
     298    return !!(value & SpecRealNumber) && !(value & ~SpecRealNumber);
     299}
     300
     301inline bool isNumberSpeculation(SpeculatedType value)
     302{
     303    return !!(value & SpecNumber) && !(value & ~SpecNumber);
     304}
     305
     306inline bool isNumberSpeculationExpectingDefined(SpeculatedType value)
     307{
     308    return isNumberSpeculation(value & ~SpecOther);
    326309}
    327310
  • trunk/Source/JavaScriptCore/bytecode/ValueRecovery.h

    r156019 r156029  
    4545    // It's already in the stack but unboxed.
    4646    AlreadyInJSStackAsUnboxedInt32,
    47     AlreadyInJSStackAsUnboxedInt52,
    4847    AlreadyInJSStackAsUnboxedCell,
    4948    AlreadyInJSStackAsUnboxedBoolean,
    … …  
    5251    InGPR,
    5352    UnboxedInt32InGPR,
    54     UnboxedInt52InGPR,
    55     UnboxedStrictInt52InGPR,
    5653    UnboxedBooleanInGPR,
    5754#if USE(JSVALUE32_64)
    … …  
    6461    // It's in the stack, at a different location, and it's unboxed.
    6562    Int32DisplacedInJSStack,
    66     Int52DisplacedInJSStack,
    67     StrictInt52DisplacedInJSStack,
    6863    DoubleDisplacedInJSStack,
    6964    CellDisplacedInJSStack,
    … …  
    10196    }
    10297   
    103     static ValueRecovery alreadyInJSStackAsUnboxedInt52()
    104     {
    105         ValueRecovery result;
    106         result.m_technique = AlreadyInJSStackAsUnboxedInt52;
    107         return result;
    108     }
    109    
    11098    static ValueRecovery alreadyInJSStackAsUnboxedCell()
    11199    {
    … …  
    138126        if (dataFormat == DataFormatInt32)
    139127            result.m_technique = UnboxedInt32InGPR;
    140         else if (dataFormat == DataFormatInt52)
    141             result.m_technique = UnboxedInt52InGPR;
    142         else if (dataFormat == DataFormatStrictInt52)
    143             result.m_technique = UnboxedStrictInt52InGPR;
    144128        else if (dataFormat == DataFormatBoolean)
    145129            result.m_technique = UnboxedBooleanInGPR;
    … …  
    185169            break;
    186170           
    187         case DataFormatInt52:
    188             result.m_technique = Int52DisplacedInJSStack;
    189             break;
    190            
    191         case DataFormatStrictInt52:
    192             result.m_technique = StrictInt52DisplacedInJSStack;
    193             break;
    194            
    195171        case DataFormatDouble:
    196172            result.m_technique = DoubleDisplacedInJSStack;
    … …  
    254230        case AlreadyInJSStack:
    255231        case AlreadyInJSStackAsUnboxedInt32:
    256         case AlreadyInJSStackAsUnboxedInt52:
    257232        case AlreadyInJSStackAsUnboxedCell:
    258233        case AlreadyInJSStackAsUnboxedBoolean:
    … …  
    266241    MacroAssembler::RegisterID gpr() const
    267242    {
    268         ASSERT(m_technique == InGPR || m_technique == UnboxedInt32InGPR || m_technique == UnboxedBooleanInGPR || m_technique == UInt32InGPR || m_technique == UnboxedInt52InGPR || m_technique == UnboxedStrictInt52InGPR);
     243        ASSERT(m_technique == InGPR || m_technique == UnboxedInt32InGPR || m_technique == UnboxedBooleanInGPR || m_technique == UInt32InGPR);
    269244        return m_source.gpr;
    270245    }
    … …  
    292267    VirtualRegister virtualRegister() const
    293268    {
    294         ASSERT(m_technique == DisplacedInJSStack || m_technique == Int32DisplacedInJSStack || m_technique == DoubleDisplacedInJSStack || m_technique == CellDisplacedInJSStack || m_technique == BooleanDisplacedInJSStack || m_technique == Int52DisplacedInJSStack || m_technique == StrictInt52DisplacedInJSStack);
     269        ASSERT(m_technique == DisplacedInJSStack || m_technique == Int32DisplacedInJSStack || m_technique == DoubleDisplacedInJSStack || m_technique == CellDisplacedInJSStack || m_technique == BooleanDisplacedInJSStack);
    295270        return m_source.virtualReg;
    296271    }
    … …  
    311286            out.printf("(int32)");
    312287            return;
    313         case AlreadyInJSStackAsUnboxedInt52:
    314             out.printf("(int52)");
    315             return;
    316288        case AlreadyInJSStackAsUnboxedCell:
    317289            out.printf("(cell)");
    … …  
    329301            out.printf("int32(%%r%d)", gpr());
    330302            return;
    331         case UnboxedInt52InGPR:
    332             out.printf("int52(%%r%d)", gpr());
    333             return;
    334         case UnboxedStrictInt52InGPR:
    335             out.printf("strictInt52(%%r%d)", gpr());
    336             return;
    337303        case UnboxedBooleanInGPR:
    338304            out.printf("bool(%%r%d)", gpr());
    … …  
    354320        case Int32DisplacedInJSStack:
    355321            out.printf("*int32(%d)", virtualRegister());
    356             return;
    357         case Int52DisplacedInJSStack:
    358             out.printf("*int52(%d)", virtualRegister());
    359             return;
    360         case StrictInt52DisplacedInJSStack:
    361             out.printf("*strictInt52(%d)", virtualRegister());
    362322            return;
    363323        case DoubleDisplacedInJSStack:
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreter.h

    r156019 r156029  
    6161    bool needsTypeCheck(Node* node, SpeculatedType typesPassedThrough)
    6262    {
    63         return !forNode(node).isType(typesPassedThrough);
     63        return forNode(node).m_type & ~typesPassedThrough;
    6464    }
    6565   
    … …  
    169169    {
    170170        AbstractValue& value = forNode(edge);
    171         if (!value.isType(type)) {
     171        if (value.m_type & ~type) {
    172172            node->setCanExit(true);
    173173            edge.setProofStatus(NeedsCheck);
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractInterpreterInlines.h

    r156019 r156029  
    311311    }
    312312       
    313     case Int52ToDouble: {
    314         JSValue child = forNode(node->child1()).value();
    315         if (child && child.isNumber()) {
    316             setConstant(node, child);
    317             break;
    318         }
    319         forNode(node).setType(SpecDouble);
    320         break;
    321     }
    322        
    323     case Int52ToValue: {
    324         JSValue child = forNode(node->child1()).value();
    325         if (child && child.isNumber()) {
    326             setConstant(node, child);
    327             break;
    328         }
    329         SpeculatedType type = forNode(node->child1()).m_type;
    330         if (type & SpecInt52)
    331             type = (type | SpecInt32 | SpecInt52AsDouble) & ~SpecInt52;
    332         forNode(node).setType(type);
    333         break;
    334     }
    335        
    336313    case ValueAdd:
    337314    case ArithAdd: {
    … …  
    348325                node->setCanExit(true);
    349326            break;
    350         case MachineIntUse:
    351             forNode(node).setType(SpecInt52);
    352             if (!forNode(node->child1()).isType(SpecInt32)
    353                 || !forNode(node->child2()).isType(SpecInt32))
    354                 node->setCanExit(true);
    355             break;
    356327        case NumberUse:
    357             if (isFullRealNumberSpeculation(forNode(node->child1()).m_type)
    358                 && isFullRealNumberSpeculation(forNode(node->child2()).m_type))
     328            if (isRealNumberSpeculation(forNode(node->child1()).m_type)
     329                && isRealNumberSpeculation(forNode(node->child2()).m_type))
    359330                forNode(node).setType(SpecDoubleReal);
    360331            else
    … …  
    364335            RELEASE_ASSERT(node->op() == ValueAdd);
    365336            clobberWorld(node->codeOrigin, clobberLimit);
    366             forNode(node).setType(SpecString | SpecBytecodeNumber);
     337            forNode(node).setType(SpecString | SpecInt32 | SpecNumber);
    367338            break;
    368339        }
    … …  
    388359                node->setCanExit(true);
    389360            break;
    390         case MachineIntUse:
    391             forNode(node).setType(SpecInt52);
    392             if (!forNode(node->child1()).isType(SpecInt32)
    393                 || !forNode(node->child2()).isType(SpecInt32))
    394                 node->setCanExit(true);
    395             break;
    396361        case NumberUse:
    397362            forNode(node).setType(SpecDouble);
    … …  
    414379            forNode(node).setType(SpecInt32);
    415380            if (!bytecodeCanTruncateInteger(node->arithNodeFlags()))
    416                 node->setCanExit(true);
    417             break;
    418         case MachineIntUse:
    419             forNode(node).setType(SpecInt52);
    420             if (m_state.forNode(node->child1()).couldBeType(SpecInt52))
    421                 node->setCanExit(true);
    422             if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags()))
    423381                node->setCanExit(true);
    424382            break;
    … …  
    447405                node->setCanExit(true);
    448406            break;
    449         case MachineIntUse:
    450             forNode(node).setType(SpecInt52);
    451             node->setCanExit(true);
    452             break;
    453407        case NumberUse:
    454             if (isFullRealNumberSpeculation(forNode(node->child1()).m_type)
    455                 || isFullRealNumberSpeculation(forNode(node->child2()).m_type))
     408            if (isRealNumberSpeculation(forNode(node->child1()).m_type)
     409                || isRealNumberSpeculation(forNode(node->child2()).m_type))
    456410                forNode(node).setType(SpecDoubleReal);
    457411            else
    … …  
    633587        }
    634588       
    635         if (isFullNumberSpeculation(abstractChild.m_type)) {
     589        if (isNumberSpeculation(abstractChild.m_type)) {
    636590            setConstant(node, vm->smallStrings.numberString());
    637591            break;
    … …  
    858812            if (node->shouldSpeculateInt32())
    859813                forNode(node).setType(SpecInt32);
    860             else if (enableInt52() && node->shouldSpeculateMachineInt())
    861                 forNode(node).setType(SpecInt52);
    862814            else
    863815                forNode(node).setType(SpecDouble);
    … …  
    912864        node->setCanExit(true);
    913865        clobberWorld(node->codeOrigin, clobberLimit);
    914         forNode(node).setType(SpecBytecodeNumber);
     866        forNode(node).setType(SpecNumber);
    915867        break;
    916868           
    … …  
    983935        //
    984936        // destination = source;
    985         // if (destination.m_type & !(SpecFullNumber | SpecString | SpecBoolean)) {
    986         //     destination.filter(SpecFullNumber | SpecString | SpecBoolean);
     937        // if (destination.m_type & !(SpecNumber | SpecString | SpecBoolean)) {
     938        //     destination.filter(SpecNumber | SpecString | SpecBoolean);
    987939        //     AbstractValue string;
    988940        //     string.set(vm->stringStructure);
    … …  
    1004956       
    1005957        SpeculatedType type = source.m_type;
    1006         if (type & ~(SpecFullNumber | SpecString | SpecBoolean))
     958        if (type & ~(SpecNumber | SpecString | SpecBoolean))
    1007959            type = (SpecHeapTop & ~SpecCell) | SpecString;
    1008960
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractValue.cpp

    r156019 r156029  
    6868       
    6969    m_type = speculationFromValue(value);
    70     if (m_type == SpecInt52AsDouble)
    71         m_type = SpecInt52;
    7270    m_value = value;
    7371       
    … …  
    230228}
    231229
    232 #if !ASSERT_DISABLED
    233230void AbstractValue::checkConsistency() const
    234231{
    … …  
    242239        ASSERT(!m_value);
    243240   
    244     if (!!m_value) {
    245         SpeculatedType type = m_type;
    246         if (type & SpecInt52)
    247             type |= SpecInt52AsDouble;
    248         ASSERT(mergeSpeculations(type, speculationFromValue(m_value)) == type);
    249     }
     241    if (!!m_value)
     242        ASSERT(mergeSpeculations(m_type, speculationFromValue(m_value)) == m_type);
    250243   
    251244    // Note that it's possible for a prediction like (Final, []). This really means that
    … …  
    254247    // complexity of the code.
    255248}
    256 #endif
    257249
    258250void AbstractValue::dump(PrintStream& out) const
  • trunk/Source/JavaScriptCore/dfg/DFGAbstractValue.h

    r156019 r156029  
    186186    }
    187187   
    188     bool couldBeType(SpeculatedType desiredType)
    189     {
    190         return !!(m_type & desiredType);
    191     }
    192    
    193     bool isType(SpeculatedType desiredType)
    194     {
    195         return !(m_type & ~desiredType);
    196     }
    197    
    198188    FiltrationResult filter(Graph&, const StructureSet&);
    199189   
    … …  
    203193   
    204194    FiltrationResult filterByValue(JSValue value);
     195   
     196    bool validateType(JSValue value) const
     197    {
     198        if (isHeapTop())
     199            return true;
     200       
     201        if (mergeSpeculations(m_type, speculationFromValue(value)) != m_type)
     202            return false;
     203       
     204        if (value.isEmpty()) {
     205            ASSERT(m_type & SpecEmpty);
     206            return true;
     207        }
     208       
     209        return true;
     210    }
    205211   
    206212    bool validate(JSValue value) const
    … …  
    246252    }
    247253   
    248 #if ASSERT_DISABLED
    249     void checkConsistency() const { }
    250 #else
    251254    void checkConsistency() const;
    252 #endif
    253255   
    254256    void dumpInContext(PrintStream&, DumpContext*) const;
    … …  
    362364    }
    363365   
    364     bool validateType(JSValue value) const
    365     {
    366         if (isHeapTop())
    367             return true;
    368        
    369         // Constant folding always represents Int52's in a double (i.e. Int52AsDouble).
    370         // So speculationFromValue(value) for an Int52 value will return Int52AsDouble,
    371         // and that's fine - the type validates just fine.
    372         SpeculatedType type = m_type;
    373         if (type & SpecInt52)
    374             type |= SpecInt52AsDouble;
    375        
    376         if (mergeSpeculations(type, speculationFromValue(value)) != type)
    377             return false;
    378        
    379         if (value.isEmpty()) {
    380             ASSERT(m_type & SpecEmpty);
    381             return true;
    382         }
    383        
    384         return true;
    385     }
    386    
    387366    void makeTop(SpeculatedType top)
    388367    {
  • trunk/Source/JavaScriptCore/dfg/DFGArrayMode.cpp

    r156019 r156029  
    164164        if (isInt32Speculation(value))
    165165            return withTypeAndConversion(Array::Int32, Array::Convert);
    166         if (isFullNumberSpeculation(value))
     166        if (isNumberSpeculation(value))
    167167            return withTypeAndConversion(Array::Double, Array::Convert);
    168168        return withTypeAndConversion(Array::Contiguous, Array::Convert);
    … …  
    171171        if (!value || isInt32Speculation(value))
    172172            return *this;
    173         if (isFullNumberSpeculation(value))
     173        if (isNumberSpeculation(value))
    174174            return withTypeAndConversion(Array::Double, Array::Convert);
    175175        return withTypeAndConversion(Array::Contiguous, Array::Convert);
    … …  
    178178        if (flags & NodeBytecodeUsesAsInt)
    179179            return withTypeAndConversion(Array::Contiguous, Array::RageConvert);
    180         if (!value || isFullNumberSpeculation(value))
     180        if (!value || isNumberSpeculation(value))
    181181            return *this;
    182182        return withTypeAndConversion(Array::Contiguous, Array::Convert);
  • trunk/Source/JavaScriptCore/dfg/DFGAssemblyHelpers.h

    r156019 r156029  
    294294        return fpr;
    295295    }
    296    
    297     void boxInt52(GPRReg source, GPRReg target, GPRReg scratch, FPRReg fpScratch)
    298     {
    299         // Is it an int32?
    300         signExtend32ToPtr(source, scratch);
    301         Jump isInt32 = branch64(Equal, source, scratch);
    302        
    303         // Nope, it's not, but regT0 contains the int64 value.
    304         convertInt64ToDouble(source, fpScratch);
    305         boxDouble(fpScratch, target);
    306         Jump done = jump();
    307        
    308         isInt32.link(this);
    309         zeroExtend32ToPtr(source, target);
    310         or64(GPRInfo::tagTypeNumberRegister, target);
    311        
    312         done.link(this);
    313     }
    314296#endif
    315297
  • trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp

    r156019 r156029  
    875875        case ArithAdd:
    876876        case ArithSub:
     877        case ArithNegate:
    877878        case ValueAdd:
    878879        case ArithMod: // for ArithMod "MayOverflow" means we tried to divide by zero, or we saw double.
    … …  
    880881            break;
    881882           
    882         case ArithNegate:
    883             // Currently we can't tell the difference between a negation overflowing
    884             // (i.e. -(1 << 31)) or generating negative zero (i.e. -0). If it took slow
    885             // path then we assume that it did both of those things.
    886             node->mergeFlags(NodeMayOverflow);
    887             node->mergeFlags(NodeMayNegZero);
    888             break;
    889 
    890883        case ArithMul:
    891884            if (m_inlineStackTop->m_profiledBlock->likelyToTakeDeepestSlowCase(m_currentIndex)
  • trunk/Source/JavaScriptCore/dfg/DFGCSEPhase.cpp

    r156019 r156029  
    6464private:
    6565   
     66    Node* canonicalize(Node* node)
     67    {
     68        if (!node)
     69            return 0;
     70       
     71        if (node->op() == ValueToInt32)
     72            node = node->child1().node();
     73       
     74        return node;
     75    }
     76    Node* canonicalize(Edge edge)
     77    {
     78        return canonicalize(edge.node());
     79    }
     80   
    6681    unsigned endIndexForPureCSE()
    6782    {
    … …  
    8095    Node* pureCSE(Node* node)
    8196    {
    82         Edge child1 = node->child1();
    83         Edge child2 = node->child2();
    84         Edge child3 = node->child3();
     97        Node* child1 = canonicalize(node->child1());
     98        Node* child2 = canonicalize(node->child2());
     99        Node* child3 = canonicalize(node->child3());
    85100       
    86101        for (unsigned i = endIndexForPureCSE(); i--;) {
    … …  
    95110                continue;
    96111           
    97             Edge otherChild = otherNode->child1();
     112            Node* otherChild = canonicalize(otherNode->child1());
    98113            if (!otherChild)
    99114                return otherNode;
    … …  
    101116                continue;
    102117           
    103             otherChild = otherNode->child2();
     118            otherChild = canonicalize(otherNode->child2());
    104119            if (!otherChild)
    105120                return otherNode;
    … …  
    107122                continue;
    108123           
    109             otherChild = otherNode->child3();
     124            otherChild = canonicalize(otherNode->child3());
    110125            if (!otherChild)
    111126                return otherNode;
    … …  
    363378        for (unsigned i = m_indexInBlock; i--;) {
    364379            Node* node = m_currentBlock->at(i);
    365             if (node == child1 || node == child2)
     380            if (node == child1 || node == canonicalize(child2))
    366381                break;
    367382
    … …  
    370385                if (!m_graph.byValIsPure(node))
    371386                    return 0;
    372                 if (node->child1() == child1 && node->child2() == child2)
     387                if (node->child1() == child1 && canonicalize(node->child2()) == canonicalize(child2))
    373388                    return node;
    374389                break;
    … …  
    377392                if (!m_graph.byValIsPure(node))
    378393                    return 0;
    379                 if (m_graph.varArgChild(node, 0) == child1 && m_graph.varArgChild(node, 1) == child2)
     394                if (m_graph.varArgChild(node, 0) == child1 && canonicalize(m_graph.varArgChild(node, 1)) == canonicalize(child2))
    380395                    return m_graph.varArgChild(node, 2).node();
    381396                // We must assume that the PutByVal will clobber the location we're getting from.
    … …  
    10761091        case ValueToInt32:
    10771092        case MakeRope:
    1078         case Int52ToDouble:
    1079         case Int52ToValue:
    10801093            if (cseMode == StoreElimination)
    10811094                break;
  • trunk/Source/JavaScriptCore/dfg/DFGClobberize.h

    r156019 r156029  
    113113    case Int32ToDouble:
    114114    case ExtractOSREntryLocal:
    115     case Int52ToDouble:
    116     case Int52ToValue:
    117115        return;
    118116       
    … …  
    183181        case Int32Use:
    184182        case NumberUse:
    185         case MachineIntUse:
    186183            return;
    187184        case UntypedUse:
  • trunk/Source/JavaScriptCore/dfg/DFGCommon.h

    r156019 r156029  
    139139#if ENABLE(CONCURRENT_JIT)
    140140    return Options::enableConcurrentJIT() && Options::numberOfCompilerThreads();
    141 #else
    142     return false;
    143 #endif
    144 }
    145 
    146 inline bool enableInt52()
    147 {
    148 #if USE(JSVALUE64)
    149     return true;
    150141#else
    151142    return false;
  • 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   
  • trunk/Source/JavaScriptCore/dfg/DFGFlushFormat.cpp

    r156019 r156029  
    4242        out.print("FlushedInt32");
    4343        return;
    44     case FlushedInt52:
    45         out.print("FlushedInt52");
    46         return;
    4744    case FlushedDouble:
    4845        out.print("FlushedDouble");
  • trunk/Source/JavaScriptCore/dfg/DFGFlushFormat.h

    r156019 r156029  
    4141    DeadFlush,
    4242    FlushedInt32,
    43     FlushedInt52,
    4443    FlushedDouble,
    4544    FlushedCell,
    … …  
    5756    case FlushedInt32:
    5857        return NodeResultInt32;
    59     case FlushedInt52:
    60         return NodeResultInt52;
    6158    case FlushedDouble:
    6259        return NodeResultNumber;
    … …  
    7875    case FlushedInt32:
    7976        return Int32Use;
    80     case FlushedInt52:
    81         return MachineIntUse;
    8277    case FlushedDouble:
    8378        return NumberUse;
  • trunk/Source/JavaScriptCore/dfg/DFGGenerationInfo.h

    r156019 r156029  
    8787        initGPR(node, useCount, gpr, DataFormatInt32);
    8888    }
    89     void initInt52(Node* node, uint32_t useCount, GPRReg reg, DataFormat format)
    90     {
    91         ASSERT(format == DataFormatInt52 || format == DataFormatStrictInt52);
    92         initGPR(node, useCount, reg, format);
    93     }
    94     void initInt52(Node* node, uint32_t useCount, GPRReg reg)
    95     {
    96         initGPR(node, useCount, reg, DataFormatInt52);
    97     }
    98     void initStrictInt52(Node* node, uint32_t useCount, GPRReg reg)
    99     {
    100         initGPR(node, useCount, reg, DataFormatStrictInt52);
    101     }
    10289#if USE(JSVALUE64)
    10390    void initJSValue(Node* node, uint32_t useCount, GPRReg gpr, DataFormat format = DataFormatJS)
    … …  
    201188    DataFormat spillFormat() { return m_spillFormat; }
    202189   
    203     bool isFormat(DataFormat expectedFormat)
    204     {
    205         return registerFormat() == expectedFormat || spillFormat() == expectedFormat;
    206     }
    207    
    208190    bool isJSFormat(DataFormat expectedFormat)
    209191    {
    … …  
    214196    {
    215197        return isJSFormat(DataFormatJSInt32);
    216     }
    217    
    218     bool isInt52()
    219     {
    220         return isFormat(DataFormatInt52);
    221     }
    222    
    223     bool isStrictInt52()
    224     {
    225         return isFormat(DataFormatStrictInt52);
    226198    }
    227199   
    … …  
    342314    {
    343315        fillGPR(stream, gpr, DataFormatInt32);
    344     }
    345     void fillInt52(VariableEventStream& stream, GPRReg gpr, DataFormat format)
    346     {
    347         ASSERT(format == DataFormatInt52 || format == DataFormatStrictInt52);
    348         fillGPR(stream, gpr, format);
    349     }
    350     void fillInt52(VariableEventStream& stream, GPRReg gpr)
    351     {
    352         fillGPR(stream, gpr, DataFormatInt52);
    353     }
    354     void fillStrictInt52(VariableEventStream& stream, GPRReg gpr)
    355     {
    356         fillGPR(stream, gpr, DataFormatStrictInt52);
    357316    }
    358317    void fillBoolean(VariableEventStream& stream, GPRReg gpr)
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.cpp

    r156019 r156029  
    237237            out.print(comma, "arg", operandToArgument(operand), "(", VariableAccessDataDump(*this, variableAccessData), ")");
    238238        else
    239             out.print(comma, "loc", operandToLocal(operand), "(", VariableAccessDataDump(*this, variableAccessData), ")");
     239            out.print(comma, "r", operand, "(", VariableAccessDataDump(*this, variableAccessData), ")");
    240240    }
    241241    if (node->hasUnlinkedLocal()) {
    … …  
    244244            out.print(comma, "arg", operandToArgument(operand));
    245245        else
    246             out.print(comma, "loc", operandToLocal(operand));
     246            out.print(comma, "r", operand);
    247247    }
    248248    if (node->hasConstantBuffer()) {
  • trunk/Source/JavaScriptCore/dfg/DFGGraph.h

    r156019 r156029  
    231231    bool addShouldSpeculateMachineInt(Node* add)
    232232    {
    233         if (!enableInt52())
    234             return false;
    235        
    236233        Node* left = add->child1().node();
    237234        Node* right = add->child2().node();
    … …  
    239236        bool speculation;
    240237        if (add->op() == ValueAdd)
    241             speculation = Node::shouldSpeculateMachineInt(left, right);
     238            speculation = Node::shouldSpeculateMachineIntExpectingDefined(left, right);
    242239        else
    243             speculation = Node::shouldSpeculateMachineInt(left, right);
    244 
    245         return speculation && !hasExitSite(add, Int52Overflow);
     240            speculation = Node::shouldSpeculateMachineIntForArithmetic(left, right);
     241
     242        return speculation && !hasExitSite(add, Int48Overflow);
    246243    }
    247244   
    … …  
    261258        ASSERT(mul->op() == ArithMul);
    262259       
    263         if (!enableInt52())
    264             return false;
    265        
    266260        Node* left = mul->child1().node();
    267261        Node* right = mul->child2().node();
    268262
    269         return Node::shouldSpeculateMachineInt(left, right)
    270             && mul->canSpeculateInt52()
    271             && !hasExitSite(mul, Int52Overflow);
     263        return Node::shouldSpeculateMachineIntForArithmetic(left, right)
     264            && mul->canSpeculateInt48()
     265            && !hasExitSite(mul, Int48Overflow);
    272266    }
    273267   
    … …  
    281275    {
    282276        ASSERT(negate->op() == ArithNegate);
    283         if (!enableInt52())
    284             return false;
    285         return negate->child1()->shouldSpeculateMachineInt()
    286             && !hasExitSite(negate, Int52Overflow)
    287             && negate->canSpeculateInt52();
     277        return negate->child1()->shouldSpeculateMachineIntForArithmetic()
     278            && !hasExitSite(negate, Int48Overflow)
     279            && negate->canSpeculateInt48();
    288280    }
    289281   
  • trunk/Source/JavaScriptCore/dfg/DFGInPlaceAbstractState.cpp

    r156019 r156029  
    314314            source = forNode(node->child1());
    315315            if (node->variableAccessData()->flushFormat() == FlushedDouble) {
    316                 ASSERT(!(source.m_type & ~SpecFullNumber));
    317                 ASSERT(!!(source.m_type & ~SpecDouble) == !!(source.m_type & SpecMachineInt));
     316                ASSERT(!(source.m_type & ~SpecNumber));
     317                ASSERT(!!(source.m_type & ~SpecDouble) == !!(source.m_type & SpecInt32));
    318318                if (!(source.m_type & ~SpecDouble)) {
    319                     source.merge(SpecInt52AsDouble);
     319                    source.merge(SpecInt48AsDouble);
    320320                    source.filter(SpecDouble);
    321321                }
  • trunk/Source/JavaScriptCore/dfg/DFGJITCode.cpp

    r156019 r156029  
    104104            value = jsNumber(exec->r(operand).unboxedInt32());
    105105            break;
    106         case AlreadyInJSStackAsUnboxedInt52:
    107             value = jsNumber(exec->r(operand).unboxedInt52());
    108             break;
    109106        case AlreadyInJSStackAsUnboxedDouble:
    110107            value = jsDoubleNumber(exec->r(operand).unboxedDouble());
  • trunk/Source/JavaScriptCore/dfg/DFGMinifiedNode.h

    r156019 r156029  
    4949    case DoubleAsInt32:
    5050    case PhantomArguments:
    51     case Int52ToValue:
    52     case Int52ToDouble:
    5351        return true;
    5452    default:
    … …  
    107105        case UInt32ToNumber:
    108106        case DoubleAsInt32:
    109         case Int52ToDouble:
    110         case Int52ToValue:
    111107            return true;
    112108        default:
  • trunk/Source/JavaScriptCore/dfg/DFGNode.h

    r156019 r156029  
    12421242    bool shouldSpeculateNumber()
    12431243    {
    1244         return isFullNumberSpeculation(prediction());
     1244        return isNumberSpeculation(prediction());
    12451245    }
    12461246   
    12471247    bool shouldSpeculateNumberExpectingDefined()
    12481248    {
    1249         return isFullNumberSpeculationExpectingDefined(prediction());
     1249        return isNumberSpeculationExpectingDefined(prediction());
    12501250    }
    12511251   
    … …  
    14251425    }
    14261426   
    1427     bool canSpeculateInt52()
    1428     {
    1429         return nodeCanSpeculateInt52(arithNodeFlags());
     1427    bool canSpeculateInt48()
     1428    {
     1429        return nodeCanSpeculateInt48(arithNodeFlags());
    14301430    }
    14311431   
  • trunk/Source/JavaScriptCore/dfg/DFGNodeFlags.h

    r156019 r156029  
    4242#define NodeResultNumber                 0x0002
    4343#define NodeResultInt32                  0x0003
    44 #define NodeResultInt52                  0x0004
    45 #define NodeResultBoolean                0x0005
    46 #define NodeResultStorage                0x0006
     44#define NodeResultBoolean                0x0004
     45#define NodeResultStorage                0x0005
    4746                               
    4847#define NodeMustGenerate                 0x0008 // set on nodes that have side effects, and may not trivially be removed by DCE.
    … …  
    109108}
    110109
    111 static inline bool nodeCanSpeculateInt52(NodeFlags flags)
     110static inline bool nodeCanSpeculateInt48(NodeFlags flags)
    112111{
    113112    if (nodeMayNegZero(flags))
  • trunk/Source/JavaScriptCore/dfg/DFGNodeType.h

    r156019 r156029  
    115115    /* Used to speculate that a double value is actually an integer. */\
    116116    macro(DoubleAsInt32, NodeResultInt32 | NodeExitsForward) \
    117     /* Used to separate representation and register allocation of Int52's represented */\
    118     /* as values. */\
    119     macro(Int52ToValue, NodeResultJS) \
    120     macro(Int52ToDouble, NodeResultNumber) \
    121117    \
    122118    /* Nodes for arithmetic operations. */\
    … …  
    361357        return 25;
    362358       
    363     case Int52ToValue:
    364         // Loses no information. It just boxes the value, which is what OSR wants
    365         // to do anyway.
    366         return 100;
    367        
    368     case Int52ToDouble:
    369         // This is like Int32ToDouble; we can use it because it gives a semantically
    370         // equivalent value but that value may be an int32 in a double, so we'd
    371         // rather not if we can avoid it.
    372         return 75;
    373        
    374359    default:
    375360        return 0;
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler.cpp

    r156019 r156029  
    4040
    4141namespace JSC { namespace DFG {
     42
     43static CString shortOperandsDump(const Operands<ValueRecovery>& operands)
     44{
     45    DumpContext context;
     46    StringPrintStream out;
     47    out.print(inContext(operands, &context));
     48    return out.toCString();
     49}
    4250
    4351extern "C" {
    … …  
    110118                exitIndex, toCString(exit.m_codeOrigin).data(),
    111119                exitKindToString(exit.m_kind), toCString(*codeBlock).data(),
    112                 toCString(ignoringContext<DumpContext>(operands)).data()));
     120                shortOperandsDump(operands).data()));
    113121    }
    114122   
  • trunk/Source/JavaScriptCore/dfg/DFGOSRExitCompiler64.cpp

    r156019 r156029  
    196196        case UnboxedInt32InGPR:
    197197        case UInt32InGPR:
    198         case UnboxedInt52InGPR:
    199         case UnboxedStrictInt52InGPR:
    200198            m_jit.store64(recovery.gpr(), scratch + index);
    201199            break;
    … …  
    238236        case Int32DisplacedInJSStack:
    239237        case DoubleDisplacedInJSStack:
    240         case Int52DisplacedInJSStack:
    241         case StrictInt52DisplacedInJSStack:
    242238            m_jit.load64(AssemblyHelpers::addressFor(recovery.virtualRegister()), GPRInfo::regT0);
    243239            m_jit.store64(GPRInfo::regT0, scratch + index);
    … …  
    246242        case AlreadyInJSStackAsUnboxedInt32:
    247243        case AlreadyInJSStackAsUnboxedDouble:
    248         case AlreadyInJSStackAsUnboxedInt52:
    249244            m_jit.load64(AssemblyHelpers::addressFor(operand), GPRInfo::regT0);
    250245            m_jit.store64(GPRInfo::regT0, scratch + index);
    … …  
    280275            break;
    281276           
    282         case AlreadyInJSStackAsUnboxedInt52:
    283         case UnboxedInt52InGPR:
    284         case Int52DisplacedInJSStack:
    285             m_jit.load64(scratch + index, GPRInfo::regT0);
    286             m_jit.rshift64(
    287                 AssemblyHelpers::TrustedImm32(JSValue::int52ShiftAmount), GPRInfo::regT0);
    288             m_jit.boxInt52(GPRInfo::regT0, GPRInfo::regT0, GPRInfo::regT1, FPRInfo::fpRegT0);
    289             m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand));
    290             break;
    291            
    292         case UnboxedStrictInt52InGPR:
    293         case StrictInt52DisplacedInJSStack:
    294             m_jit.load64(scratch + index, GPRInfo::regT0);
    295             m_jit.boxInt52(GPRInfo::regT0, GPRInfo::regT0, GPRInfo::regT1, FPRInfo::fpRegT0);
    296             m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand));
    297             break;
    298            
    299         case UInt32InGPR:
    300             m_jit.load64(scratch + index, GPRInfo::regT0);
    301             m_jit.zeroExtend32ToPtr(GPRInfo::regT0, GPRInfo::regT0);
    302             m_jit.boxInt52(GPRInfo::regT0, GPRInfo::regT0, GPRInfo::regT1, FPRInfo::fpRegT0);
    303             m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand));
    304             break;
    305            
    306277        case AlreadyInJSStackAsUnboxedDouble:
    307278        case InFPR:
    … …  
    312283            m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand));
    313284            break;
     285           
     286        case UInt32InGPR: {
     287            m_jit.load64(scratch + index, GPRInfo::regT0);
     288            m_jit.zeroExtend32ToPtr(GPRInfo::regT0, GPRInfo::regT0);
     289            AssemblyHelpers::Jump positive = m_jit.branch32(
     290                AssemblyHelpers::GreaterThanOrEqual,
     291                GPRInfo::regT0, AssemblyHelpers::TrustedImm32(0));
     292            m_jit.convertInt32ToDouble(GPRInfo::regT0, FPRInfo::fpRegT0);
     293            m_jit.addDouble(
     294                AssemblyHelpers::AbsoluteAddress(&AssemblyHelpers::twoToThe32),
     295                FPRInfo::fpRegT0);
     296            m_jit.boxDouble(FPRInfo::fpRegT0, GPRInfo::regT0);
     297            AssemblyHelpers::Jump done = m_jit.jump();
     298            positive.link(&m_jit);
     299            m_jit.or64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
     300            done.link(&m_jit);
     301            m_jit.store64(GPRInfo::regT0, AssemblyHelpers::addressFor(operand));
     302            break;
     303        }
    314304           
    315305        case Constant:
  • trunk/Source/JavaScriptCore/dfg/DFGPredictionPropagationPhase.cpp

    r156019 r156029  
    117117    SpeculatedType speculatedDoubleTypeForPrediction(SpeculatedType value)
    118118    {
    119         if (!isFullNumberSpeculation(value))
     119        if (!isNumberSpeculation(value))
    120120            return SpecDouble;
    121121        if (value & SpecDoubleNaN)
    … …  
    143143        case WeakJSConstant: {
    144144            SpeculatedType type = speculationFromValue(m_graph.valueOfJSConstant(node));
    145             if (type == SpecInt52AsDouble)
    146                 type = SpecInt52;
     145            if (type == SpecInt48AsDouble)
     146                type = SpecInt48;
    147147            changed |= setPrediction(type);
    148148            break;
    … …  
    150150           
    151151        case GetLocal: {
    152             VariableAccessData* variable = node->variableAccessData();
    153             SpeculatedType prediction = variable->prediction();
    154             if (variable->shouldNeverUnbox() && (prediction & SpecInt52))
    155                 prediction = (prediction | SpecInt52AsDouble) & ~SpecInt52;
     152            VariableAccessData* variableAccessData = node->variableAccessData();
     153            SpeculatedType prediction = variableAccessData->prediction();
    156154            if (prediction)
    157155                changed |= mergePrediction(prediction);
    … …  
    206204                changed |= mergePrediction(SpecInt32);
    207205            else
    208                 changed |= mergePrediction(SpecBytecodeNumber);
     206                changed |= mergePrediction(SpecNumber);
    209207            break;
    210208        }
    … …  
    215213           
    216214            if (left && right) {
    217                 if (isFullNumberSpeculationExpectingDefined(left) && isFullNumberSpeculationExpectingDefined(right)) {
     215                if (isNumberSpeculationExpectingDefined(left) && isNumberSpeculationExpectingDefined(right)) {
    218216                    if (m_graph.addSpeculationMode(node) != DontSpeculateInt32)
    219217                        changed |= mergePrediction(SpecInt32);
    220218                    else if (m_graph.addShouldSpeculateMachineInt(node))
    221                         changed |= mergePrediction(SpecInt52);
     219                        changed |= mergePrediction(SpecInt48);
    222220                    else
    223221                        changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right));
    224                 } else if (!(left & SpecFullNumber) || !(right & SpecFullNumber)) {
     222                } else if (!(left & SpecNumber) || !(right & SpecNumber)) {
    225223                    // left or right is definitely something other than a number.
    226224                    changed |= mergePrediction(SpecString);
    … …  
    239237                    changed |= mergePrediction(SpecInt32);
    240238                else if (m_graph.addShouldSpeculateMachineInt(node))
    241                     changed |= mergePrediction(SpecInt52);
     239                    changed |= mergePrediction(SpecInt48);
    242240                else
    243241                    changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right));
    … …  
    254252                    changed |= mergePrediction(SpecInt32);
    255253                else if (m_graph.addShouldSpeculateMachineInt(node))
    256                     changed |= mergePrediction(SpecInt52);
     254                    changed |= mergePrediction(SpecInt48);
    257255                else
    258256                    changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right));
    … …  
    266264                    changed |= mergePrediction(SpecInt32);
    267265                else if (m_graph.negateShouldSpeculateMachineInt(node))
    268                     changed |= mergePrediction(SpecInt52);
     266                    changed |= mergePrediction(SpecInt48);
    269267                else
    270268                    changed |= mergePrediction(speculatedDoubleTypeForPrediction(node->child1()->prediction()));
    … …  
    295293                    changed |= mergePrediction(SpecInt32);
    296294                else if (m_graph.mulShouldSpeculateMachineInt(node))
    297                     changed |= mergePrediction(SpecInt52);
     295                    changed |= mergePrediction(SpecInt48);
    298296                else
    299297                    changed |= mergePrediction(speculatedDoubleTypeForPredictions(left, right));
    … …  
    371369
    372370        case GetByVal: {
    373             if (!node->child1()->prediction())
    374                 break;
    375             if (!node->getHeapPrediction())
    376                 break;
    377            
    378371            if (node->child1()->shouldSpeculateFloat32Array()
    379372                || node->child1()->shouldSpeculateFloat64Array())
    380373                changed |= mergePrediction(SpecDouble);
    381             else if (node->child1()->shouldSpeculateUint32Array()) {
    382                 if (isInt32Speculation(node->getHeapPrediction()))
    383                     changed |= mergePrediction(SpecInt32);
    384                 else
    385                     changed |= mergePrediction(SpecInt52);
    386             } else
     374            else
    387375                changed |= mergePrediction(node->getHeapPrediction());
    388376            break;
    … …  
    579567        case Unreachable:
    580568        case LoopHint:
    581         case Int52ToValue:
    582         case Int52ToDouble:
    583569            break;
    584570           
    … …  
    655641            DoubleBallot ballot;
    656642               
    657             if (isFullNumberSpeculationExpectingDefined(left) && isFullNumberSpeculationExpectingDefined(right)
    658                 && !m_graph.addShouldSpeculateInt32(node)
    659                 && !m_graph.addShouldSpeculateMachineInt(node))
     643            if (isNumberSpeculationExpectingDefined(left) && isNumberSpeculationExpectingDefined(right)
     644                && !m_graph.addShouldSpeculateInt32(node))
    660645                ballot = VoteDouble;
    661646            else
    … …  
    673658            DoubleBallot ballot;
    674659               
    675             if (isFullNumberSpeculation(left) && isFullNumberSpeculation(right)
    676                 && !m_graph.mulShouldSpeculateInt32(node)
    677                 && !m_graph.mulShouldSpeculateMachineInt(node))
     660            if (isNumberSpeculation(left) && isNumberSpeculation(right)
     661                && !m_graph.mulShouldSpeculateInt32(node))
    678662                ballot = VoteDouble;
    679663            else
    … …  
    694678            DoubleBallot ballot;
    695679               
    696             if (isFullNumberSpeculation(left) && isFullNumberSpeculation(right)
     680            if (isNumberSpeculation(left) && isNumberSpeculation(right)
    697681                && !(Node::shouldSpeculateInt32ForArithmetic(node->child1().node(), node->child2().node()) && node->canSpeculateInt32()))
    698682                ballot = VoteDouble;
    … …  
    723707            if (isDoubleSpeculation(prediction))
    724708                node->variableAccessData()->vote(VoteDouble);
    725             else if (
    726                 !isFullNumberSpeculation(prediction)
    727                 || isInt32Speculation(prediction) || isMachineIntSpeculation(prediction))
     709            else if (!isNumberSpeculation(prediction) || isInt32Speculation(prediction))
    728710                node->variableAccessData()->vote(VoteValue);
    729711            break;
  • trunk/Source/JavaScriptCore/dfg/DFGSafeToExecute.h

    r156019 r156029  
    6262        case NotCellUse:
    6363        case OtherUse:
    64         case MachineIntUse:
    6564            return;
    6665           
    … …  
    7170           
    7271        case KnownNumberUse:
    73             if (m_state.forNode(edge).m_type & ~SpecFullNumber)
     72            if (m_state.forNode(edge).m_type & ~SpecNumber)
    7473                m_result = false;
    7574            return;
    … …  
    241240    case CheckTierUpAndOSREnter:
    242241    case LoopHint:
    243     case Int52ToDouble:
    244     case Int52ToValue:
    245242        return true;
    246243       
  • trunk/Source/JavaScriptCore/dfg/DFGSilentRegisterSavePlan.h

    r156019 r156029  
    4949    DoNothingForFill,
    5050    SetInt32Constant,
    51     SetInt52Constant,
    52     SetStrictInt52Constant,
    5351    SetBooleanConstant,
    5452    SetCellConstant,
    … …  
    6462    Load32Payload,
    6563    Load32PayloadBoxInt,
    66     Load32PayloadConvertToInt52,
    67     Load32PayloadSignExtend,
    6864    LoadPtr,
    6965    Load64,
    70     Load64ShiftInt52Right,
    71     Load64ShiftInt52Left,
    7266    LoadDouble,
    7367    LoadDoubleBoxDouble,
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp

    r156019 r156029  
    336336        else if (registerFormat == DataFormatCell || registerFormat == DataFormatStorage)
    337337            spillAction = StorePtr;
    338         else if (registerFormat == DataFormatInt52 || registerFormat == DataFormatStrictInt52)
    339             spillAction = Store64;
    340338        else {
    341339            ASSERT(registerFormat & DataFormatJS);
    … …  
    389387        ASSERT(info.gpr() == source);
    390388        fillAction = LoadPtr;
    391     } else if (registerFormat == DataFormatInt52) {
    392         if (node->hasConstant())
    393             fillAction = SetInt52Constant;
    394         else if (isJSInt32(info.spillFormat()) || info.spillFormat() == DataFormatJS)
    395             fillAction = Load32PayloadConvertToInt52;
    396         else if (info.spillFormat() == DataFormatInt52)
    397             fillAction = Load64;
    398         else if (info.spillFormat() == DataFormatStrictInt52)
    399             fillAction = Load64ShiftInt52Left;
    400         else if (info.spillFormat() == DataFormatNone)
    401             fillAction = Load64;
    402         else {
    403             // Should never happen. Anything that qualifies as an int32 will never
    404             // be turned into a cell (immediate spec fail) or a double (to-double
    405             // conversions involve a separate node).
    406             RELEASE_ASSERT_NOT_REACHED();
    407             fillAction = Load64; // Make GCC happy.
    408         }
    409     } else if (registerFormat == DataFormatStrictInt52) {
    410         if (node->hasConstant())
    411             fillAction = SetStrictInt52Constant;
    412         else if (isJSInt32(info.spillFormat()) || info.spillFormat() == DataFormatJS)
    413             fillAction = Load32PayloadSignExtend;
    414         else if (info.spillFormat() == DataFormatInt52)
    415             fillAction = Load64ShiftInt52Right;
    416         else if (info.spillFormat() == DataFormatStrictInt52)
    417             fillAction = Load64;
    418         else if (info.spillFormat() == DataFormatNone)
    419             fillAction = Load64;
    420         else {
    421             // Should never happen. Anything that qualifies as an int32 will never
    422             // be turned into a cell (immediate spec fail) or a double (to-double
    423             // conversions involve a separate node).
    424             RELEASE_ASSERT_NOT_REACHED();
    425             fillAction = Load64; // Make GCC happy.
    426         }
    427389    } else {
    428390        ASSERT(registerFormat & DataFormatJS);
    … …  
    432394            if (valueOfJSConstant(node).isCell())
    433395                fillAction = SetTrustedJSConstant;
     396            else
    434397                fillAction = SetJSConstant;
    435398        } else if (info.spillFormat() == DataFormatInt32) {
    … …  
    550513        m_jit.move(Imm32(valueOfInt32Constant(plan.node())), plan.gpr());
    551514        break;
    552 #if USE(JSVALUE64)
    553     case SetInt52Constant:
    554         m_jit.move(Imm64(valueOfJSConstant(plan.node()).asMachineInt() << JSValue::int52ShiftAmount), plan.gpr());
    555         break;
    556     case SetStrictInt52Constant:
    557         m_jit.move(Imm64(valueOfJSConstant(plan.node()).asMachineInt()), plan.gpr());
    558         break;
    559 #endif // USE(JSVALUE64)
    560515    case SetBooleanConstant:
    561516        m_jit.move(TrustedImm32(valueOfBooleanConstant(plan.node())), plan.gpr());
    … …  
    579534        m_jit.or64(GPRInfo::tagTypeNumberRegister, plan.gpr());
    580535        break;
    581     case Load32PayloadConvertToInt52:
    582         m_jit.load32(JITCompiler::payloadFor(plan.node()->virtualRegister()), plan.gpr());
    583         m_jit.signExtend32ToPtr(plan.gpr(), plan.gpr());
    584         m_jit.lshift64(TrustedImm32(JSValue::int52ShiftAmount), plan.gpr());
    585         break;
    586     case Load32PayloadSignExtend:
    587         m_jit.load32(JITCompiler::payloadFor(plan.node()->virtualRegister()), plan.gpr());
    588         m_jit.signExtend32ToPtr(plan.gpr(), plan.gpr());
    589         break;
    590536    case LoadDoubleBoxDouble:
    591537        m_jit.load64(JITCompiler::addressFor(plan.node()->virtualRegister()), plan.gpr());
    … …  
    628574    case Load64:
    629575        m_jit.load64(JITCompiler::addressFor(plan.node()->virtualRegister()), plan.gpr());
    630         break;
    631     case Load64ShiftInt52Right:
    632         m_jit.load64(JITCompiler::addressFor(plan.node()->virtualRegister()), plan.gpr());
    633         m_jit.rshift64(TrustedImm32(JSValue::int52ShiftAmount), plan.gpr());
    634         break;
    635     case Load64ShiftInt52Left:
    636         m_jit.load64(JITCompiler::addressFor(plan.node()->virtualRegister()), plan.gpr());
    637         m_jit.lshift64(TrustedImm32(JSValue::int52ShiftAmount), plan.gpr());
    638576        break;
    639577#endif
    … …  
    14791417        if (node->isBinaryUseKind(Int32Use))
    14801418            compilePeepHoleInt32Branch(node, branchNode, condition);
    1481 #if USE(JSVALUE64)
    1482         else if (node->isBinaryUseKind(MachineIntUse))
    1483             compilePeepHoleInt52Branch(node, branchNode, condition);
    1484 #endif // USE(JSVALUE64)
    14851419        else if (node->isBinaryUseKind(NumberUse))
    14861420            compilePeepHoleDoubleBranch(node, branchNode, doubleCondition);
    … …  
    15731507            case FlushedInt32:
    15741508                valueSource = ValueSource(Int32InJSStack);
    1575                 break;
    1576             case FlushedInt52:
    1577                 valueSource = ValueSource(Int52InJSStack);
    15781509                break;
    15791510            case FlushedCell:
    … …  
    19431874   
    19441875    DFG_TYPE_CHECK(
    1945         JSValueRegs(), child3, SpecFullRealNumber,
     1876        JSValueRegs(), child3, SpecRealNumber,
    19461877        m_jit.branchDouble(
    19471878            MacroAssembler::DoubleNotEqualOrUnordered, valueReg, valueReg));
    … …  
    22192150        return;
    22202151    }
    2221        
    2222 #if USE(JSVALUE64)
    2223     case MachineIntUse: {
    2224         SpeculateStrictInt52Operand op1(this, node->child1());
    2225         GPRTemporary result(this, Reuse, op1);
    2226         GPRReg op1GPR = op1.gpr();
    2227         GPRReg resultGPR = result.gpr();
    2228         m_jit.zeroExtend32ToPtr(op1GPR, resultGPR);
    2229         int32Result(resultGPR, node, DataFormatInt32);
    2230         return;
    2231     }
    2232 #endif // USE(JSVALUE64)
    22332152   
    22342153    case NumberUse:
    … …  
    22692188            if (node->child1().useKind() == NumberUse) {
    22702189                DFG_TYPE_CHECK(
    2271                     JSValueRegs(gpr), node->child1(), SpecFullNumber,
     2190                    JSValueRegs(gpr), node->child1(), SpecNumber,
    22722191                    m_jit.branchTest64(
    22732192                        MacroAssembler::Zero, gpr, GPRInfo::tagTypeNumberRegister));
    … …  
    23252244                if (node->child1().useKind() == NumberUse) {
    23262245                    DFG_TYPE_CHECK(
    2327                         JSValueRegs(tagGPR, payloadGPR), node->child1(), SpecFullNumber,
     2246                        JSValueRegs(tagGPR, payloadGPR), node->child1(), SpecNumber,
    23282247                        m_jit.branch32(
    23292248                            MacroAssembler::AboveOrEqual, tagGPR,
    … …  
    24712390        MacroAssembler::AboveOrEqual, op1GPR, GPRInfo::tagTypeNumberRegister);
    24722391   
    2473     if (needsTypeCheck(node->child1(), SpecFullNumber)) {
     2392    if (needsTypeCheck(node->child1(), SpecNumber)) {
    24742393        if (node->flags() & NodeExitsForward) {
    24752394            forwardTypeCheck(
    2476                 JSValueRegs(op1GPR), node->child1(), SpecFullNumber,
     2395                JSValueRegs(op1GPR), node->child1(), SpecNumber,
    24772396                m_jit.branchTest64(MacroAssembler::Zero, op1GPR, GPRInfo::tagTypeNumberRegister),
    24782397                ValueRecovery::inGPR(op1GPR, DataFormatJS));
    24792398        } else {
    24802399            backwardTypeCheck(
    2481                 JSValueRegs(op1GPR), node->child1(), SpecFullNumber,
     2400                JSValueRegs(op1GPR), node->child1(), SpecNumber,
    24822401                m_jit.branchTest64(MacroAssembler::Zero, op1GPR, GPRInfo::tagTypeNumberRegister));
    24832402        }
    … …  
    25022421        MacroAssembler::Equal, op1TagGPR, TrustedImm32(JSValue::Int32Tag));
    25032422   
    2504     if (needsTypeCheck(node->child1(), SpecFullNumber)) {
     2423    if (needsTypeCheck(node->child1(), SpecNumber)) {
    25052424        if (node->flags() & NodeExitsForward) {
    25062425            forwardTypeCheck(
    2507                 JSValueRegs(op1TagGPR, op1PayloadGPR), node->child1(), SpecFullNumber,
     2426                JSValueRegs(op1TagGPR, op1PayloadGPR), node->child1(), SpecNumber,
    25082427                m_jit.branch32(MacroAssembler::AboveOrEqual, op1TagGPR, TrustedImm32(JSValue::LowestTag)),
    25092428                ValueRecovery::inPair(op1TagGPR, op1PayloadGPR));
    25102429        } else {
    25112430            backwardTypeCheck(
    2512                 JSValueRegs(op1TagGPR, op1PayloadGPR), node->child1(), SpecFullNumber,
     2431                JSValueRegs(op1TagGPR, op1PayloadGPR), node->child1(), SpecNumber,
    25132432                m_jit.branch32(MacroAssembler::AboveOrEqual, op1TagGPR, TrustedImm32(JSValue::LowestTag)));
    25142433        }
    … …  
    26302549        return;
    26312550    }
    2632    
    2633 #if USE(JSVALUE64)
    2634     if (node->shouldSpeculateMachineInt()) {
    2635         m_jit.zeroExtend32ToPtr(resultReg, resultReg);
    2636         strictInt52Result(resultReg, node);
    2637         return;
    2638     }
    2639 #endif
    26402551   
    26412552    FPRTemporary fresult(this);
    … …  
    26912602            break;
    26922603        }
    2693            
    2694 #if USE(JSVALUE64)
    2695         case MachineIntUse: {
    2696             SpeculateStrictInt52Operand valueOp(this, valueUse);
    2697             GPRTemporary scratch(this);
    2698             GPRReg scratchReg = scratch.gpr();
    2699             m_jit.move(valueOp.gpr(), scratchReg);
    2700             if (isClamped(type)) {
    2701                 ASSERT(elementSize(type) == 1);
    2702                 MacroAssembler::Jump inBounds = m_jit.branch64(
    2703                     MacroAssembler::BelowOrEqual, scratchReg, JITCompiler::TrustedImm64(0xff));
    2704                 MacroAssembler::Jump tooBig = m_jit.branch64(
    2705                     MacroAssembler::GreaterThan, scratchReg, JITCompiler::TrustedImm64(0xff));
    2706                 m_jit.move(TrustedImm32(0), scratchReg);
    2707                 MacroAssembler::Jump clamped = m_jit.jump();
    2708                 tooBig.link(&m_jit);
    2709                 m_jit.move(JITCompiler::TrustedImm32(255), scratchReg);
    2710                 clamped.link(&m_jit);
    2711                 inBounds.link(&m_jit);
    2712             }
    2713             value.adopt(scratch);
    2714             valueGPR = scratchReg;
    2715             break;
    2716         }
    2717 #endif // USE(JSVALUE64)
    27182604           
    27192605        case NumberUse: {
    … …  
    29852871            return;
    29862872        }
    2987        
     2873               
    29882874        if (isNumberConstant(node->child2().node())) {
    29892875            SpeculateInt32Operand op1(this, node->child1());
    … …  
    30302916        return;
    30312917    }
    3032        
    3033 #if USE(JSVALUE64)
    3034     case MachineIntUse: {
    3035         // Will we need an overflow check? If we can prove that neither input can be
    3036         // Int52 then the overflow check will not be necessary.
    3037         if (!m_state.forNode(node->child1()).couldBeType(SpecInt52)
    3038             && !m_state.forNode(node->child2()).couldBeType(SpecInt52)) {
    3039             SpeculateWhicheverInt52Operand op1(this, node->child1());
    3040             SpeculateWhicheverInt52Operand op2(this, node->child2(), op1);
    3041             GPRTemporary result(this, Reuse, op1);
    3042             m_jit.move(op1.gpr(), result.gpr());
    3043             m_jit.add64(op2.gpr(), result.gpr());
    3044             int52Result(result.gpr(), node, op1.format());
    3045             return;
    3046         }
    3047        
    3048         SpeculateInt52Operand op1(this, node->child1());
    3049         SpeculateInt52Operand op2(this, node->child2());
    3050         GPRTemporary result(this, Reuse, op1, op2);
    3051         m_jit.move(op1.gpr(), result.gpr());
    3052         speculationCheck(
    3053             Int52Overflow, JSValueRegs(), 0,
    3054             m_jit.branchAdd64(MacroAssembler::Overflow, op2.gpr(), result.gpr()));
    3055         int52Result(result.gpr(), node);
    3056         return;
    3057     }
    3058 #endif // USE(JSVALUE64)
    30592918   
    30602919    case NumberUse: {
    … …  
    32023061    }
    32033062       
    3204 #if USE(JSVALUE64)
    3205     case MachineIntUse: {
    3206         // Will we need an overflow check? If we can prove that neither input can be
    3207         // Int52 then the overflow check will not be necessary.
    3208         if (!m_state.forNode(node->child1()).couldBeType(SpecInt52)
    3209             && !m_state.forNode(node->child2()).couldBeType(SpecInt52)) {
    3210             SpeculateWhicheverInt52Operand op1(this, node->child1());
    3211             SpeculateWhicheverInt52Operand op2(this, node->child2(), op1);
    3212             GPRTemporary result(this, Reuse, op1);
    3213             m_jit.move(op1.gpr(), result.gpr());
    3214             m_jit.sub64(op2.gpr(), result.gpr());
    3215             int52Result(result.gpr(), node, op1.format());
    3216             return;
    3217         }
    3218        
    3219         SpeculateInt52Operand op1(this, node->child1());
    3220         SpeculateInt52Operand op2(this, node->child2());
    3221         GPRTemporary result(this, Reuse, op1, op2);
    3222         m_jit.move(op1.gpr(), result.gpr());
    3223         speculationCheck(
    3224             Int52Overflow, JSValueRegs(), 0,
    3225             m_jit.branchSub64(MacroAssembler::Overflow, op2.gpr(), result.gpr()));
    3226         int52Result(result.gpr(), node);
    3227         return;
    3228     }
    3229 #endif // USE(JSVALUE64)
    3230 
    32313063    case NumberUse: {
    32323064        SpeculateDoubleOperand op1(this, node->child1());
    … …  
    32573089        m_jit.move(op1.gpr(), result.gpr());
    32583090
    3259         // Note: there is no notion of being not used as a number, but someone
    3260         // caring about negative zero.
    3261        
    32623091        if (bytecodeCanTruncateInteger(node->arithNodeFlags()))
    32633092            m_jit.neg32(result.gpr());
    … …  
    32723101        return;
    32733102    }
    3274 
    3275 #if USE(JSVALUE64)
    3276     case MachineIntUse: {
    3277         if (!m_state.forNode(node->child1()).couldBeType(SpecInt52)) {
    3278             SpeculateWhicheverInt52Operand op1(this, node->child1());
    3279             GPRTemporary result(this);
    3280             GPRReg op1GPR = op1.gpr();
    3281             GPRReg resultGPR = result.gpr();
    3282             m_jit.move(op1GPR, resultGPR);
    3283             m_jit.neg64(resultGPR);
    3284             if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
    3285                 speculationCheck(
    3286                     NegativeZero, JSValueRegs(), 0,
    3287                     m_jit.branchTest64(MacroAssembler::Zero, resultGPR));
    3288             }
    3289             int52Result(resultGPR, node, op1.format());
    3290             return;
    3291         }
    3292        
    3293         SpeculateInt52Operand op1(this, node->child1());
    3294         GPRTemporary result(this);
    3295         GPRReg op1GPR = op1.gpr();
    3296         GPRReg resultGPR = result.gpr();
    3297         m_jit.move(op1GPR, resultGPR);
    3298         speculationCheck(
    3299             Int52Overflow, JSValueRegs(), 0,
    3300             m_jit.branchNeg64(MacroAssembler::Overflow, resultGPR));
    3301         if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
    3302             speculationCheck(
    3303                 NegativeZero, JSValueRegs(), 0,
    3304                 m_jit.branchTest64(MacroAssembler::Zero, resultGPR));
    3305         }
    3306         int52Result(resultGPR, node);
    3307         return;
    3308     }
    3309 #endif // USE(JSVALUE64)
    33103103       
    33113104    case NumberUse: {
    … …  
    33733166        return;
    33743167    }
    3375    
    3376 #if USE(JSVALUE64)   
    3377     case MachineIntUse: {
    3378         // This is super clever. We want to do an int52 multiplication and check the
    3379         // int52 overflow bit. There is no direct hardware support for this, but we do
    3380         // have the ability to do an int64 multiplication and check the int64 overflow
    3381         // bit. We leverage that. Consider that a, b are int52 numbers inside int64
    3382         // registers, with the high 12 bits being sign-extended. We can do:
    3383         //
    3384         //     (a * (b << 12))
    3385         //
    3386         // This will give us a left-shifted int52 (value is in high 52 bits, low 16
    3387         // bits are zero) plus the int52 overflow bit. I.e. whether this 64-bit
    3388         // multiplication overflows is identical to whether the 'a * b' 52-bit
    3389         // multiplication overflows.
    3390         //
    3391         // In our nomenclature, this is:
    3392         //
    3393         //     strictInt52(a) * int52(b) => int52
    3394         //
    3395         // That is "strictInt52" means unshifted and "int52" means left-shifted by 16
    3396         // bits.
    3397         //
    3398         // We don't care which of op1 or op2 serves as the left-shifted operand, so
    3399         // we just do whatever is more convenient for op1 and have op2 do the
    3400         // opposite. This ensures that we do at most one shift.
    3401 
    3402         SpeculateWhicheverInt52Operand op1(this, node->child1());
    3403         SpeculateWhicheverInt52Operand op2(this, node->child2(), OppositeShift, op1);
    3404         GPRTemporary result(this);
    3405        
    3406         GPRReg op1GPR = op1.gpr();
    3407         GPRReg op2GPR = op2.gpr();
    3408         GPRReg resultGPR = result.gpr();
    3409        
    3410         m_jit.move(op1GPR, resultGPR);
    3411         speculationCheck(
    3412             Int52Overflow, JSValueRegs(), 0,
    3413             m_jit.branchMul64(MacroAssembler::Overflow, op2GPR, resultGPR));
    3414        
    3415         if (!bytecodeCanIgnoreNegativeZero(node->arithNodeFlags())) {
    3416             MacroAssembler::Jump resultNonZero = m_jit.branchTest64(
    3417                 MacroAssembler::NonZero, resultGPR);
    3418             speculationCheck(
    3419                 NegativeZero, JSValueRegs(), 0,
    3420                 m_jit.branch64(MacroAssembler::LessThan, op1GPR, TrustedImm64(0)));
    3421             speculationCheck(
    3422                 NegativeZero, JSValueRegs(), 0,
    3423                 m_jit.branch64(MacroAssembler::LessThan, op2GPR, TrustedImm64(0)));
    3424             resultNonZero.link(&m_jit);
    3425         }
    3426        
    3427         int52Result(resultGPR, node);
    3428         return;
    3429     }
    3430 #endif // USE(JSVALUE64)
    34313168       
    34323169    case NumberUse: {
    … …  
    38523589        return false;
    38533590    }
    3854    
    3855 #if USE(JSVALUE64)
    3856     if (node->isBinaryUseKind(MachineIntUse)) {
    3857         compileInt52Compare(node, condition);
    3858         return false;
    3859     }
    3860 #endif // USE(JSVALUE64)
    3861    
     3591
    38623592    if (node->isBinaryUseKind(NumberUse)) {
    38633593        compileDoubleCompare(node, doubleCondition);
    … …  
    40093739        return false;
    40103740    }
    4011    
    4012 #if USE(JSVALUE64)   
    4013     case MachineIntUse: {
    4014         unsigned branchIndexInBlock = detectPeepHoleBranch();
    4015         if (branchIndexInBlock != UINT_MAX) {
    4016             Node* branchNode = m_block->at(branchIndexInBlock);
    4017             compilePeepHoleInt52Branch(node, branchNode, MacroAssembler::Equal);
    4018             use(node->child1());
    4019             use(node->child2());
    4020             m_indexInBlock = branchIndexInBlock;
    4021             m_currentNode = branchNode;
    4022             return true;
    4023         }
    4024         compileInt52Compare(node, MacroAssembler::Equal);
    4025         return false;
    4026     }
    4027 #endif // USE(JSVALUE64)
    40283741       
    40293742    case NumberUse: {
    … …  
    47814494}
    47824495
    4783 void SpeculativeJIT::speculateMachineInt(Edge edge)
    4784 {
    4785 #if USE(JSVALUE64)
    4786     if (!needsTypeCheck(edge, SpecMachineInt))
    4787         return;
    4788    
    4789     (SpeculateWhicheverInt52Operand(this, edge)).gpr();
    4790 #else // USE(JSVALUE64)
    4791     UNUSED_PARAM(edge);
    4792     UNREACHABLE_FOR_PLATFORM();
    4793 #endif // USE(JSVALUE64)
    4794 }
    4795 
    47964496void SpeculativeJIT::speculateNumber(Edge edge)
    47974497{
    4798     if (!needsTypeCheck(edge, SpecFullNumber))
     4498    if (!needsTypeCheck(edge, SpecNumber))
    47994499        return;
    48004500   
    … …  
    48044504void SpeculativeJIT::speculateRealNumber(Edge edge)
    48054505{
    4806     if (!needsTypeCheck(edge, SpecFullRealNumber))
     4506    if (!needsTypeCheck(edge, SpecRealNumber))
    48074507        return;
    48084508   
    … …  
    48104510    FPRReg fpr = operand.fpr();
    48114511    DFG_TYPE_CHECK(
    4812         JSValueRegs(), edge, SpecFullRealNumber,
     4512        JSValueRegs(), edge, SpecRealNumber,
    48134513        m_jit.branchDouble(
    48144514            MacroAssembler::DoubleNotEqualOrUnordered, fpr, fpr));
    … …  
    50724772        break;
    50734773    case KnownNumberUse:
    5074         ASSERT(!needsTypeCheck(edge, SpecFullNumber));
     4774        ASSERT(!needsTypeCheck(edge, SpecNumber));
    50754775        break;
    50764776    case KnownCellUse:
    … …  
    50824782    case Int32Use:
    50834783        speculateInt32(edge);
    5084         break;
    5085     case MachineIntUse:
    5086         speculateMachineInt(edge);
    50874784        break;
    50884785    case RealNumberUse:
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.h

    r156019 r156029  
    160160    bool canReuse(Node* node)
    161161    {
    162         return generationInfo(node).canReuse();
     162        VirtualRegister virtualRegister = node->virtualRegister();
     163        GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     164        return info.canReuse();
    163165    }
    164166    bool canReuse(Edge nodeUse)
    … …  
    236238    bool isFilled(Node* node)
    237239    {
    238         return generationInfo(node).registerFormat() != DataFormatNone;
     240        VirtualRegister virtualRegister = node->virtualRegister();
     241        GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     242        return info.registerFormat() != DataFormatNone;
    239243    }
    240244    bool isFilledDouble(Node* node)
    241245    {
    242         return generationInfo(node).registerFormat() == DataFormatDouble;
     246        VirtualRegister virtualRegister = node->virtualRegister();
     247        GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     248        return info.registerFormat() == DataFormatDouble;
    243249    }
    244250
    … …  
    248254        if (!node->hasResult())
    249255            return;
    250         GenerationInfo& info = generationInfo(node);
     256        VirtualRegister virtualRegister = node->virtualRegister();
     257        GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
    251258
    252259        // use() returns true when the value becomes dead, and any
    … …  
    327334    GPRReg fillSpeculateInt32(Edge, DataFormat& returnFormat);
    328335    GPRReg fillSpeculateInt32Strict(Edge);
    329     GPRReg fillSpeculateInt52(Edge, DataFormat desiredFormat);
    330336    FPRReg fillSpeculateDouble(Edge);
    331337    GPRReg fillSpeculateCell(Edge);
    … …  
    463469        return boxDouble(fpr, allocate());
    464470    }
    465    
    466     void boxInt52(GPRReg sourceGPR, GPRReg targetGPR, DataFormat);
    467471#elif USE(JSVALUE32_64)
    468472    void boxDouble(FPRReg fpr, GPRReg tagGPR, GPRReg payloadGPR)
    … …  
    556560    }
    557561   
    558     bool isKnownInteger(Node* node) { return m_state.forNode(node).isType(SpecInt32); }
    559     bool isKnownCell(Node* node) { return m_state.forNode(node).isType(SpecCell); }
     562    bool isKnownInteger(Node* node) { return !(m_state.forNode(node).m_type & ~SpecInt32); }
     563    bool isKnownCell(Node* node) { return !(m_state.forNode(node).m_type & ~SpecCell); }
    560564   
    561565    bool isKnownNotInteger(Node* node) { return !(m_state.forNode(node).m_type & SpecInt32); }
    562     bool isKnownNotNumber(Node* node) { return !(m_state.forNode(node).m_type & SpecFullNumber); }
     566    bool isKnownNotNumber(Node* node) { return !(m_state.forNode(node).m_type & SpecNumber); }
    563567    bool isKnownNotCell(Node* node) { return !(m_state.forNode(node).m_type & SpecCell); }
    564568   
    … …  
    813817        int32Result(reg, node, DataFormatInt32, mode);
    814818    }
    815     void int52Result(GPRReg reg, Node* node, DataFormat format, UseChildrenMode mode = CallUseChildren)
    816     {
    817         if (mode == CallUseChildren)
    818             useChildren(node);
    819 
    820         VirtualRegister virtualRegister = node->virtualRegister();
    821         GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
    822 
    823         m_gprs.retain(reg, virtualRegister, SpillOrderJS);
    824         info.initInt52(node, node->refCount(), reg, format);
    825     }
    826     void int52Result(GPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
    827     {
    828         int52Result(reg, node, DataFormatInt52, mode);
    829     }
    830     void strictInt52Result(GPRReg reg, Node* node, UseChildrenMode mode = CallUseChildren)
    831     {
    832         int52Result(reg, node, DataFormatStrictInt52, mode);
    833     }
    834819    void noResult(Node* node, UseChildrenMode mode = CallUseChildren)
    835820    {
    … …  
    916901    {
    917902        ASSERT(isInt32Constant(node) || isNumberConstant(node) || isJSConstant(node));
    918         generationInfo(node).initConstant(node, node->refCount());
     903        generationInfoFromVirtualRegister(node->virtualRegister()).initConstant(node, node->refCount());
    919904    }
    920905   
    … …  
    19051890            return true;
    19061891
    1907         return generationInfo(node).isJSInt32();
    1908     }
    1909    
    1910     bool betterUseStrictInt52(Node* node)
    1911     {
    1912         return !generationInfo(node).isInt52();
    1913     }
    1914     bool betterUseStrictInt52(Edge edge)
    1915     {
    1916         return betterUseStrictInt52(edge.node());
     1892        VirtualRegister virtualRegister = node->virtualRegister();
     1893        GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
     1894       
     1895        return info.isJSInt32();
    19171896    }
    19181897   
    … …  
    19201899    bool compilePeepHoleBranch(Node*, MacroAssembler::RelationalCondition, MacroAssembler::DoubleCondition, S_DFGOperation_EJJ);
    19211900    void compilePeepHoleInt32Branch(Node*, Node* branchNode, JITCompiler::RelationalCondition);
    1922     void compilePeepHoleInt52Branch(Node*, Node* branchNode, JITCompiler::RelationalCondition);
    19231901    void compilePeepHoleBooleanBranch(Node*, Node* branchNode, JITCompiler::RelationalCondition);
    19241902    void compilePeepHoleDoubleBranch(Node*, Node* branchNode, JITCompiler::DoubleCondition);
    … …  
    19681946   
    19691947    void compileInt32Compare(Node*, MacroAssembler::RelationalCondition);
    1970     void compileInt52Compare(Node*, MacroAssembler::RelationalCondition);
    19711948    void compileBooleanCompare(Node*, MacroAssembler::RelationalCondition);
    19721949    void compileDoubleCompare(Node*, MacroAssembler::DoubleCondition);
    … …  
    21422119
    21432120    void speculateInt32(Edge);
    2144     void speculateMachineInt(Edge);
    21452121    void speculateNumber(Edge);
    21462122    void speculateRealNumber(Edge);
    … …  
    22202196        return m_generationInfo[operandToLocal(virtualRegister)];
    22212197    }
    2222    
    2223     GenerationInfo& generationInfo(Node* node)
    2224     {
    2225         return generationInfoFromVirtualRegister(node->virtualRegister());
    2226     }
    2227    
    2228     GenerationInfo& generationInfo(Edge edge)
    2229     {
    2230         return generationInfo(edge.node());
    2231     }
    22322198
    22332199    // The JIT, while also provides MacroAssembler functionality.
    … …  
    27112677};
    27122678
    2713 // Gives you a canonical Int52 (i.e. it's left-shifted by 16, low bits zero).
    2714 class SpeculateInt52Operand {
    2715 public:
    2716     explicit SpeculateInt52Operand(SpeculativeJIT* jit, Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    2717         : m_jit(jit)
    2718         , m_edge(edge)
    2719         , m_gprOrInvalid(InvalidGPRReg)
    2720     {
    2721         ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == MachineIntUse);
    2722         if (jit->isFilled(node()))
    2723             gpr();
    2724     }
    2725    
    2726     ~SpeculateInt52Operand()
    2727     {
    2728         ASSERT(m_gprOrInvalid != InvalidGPRReg);
    2729         m_jit->unlock(m_gprOrInvalid);
    2730     }
    2731    
    2732     Edge edge() const
    2733     {
    2734         return m_edge;
    2735     }
    2736    
    2737     Node* node() const
    2738     {
    2739         return edge().node();
    2740     }
    2741    
    2742     GPRReg gpr()
    2743     {
    2744         if (m_gprOrInvalid == InvalidGPRReg)
    2745             m_gprOrInvalid = m_jit->fillSpeculateInt52(edge(), DataFormatInt52);
    2746         return m_gprOrInvalid;
    2747     }
    2748    
    2749     void use()
    2750     {
    2751         m_jit->use(node());
    2752     }
    2753    
    2754 private:
    2755     SpeculativeJIT* m_jit;
    2756     Edge m_edge;
    2757     GPRReg m_gprOrInvalid;
    2758 };
    2759 
    2760 // Gives you a strict Int52 (i.e. the payload is in the low 48 bits, high 16 bits are sign-extended).
    2761 class SpeculateStrictInt52Operand {
    2762 public:
    2763     explicit SpeculateStrictInt52Operand(SpeculativeJIT* jit, Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    2764         : m_jit(jit)
    2765         , m_edge(edge)
    2766         , m_gprOrInvalid(InvalidGPRReg)
    2767     {
    2768         ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == MachineIntUse);
    2769         if (jit->isFilled(node()))
    2770             gpr();
    2771     }
    2772    
    2773     ~SpeculateStrictInt52Operand()
    2774     {
    2775         ASSERT(m_gprOrInvalid != InvalidGPRReg);
    2776         m_jit->unlock(m_gprOrInvalid);
    2777     }
    2778    
    2779     Edge edge() const
    2780     {
    2781         return m_edge;
    2782     }
    2783    
    2784     Node* node() const
    2785     {
    2786         return edge().node();
    2787     }
    2788    
    2789     GPRReg gpr()
    2790     {
    2791         if (m_gprOrInvalid == InvalidGPRReg)
    2792             m_gprOrInvalid = m_jit->fillSpeculateInt52(edge(), DataFormatStrictInt52);
    2793         return m_gprOrInvalid;
    2794     }
    2795    
    2796     void use()
    2797     {
    2798         m_jit->use(node());
    2799     }
    2800    
    2801 private:
    2802     SpeculativeJIT* m_jit;
    2803     Edge m_edge;
    2804     GPRReg m_gprOrInvalid;
    2805 };
    2806 
    2807 enum OppositeShiftTag { OppositeShift };
    2808 
    2809 class SpeculateWhicheverInt52Operand {
    2810 public:
    2811     explicit SpeculateWhicheverInt52Operand(SpeculativeJIT* jit, Edge edge, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    2812         : m_jit(jit)
    2813         , m_edge(edge)
    2814         , m_gprOrInvalid(InvalidGPRReg)
    2815         , m_strict(jit->betterUseStrictInt52(edge))
    2816     {
    2817         ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == MachineIntUse);
    2818         if (jit->isFilled(node()))
    2819             gpr();
    2820     }
    2821    
    2822     explicit SpeculateWhicheverInt52Operand(SpeculativeJIT* jit, Edge edge, const SpeculateWhicheverInt52Operand& other, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    2823         : m_jit(jit)
    2824         , m_edge(edge)
    2825         , m_gprOrInvalid(InvalidGPRReg)
    2826         , m_strict(other.m_strict)
    2827     {
    2828         ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == MachineIntUse);
    2829         if (jit->isFilled(node()))
    2830             gpr();
    2831     }
    2832    
    2833     explicit SpeculateWhicheverInt52Operand(SpeculativeJIT* jit, Edge edge, OppositeShiftTag, const SpeculateWhicheverInt52Operand& other, OperandSpeculationMode mode = AutomaticOperandSpeculation)
    2834         : m_jit(jit)
    2835         , m_edge(edge)
    2836         , m_gprOrInvalid(InvalidGPRReg)
    2837         , m_strict(!other.m_strict)
    2838     {
    2839         ASSERT_UNUSED(mode, mode == ManualOperandSpeculation || edge.useKind() == MachineIntUse);
    2840         if (jit->isFilled(node()))
    2841             gpr();
    2842     }
    2843    
    2844     ~SpeculateWhicheverInt52Operand()
    2845     {
    2846         ASSERT(m_gprOrInvalid != InvalidGPRReg);
    2847         m_jit->unlock(m_gprOrInvalid);
    2848     }
    2849    
    2850     Edge edge() const
    2851     {
    2852         return m_edge;
    2853     }
    2854    
    2855     Node* node() const
    2856     {
    2857         return edge().node();
    2858     }
    2859    
    2860     GPRReg gpr()
    2861     {
    2862         if (m_gprOrInvalid == InvalidGPRReg) {
    2863             m_gprOrInvalid = m_jit->fillSpeculateInt52(
    2864                 edge(), m_strict ? DataFormatStrictInt52 : DataFormatInt52);
    2865         }
    2866         return m_gprOrInvalid;
    2867     }
    2868    
    2869     void use()
    2870     {
    2871         m_jit->use(node());
    2872     }
    2873    
    2874     DataFormat format() const
    2875     {
    2876         return m_strict ? DataFormatStrictInt52 : DataFormatInt52;
    2877     }
    2878 
    2879 private:
    2880     SpeculativeJIT* m_jit;
    2881     Edge m_edge;
    2882     GPRReg m_gprOrInvalid;
    2883     bool m_strict;
    2884 };
    2885 
    28862679class SpeculateDoubleOperand {
    28872680public:
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT32_64.cpp

    r156019 r156029  
    889889    AbstractValue& value = m_state.forNode(edge);
    890890    SpeculatedType type = value.m_type;
    891     ASSERT(edge.useKind() != KnownNumberUse || !(value.m_type & ~SpecFullNumber));
    892     m_interpreter.filter(value, SpecFullNumber);
     891    ASSERT(edge.useKind() != KnownNumberUse || !(value.m_type & ~SpecNumber));
     892    m_interpreter.filter(value, SpecNumber);
    893893    VirtualRegister virtualRegister = edge->virtualRegister();
    894894    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
    … …  
    929929            if (spillFormat != DataFormatJSInt32 && spillFormat != DataFormatInt32) {
    930930                JITCompiler::Jump isInteger = m_jit.branch32(MacroAssembler::Equal, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::Int32Tag));
    931                 if (type & ~SpecFullNumber)
     931                if (type & ~SpecNumber)
    932932                    speculationCheck(BadType, JSValueSource(JITCompiler::addressFor(virtualRegister)), edge, m_jit.branch32(MacroAssembler::AboveOrEqual, JITCompiler::tagFor(virtualRegister), TrustedImm32(JSValue::LowestTag)));
    933933                m_jit.loadDouble(JITCompiler::addressFor(virtualRegister), fpr);
    … …  
    964964            FPRTemporary scratch(this);
    965965            JITCompiler::Jump isInteger = m_jit.branch32(MacroAssembler::Equal, tagGPR, TrustedImm32(JSValue::Int32Tag));
    966             if (type & ~SpecFullNumber)
     966            if (type & ~SpecNumber)
    967967                speculationCheck(BadType, JSValueRegs(tagGPR, payloadGPR), edge, m_jit.branch32(MacroAssembler::AboveOrEqual, tagGPR, TrustedImm32(JSValue::LowestTag)));
    968968            unboxDouble(tagGPR, payloadGPR, fpr, scratch.fpr());
    … …  
    29242924
    29252925            DFG_TYPE_CHECK(
    2926                 JSValueRegs(), node->child2(), SpecFullRealNumber,
     2926                JSValueRegs(), node->child2(), SpecRealNumber,
    29272927                m_jit.branchDouble(MacroAssembler::DoubleNotEqualOrUnordered, valueFPR, valueFPR));
    29282928           
    … …  
    31883188        op1.use();
    31893189       
    3190         if (!(m_state.forNode(node->child1()).m_type & ~(SpecFullNumber | SpecBoolean))) {
     3190        if (!(m_state.forNode(node->child1()).m_type & ~(SpecNumber | SpecBoolean))) {
    31913191            m_jit.move(op1TagGPR, resultTagGPR);
    31923192            m_jit.move(op1PayloadGPR, resultPayloadGPR);
    … …  
    32903290                    FPRReg opFPR = operand.fpr();
    32913291                    DFG_TYPE_CHECK(
    3292                         JSValueRegs(), use, SpecFullRealNumber,
     3292                        JSValueRegs(), use, SpecRealNumber,
    32933293                        m_jit.branchDouble(MacroAssembler::DoubleNotEqualOrUnordered, opFPR, opFPR));
    32943294       
    … …  
    33553355                FPRReg opFPR = operand.fpr();
    33563356                DFG_TYPE_CHECK(
    3357                     JSValueRegs(), use, SpecFullRealNumber,
     3357                    JSValueRegs(), use, SpecRealNumber,
    33583358                    m_jit.branchDouble(MacroAssembler::DoubleNotEqualOrUnordered, opFPR, opFPR));
    33593359               
    … …  
    47984798    case CheckTierUpAtReturn:
    47994799    case CheckTierUpAndOSREnter:
    4800     case Int52ToDouble:
    4801     case Int52ToValue:
    48024800        RELEASE_ASSERT_NOT_REACHED();
    48034801        break;
  • trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT64.cpp

    r156019 r156029  
    4141#if USE(JSVALUE64)
    4242
    43 void SpeculativeJIT::boxInt52(GPRReg sourceGPR, GPRReg targetGPR, DataFormat format)
    44 {
    45     GPRReg tempGPR;
    46     if (sourceGPR == targetGPR)
    47         tempGPR = allocate();
    48     else
    49         tempGPR = targetGPR;
    50    
    51     FPRReg fpr = fprAllocate();
    52 
    53     if (format == DataFormatInt52)
    54         m_jit.rshift64(TrustedImm32(JSValue::int52ShiftAmount), sourceGPR);
    55     else
    56         ASSERT(format == DataFormatStrictInt52);
    57    
    58     m_jit.boxInt52(sourceGPR, targetGPR, tempGPR, fpr);
    59    
    60     if (tempGPR != targetGPR)
    61         unlock(tempGPR);
    62    
    63     unlock(fpr);
    64 }
    65 
    6643GPRReg SpeculativeJIT::fillJSValue(Edge edge)
    6744{
    … …  
    9370            DataFormat spillFormat = info.spillFormat();
    9471            m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    95             switch (spillFormat) {
    96             case DataFormatInt32: {
     72            if (spillFormat == DataFormatInt32) {
    9773                m_jit.load32(JITCompiler::addressFor(virtualRegister), gpr);
    9874                m_jit.or64(GPRInfo::tagTypeNumberRegister, gpr);
    9975                spillFormat = DataFormatJSInt32;
    100                 break;
    101             }
    102                
    103             case DataFormatInt52:
    104             case DataFormatStrictInt52: {
    105                 m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
    106                 boxInt52(gpr, gpr, spillFormat);
    107                 return gpr;
    108             }
    109                
    110             default:
     76            } else {
    11177                m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
    11278                if (spillFormat == DataFormatDouble) {
    … …  
    11682                } else
    11783                    RELEASE_ASSERT(spillFormat & DataFormatJS);
    118                 break;
    11984            }
    12085            info.fillJSValue(*m_stream, gpr, spillFormat);
    … …  
    148113
    149114        return gpr;
    150     }
    151        
    152     case DataFormatInt52:
    153     case DataFormatStrictInt52: {
    154         GPRReg gpr = info.gpr();
    155         lock(gpr);
    156         GPRReg resultGPR = allocate();
    157         boxInt52(gpr, resultGPR, info.registerFormat());
    158         unlock(gpr);
    159         return resultGPR;
    160115    }
    161116
    … …  
    814769        DataFormat spillFormat = info.spillFormat();
    815770       
    816         RELEASE_ASSERT((spillFormat & DataFormatJS) || spillFormat == DataFormatInt32 || spillFormat == DataFormatInt52 || spillFormat == DataFormatStrictInt52);
     771        RELEASE_ASSERT((spillFormat & DataFormatJS) || spillFormat == DataFormatInt32);
    817772       
    818773        m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    … …  
    835790            return gpr;
    836791        }
    837         if (spillFormat == DataFormatInt52 || spillFormat == DataFormatStrictInt52) {
    838             // Generally, this can only happen if we've already proved that the
    839             // value is an int32. That's because if a value originated as a JSValue
    840             // then we would speculate that it's an int32 before representing it as
    841             // an int52. Otherwise, if we knowingly produced an int52, then we would
    842             // be boxing it into a value using Int52ToValue. This assertion is valid
    843             // only because Int52 is something that we introduce at prediction time.
    844             // However: we may have an int32-producing node replaced by an
    845             // int52-producing node due to CSE. So we must do a check.
    846             RELEASE_ASSERT(!(type & ~SpecMachineInt));
    847             if (type & SpecInt52) {
    848                 GPRReg temp = allocate();
    849                 m_jit.signExtend32ToPtr(gpr, temp);
    850                 // Currently, we can't supply value profiling information here. :-/
    851                 speculationCheck(
    852                     BadType, JSValueRegs(), 0,
    853                     m_jit.branch64(MacroAssembler::NotEqual, gpr, temp));
    854                 unlock(temp);
    855             }
    856             if (spillFormat == DataFormatStrictInt52)
    857                 m_jit.load32(JITCompiler::addressFor(virtualRegister), gpr);
    858             else {
    859                 m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
    860                 m_jit.rshift64(TrustedImm32(JSValue::int52ShiftAmount), gpr);
    861                 m_jit.zeroExtend32ToPtr(gpr, gpr);
    862             }
    863             info.fillInt32(*m_stream, gpr);
    864             returnFormat = DataFormatInt32;
    865             return gpr;
    866         }
    867792        m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
    868793
    … …  
    873798
    874799    case DataFormatJS: {
    875         RELEASE_ASSERT(!(type & SpecInt52));
    876800        // Check the value is an integer.
    877801        GPRReg gpr = info.gpr();
    … …  
    920844        return gpr;
    921845    }
    922        
    923     case DataFormatStrictInt52:
    924     case DataFormatInt52: {
    925         GPRReg gpr = info.gpr();
    926         GPRReg result;
    927         if (m_gprs.isLocked(gpr)) {
    928             result = allocate();
    929             m_jit.move(gpr, result);
    930         } else {
    931             lock(gpr);
    932             info.fillInt32(*m_stream, gpr);
    933             result = gpr;
    934         }
    935         RELEASE_ASSERT(!(type & ~SpecMachineInt));
    936         if (info.registerFormat() == DataFormatInt52)
    937             m_jit.rshift64(TrustedImm32(JSValue::int52ShiftAmount), result);
    938         if (type & SpecInt52) {
    939             GPRReg temp = allocate();
    940             m_jit.signExtend32ToPtr(result, temp);
    941             // Currently, we can't supply value profiling information here. :-/
    942             speculationCheck(
    943                 BadType, JSValueRegs(), 0,
    944                 m_jit.branch64(MacroAssembler::NotEqual, result, temp));
    945             unlock(temp);
    946         }
    947         m_jit.zeroExtend32ToPtr(result, result);
    948         returnFormat = DataFormatInt32;
    949         return gpr;
    950     }
    951846
    952847    case DataFormatDouble:
    … …  
    991886}
    992887
    993 GPRReg SpeculativeJIT::fillSpeculateInt52(Edge edge, DataFormat desiredFormat)
    994 {
    995     ASSERT(desiredFormat == DataFormatInt52 || desiredFormat == DataFormatStrictInt52);
    996     AbstractValue& value = m_state.forNode(edge);
    997     SpeculatedType type = value.m_type;
    998     m_interpreter.filter(value, SpecMachineInt);
    999     VirtualRegister virtualRegister = edge->virtualRegister();
    1000     GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
    1001 
    1002     switch (info.registerFormat()) {
    1003     case DataFormatNone: {
    1004         if ((edge->hasConstant() && !valueOfJSConstant(edge.node()).isMachineInt()) || info.spillFormat() == DataFormatDouble) {
    1005             terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    1006             return allocate();
    1007         }
    1008        
    1009         GPRReg gpr = allocate();
    1010 
    1011         if (edge->hasConstant()) {
    1012             JSValue jsValue = valueOfJSConstant(edge.node());
    1013             ASSERT(jsValue.isMachineInt());
    1014             m_gprs.retain(gpr, virtualRegister, SpillOrderConstant);
    1015             int64_t value = jsValue.asMachineInt();
    1016             if (desiredFormat == DataFormatInt52)
    1017                 value = value << JSValue::int52ShiftAmount;
    1018             m_jit.move(MacroAssembler::Imm64(value), gpr);
    1019             info.fillGPR(*m_stream, gpr, desiredFormat);
    1020             return gpr;
    1021         }
    1022        
    1023         DataFormat spillFormat = info.spillFormat();
    1024        
    1025         RELEASE_ASSERT((spillFormat & DataFormatJS) || spillFormat == DataFormatInt32 || spillFormat == DataFormatInt52 || spillFormat == DataFormatStrictInt52);
    1026        
    1027         m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    1028        
    1029         if (spillFormat == DataFormatJSInt32 || spillFormat == DataFormatInt32) {
    1030             // If we know this was spilled as an integer we can fill without checking.
    1031             m_jit.load32(JITCompiler::addressFor(virtualRegister), gpr);
    1032             m_jit.signExtend32ToPtr(gpr, gpr);
    1033             if (desiredFormat == DataFormatStrictInt52) {
    1034                 info.fillStrictInt52(*m_stream, gpr);
    1035                 return gpr;
    1036             }
    1037             m_jit.lshift64(TrustedImm32(JSValue::int52ShiftAmount), gpr);
    1038             info.fillInt52(*m_stream, gpr);
    1039             return gpr;
    1040         }
    1041         if (spillFormat == DataFormatInt52 || spillFormat == DataFormatStrictInt52) {
    1042             m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
    1043             if (desiredFormat == DataFormatStrictInt52) {
    1044                 if (spillFormat == DataFormatInt52)
    1045                     m_jit.rshift64(TrustedImm32(JSValue::int52ShiftAmount), gpr);
    1046                 info.fillStrictInt52(*m_stream, gpr);
    1047                 return gpr;
    1048             }
    1049             if (spillFormat == DataFormatStrictInt52)
    1050                 m_jit.lshift64(TrustedImm32(JSValue::int52ShiftAmount), gpr);
    1051             info.fillInt52(*m_stream, gpr);
    1052             return gpr;
    1053         }
    1054         m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
    1055 
    1056         // Fill as JSValue, and fall through.
    1057         info.fillJSValue(*m_stream, gpr, DataFormatJSInt32);
    1058         m_gprs.unlock(gpr);
    1059     }
    1060 
    1061     case DataFormatJS: {
    1062         // Check the value is an integer. Note that we would *like* to unbox an Int52
    1063         // at this point but this is too costly. We only *prove* that this is an Int52
    1064         // even though we check if it's an int32.
    1065         GPRReg gpr = info.gpr();
    1066         GPRReg result;
    1067         if (m_gprs.isLocked(gpr)) {
    1068             result = allocate();
    1069             m_jit.move(gpr, result);
    1070         } else {
    1071             m_gprs.lock(gpr);
    1072             result = gpr;
    1073         }
    1074         if (type & ~SpecInt32)
    1075             speculationCheck(BadType, JSValueRegs(result), edge, m_jit.branch64(MacroAssembler::Below, result, GPRInfo::tagTypeNumberRegister));
    1076         if (result == gpr) // The not-already-locked, so fill in-place, case.
    1077             info.fillInt52(*m_stream, gpr, desiredFormat);
    1078         m_jit.signExtend32ToPtr(result, result);
    1079         if (desiredFormat == DataFormatInt52)
    1080             m_jit.lshift64(TrustedImm32(JSValue::int52ShiftAmount), result);
    1081         return result;
    1082     }
    1083 
    1084     case DataFormatInt32:
    1085     case DataFormatJSInt32: {
    1086         GPRReg gpr = info.gpr();
    1087         GPRReg result;
    1088         if (m_gprs.isLocked(gpr)) {
    1089             result = allocate();
    1090             m_jit.move(gpr, result);
    1091         } else {
    1092             m_gprs.lock(gpr);
    1093             info.fillInt52(*m_stream, gpr, desiredFormat);
    1094             result = gpr;
    1095         }
    1096         m_jit.signExtend32ToPtr(result, result);
    1097         if (desiredFormat == DataFormatInt52)
    1098             m_jit.lshift64(TrustedImm32(JSValue::int52ShiftAmount), result);
    1099         return result;
    1100     }
    1101 
    1102     case DataFormatStrictInt52: {
    1103         GPRReg gpr = info.gpr();
    1104         bool wasLocked = m_gprs.isLocked(gpr);
    1105         lock(gpr);
    1106         if (desiredFormat == DataFormatStrictInt52)
    1107             return gpr;
    1108         if (wasLocked) {
    1109             GPRReg result = allocate();
    1110             m_jit.move(gpr, result);
    1111             unlock(gpr);
    1112             gpr = result;
    1113         } else
    1114             info.fillStrictInt52(*m_stream, gpr);
    1115         m_jit.lshift64(TrustedImm32(JSValue::int52ShiftAmount), gpr);
    1116         return gpr;
    1117     }
    1118        
    1119     case DataFormatInt52: {
    1120         GPRReg gpr = info.gpr();
    1121         bool wasLocked = m_gprs.isLocked(gpr);
    1122         lock(gpr);
    1123         if (desiredFormat == DataFormatInt52)
    1124             return gpr;
    1125         if (wasLocked) {
    1126             GPRReg result = allocate();
    1127             m_jit.move(gpr, result);
    1128             unlock(gpr);
    1129             gpr = result;
    1130         } else
    1131             info.fillInt52(*m_stream, gpr);
    1132         m_jit.rshift64(TrustedImm32(JSValue::int52ShiftAmount), gpr);
    1133         return gpr;
    1134     }
    1135 
    1136     case DataFormatDouble:
    1137     case DataFormatJSDouble:
    1138         if (edge->hasConstant()) {
    1139             JSValue jsValue = valueOfJSConstant(edge.node());
    1140             if (jsValue.isMachineInt()) {
    1141                 int64_t value = jsValue.asMachineInt();
    1142                 if (desiredFormat == DataFormatInt52)
    1143                     value = value << JSValue::int52ShiftAmount;
    1144                 GPRReg gpr = allocate();
    1145                 m_jit.move(MacroAssembler::Imm64(value), gpr);
    1146                 return gpr;
    1147             }
    1148         }
    1149        
    1150     case DataFormatCell:
    1151     case DataFormatBoolean:
    1152     case DataFormatJSCell:
    1153     case DataFormatJSBoolean: {
    1154         terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    1155         return allocate();
    1156     }
    1157 
    1158     case DataFormatStorage:
    1159         RELEASE_ASSERT_NOT_REACHED();
    1160        
    1161     default:
    1162         RELEASE_ASSERT_NOT_REACHED();
    1163         return InvalidGPRReg;
    1164     }
    1165 }
    1166 
    1167888FPRReg SpeculativeJIT::fillSpeculateDouble(Edge edge)
    1168889{
    … …  
    1172893    AbstractValue& value = m_state.forNode(edge);
    1173894    SpeculatedType type = value.m_type;
    1174     ASSERT(edge.useKind() != KnownNumberUse || !(value.m_type & ~SpecFullNumber));
    1175     m_interpreter.filter(value, SpecFullNumber);
     895    ASSERT(edge.useKind() != KnownNumberUse || !(value.m_type & ~SpecNumber));
     896    m_interpreter.filter(value, SpecNumber);
    1176897    VirtualRegister virtualRegister = edge->virtualRegister();
    1177898    GenerationInfo& info = generationInfoFromVirtualRegister(virtualRegister);
    … …  
    1225946            break;
    1226947        }
    1227            
    1228         case DataFormatInt52: {
    1229             GPRReg gpr = allocate();
    1230             m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    1231             m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
    1232             info.fillInt52(*m_stream, gpr);
    1233             unlock(gpr);
    1234             break;
    1235         }
    1236            
    1237         case DataFormatStrictInt52: {
    1238             GPRReg gpr = allocate();
    1239             m_gprs.retain(gpr, virtualRegister, SpillOrderSpilled);
    1240             m_jit.load64(JITCompiler::addressFor(virtualRegister), gpr);
    1241             info.fillStrictInt52(*m_stream, gpr);
    1242             unlock(gpr);
    1243             break;
    1244         }
    1245948
    1246949        default:
    … …  
    1276979        JITCompiler::Jump isInteger = m_jit.branch64(MacroAssembler::AboveOrEqual, jsValueGpr, GPRInfo::tagTypeNumberRegister);
    1277980
    1278         if (type & ~SpecFullNumber)
     981        if (type & ~SpecNumber)
    1279982            speculationCheck(BadType, JSValueRegs(jsValueGpr), edge, m_jit.branchTest64(MacroAssembler::Zero, jsValueGpr, GPRInfo::tagTypeNumberRegister));
    1280983
    … …  
    13041007        m_gprs.lock(gpr);
    13051008        m_jit.convertInt32ToDouble(gpr, fpr);
    1306         m_gprs.unlock(gpr);
    1307         return fpr;
    1308     }
    1309        
    1310     case DataFormatInt52: {
    1311         FPRReg fpr = fprAllocate();
    1312         GPRReg gpr = info.gpr();
    1313         m_gprs.lock(gpr);
    1314         GPRReg temp = allocate();
    1315         m_jit.move(gpr, temp);
    1316         m_jit.rshift64(TrustedImm32(JSValue::int52ShiftAmount), temp);
    1317         m_jit.convertInt64ToDouble(temp, fpr);
    1318         unlock(temp);
    1319         m_gprs.unlock(gpr);
    1320         return fpr;
    1321     }
    1322        
    1323     case DataFormatStrictInt52: {
    1324         FPRReg fpr = fprAllocate();
    1325         GPRReg gpr = info.gpr();
    1326         m_gprs.lock(gpr);
    1327         m_jit.convertInt64ToDouble(gpr, fpr);
    13281009        m_gprs.unlock(gpr);
    13291010        return fpr;
    … …  
    14311112    case DataFormatDouble:
    14321113    case DataFormatJSBoolean:
    1433     case DataFormatBoolean:
    1434     case DataFormatInt52:
    1435     case DataFormatStrictInt52: {
     1114    case DataFormatBoolean: {
    14361115        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    14371116        return allocate();
    … …  
    15161195    case DataFormatDouble:
    15171196    case DataFormatJSCell:
    1518     case DataFormatCell:
    1519     case DataFormatInt52:
    1520     case DataFormatStrictInt52: {
     1197    case DataFormatCell: {
    15211198        terminateSpeculativeExecution(Uncountable, JSValueRegs(), 0);
    15221199        return allocate();
    … …  
    18251502    m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
    18261503    jsValueResult(result.gpr(), m_currentNode, DataFormatJSBoolean);
    1827 }
    1828 
    1829 void SpeculativeJIT::compileInt52Compare(Node* node, MacroAssembler::RelationalCondition condition)
    1830 {
    1831     SpeculateWhicheverInt52Operand op1(this, node->child1());
    1832     SpeculateWhicheverInt52Operand op2(this, node->child2(), op1);
    1833     GPRTemporary result(this, Reuse, op1, op2);
    1834    
    1835     m_jit.compare64(condition, op1.gpr(), op2.gpr(), result.gpr());
    1836    
    1837     // If we add a DataFormatBool, we should use it here.
    1838     m_jit.or32(TrustedImm32(ValueFalse), result.gpr());
    1839     jsValueResult(result.gpr(), m_currentNode, DataFormatJSBoolean);
    1840 }
    1841 
    1842 void SpeculativeJIT::compilePeepHoleInt52Branch(Node* node, Node* branchNode, JITCompiler::RelationalCondition condition)
    1843 {
    1844     BasicBlock* taken = branchNode->takenBlock();
    1845     BasicBlock* notTaken = branchNode->notTakenBlock();
    1846 
    1847     // The branch instruction will branch to the taken block.
    1848     // If taken is next, switch taken with notTaken & invert the branch condition so we can fall through.
    1849     if (taken == nextBlock()) {
    1850         condition = JITCompiler::invert(condition);
    1851         BasicBlock* tmp = taken;
    1852         taken = notTaken;
    1853         notTaken = tmp;
    1854     }
    1855    
    1856     SpeculateWhicheverInt52Operand op1(this, node->child1());
    1857     SpeculateWhicheverInt52Operand op2(this, node->child2(), op1);
    1858    
    1859     branch64(condition, op1.gpr(), op2.gpr(), taken);
    1860     jump(notTaken);
    18611504}
    18621505
    … …  
    22641907        }
    22651908           
    2266         case FlushedInt52: {
    2267             GPRTemporary result(this);
    2268             m_jit.load64(JITCompiler::addressFor(node->local()), result.gpr());
    2269            
    2270             VirtualRegister virtualRegister = node->virtualRegister();
    2271             m_gprs.retain(result.gpr(), virtualRegister, SpillOrderJS);
    2272             generationInfoFromVirtualRegister(virtualRegister).initInt52(node, node->refCount(), result.gpr());
    2273             break;
    2274         }
    2275            
    22761909        default:
    22771910            GPRTemporary result(this);
    … …  
    23491982        }
    23501983           
    2351         case FlushedInt52: {
    2352             SpeculateInt52Operand value(this, node->child1());
    2353             m_jit.store64(value.gpr(), JITCompiler::addressFor(node->local()));
    2354             noResult(node);
    2355             recordSetLocal(node->local(), ValueSource(Int52InJSStack));
    2356             break;
    2357         }
    2358            
    23591984        case FlushedCell: {
    23601985            SpeculateCellOperand cell(this, node->child1());
    … …  
    24772102    case Int32ToDouble: {
    24782103        compileInt32ToDouble(node);
    2479         break;
    2480     }
    2481        
    2482     case Int52ToValue: {
    2483         JSValueOperand operand(this, node->child1());
    2484         GPRTemporary result(this, Reuse, operand);
    2485         m_jit.move(operand.gpr(), result.gpr());
    2486         jsValueResult(result.gpr(), node);
    2487         break;
    2488     }
    2489        
    2490     case Int52ToDouble: {
    2491         SpeculateDoubleOperand operand(this, node->child1());
    2492         FPRTemporary result(this, operand);
    2493         m_jit.moveDouble(operand.fpr(), result.fpr());
    2494         doubleResult(result.fpr(), node);
    24952104        break;
    24962105    }
    … …  
    32812890
    32822891            DFG_TYPE_CHECK(
    3283                 JSValueRegs(), node->child2(), SpecFullRealNumber,
     2892                JSValueRegs(), node->child2(), SpecRealNumber,
    32842893                m_jit.branchDouble(MacroAssembler::DoubleNotEqualOrUnordered, valueFPR, valueFPR));
    32852894           
    … …  
    34973106        op1.use();
    34983107       
    3499         if (!(m_state.forNode(node->child1()).m_type & ~(SpecFullNumber | SpecBoolean)))
     3108        if (!(m_state.forNode(node->child1()).m_type & ~(SpecNumber | SpecBoolean)))
    35003109            m_jit.move(op1GPR, resultGPR);
    35013110        else {
    … …  
    35943203                    FPRReg opFPR = operand.fpr();
    35953204                    DFG_TYPE_CHECK(
    3596                         JSValueRegs(), use, SpecFullRealNumber,
     3205                        JSValueRegs(), use, SpecRealNumber,
    35973206                        m_jit.branchDouble(
    35983207                            MacroAssembler::DoubleNotEqualOrUnordered, opFPR, opFPR));
    … …  
    36593268                GPRReg scratchGPR = scratch.gpr();
    36603269                DFG_TYPE_CHECK(
    3661                     JSValueRegs(), use, SpecFullRealNumber,
     3270                    JSValueRegs(), use, SpecRealNumber,
    36623271                    m_jit.branchDouble(
    36633272                        MacroAssembler::DoubleNotEqualOrUnordered, opFPR, opFPR));
  • trunk/Source/JavaScriptCore/dfg/DFGUseKind.cpp

    r156019 r156029  
    4444    case KnownInt32Use:
    4545        out.print("KnownInt32");
    46         break;
    47     case MachineIntUse:
    48         out.print("MachineInt");
    4946        break;
    5047    case RealNumberUse:
  • trunk/Source/JavaScriptCore/dfg/DFGUseKind.h

    r156019 r156029  
    4040    Int32Use,
    4141    KnownInt32Use,
    42     MachineIntUse,
    4342    RealNumberUse,
    4443    NumberUse,
    … …  
    6867    case KnownInt32Use:
    6968        return SpecInt32;
    70     case MachineIntUse:
    71         return SpecMachineInt;
    7269    case RealNumberUse:
    73         return SpecFullRealNumber;
     70        return SpecRealNumber;
    7471    case NumberUse:
    7572    case KnownNumberUse:
    76         return SpecFullNumber;
     73        return SpecNumber;
    7774    case BooleanUse:
    7875        return SpecBoolean;
    … …  
    129126    case Int32Use:
    130127    case KnownInt32Use:
    131     case MachineIntUse:
    132128    case RealNumberUse:
    133129    case NumberUse:
  • trunk/Source/JavaScriptCore/dfg/DFGValueSource.cpp

    r156019 r156029  
    4646        out.print("Int32");
    4747        break;
    48     case Int52InJSStack:
    49         out.print("Int52");
    50         break;
    5148    case CellInJSStack:
    5249        out.print("Cell");
  • trunk/Source/JavaScriptCore/dfg/DFGValueSource.h

    r156019 r156029  
    4444    ValueInJSStack,
    4545    Int32InJSStack,
    46     Int52InJSStack,
    4746    CellInJSStack,
    4847    BooleanInJSStack,
    … …  
    5857    case DataFormatInt32:
    5958        return Int32InJSStack;
    60     case DataFormatInt52:
    61         return Int52InJSStack;
    6259    case DataFormatDouble:
    6360        return DoubleInJSStack;
    … …  
    8380    case Int32InJSStack:
    8481        return DataFormatInt32;
    85     case Int52InJSStack:
    86         return DataFormatInt52;
    8782    case CellInJSStack:
    8883        return DataFormatCell;
    … …  
    145140        case FlushedInt32:
    146141            return ValueSource(Int32InJSStack);
    147         case FlushedInt52:
    148             return ValueSource(Int52InJSStack);
    149142        case FlushedCell:
    150143            return ValueSource(CellInJSStack);
    … …  
    189182            return ValueRecovery::alreadyInJSStackAsUnboxedInt32();
    190183           
    191         case Int52InJSStack:
    192             return ValueRecovery::alreadyInJSStackAsUnboxedInt52();
    193            
    194184        case CellInJSStack:
    195185            return ValueRecovery::alreadyInJSStackAsUnboxedCell();
  • trunk/Source/JavaScriptCore/dfg/DFGVariableAccessData.h

    r156019 r156029  
    236236        // If the variable is not a number prediction, then this doesn't
    237237        // make any sense.
    238         if (!isFullNumberSpeculation(prediction())) {
     238        if (!isNumberSpeculation(prediction())) {
    239239            // FIXME: we may end up forcing a local in inlined argument position to be a double even
    240240            // if it is sometimes not even numeric, since this never signals the fact that it doesn't
    … …  
    333333        if (isInt32Speculation(prediction))
    334334            return FlushedInt32;
    335        
    336         if (enableInt52() && !operandIsArgument(m_local) && isMachineIntSpeculation(prediction))
    337             return FlushedInt52;
    338335       
    339336        if (isCellSpeculation(prediction))
  • trunk/Source/JavaScriptCore/ftl/FTLCArgumentGetter.cpp

    r156019 r156029  
    3333using namespace DFG;
    3434
    35 void CArgumentGetter::loadNextAndBox(
    36     ValueFormat format, GPRReg destination, GPRReg scratch1, GPRReg scratch2)
     35void CArgumentGetter::loadNextAndBox(ValueFormat format, GPRReg destination, GPRReg scratch)
    3736{
    38     if (scratch1 == InvalidGPRReg) {
    39         ASSERT(scratch2 == InvalidGPRReg);
     37    if (scratch == InvalidGPRReg) {
    4038        if (destination == GPRInfo::nonArgGPR0)
    41             scratch1 = GPRInfo::nonArgGPR1;
     39            scratch = GPRInfo::nonArgGPR1;
    4240        else
    43             scratch1 = GPRInfo::nonArgGPR0;
    44     }
    45     if (scratch2 == InvalidGPRReg) {
    46         if (destination != GPRInfo::nonArgGPR0 && scratch1 != GPRInfo::nonArgGPR0)
    47             scratch2 = GPRInfo::nonArgGPR0;
    48         else if (destination != GPRInfo::nonArgGPR1 && scratch1 != GPRInfo::nonArgGPR1)
    49             scratch2 = GPRInfo::nonArgGPR1;
    50         else
    51             scratch2 = GPRInfo::nonArgGPR2;
     41            scratch = GPRInfo::nonArgGPR0;
    5242    }
    5343   
    … …  
    6151    case ValueFormatUInt32: {
    6252        loadNext32(destination);
    63         m_jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch2);
    64         m_jit.boxInt52(destination, destination, scratch1, FPRInfo::fpRegT0);
    65         m_jit.move64ToDouble(scratch2, FPRInfo::fpRegT0);
    66         break;
    67     }
    68        
    69     case ValueFormatInt52: {
    70         loadNext64(destination);
    71         m_jit.rshift64(AssemblyHelpers::TrustedImm32(JSValue::int52ShiftAmount), destination);
    72         m_jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch2);
    73         m_jit.boxInt52(destination, destination, scratch1, FPRInfo::fpRegT0);
    74         m_jit.move64ToDouble(scratch2, FPRInfo::fpRegT0);
    75         break;
    76     }
     53        MacroAssembler::Jump isInt = m_jit.branch32(
     54            MacroAssembler::GreaterThanOrEqual,
     55            destination, MacroAssembler::TrustedImm32(0));
    7756           
    78     case ValueFormatStrictInt52: {
    79         loadNext64(destination);
    80         m_jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch2);
    81         m_jit.boxInt52(destination, destination, scratch1, FPRInfo::fpRegT0);
    82         m_jit.move64ToDouble(scratch2, FPRInfo::fpRegT0);
     57        m_jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch);
     58        m_jit.convertInt32ToDouble(destination, FPRInfo::fpRegT0);
     59        m_jit.boxDouble(FPRInfo::fpRegT0, destination);
     60        m_jit.move64ToDouble(scratch, FPRInfo::fpRegT0);
     61           
     62        MacroAssembler::Jump done = m_jit.jump();
     63           
     64        isInt.link(&m_jit);
     65        m_jit.or64(GPRInfo::tagTypeNumberRegister, destination);
     66           
     67        done.link(&m_jit);
    8368        break;
    8469    }
    … …  
    9681           
    9782    case ValueFormatDouble: {
    98         m_jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch1);
     83        m_jit.moveDoubleTo64(FPRInfo::fpRegT0, scratch);
    9984        loadNextDouble(FPRInfo::fpRegT0);
    10085        m_jit.boxDouble(FPRInfo::fpRegT0, destination);
    101         m_jit.move64ToDouble(scratch1, FPRInfo::fpRegT0);
     86        m_jit.move64ToDouble(scratch, FPRInfo::fpRegT0);
    10287        break;
    10388    }
  • trunk/Source/JavaScriptCore/ftl/FTLCArgumentGetter.h

    r156019 r156029  
    116116   
    117117    void loadNextAndBox(
    118         ValueFormat, DFG::GPRReg destination,
    119         DFG::GPRReg scratch1 = InvalidGPRReg, DFG::GPRReg scratch2 = InvalidGPRReg);
     118        ValueFormat format, DFG::GPRReg destination, DFG::GPRReg scratch = InvalidGPRReg);
    120119
    121120private:
  • trunk/Source/JavaScriptCore/ftl/FTLCapabilities.cpp

    r156019 r156029  
    165165        if (node->isBinaryUseKind(Int32Use))
    166166            break;
    167         if (node->isBinaryUseKind(MachineIntUse))
    168             break;
    169167        if (node->isBinaryUseKind(NumberUse))
    170168            break;
    … …  
    177175    case CompareGreaterEq:
    178176        if (node->isBinaryUseKind(Int32Use))
    179             break;
    180         if (node->isBinaryUseKind(MachineIntUse))
    181177            break;
    182178        if (node->isBinaryUseKind(NumberUse))
    … …  
    241237                case Int32Use:
    242238                case KnownInt32Use:
    243                 case MachineIntUse:
    244239                case NumberUse:
    245240                case KnownNumberUse:
  • trunk/Source/JavaScriptCore/ftl/FTLExitValue.cpp

    r156019 r156029  
    5454        out.print("InJSStackAsInt32");
    5555        return;
    56     case ExitValueInJSStackAsInt52:
    57         out.print("InJSStackAsInt52");
    58         return;
    5956    case ExitValueInJSStackAsDouble:
    6057        out.print("InJSStackAsDouble");
  • trunk/Source/JavaScriptCore/ftl/FTLExitValue.h

    r156019 r156029  
    5050    ExitValueInJSStack,
    5151    ExitValueInJSStackAsInt32,
    52     ExitValueInJSStackAsInt52,
    5352    ExitValueInJSStackAsDouble
    5453};
    … …  
    8180        ExitValue result;
    8281        result.m_kind = ExitValueInJSStackAsInt32;
    83         return result;
    84     }
    85    
    86     static ExitValue inJSStackAsInt52()
    87     {
    88         ExitValue result;
    89         result.m_kind = ExitValueInJSStackAsInt52;
    9082        return result;
    9183    }
  • trunk/Source/JavaScriptCore/ftl/FTLIntrinsicRepository.h

    r156019 r156029  
    3939#define FOR_EACH_FTL_INTRINSIC(macro) \
    4040    macro(addWithOverflow32, "llvm.sadd.with.overflow.i32", functionType(structType(m_context, int32, boolean), int32, int32)) \
    41     macro(addWithOverflow64, "llvm.sadd.with.overflow.i64", functionType(structType(m_context, int64, boolean), int64, int64)) \
    4241    macro(doubleAbs, "llvm.fabs.f64", functionType(doubleType, doubleType)) \
    4342    macro(mulWithOverflow32, "llvm.smul.with.overflow.i32", functionType(structType(m_context, int32, boolean), int32, int32)) \
    44     macro(mulWithOverflow64, "llvm.smul.with.overflow.i64", functionType(structType(m_context, int64, boolean), int64, int64)) \
    4543    macro(subWithOverflow32, "llvm.ssub.with.overflow.i32", functionType(structType(m_context, int32, boolean), int32, int32)) \
    46     macro(subWithOverflow64, "llvm.ssub.with.overflow.i64", functionType(structType(m_context, int64, boolean), int64, int64)) \
    4744    macro(trap, "llvm.trap", functionType(voidType)) \
    4845    macro(osrExit, "webkit_osr_exit", functionType(voidType, boolean, int32, Variadic))
  • 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;
  • trunk/Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp

    r156019 r156029  
    105105    }
    106106   
    107     // All temp registers are free at this point.
    108    
    109107    // Box anything that is already on the stack, or that is a constant.
    110108   
    … …  
    129127                GPRInfo::regT0);
    130128            jit.or64(GPRInfo::tagTypeNumberRegister, GPRInfo::regT0);
    131             jit.store64(GPRInfo::regT0, address);
    132             break;
    133         case ExitValueInJSStackAsInt52:
    134             jit.load64(address, GPRInfo::regT0);
    135             jit.rshift64(
    136                 AssemblyHelpers::TrustedImm32(JSValue::int52ShiftAmount), GPRInfo::regT0);
    137             jit.boxInt52(GPRInfo::regT0, GPRInfo::regT0, GPRInfo::regT1, FPRInfo::fpRegT0);
    138129            jit.store64(GPRInfo::regT0, address);
    139130            break;
    … …  
    170161        shouldShowDisassembly(),
    171162        patchBuffer,
    172         ("FTL OSR exit #%u (bc#%u, %s) from %s, with operands = %s",
     163        ("FTL OSR exit #%u (bc#%u, %s) from %s",
    173164            exitID, exit.m_codeOrigin.bytecodeIndex,
    174             exitKindToString(exit.m_kind), toCString(*codeBlock).data(),
    175             toCString(ignoringContext<DumpContext>(exit.m_values)).data()));
     165            exitKindToString(exit.m_kind), toCString(*codeBlock).data()));
    176166}
    177167
  • trunk/Source/JavaScriptCore/ftl/FTLOutput.h

    r156019 r156029  
    167167        return call(mulWithOverflow32Intrinsic(), left, right);
    168168    }
    169     LValue addWithOverflow64(LValue left, LValue right)
    170     {
    171         return call(addWithOverflow64Intrinsic(), left, right);
    172     }
    173     LValue subWithOverflow64(LValue left, LValue right)
    174     {
    175         return call(subWithOverflow64Intrinsic(), left, right);
    176     }
    177     LValue mulWithOverflow64(LValue left, LValue right)
    178     {
    179         return call(mulWithOverflow64Intrinsic(), left, right);
    180     }
    181169    LValue doubleAbs(LValue value)
    182170    {
  • trunk/Source/JavaScriptCore/ftl/FTLValueFormat.cpp

    r156019 r156029  
    4545        out.print("UInt32");
    4646        return;
    47     case ValueFormatInt52:
    48         out.print("Int52");
    49         return;
    50     case ValueFormatStrictInt52:
    51         out.print("StrictInt52");
    52         return;
    5347    case ValueFormatBoolean:
    5448        out.print("Boolean");
  • trunk/Source/JavaScriptCore/ftl/FTLValueFormat.h

    r156019 r156029  
    4242    ValueFormatInt32,
    4343    ValueFormatUInt32,
    44     ValueFormatInt52,
    45     ValueFormatStrictInt52,
    4644    ValueFormatBoolean,
    4745    ValueFormatJSValue,
  • trunk/Source/JavaScriptCore/ftl/FTLValueSource.cpp

    r156019 r156029  
    4343        out.print("Int32InJSStack");
    4444        return;
    45     case Int52InJSStack:
    46         out.print("Int52InJSStack");
    47         return;
    4845    case DoubleInJSStack:
    4946        out.print("DoubleInJSStack");
  • trunk/Source/JavaScriptCore/ftl/FTLValueSource.h

    r156019 r156029  
    4141    ValueInJSStack,
    4242    Int32InJSStack,
    43     Int52InJSStack,
    4443    DoubleInJSStack,
    4544    SourceIsDead,
  • trunk/Source/JavaScriptCore/interpreter/Register.h

    r156019 r156029  
    7474        InlineCallFrame* asInlineCallFrame() const;
    7575        int32_t unboxedInt32() const;
    76         int64_t unboxedInt52() const;
    7776        bool unboxedBoolean() const;
    7877        double unboxedDouble() const;
    … …  
    10099            EncodedValueDescriptor encodedValue;
    101100            double number;
    102             int64_t integer;
    103101        } u;
    104102    };
    … …  
    186184    {
    187185        return payload();
    188     }
    189 
    190     ALWAYS_INLINE int64_t Register::unboxedInt52() const
    191     {
    192         return u.integer >> JSValue::int52ShiftAmount;
    193186    }
    194187
  • trunk/Source/JavaScriptCore/runtime/Arguments.cpp

    r156019 r156029  
    384384            value = jsNumber(location->unboxedInt32());
    385385            break;
    386         case AlreadyInJSStackAsUnboxedInt52:
    387             value = jsNumber(location->unboxedInt52());
    388             break;
    389386        case AlreadyInJSStackAsUnboxedCell:
    390387            value = location->unboxedCell();
  • trunk/Source/JavaScriptCore/runtime/IndexingType.cpp

    r156019 r156029  
    5151        if (isInt32Speculation(type))
    5252            return (indexingType & ~IndexingShapeMask) | Int32Shape;
    53         if (isFullNumberSpeculation(type))
     53        if (isNumberSpeculation(type))
    5454            return (indexingType & ~IndexingShapeMask) | DoubleShape;
    5555        return (indexingType & ~IndexingShapeMask) | ContiguousShape;
    5656    case ALL_DOUBLE_INDEXING_TYPES:
    57         if (isFullNumberSpeculation(type))
     57        if (isNumberSpeculation(type))
    5858            return indexingType;
    5959        return (indexingType & ~IndexingShapeMask) | ContiguousShape;
  • trunk/Source/JavaScriptCore/runtime/JSCJSValue.h

    r156020 r156029  
    192192    int32_t asInt32() const;
    193193    uint32_t asUInt32() const;
    194     int64_t asMachineInt() const;
    195194    double asDouble() const;
    196195    bool asBoolean() const;
    … …  
    204203    bool isUndefinedOrNull() const;
    205204    bool isBoolean() const;
    206     bool isMachineInt() const;
    207205    bool isNumber() const;
    208206    bool isString() const;
    … …  
    276274
    277275    JS_EXPORT_PRIVATE JSObject* synthesizePrototype(ExecState*) const;
    278 
    279     // Constants used for Int52. Int52 isn't part of JSValue right now, but JSValues may be
    280     // converted to Int52s and back again.
    281     static const unsigned numberOfInt52Bits = 52;
    282     static const unsigned int52ShiftAmount = 12;
    283276
    284277private:
  • trunk/Source/JavaScriptCore/runtime/JSCJSValueInlines.h

    r156019 r156029  
    495495#endif // USE(JSVALUE64)
    496496
    497 inline bool JSValue::isMachineInt() const
    498 {
    499     if (isInt32())
    500         return true;
    501     if (!isNumber())
    502         return false;
    503     double number = asDouble();
    504     if (number != number)
    505         return false;
    506     int64_t asInt64 = static_cast<int64_t>(number);
    507     if (asInt64 != number)
    508         return false;
    509     if (!asInt64 && std::signbit(number))
    510         return false;
    511     if (asInt64 >= (static_cast<int64_t>(1) << (numberOfInt52Bits - 1)))
    512         return false;
    513     if (asInt64 < -(static_cast<int64_t>(1) << (numberOfInt52Bits - 1)))
    514         return false;
    515     return true;
    516 }
    517 
    518 inline int64_t JSValue::asMachineInt() const
    519 {
    520     ASSERT(isMachineInt());
    521     if (isInt32())
    522         return asInt32();
    523     return static_cast<int64_t>(asDouble());
    524 }
    525 
    526497inline bool JSValue::isString() const
    527498{
  • trunk/Source/WTF/ChangeLog

    r156019 r156029  
     12013-09-18  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r156019 and r156020.
     4        http://trac.webkit.org/changeset/156019
     5        http://trac.webkit.org/changeset/156020
     6        https://bugs.webkit.org/show_bug.cgi?id=121540
     7
     8        Broke tests (Requested by ap on #webkit).
     9
     10        * wtf/PrintStream.h:
     11
    1122013-09-16  Filip Pizlo  <fpizlo@apple.com>
    213
  • trunk/Source/WTF/wtf/PrintStream.h

    r156019 r156029  
    361361}
    362362
    363 template<typename T, typename U>
    364 class ValueIgnoringContext {
    365 public:
    366     ValueIgnoringContext(const U& value)
    367         : m_value(&value)
    368     {
    369     }
    370    
    371     void dump(PrintStream& out) const
    372     {
    373         T context;
    374         m_value->dumpInContext(out, &context);
    375     }
    376 
    377 private:
    378     const U* m_value;
    379 };
    380 
    381 template<typename T, typename U>
    382 ValueIgnoringContext<T, U> ignoringContext(const U& value)
    383 {
    384     return ValueIgnoringContext<T, U>(value);
    385 }
    386 
    387363} // namespace WTF
    388364
    … …  
    390366using WTF::PointerDump;
    391367using WTF::PrintStream;
    392 using WTF::ignoringContext;
    393368using WTF::inContext;
    394369using WTF::pointerDump;
  • trunk/Tools/ChangeLog

    r156026 r156029  
     12013-09-18  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r156019 and r156020.
     4        http://trac.webkit.org/changeset/156019
     5        http://trac.webkit.org/changeset/156020
     6        https://bugs.webkit.org/show_bug.cgi?id=121540
     7
     8        Broke tests (Requested by ap on #webkit).
     9
     10        * Scripts/run-jsc-stress-tests:
     11
    1122013-09-17  Gwang Yoon Hwang  <ryumiel@company100.net>
    213
  • trunk/Tools/Scripts/run-jsc-stress-tests

    r156019 r156029  
    215215    runAlwaysTriggerCopyPhase
    216216    runNoCJIT
    217     runDFGEager
    218217    if $enableFTL
    219218        runDefaultFTL
    220219        runFTLNoCJIT
    221220        runFTLEager
     221    else
     222        runDFGEager
    222223    end
    223224end
Note: See TracChangeset for help on using the changeset viewer.