Changeset 192605 in webkit


Ignore:
Timestamp:
Nov 18, 2015 6:48:48 PM (8 years ago)
Author:
benjamin@webkit.org
Message:

FTL should be able to compile a small function with B3
https://bugs.webkit.org/show_bug.cgi?id=151423

Patch by Filip Pizlo <fpizlo@apple.com> and Benjamin Poulain <bpoulain@apple.com> on 2015-11-18
Reviewed by Filip Pizlo.

  • b3/B3LowerToAir.cpp:

(JSC::B3::Air::LowerToAir::lower):

  • dfg/DFGPlan.cpp:

(JSC::DFG::Plan::compileInThreadImpl):

  • ftl/FTLAbbreviatedTypes.h:
  • ftl/FTLB3Output.cpp:

(JSC::FTL::Output::Output):
(JSC::FTL::Output::~Output):
(JSC::FTL::Output::initialize):
(JSC::FTL::Output::appendTo):
(JSC::FTL::Output::lockedStackSlot):
(JSC::FTL::Output::load):
(JSC::FTL::Output::store):
(JSC::FTL::Output::branch):

  • ftl/FTLB3Output.h:

(JSC::FTL::Output::newBlock):
(JSC::FTL::Output::setOrigin):
(JSC::FTL::Output::origin):
(JSC::FTL::Output::framePointer):
(JSC::FTL::Output::constBool):
(JSC::FTL::Output::constInt32):
(JSC::FTL::Output::constIntPtr):
(JSC::FTL::Output::constInt64):
(JSC::FTL::Output::constDouble):
(JSC::FTL::Output::upsilon):
(JSC::FTL::Output::phi):
(JSC::FTL::Output::add):
(JSC::FTL::Output::sub):
(JSC::FTL::Output::mul):
(JSC::FTL::Output::neg):
(JSC::FTL::Output::doubleAdd):
(JSC::FTL::Output::doubleSub):
(JSC::FTL::Output::doubleMul):
(JSC::FTL::Output::doubleDiv):
(JSC::FTL::Output::doubleNeg):
(JSC::FTL::Output::bitAnd):
(JSC::FTL::Output::bitOr):
(JSC::FTL::Output::bitXor):
(JSC::FTL::Output::shl):
(JSC::FTL::Output::aShr):
(JSC::FTL::Output::lShr):
(JSC::FTL::Output::load64):
(JSC::FTL::Output::store32):
(JSC::FTL::Output::store64):
(JSC::FTL::Output::storePtr):
(JSC::FTL::Output::storeDouble):
(JSC::FTL::Output::addPtr):
(JSC::FTL::Output::address):
(JSC::FTL::Output::below):
(JSC::FTL::Output::isZero32):
(JSC::FTL::Output::notZero32):
(JSC::FTL::Output::isZero64):
(JSC::FTL::Output::notZero64):
(JSC::FTL::Output::isNull):
(JSC::FTL::Output::notNull):
(JSC::FTL::Output::testIsZero32):
(JSC::FTL::Output::testNonZero32):
(JSC::FTL::Output::testIsZero64):
(JSC::FTL::Output::testNonZero64):
(JSC::FTL::Output::testIsZeroPtr):
(JSC::FTL::Output::testNonZeroPtr):
(JSC::FTL::Output::call):
(JSC::FTL::Output::operation):
(JSC::FTL::Output::jump):
(JSC::FTL::Output::branch):
(JSC::FTL::Output::ret):
(JSC::FTL::Output::unreachable):
(JSC::FTL::Output::check):
(JSC::FTL::Output::anchor):
(JSC::FTL::Output::addIncomingToPhi):
(JSC::FTL::Output::~Output): Deleted.
(JSC::FTL::Output::appendTo): Deleted.
(JSC::FTL::Output::param): Deleted.
(JSC::FTL::Output::load): Deleted.
(JSC::FTL::Output::store): Deleted.
(JSC::FTL::Output::store16): Deleted.

  • ftl/FTLCommonValues.cpp:

(JSC::FTL::CommonValues::CommonValues):
(JSC::FTL::CommonValues::initializeConstants):

  • ftl/FTLCommonValues.h:
  • ftl/FTLJITFinalizer.cpp:

(JSC::FTL::JITFinalizer::finalizeFunction):

  • ftl/FTLLink.cpp:

(JSC::FTL::link):

  • ftl/FTLLowerDFGToLLVM.cpp:

(JSC::FTL::DFG::LowerDFGToLLVM::LowerDFGToLLVM):
(JSC::FTL::DFG::LowerDFGToLLVM::lower):
(JSC::FTL::DFG::LowerDFGToLLVM::createPhiVariables):
(JSC::FTL::DFG::LowerDFGToLLVM::compileBlock):
(JSC::FTL::DFG::LowerDFGToLLVM::safelyInvalidateAfterTermination):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
(JSC::FTL::DFG::LowerDFGToLLVM::compileUpsilon):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePhi):
(JSC::FTL::DFG::LowerDFGToLLVM::compileToThis):
(JSC::FTL::DFG::LowerDFGToLLVM::compileValueAdd):
(JSC::FTL::DFG::LowerDFGToLLVM::compileStrCat):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArithAddOrSub):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArrayifyToStructure):
(JSC::FTL::DFG::LowerDFGToLLVM::compileGetById):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePutById):
(JSC::FTL::DFG::LowerDFGToLLVM::compileGetIndexedPropertyStorage):
(JSC::FTL::DFG::LowerDFGToLLVM::compileGetByVal):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePutByVal):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePutAccessorById):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePutGetterSetterById):
(JSC::FTL::DFG::LowerDFGToLLVM::compilePutAccessorByVal):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArrayPush):
(JSC::FTL::DFG::LowerDFGToLLVM::compileArrayPop):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCreateActivation):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNewFunction):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCreateScopedArguments):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCreateClonedArguments):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNewArray):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayBuffer):
(JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayWithSize):
(JSC::FTL::DFG::LowerDFGToLLVM::compileToStringOrCallStringConstructor):
(JSC::FTL::DFG::LowerDFGToLLVM::compileToPrimitive):
(JSC::FTL::DFG::LowerDFGToLLVM::compileStringCharAt):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstruct):
(JSC::FTL::DFG::LowerDFGToLLVM::compileTailCall):
(JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstructVarargs):
(JSC::FTL::DFG::LowerDFGToLLVM::compileLoadVarargs):
(JSC::FTL::DFG::LowerDFGToLLVM::compileSwitch):
(JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint):
(JSC::FTL::DFG::LowerDFGToLLVM::compileIn):
(JSC::FTL::DFG::LowerDFGToLLVM::compileHasIndexedProperty):
(JSC::FTL::DFG::LowerDFGToLLVM::compileHasGenericProperty):
(JSC::FTL::DFG::LowerDFGToLLVM::compileHasStructureProperty):
(JSC::FTL::DFG::LowerDFGToLLVM::compileGetDirectPname):
(JSC::FTL::DFG::LowerDFGToLLVM::compileGetPropertyEnumerator):
(JSC::FTL::DFG::LowerDFGToLLVM::compileToIndexString):
(JSC::FTL::DFG::LowerDFGToLLVM::didOverflowStack):
(JSC::FTL::DFG::LowerDFGToLLVM::allocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToLLVM::reallocatePropertyStorage):
(JSC::FTL::DFG::LowerDFGToLLVM::getById):
(JSC::FTL::DFG::LowerDFGToLLVM::nonSpeculativeCompare):
(JSC::FTL::DFG::LowerDFGToLLVM::contiguousPutByValOutOfBounds):
(JSC::FTL::DFG::LowerDFGToLLVM::switchStringSlow):
(JSC::FTL::DFG::LowerDFGToLLVM::doubleToInt32):
(JSC::FTL::DFG::LowerDFGToLLVM::sensibleDoubleToInt32):
(JSC::FTL::DFG::LowerDFGToLLVM::lazySlowPath):
(JSC::FTL::DFG::LowerDFGToLLVM::jsValueToStrictInt52):
(JSC::FTL::DFG::LowerDFGToLLVM::doubleToStrictInt52):
(JSC::FTL::DFG::LowerDFGToLLVM::vmCall):
(JSC::FTL::DFG::LowerDFGToLLVM::callCheck):
(JSC::FTL::DFG::LowerDFGToLLVM::lowBlock):
(JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExit):
(JSC::FTL::DFG::LowerDFGToLLVM::callStackmap):
(JSC::FTL::DFG::LowerDFGToLLVM::probe):
(JSC::FTL::DFG::LowerDFGToLLVM::crash):
(JSC::FTL::lowerDFGToLLVM):
(JSC::FTL::DFG::LowerDFGToLLVM::vmCallNoExceptions): Deleted.

  • ftl/FTLOutput.cpp:

(JSC::FTL::Output::sensibleDoubleToInt):

  • ftl/FTLOutput.h:

(JSC::FTL::Output::ceil64):
(JSC::FTL::Output::ctlz32):
(JSC::FTL::Output::addWithOverflow32):
(JSC::FTL::Output::subWithOverflow32):
(JSC::FTL::Output::mulWithOverflow32):
(JSC::FTL::Output::addWithOverflow64):
(JSC::FTL::Output::subWithOverflow64):
(JSC::FTL::Output::mulWithOverflow64):
(JSC::FTL::Output::doubleAbs):
(JSC::FTL::Output::doubleSin):
(JSC::FTL::Output::doubleCos):
(JSC::FTL::Output::doublePow):
(JSC::FTL::Output::doublePowi):
(JSC::FTL::Output::doubleSqrt):
(JSC::FTL::Output::doubleLog):
(JSC::FTL::Output::call):
(JSC::FTL::Output::trap):

  • ftl/FTLState.cpp:

(JSC::FTL::State::State): Deleted.

  • ftl/FTLState.h:
  • ftl/FTLWeight.h:

(JSC::FTL::Weight::frequencyClass):

Location:
trunk/Source/JavaScriptCore
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r192603 r192605  
     12015-11-18  Filip Pizlo  <fpizlo@apple.com> and Benjamin Poulain  <bpoulain@apple.com>
     2
     3        FTL should be able to compile a small function with B3
     4        https://bugs.webkit.org/show_bug.cgi?id=151423
     5
     6        Reviewed by Filip Pizlo.
     7
     8        * b3/B3LowerToAir.cpp:
     9        (JSC::B3::Air::LowerToAir::lower):
     10        * dfg/DFGPlan.cpp:
     11        (JSC::DFG::Plan::compileInThreadImpl):
     12        * ftl/FTLAbbreviatedTypes.h:
     13        * ftl/FTLB3Output.cpp:
     14        (JSC::FTL::Output::Output):
     15        (JSC::FTL::Output::~Output):
     16        (JSC::FTL::Output::initialize):
     17        (JSC::FTL::Output::appendTo):
     18        (JSC::FTL::Output::lockedStackSlot):
     19        (JSC::FTL::Output::load):
     20        (JSC::FTL::Output::store):
     21        (JSC::FTL::Output::branch):
     22        * ftl/FTLB3Output.h:
     23        (JSC::FTL::Output::newBlock):
     24        (JSC::FTL::Output::setOrigin):
     25        (JSC::FTL::Output::origin):
     26        (JSC::FTL::Output::framePointer):
     27        (JSC::FTL::Output::constBool):
     28        (JSC::FTL::Output::constInt32):
     29        (JSC::FTL::Output::constIntPtr):
     30        (JSC::FTL::Output::constInt64):
     31        (JSC::FTL::Output::constDouble):
     32        (JSC::FTL::Output::upsilon):
     33        (JSC::FTL::Output::phi):
     34        (JSC::FTL::Output::add):
     35        (JSC::FTL::Output::sub):
     36        (JSC::FTL::Output::mul):
     37        (JSC::FTL::Output::neg):
     38        (JSC::FTL::Output::doubleAdd):
     39        (JSC::FTL::Output::doubleSub):
     40        (JSC::FTL::Output::doubleMul):
     41        (JSC::FTL::Output::doubleDiv):
     42        (JSC::FTL::Output::doubleNeg):
     43        (JSC::FTL::Output::bitAnd):
     44        (JSC::FTL::Output::bitOr):
     45        (JSC::FTL::Output::bitXor):
     46        (JSC::FTL::Output::shl):
     47        (JSC::FTL::Output::aShr):
     48        (JSC::FTL::Output::lShr):
     49        (JSC::FTL::Output::load64):
     50        (JSC::FTL::Output::store32):
     51        (JSC::FTL::Output::store64):
     52        (JSC::FTL::Output::storePtr):
     53        (JSC::FTL::Output::storeDouble):
     54        (JSC::FTL::Output::addPtr):
     55        (JSC::FTL::Output::address):
     56        (JSC::FTL::Output::below):
     57        (JSC::FTL::Output::isZero32):
     58        (JSC::FTL::Output::notZero32):
     59        (JSC::FTL::Output::isZero64):
     60        (JSC::FTL::Output::notZero64):
     61        (JSC::FTL::Output::isNull):
     62        (JSC::FTL::Output::notNull):
     63        (JSC::FTL::Output::testIsZero32):
     64        (JSC::FTL::Output::testNonZero32):
     65        (JSC::FTL::Output::testIsZero64):
     66        (JSC::FTL::Output::testNonZero64):
     67        (JSC::FTL::Output::testIsZeroPtr):
     68        (JSC::FTL::Output::testNonZeroPtr):
     69        (JSC::FTL::Output::call):
     70        (JSC::FTL::Output::operation):
     71        (JSC::FTL::Output::jump):
     72        (JSC::FTL::Output::branch):
     73        (JSC::FTL::Output::ret):
     74        (JSC::FTL::Output::unreachable):
     75        (JSC::FTL::Output::check):
     76        (JSC::FTL::Output::anchor):
     77        (JSC::FTL::Output::addIncomingToPhi):
     78        (JSC::FTL::Output::~Output): Deleted.
     79        (JSC::FTL::Output::appendTo): Deleted.
     80        (JSC::FTL::Output::param): Deleted.
     81        (JSC::FTL::Output::load): Deleted.
     82        (JSC::FTL::Output::store): Deleted.
     83        (JSC::FTL::Output::store16): Deleted.
     84        * ftl/FTLCommonValues.cpp:
     85        (JSC::FTL::CommonValues::CommonValues):
     86        (JSC::FTL::CommonValues::initializeConstants):
     87        * ftl/FTLCommonValues.h:
     88        * ftl/FTLJITFinalizer.cpp:
     89        (JSC::FTL::JITFinalizer::finalizeFunction):
     90        * ftl/FTLLink.cpp:
     91        (JSC::FTL::link):
     92        * ftl/FTLLowerDFGToLLVM.cpp:
     93        (JSC::FTL::DFG::LowerDFGToLLVM::LowerDFGToLLVM):
     94        (JSC::FTL::DFG::LowerDFGToLLVM::lower):
     95        (JSC::FTL::DFG::LowerDFGToLLVM::createPhiVariables):
     96        (JSC::FTL::DFG::LowerDFGToLLVM::compileBlock):
     97        (JSC::FTL::DFG::LowerDFGToLLVM::safelyInvalidateAfterTermination):
     98        (JSC::FTL::DFG::LowerDFGToLLVM::compileNode):
     99        (JSC::FTL::DFG::LowerDFGToLLVM::compileUpsilon):
     100        (JSC::FTL::DFG::LowerDFGToLLVM::compilePhi):
     101        (JSC::FTL::DFG::LowerDFGToLLVM::compileToThis):
     102        (JSC::FTL::DFG::LowerDFGToLLVM::compileValueAdd):
     103        (JSC::FTL::DFG::LowerDFGToLLVM::compileStrCat):
     104        (JSC::FTL::DFG::LowerDFGToLLVM::compileArithAddOrSub):
     105        (JSC::FTL::DFG::LowerDFGToLLVM::compileArrayifyToStructure):
     106        (JSC::FTL::DFG::LowerDFGToLLVM::compileGetById):
     107        (JSC::FTL::DFG::LowerDFGToLLVM::compilePutById):
     108        (JSC::FTL::DFG::LowerDFGToLLVM::compileGetIndexedPropertyStorage):
     109        (JSC::FTL::DFG::LowerDFGToLLVM::compileGetByVal):
     110        (JSC::FTL::DFG::LowerDFGToLLVM::compilePutByVal):
     111        (JSC::FTL::DFG::LowerDFGToLLVM::compilePutAccessorById):
     112        (JSC::FTL::DFG::LowerDFGToLLVM::compilePutGetterSetterById):
     113        (JSC::FTL::DFG::LowerDFGToLLVM::compilePutAccessorByVal):
     114        (JSC::FTL::DFG::LowerDFGToLLVM::compileArrayPush):
     115        (JSC::FTL::DFG::LowerDFGToLLVM::compileArrayPop):
     116        (JSC::FTL::DFG::LowerDFGToLLVM::compileCreateActivation):
     117        (JSC::FTL::DFG::LowerDFGToLLVM::compileNewFunction):
     118        (JSC::FTL::DFG::LowerDFGToLLVM::compileCreateScopedArguments):
     119        (JSC::FTL::DFG::LowerDFGToLLVM::compileCreateClonedArguments):
     120        (JSC::FTL::DFG::LowerDFGToLLVM::compileNewArray):
     121        (JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayBuffer):
     122        (JSC::FTL::DFG::LowerDFGToLLVM::compileNewArrayWithSize):
     123        (JSC::FTL::DFG::LowerDFGToLLVM::compileToStringOrCallStringConstructor):
     124        (JSC::FTL::DFG::LowerDFGToLLVM::compileToPrimitive):
     125        (JSC::FTL::DFG::LowerDFGToLLVM::compileStringCharAt):
     126        (JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstruct):
     127        (JSC::FTL::DFG::LowerDFGToLLVM::compileTailCall):
     128        (JSC::FTL::DFG::LowerDFGToLLVM::compileCallOrConstructVarargs):
     129        (JSC::FTL::DFG::LowerDFGToLLVM::compileLoadVarargs):
     130        (JSC::FTL::DFG::LowerDFGToLLVM::compileSwitch):
     131        (JSC::FTL::DFG::LowerDFGToLLVM::compileInvalidationPoint):
     132        (JSC::FTL::DFG::LowerDFGToLLVM::compileIn):
     133        (JSC::FTL::DFG::LowerDFGToLLVM::compileHasIndexedProperty):
     134        (JSC::FTL::DFG::LowerDFGToLLVM::compileHasGenericProperty):
     135        (JSC::FTL::DFG::LowerDFGToLLVM::compileHasStructureProperty):
     136        (JSC::FTL::DFG::LowerDFGToLLVM::compileGetDirectPname):
     137        (JSC::FTL::DFG::LowerDFGToLLVM::compileGetPropertyEnumerator):
     138        (JSC::FTL::DFG::LowerDFGToLLVM::compileToIndexString):
     139        (JSC::FTL::DFG::LowerDFGToLLVM::didOverflowStack):
     140        (JSC::FTL::DFG::LowerDFGToLLVM::allocatePropertyStorage):
     141        (JSC::FTL::DFG::LowerDFGToLLVM::reallocatePropertyStorage):
     142        (JSC::FTL::DFG::LowerDFGToLLVM::getById):
     143        (JSC::FTL::DFG::LowerDFGToLLVM::nonSpeculativeCompare):
     144        (JSC::FTL::DFG::LowerDFGToLLVM::contiguousPutByValOutOfBounds):
     145        (JSC::FTL::DFG::LowerDFGToLLVM::switchStringSlow):
     146        (JSC::FTL::DFG::LowerDFGToLLVM::doubleToInt32):
     147        (JSC::FTL::DFG::LowerDFGToLLVM::sensibleDoubleToInt32):
     148        (JSC::FTL::DFG::LowerDFGToLLVM::lazySlowPath):
     149        (JSC::FTL::DFG::LowerDFGToLLVM::jsValueToStrictInt52):
     150        (JSC::FTL::DFG::LowerDFGToLLVM::doubleToStrictInt52):
     151        (JSC::FTL::DFG::LowerDFGToLLVM::vmCall):
     152        (JSC::FTL::DFG::LowerDFGToLLVM::callCheck):
     153        (JSC::FTL::DFG::LowerDFGToLLVM::lowBlock):
     154        (JSC::FTL::DFG::LowerDFGToLLVM::appendOSRExit):
     155        (JSC::FTL::DFG::LowerDFGToLLVM::callStackmap):
     156        (JSC::FTL::DFG::LowerDFGToLLVM::probe):
     157        (JSC::FTL::DFG::LowerDFGToLLVM::crash):
     158        (JSC::FTL::lowerDFGToLLVM):
     159        (JSC::FTL::DFG::LowerDFGToLLVM::vmCallNoExceptions): Deleted.
     160        * ftl/FTLOutput.cpp:
     161        (JSC::FTL::Output::sensibleDoubleToInt):
     162        * ftl/FTLOutput.h:
     163        (JSC::FTL::Output::ceil64):
     164        (JSC::FTL::Output::ctlz32):
     165        (JSC::FTL::Output::addWithOverflow32):
     166        (JSC::FTL::Output::subWithOverflow32):
     167        (JSC::FTL::Output::mulWithOverflow32):
     168        (JSC::FTL::Output::addWithOverflow64):
     169        (JSC::FTL::Output::subWithOverflow64):
     170        (JSC::FTL::Output::mulWithOverflow64):
     171        (JSC::FTL::Output::doubleAbs):
     172        (JSC::FTL::Output::doubleSin):
     173        (JSC::FTL::Output::doubleCos):
     174        (JSC::FTL::Output::doublePow):
     175        (JSC::FTL::Output::doublePowi):
     176        (JSC::FTL::Output::doubleSqrt):
     177        (JSC::FTL::Output::doubleLog):
     178        (JSC::FTL::Output::call):
     179        (JSC::FTL::Output::trap):
     180        * ftl/FTLState.cpp:
     181        (JSC::FTL::State::State): Deleted.
     182        * ftl/FTLState.h:
     183        * ftl/FTLWeight.h:
     184        (JSC::FTL::Weight::frequencyClass):
     185
    11862015-11-18  Saam barati  <sbarati@apple.com>
    2187
  • trunk/Source/JavaScriptCore/b3/B3LowerToAir.cpp

    r192558 r192605  
    17151715        }
    17161716
     1717        case B3::Oops: {
     1718            append(Air::Oops);
     1719            return;
     1720        }
     1721
    17171722        default:
    17181723            break;
  • trunk/Source/JavaScriptCore/dfg/DFGPlan.cpp

    r191870 r192605  
    499499        }
    500500
     501#if !FTL_USES_B3
    501502        if (state.jitCode->stackmaps.stackSize() > Options::llvmMaxStackSize()) {
    502503            FTL::fail(state);
    503504            return FTLPath;
    504505        }
     506#endif
    505507
    506508        FTL::link(state);
  • trunk/Source/JavaScriptCore/ftl/FTLAbbreviatedTypes.h

    r192591 r192605  
    11/*
    2  * Copyright (C) 2013 Apple Inc. All rights reserved.
     2 * Copyright (C) 2013, 2015 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    3434namespace JSC { namespace B3 {
    3535class BasicBlock;
     36class Value;
    3637enum Type : int8_t;
    3738} }
     
    4243typedef B3::BasicBlock* LBasicBlock;
    4344typedef B3::Type LType;
     45typedef B3::Value* LValue;
    4446#else
    4547typedef LLVMBasicBlockRef LBasicBlock;
    4648typedef LLVMTypeRef LType;
     49typedef LLVMValueRef LValue;
    4750#endif
    4851
     
    5558typedef LLVMModuleRef LModule;
    5659typedef LLVMRealPredicate LRealPredicate;
    57 typedef LLVMValueRef LValue;
    5860typedef LLVMMemoryBufferRef LMemoryBuffer;
    5961
  • trunk/Source/JavaScriptCore/ftl/FTLB3Output.cpp

    r192591 r192605  
    3434Output::Output(State& state)
    3535    : CommonValues(state.context)
    36     , m_procedure(*state.proc)
     36    , m_proc(*state.proc)
    3737{
     38}
     39
     40Output::~Output()
     41{
     42}
     43
     44void Output::initialize(AbstractHeapRepository& heaps)
     45{
     46    m_heaps = &heaps;
     47}
     48
     49LBasicBlock Output::appendTo(LBasicBlock block, LBasicBlock nextBlock)
     50{
     51    appendTo(block);
     52    return insertNewBlocksBefore(nextBlock);
     53}
     54
     55void Output::appendTo(LBasicBlock block)
     56{
     57    m_block = block;
     58}
     59
     60LValue Output::lockedStackSlot(size_t bytes)
     61{
     62    return m_block->appendNew<B3::StackSlotValue>(m_proc, origin(), bytes, B3::StackSlotKind::Locked);
     63}
     64
     65LValue Output::load(TypedPointer pointer, LType type)
     66{
     67    LValue load = m_block->appendNew<B3::MemoryValue>(m_proc, B3::Load, type, origin(), pointer.value());
     68    pointer.heap().decorateInstruction(load, *m_heaps);
     69    return load;
     70}
     71
     72void Output::store(LValue value, TypedPointer pointer)
     73{
     74    LValue store = m_block->appendNew<B3::MemoryValue>(m_proc, B3::Store, origin(), value, pointer.value());
     75    pointer.heap().decorateInstruction(store, *m_heaps);
     76}
     77
     78void Output::branch(LValue condition, LBasicBlock taken, Weight takenWeight, LBasicBlock notTaken, Weight notTakenWeight)
     79{
     80    m_block->appendNew<B3::ControlValue>(
     81        m_proc, B3::Branch, origin(), condition,
     82        B3::FrequentedBlock(taken, takenWeight.frequencyClass()),
     83        B3::FrequentedBlock(notTaken, notTakenWeight.frequencyClass()));
    3884}
    3985
  • trunk/Source/JavaScriptCore/ftl/FTLB3Output.h

    r192591 r192605  
    3232#if FTL_USES_B3
    3333
    34 #include "B3BasicBlock.h"
     34#include "B3ArgumentRegValue.h"
     35#include "B3BasicBlockInlines.h"
     36#include "B3CCallValue.h"
     37#include "B3Compilation.h"
     38#include "B3Const32Value.h"
     39#include "B3ConstPtrValue.h"
     40#include "B3ControlValue.h"
     41#include "B3MemoryValue.h"
    3542#include "B3Procedure.h"
     43#include "B3StackSlotValue.h"
     44#include "B3SwitchValue.h"
     45#include "B3UpsilonValue.h"
     46#include "B3ValueInlines.h"
    3647#include "FTLAbbreviatedTypes.h"
    3748#include "FTLAbstractHeapRepository.h"
     
    5263#endif // COMPILER(CLANG)
    5364
    54 namespace JSC { namespace FTL {
     65namespace JSC {
     66
     67namespace DFG { struct Node; }
     68
     69namespace FTL {
    5570
    5671enum Scale { ScaleOne, ScaleTwo, ScaleFour, ScaleEight, ScalePtr };
     
    5974public:
    6075    Output(State&);
    61     ~Output() { CRASH(); }
     76    ~Output();
     77
     78    void initialize(AbstractHeapRepository&);
    6279
    6380    LBasicBlock newBlock(const char* name = "")
    6481    {
    6582        UNUSED_PARAM(name);
    66         return m_procedure.addBlock();
     83        return m_proc.addBlock();
    6784    }
    6885
     
    7491    }
    7592
    76     LBasicBlock appendTo(LBasicBlock, LBasicBlock nextBlock) { CRASH(); }
    77     void appendTo(LBasicBlock) { CRASH(); }
    78 
    79     LValue param(unsigned index) { CRASH(); }
    80     LValue constBool(bool value) { CRASH(); }
    81     LValue constInt32(int32_t value) { CRASH(); }
     93    LBasicBlock appendTo(LBasicBlock, LBasicBlock nextBlock);
     94    void appendTo(LBasicBlock);
     95
     96    void setOrigin(DFG::Node* node) { m_origin = node; }
     97    B3::Origin origin() { return B3::Origin(m_origin); }
     98
     99    LValue framePointer() { return m_block->appendNew<B3::Value>(m_proc, B3::FramePointer, origin()); }
     100
     101    LValue lockedStackSlot(size_t bytes);
     102
     103    LValue constBool(bool value) { return m_block->appendNew<B3::Const32Value>(m_proc, origin(), value); }
     104    LValue constInt32(int32_t value) { return m_block->appendNew<B3::Const32Value>(m_proc, origin(), value); }
    82105    template<typename T>
    83     LValue constIntPtr(T* value) { CRASH(); }
     106    LValue constIntPtr(T* value) { return m_block->appendNew<B3::ConstPtrValue>(m_proc, origin(), value); }
    84107    template<typename T>
    85     LValue constIntPtr(T value) { CRASH(); }
    86     LValue constInt64(int64_t value) { CRASH(); }
    87     LValue constDouble(double value) { CRASH(); }
    88 
    89     LValue phi(LType type) { CRASH(); }
     108    LValue constIntPtr(T value) { return m_block->appendNew<B3::ConstPtrValue>(m_proc, origin(), value); }
     109    LValue constInt64(int64_t value) { return m_block->appendNew<B3::Const64Value>(m_proc, origin(), value); }
     110    LValue constDouble(double value) { return m_block->appendNew<B3::ConstDoubleValue>(m_proc, origin(), value); }
     111
     112    LValue phi(LType type) { return m_block->appendNew<B3::Value>(m_proc, B3::Phi, type, origin()); }
    90113    template<typename... Params>
    91     LValue phi(LType type, ValueFromBlock value, Params... theRest) { CRASH(); }
     114    LValue phi(LType, ValueFromBlock, Params... theRest);
    92115    template<typename VectorType>
    93     LValue phi(LType type, const VectorType& vector) { CRASH(); }
    94     void addIncomingToPhi(LValue phi, ValueFromBlock value) { CRASH(); }
    95 
    96     LValue add(LValue left, LValue right) { CRASH(); }
    97     LValue sub(LValue left, LValue right) { CRASH(); }
    98     LValue mul(LValue left, LValue right) { CRASH(); }
     116    LValue phi(LType, const VectorType&);
     117    void addIncomingToPhi(LValue phi, ValueFromBlock);
     118    template<typename... Params>
     119    void addIncomingToPhi(LValue phi, ValueFromBlock, Params... theRest);
     120
     121    LValue add(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Add, origin(), left, right); }
     122    LValue sub(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Sub, origin(), left, right); }
     123    LValue mul(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Mul, origin(), left, right); }
    99124    LValue div(LValue left, LValue right) { CRASH(); }
    100125    LValue rem(LValue left, LValue right) { CRASH(); }
    101     LValue neg(LValue value) { CRASH(); }
    102 
    103     LValue doubleAdd(LValue left, LValue right) { CRASH(); }
    104     LValue doubleSub(LValue left, LValue right) { CRASH(); }
    105     LValue doubleMul(LValue left, LValue right) { CRASH(); }
    106     LValue doubleDiv(LValue left, LValue right) { CRASH(); }
     126    LValue neg(LValue value)
     127    {
     128        LValue zero = m_block->appendIntConstant(m_proc, origin(), value->type(), 0);
     129        return sub(zero, value);
     130    }
     131
     132    LValue doubleAdd(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Add, origin(), left, right); }
     133    LValue doubleSub(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Sub, origin(), left, right); }
     134    LValue doubleMul(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Mul, origin(), left, right); }
     135    LValue doubleDiv(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Div, origin(), left, right); }
    107136    LValue doubleRem(LValue left, LValue right) { CRASH(); }
    108     LValue doubleNeg(LValue value) { CRASH(); }
    109 
    110     LValue bitAnd(LValue left, LValue right) { CRASH(); }
    111     LValue bitOr(LValue left, LValue right) { CRASH(); }
    112     LValue bitXor(LValue left, LValue right) { CRASH(); }
    113     LValue shl(LValue left, LValue right) { CRASH(); }
    114     LValue aShr(LValue left, LValue right) { CRASH(); }
    115     LValue lShr(LValue left, LValue right) { CRASH(); }
     137    LValue doubleNeg(LValue value)
     138    {
     139        return sub(doubleZero, value);
     140    }
     141
     142    LValue bitAnd(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::BitAnd, origin(), left, right); }
     143    LValue bitOr(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::BitOr, origin(), left, right); }
     144    LValue bitXor(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::BitXor, origin(), left, right); }
     145    LValue shl(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Shl, origin(), left, right); }
     146    LValue aShr(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::SShr, origin(), left, right); }
     147    LValue lShr(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::ZShr, origin(), left, right); }
    116148    LValue bitNot(LValue value) { CRASH(); }
    117149
     
    176208    LValue set(LValue value, LValue reference) { CRASH(); }
    177209
    178     LValue load(TypedPointer, LType refType) { CRASH(); }
    179     void store(LValue, TypedPointer, LType refType) { CRASH(); }
     210    LValue load(TypedPointer, LType);
     211    void store(LValue, TypedPointer);
    180212
    181213    LValue load8SignExt32(TypedPointer) { CRASH(); }
     
    184216    LValue load16ZeroExt32(TypedPointer) { CRASH(); }
    185217    LValue load32(TypedPointer pointer) { CRASH(); }
    186     LValue load64(TypedPointer pointer) { CRASH(); }
     218    LValue load64(TypedPointer pointer) { return load(pointer, B3::Int64); }
    187219    LValue loadPtr(TypedPointer pointer) { CRASH(); }
    188220    LValue loadFloatToDouble(TypedPointer pointer) { CRASH(); }
    189221    LValue loadDouble(TypedPointer pointer) { CRASH(); }
    190     void store16(LValue value, TypedPointer pointer) { CRASH(); }
    191     void store32(LValue value, TypedPointer pointer) { CRASH(); }
    192     void store64(LValue value, TypedPointer pointer) { CRASH(); }
    193     void storePtr(LValue value, TypedPointer pointer) { CRASH(); }
    194     void storeDouble(LValue value, TypedPointer pointer) { CRASH(); }
    195 
    196     LValue addPtr(LValue value, ptrdiff_t immediate = 0) { CRASH(); }
     222    void store32(LValue value, TypedPointer pointer) { store(value, pointer); }
     223    void store64(LValue value, TypedPointer pointer) { store(value, pointer); }
     224    void storePtr(LValue value, TypedPointer pointer) { store(value, pointer); }
     225    void storeDouble(LValue value, TypedPointer pointer) { store(value, pointer); }
     226
     227    LValue addPtr(LValue value, ptrdiff_t immediate = 0)
     228    {
     229        if (!immediate)
     230            return value;
     231        return add(value, constIntPtr(immediate));
     232    }
    197233
    198234    // Construct an address by offsetting base by the requested amount and ascribing
    199235    // the requested abstract heap to it.
    200     TypedPointer address(const AbstractHeap& heap, LValue base, ptrdiff_t offset = 0) { CRASH(); }
     236    TypedPointer address(const AbstractHeap& heap, LValue base, ptrdiff_t offset = 0)
     237    {
     238        return TypedPointer(heap, addPtr(base, offset));
     239    }
    201240    // Construct an address by offsetting base by the amount specified by the field,
    202241    // and optionally an additional amount (use this with care), and then creating
    203242    // a TypedPointer with the given field as the heap.
    204     TypedPointer address(LValue base, const AbstractField& field, ptrdiff_t offset = 0) { CRASH(); }
     243    TypedPointer address(LValue base, const AbstractField& field, ptrdiff_t offset = 0)
     244    {
     245        return address(field, base, offset + field.offset());
     246    }
    205247
    206248    LValue baseIndex(LValue base, LValue index, Scale, ptrdiff_t offset = 0) { CRASH(); }
     
    236278    LValue above(LValue left, LValue right) { CRASH(); }
    237279    LValue aboveOrEqual(LValue left, LValue right) { CRASH(); }
    238     LValue below(LValue left, LValue right) { CRASH(); }
     280    LValue below(LValue left, LValue right) { return m_block->appendNew<B3::Value>(m_proc, B3::Below, origin(), left, right); }
    239281    LValue belowOrEqual(LValue left, LValue right) { CRASH(); }
    240282    LValue greaterThan(LValue left, LValue right) { CRASH(); }
     
    257299    LValue doubleGreaterThanOrEqualOrUnordered(LValue left, LValue right) { CRASH(); }
    258300
    259     LValue isZero32(LValue value) { CRASH(); }
    260     LValue notZero32(LValue value) { CRASH(); }
    261     LValue isZero64(LValue value) { CRASH(); }
    262     LValue notZero64(LValue value) { CRASH(); }
    263     LValue isNull(LValue value) { CRASH(); }
    264     LValue notNull(LValue value) { CRASH(); }
    265 
    266     LValue testIsZero32(LValue value, LValue mask) { CRASH(); }
    267     LValue testNonZero32(LValue value, LValue mask) { CRASH(); }
    268     LValue testIsZero64(LValue value, LValue mask) { CRASH(); }
    269     LValue testNonZero64(LValue value, LValue mask) { CRASH(); }
    270     LValue testIsZeroPtr(LValue value, LValue mask) { CRASH(); }
    271     LValue testNonZeroPtr(LValue value, LValue mask) { CRASH(); }
     301    LValue isZero32(LValue value) { return m_block->appendNew<B3::Value>(m_proc, B3::Equal, origin(), value, int32Zero); }
     302    LValue notZero32(LValue value) { return m_block->appendNew<B3::Value>(m_proc, B3::NotEqual, origin(), value, int32Zero); }
     303    LValue isZero64(LValue value) { return m_block->appendNew<B3::Value>(m_proc, B3::Equal, origin(), value, int64Zero); }
     304    LValue notZero64(LValue value) { return m_block->appendNew<B3::Value>(m_proc, B3::NotEqual, origin(), value, int64Zero); }
     305    LValue isNull(LValue value) { return isZero64(value); }
     306    LValue notNull(LValue value) { return notZero64(value); }
     307
     308    LValue testIsZero32(LValue value, LValue mask) { return isZero32(bitAnd(value, mask)); }
     309    LValue testNonZero32(LValue value, LValue mask) { return notZero32(bitAnd(value, mask)); }
     310    LValue testIsZero64(LValue value, LValue mask) { return isZero64(bitAnd(value, mask)); }
     311    LValue testNonZero64(LValue value, LValue mask) { return notZero64(bitAnd(value, mask)); }
     312    LValue testIsZeroPtr(LValue value, LValue mask) { return isNull(bitAnd(value, mask)); }
     313    LValue testNonZeroPtr(LValue value, LValue mask) { return notNull(bitAnd(value, mask)); }
    272314
    273315    LValue select(LValue value, LValue taken, LValue notTaken) { CRASH(); }
     
    278320
    279321    template<typename VectorType>
    280     LValue call(LValue function, const VectorType& vector) { CRASH(); }
    281     LValue call(LValue function) { CRASH(); }
    282     LValue call(LValue function, LValue arg1) { CRASH(); }
     322    LValue call(LType type, LValue function, const VectorType& vector) { return m_block->appendNew<B3::CCallValue>(m_proc, type, origin(), B3::Value::AdjacencyList(vector)); }
     323    LValue call(LType type, LValue function) { return m_block->appendNew<B3::CCallValue>(m_proc, type, origin()); }
     324    LValue call(LType type, LValue function, LValue arg1) { return m_block->appendNew<B3::CCallValue>(m_proc, type, origin(), arg1); }
    283325    template<typename... Args>
    284     LValue call(LValue function, LValue arg1, Args... args) { CRASH(); }
     326    LValue call(LType type, LValue function, LValue arg1, Args... args) { return m_block->appendNew<B3::CCallValue>(m_proc, type, origin(), arg1, args...); }
    285327
    286328    template<typename FunctionType>
    287     LValue operation(FunctionType function) { CRASH(); }
    288 
    289     void jump(LBasicBlock destination) { CRASH(); }
    290     void branch(LValue condition, LBasicBlock taken, Weight takenWeight, LBasicBlock notTaken, Weight notTakenWeight) { CRASH(); }
    291     void branch(LValue condition, WeightedTarget taken, WeightedTarget notTaken) { CRASH(); }
     329    LValue operation(FunctionType function) { return constIntPtr(bitwise_cast<void*>(function)); }
     330
     331    void jump(LBasicBlock destination) { m_block->appendNew<B3::ControlValue>(m_proc, B3::Jump, origin(), B3::FrequentedBlock(destination)); }
     332    void branch(LValue condition, LBasicBlock taken, Weight takenWeight, LBasicBlock notTaken, Weight notTakenWeight);
     333    void branch(LValue condition, WeightedTarget taken, WeightedTarget notTaken)
     334    {
     335        branch(condition, taken.target(), taken.weight(), notTaken.target(), notTaken.weight());
     336    }
    292337
    293338    // Branches to an already-created handler if true, "falls through" if false. Fall-through is
     
    301346    void switchInstruction(LValue value, const VectorType& cases, LBasicBlock fallThrough, Weight fallThroughWeight) { CRASH(); }
    302347
    303     void ret(LValue value) { CRASH(); }
    304 
    305     void unreachable() { CRASH(); }
     348    void ret(LValue value) { m_block->appendNew<B3::ControlValue>(m_proc, B3::Return, origin(), value); }
     349
     350    void unreachable() { m_block->appendNew<B3::ControlValue>(m_proc, B3::Oops, origin()); }
     351
     352    template<typename Functor>
     353    void check(LValue value, const StackmapArgumentList& arguments, const Functor& functor)
     354    {
     355        B3::CheckValue* check = m_block->appendNew<B3::CheckValue>(m_proc, B3::Check, origin(), value);
     356        for (LValue value : arguments)
     357            check->append(B3::ConstrainedValue(value));
     358        check->setGenerator(functor);
     359    }
    306360
    307361    void trap() { CRASH(); }
    308362
    309     ValueFromBlock anchor(LValue value) { CRASH(); }
     363    ValueFromBlock anchor(LValue value)
     364    {
     365        B3::UpsilonValue* upsilon = m_block->appendNew<B3::UpsilonValue>(m_proc, origin(), value);
     366        return ValueFromBlock(upsilon, m_block);
     367    }
    310368
    311369#pragma mark - Intrinsics
     
    317375
    318376#pragma mark - States
    319     B3::Procedure& m_procedure;
    320 
     377    B3::Procedure& m_proc;
     378
     379    DFG::Node* m_origin { nullptr };
    321380    LBasicBlock m_block { nullptr };
    322381    LBasicBlock m_nextBlock { nullptr };
     382
     383    AbstractHeapRepository* m_heaps;
    323384};
     385
     386template<typename... Params>
     387inline LValue Output::phi(LType type, ValueFromBlock value, Params... theRest)
     388{
     389    LValue phiNode = phi(type);
     390    addIncomingToPhi(phiNode, value, theRest...);
     391    return phiNode;
     392}
     393
     394template<typename VectorType>
     395inline LValue Output::phi(LType type, const VectorType& vector)
     396{
     397    LValue phiNode = phi(type);
     398    for (const ValueFromBlock& valueFromBlock : vector)
     399        addIncomingToPhi(phiNode, valueFromBlock);
     400    return phiNode;
     401}
     402
     403inline void Output::addIncomingToPhi(LValue phi, ValueFromBlock value)
     404{
     405    value.value()->as<B3::UpsilonValue>()->setPhi(phi);
     406}
     407
     408template<typename... Params>
     409inline void Output::addIncomingToPhi(LValue phi, ValueFromBlock value, Params... theRest)
     410{
     411    addIncomingToPhi(phi, value);
     412    addIncomingToPhi(phi, theRest...);
     413}
     414
    324415
    325416#if COMPILER(CLANG)
  • trunk/Source/JavaScriptCore/ftl/FTLCommonValues.cpp

    r192591 r192605  
    2727#include "FTLCommonValues.h"
    2828
     29#include "B3BasicBlockInlines.h"
     30#include "B3Const32Value.h"
     31#include "B3Const64Value.h"
     32#include "B3ConstDoubleValue.h"
     33#include "B3ConstPtrValue.h"
     34#include "B3ProcedureInlines.h"
    2935#include "B3Type.h"
     36#include "B3ValueInlines.h"
    3037#include "FTLAbbreviations.h"
    3138
     
    3340
    3441namespace JSC { namespace FTL {
     42
     43using namespace B3;
    3544
    3645CommonValues::CommonValues(LContext context)
     
    6978    , intPtrTwo(constInt(intPtr, 2, SignExtend))
    7079    , intPtrThree(constInt(intPtr, 3, SignExtend))
    71     , intPtrFour(constInt(intPtr, 4, SignExtend))
    7280    , intPtrEight(constInt(intPtr, 8, SignExtend))
    73     , intPtrPtr(constInt(intPtr, sizeof(void*), SignExtend))
    7481    , doubleZero(constReal(doubleType, 0))
    7582    , rangeKind(mdKindID(context, "range"))
     
    8188    , m_module(0)
    8289{
     90}
     91
    8392#if FTL_USES_B3
    84     // Plenty of values are uninitialized. The branch is just there for NORETURN.
    85     if (!m_module)
    86         CRASH();
     93void CommonValues::initializeConstants(B3::Procedure& proc, B3::BasicBlock* block)
     94{
     95    int32Zero = block->appendNew<Const32Value>(proc, Origin(), 0);
     96    int32One = block->appendNew<Const32Value>(proc, Origin(), 1);
     97    booleanTrue = int32One;
     98    booleanFalse = int32Zero;
     99    int64Zero = block->appendNew<Const64Value>(proc, Origin(), 0);
     100    intPtrZero = block->appendNew<ConstPtrValue>(proc, Origin(), 0);
     101    intPtrOne = block->appendNew<ConstPtrValue>(proc, Origin(), 1);
     102    intPtrTwo = block->appendNew<ConstPtrValue>(proc, Origin(), 2);
     103    intPtrThree = block->appendNew<ConstPtrValue>(proc, Origin(), 3);
     104    intPtrEight = block->appendNew<ConstPtrValue>(proc, Origin(), 8);
     105    doubleZero = block->appendNew<ConstDoubleValue>(proc, Origin(), 0.);
     106}
    87107#endif
    88 }
    89108
    90109} } // namespace JSC::FTL
  • trunk/Source/JavaScriptCore/ftl/FTLCommonValues.h

    r192591 r192605  
    3232#include "FTLValueRange.h"
    3333
    34 namespace JSC { namespace FTL {
     34namespace JSC {
     35
     36namespace B3 {
     37class BasicBlock;
     38class Procedure;
     39}
     40
     41namespace FTL {
    3542
    3643class CommonValues {
    3744public:
    3845    CommonValues(LContext context);
    39    
     46
     47#if FTL_USES_B3
     48    void initializeConstants(B3::Procedure&, B3::BasicBlock*);
     49#else // FTL_USES_B3
    4050    void initialize(LModule module)
    4151    {
    4252        m_module = module;
    4353    }
     54#endif // FTL_USES_B3
    4455   
    4556    const LType voidType;
     
    6172    const LType refDouble;
    6273#endif
    63     const LValue booleanTrue { nullptr };
    64     const LValue booleanFalse { nullptr };
    65     const LValue int8Zero { nullptr };
    66     const LValue int32Zero { nullptr };
    67     const LValue int32One { nullptr };
    68     const LValue int64Zero { nullptr };
    69     const LValue intPtrZero { nullptr };
    70     const LValue intPtrOne { nullptr };
    71     const LValue intPtrTwo { nullptr };
    72     const LValue intPtrThree { nullptr };
    73     const LValue intPtrFour { nullptr };
    74     const LValue intPtrEight { nullptr };
    75     const LValue intPtrPtr { nullptr };
    76     const LValue doubleZero { nullptr };
     74    LValue booleanTrue { nullptr };
     75    LValue booleanFalse { nullptr };
     76#if !FTL_USES_B3
     77    LValue int8Zero { nullptr };
     78#endif
     79    LValue int32Zero { nullptr };
     80    LValue int32One { nullptr };
     81    LValue int64Zero { nullptr };
     82    LValue intPtrZero { nullptr };
     83    LValue intPtrOne { nullptr };
     84    LValue intPtrTwo { nullptr };
     85    LValue intPtrThree { nullptr };
     86    LValue intPtrEight { nullptr };
     87    LValue doubleZero { nullptr };
    7788   
    7889    const unsigned rangeKind { 0 };
  • trunk/Source/JavaScriptCore/ftl/FTLJITFinalizer.cpp

    r192590 r192605  
    152152   
    153153    m_plan.codeBlock->setJITCode(jitCode);
    154 
     154#if !FTL_USES_B3
    155155    m_plan.vm.updateFTLLargestStackSize(jitCode->stackmaps.stackSize());
     156#endif
    156157
    157158    if (m_plan.compilation)
  • trunk/Source/JavaScriptCore/ftl/FTLLink.cpp

    r192590 r192605  
    5353    codeBlock->clearSwitchJumpTables();
    5454
     55#if !FTL_USES_B3
    5556    // What LLVM's stackmaps call stackSizeForLocals and what we call frameRegisterCount have a simple
    5657    // relationship, though it's not obvious from reading the code. The easiest way to understand them
     
    7879    //     frameRegisterCount == state.jitCode->stackmaps.stackSizeForLocals() / sizeof(Register)
    7980    state.jitCode->common.frameRegisterCount = state.jitCode->stackmaps.stackSizeForLocals() / sizeof(void*);
     81#endif
    8082   
    8183    state.jitCode->common.requiredRegisterCountForExit = graph.requiredRegisterCountForExit();
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToLLVM.cpp

    r192591 r192605  
    6565namespace JSC { namespace FTL {
    6666
     67using namespace B3;
    6768using namespace DFG;
    6869
     
    106107        , m_heaps(state.context)
    107108        , m_out(state)
     109#if FTL_USES_B3
     110        , m_proc(*state.proc)
     111#endif
    108112        , m_state(state.graph)
    109113        , m_interpreter(state.graph, m_state)
     
    128132        m_graph.ensureDominators();
    129133
    130 #if FTL_USES_B3
    131         if (verboseCompilationEnabled() || !verboseCompilationEnabled())
    132             CRASH();
    133 
    134         m_prologue = FTL_NEW_BLOCK(m_out, ("Prologue"));
    135         LBasicBlock stackOverflow = FTL_NEW_BLOCK(m_out, ("Stack overflow"));
    136         LBasicBlock checkArguments = FTL_NEW_BLOCK(m_out, ("Check arguments"));
    137 #else
     134#if !FTL_USES_B3
    138135        m_ftlState.module =
    139136            moduleCreateWithNameInContext(name.data(), m_ftlState.context);
     
    147144            addTargetDependentFunctionAttr(m_ftlState.function, "target-features", "-avx");
    148145        }
     146#endif // !FTL_USES_B3
    149147       
    150148        if (verboseCompilationEnabled())
    151149            dataLog("Function ready, beginning lowering.\n");
    152        
     150
     151#if FTL_USES_B3
     152        m_out.initialize(m_heaps);
     153#else
    153154        m_out.initialize(m_ftlState.module, m_ftlState.function, m_heaps);
     155#endif
    154156       
    155157        m_prologue = FTL_NEW_BLOCK(m_out, ("Prologue"));
     
    167169       
    168170        m_out.appendTo(m_prologue, stackOverflow);
     171#if FTL_USES_B3
     172        m_out.initializeConstants(m_proc, m_prologue);
     173#endif
    169174        createPhiVariables();
    170175
     176#if FTL_USES_B3
     177        m_captured = m_out.lockedStackSlot(sizeof(JSValue) * m_graph.m_nextMachineLocal);
     178        m_ftlState.capturedValue = m_captured;
     179#else // FTL_USES_B3
    171180        LValue capturedAlloca = m_out.alloca(arrayType(m_out.int64, m_graph.m_nextMachineLocal));
    172181       
     
    177186        m_ftlState.capturedStackmapID = m_stackmapIDs++;
    178187        m_out.call(
    179             m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.capturedStackmapID),
     188            m_out.voidType, m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.capturedStackmapID),
    180189            m_out.int32Zero, capturedAlloca);
    181 #endif
     190#endif // FTL_USE_B3
    182191
    183192        auto preOrder = m_graph.blocksInPreOrder();
     
    186195        bool hasVarargs = false;
    187196        size_t maxNumberOfCatchSpills = 0;
    188         for (BasicBlock* block : preOrder) {
     197        for (DFG::BasicBlock* block : preOrder) {
    189198            for (Node* node : *block) {
    190199                switch (node->op()) {
     
    245254
    246255#if FTL_USES_B3
    247         if (hasVarargs || !hasVarargs)
    248             CRASH();
     256        // FIXME
    249257#else
    250258        if (hasVarargs) {
     
    253261            m_ftlState.varargsSpillSlotsStackmapID = m_stackmapIDs++;
    254262            m_out.call(
    255                 m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.varargsSpillSlotsStackmapID),
     263                m_out.voidType, m_out.stackmapIntrinsic(),
     264                m_out.constInt64(m_ftlState.varargsSpillSlotsStackmapID),
    256265                m_out.int32Zero, varargsSpillSlots);
    257266        }
     
    265274            m_ftlState.exceptionHandlingSpillSlotStackmapID = m_stackmapIDs++;
    266275            m_out.call(
    267                 m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.exceptionHandlingSpillSlotStackmapID),
     276                m_out.voidType, m_out.stackmapIntrinsic(),
     277                m_out.constInt64(m_ftlState.exceptionHandlingSpillSlotStackmapID),
    268278                m_out.int32Zero, exceptionHandlingVolatileRegistersSpillSlots);
    269279        }
     
    273283        // be mem2reg candidates.
    274284       
     285#if FTL_USES_B3
     286        m_callFrame = m_out.framePointer();
     287#else
    275288        m_callFrame = m_out.ptrToInt(
    276             m_out.call(m_out.frameAddressIntrinsic(), m_out.int32Zero), m_out.intPtr);
     289            m_out.call(m_out.intPtr, m_out.frameAddressIntrinsic(), m_out.int32Zero), m_out.intPtr);
     290#endif
    277291        m_tagTypeNumber = m_out.constInt64(TagTypeNumber);
    278292        m_tagMask = m_out.constInt64(TagMask);
     
    284298       
    285299        m_out.appendTo(stackOverflow, m_handleExceptions);
    286         m_out.call(m_out.operation(operationThrowStackOverflowError), m_callFrame, m_out.constIntPtr(codeBlock()));
     300        m_out.call(m_out.voidType, m_out.operation(operationThrowStackOverflowError), m_callFrame, m_out.constIntPtr(codeBlock()));
     301#if FTL_USES_B3
     302        // FIXME
     303#else
    287304        m_ftlState.handleStackOverflowExceptionStackmapID = m_stackmapIDs++;
    288305        m_out.call(
    289             m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.handleStackOverflowExceptionStackmapID),
     306            m_out.voidType, m_out.stackmapIntrinsic(),
     307            m_out.constInt64(m_ftlState.handleStackOverflowExceptionStackmapID),
    290308            m_out.constInt32(MacroAssembler::maxJumpReplacementSize()));
     309#endif
    291310        m_out.unreachable();
    292311       
    293312        m_out.appendTo(m_handleExceptions, checkArguments);
     313#if FTL_USES_B3
     314        // FIXME
     315#else
    294316        m_ftlState.handleExceptionStackmapID = m_stackmapIDs++;
    295317        m_out.call(
    296             m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.handleExceptionStackmapID),
     318            m_out.voidType, m_out.stackmapIntrinsic(), m_out.constInt64(m_ftlState.handleExceptionStackmapID),
    297319            m_out.constInt32(MacroAssembler::maxJumpReplacementSize()));
     320#endif
    298321        m_out.unreachable();
    299322       
     
    342365        m_out.jump(lowBlock(m_graph.block(0)));
    343366       
    344         for (BasicBlock* block : preOrder)
     367        for (DFG::BasicBlock* block : preOrder)
    345368            compileBlock(block);
    346369
     
    360383    {
    361384        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
    362             BasicBlock* block = m_graph.block(blockIndex);
     385            DFG::BasicBlock* block = m_graph.block(blockIndex);
    363386            if (!block)
    364387                continue;
    365388            for (unsigned nodeIndex = block->size(); nodeIndex--;) {
    366389                Node* node = block->at(nodeIndex);
    367                 if (node->op() != Phi)
     390                if (node->op() != DFG::Phi)
    368391                    continue;
    369392                LType type;
     
    388411                    break;
    389412                }
     413#if FTL_USES_B3
     414                m_phis.add(node, m_proc.add<Value>(B3::Phi, type, Origin(node)));
     415#else
    390416                m_phis.add(node, m_out.alloca(type));
     417#endif
    391418            }
    392419        }
    393420    }
    394421   
    395     void compileBlock(BasicBlock* block)
     422    void compileBlock(DFG::BasicBlock* block)
    396423    {
    397424        if (!block)
     
    452479        // being used but not defined. Race conditions FTW!
    453480        for (BlockIndex blockIndex = m_graph.numBlocks(); blockIndex--;) {
    454             BasicBlock* target = m_graph.block(blockIndex);
     481            DFG::BasicBlock* target = m_graph.block(blockIndex);
    455482            if (!target)
    456483                continue;
     
    472499        m_node = m_highBlock->at(nodeIndex);
    473500        m_origin = m_node->origin;
     501#if FTL_USES_B3
     502        m_out.setOrigin(m_node);
     503#endif
    474504       
    475505        if (verboseCompilationEnabled())
     
    481511       
    482512        switch (m_node->op()) {
    483         case Upsilon:
     513        case DFG::Upsilon:
    484514            compileUpsilon();
    485515            break;
    486         case Phi:
     516        case DFG::Phi:
    487517            compilePhi();
    488518            break;
     
    501531            compileDoubleAsInt32();
    502532            break;
    503         case ValueRep:
     533        case DFG::ValueRep:
    504534            compileValueRep();
    505535            break;
     
    522552            compilePutStack();
    523553            break;
    524         case Check:
     554        case DFG::Check:
    525555            compileNoOp();
    526556            break;
     
    581611            compileArithNegate();
    582612            break;
    583         case BitAnd:
     613        case DFG::BitAnd:
    584614            compileBitAnd();
    585615            break;
    586         case BitOr:
     616        case DFG::BitOr:
    587617            compileBitOr();
    588618            break;
    589         case BitXor:
     619        case DFG::BitXor:
    590620            compileBitXor();
    591621            break;
     
    841871            compileForwardVarargs();
    842872            break;
    843         case Jump:
     873        case DFG::Jump:
    844874            compileJump();
    845875            break;
    846         case Branch:
     876        case DFG::Branch:
    847877            compileBranch();
    848878            break;
    849         case Switch:
     879        case DFG::Switch:
    850880            compileSwitch();
    851881            break;
    852         case Return:
     882        case DFG::Return:
    853883            compileReturn();
    854884            break;
     
    9741004    void compileUpsilon()
    9751005    {
    976         LValue destination = m_phis.get(m_node->phi());
    977        
     1006        LValue upsilonValue = nullptr;
    9781007        switch (m_node->child1().useKind()) {
    9791008        case DoubleRepUse:
    980             m_out.set(lowDouble(m_node->child1()), destination);
     1009            upsilonValue = lowDouble(m_node->child1());
    9811010            break;
    9821011        case Int32Use:
    9831012        case KnownInt32Use:
    984             m_out.set(lowInt32(m_node->child1()), destination);
     1013            upsilonValue = lowInt32(m_node->child1());
    9851014            break;
    9861015        case Int52RepUse:
    987             m_out.set(lowInt52(m_node->child1()), destination);
     1016            upsilonValue = lowInt52(m_node->child1());
    9881017            break;
    9891018        case BooleanUse:
    9901019        case KnownBooleanUse:
    991             m_out.set(lowBoolean(m_node->child1()), destination);
     1020            upsilonValue = lowBoolean(m_node->child1());
    9921021            break;
    9931022        case CellUse:
    9941023        case KnownCellUse:
    995             m_out.set(lowCell(m_node->child1()), destination);
     1024            upsilonValue = lowCell(m_node->child1());
    9961025            break;
    9971026        case UntypedUse:
    998             m_out.set(lowJSValue(m_node->child1()), destination);
     1027            upsilonValue = lowJSValue(m_node->child1());
    9991028            break;
    10001029        default:
     
    10021031            break;
    10031032        }
     1033#if FTL_USES_B3
     1034        ValueFromBlock upsilon = m_out.anchor(upsilonValue);
     1035        LValue phiNode = m_phis.get(m_node->phi());
     1036        addIncomingToPhi(phiNode, uspilon);
     1037#else
     1038        LValue destination = m_phis.get(m_node->phi());
     1039        m_out.set(upsilonValue, destination);
     1040#endif
    10041041    }
    10051042   
    10061043    void compilePhi()
    10071044    {
     1045#if FTL_USES_B3
     1046        LValue phiNode = m_phis.get(m_node->phi());
     1047        m_out.m_block->append(phiNode);
     1048#else
    10081049        LValue source = m_phis.get(m_node);
    10091050       
     
    10281069            break;
    10291070        }
     1071#endif
    10301072    }
    10311073   
     
    14041446            function = operationToThis;
    14051447        ValueFromBlock slowResult = m_out.anchor(
    1406             vmCall(m_out.operation(function), m_callFrame, value));
     1448            vmCall(m_out.int64, m_out.operation(function), m_callFrame, value));
    14071449        m_out.jump(continuation);
    14081450       
     
    14201462            operation = operationValueAdd;
    14211463        setJSValue(vmCall(
    1422             m_out.operation(operation), m_callFrame,
     1464            m_out.int64, m_out.operation(operation), m_callFrame,
    14231465            lowJSValue(m_node->child1()), lowJSValue(m_node->child2())));
    14241466    }
     
    14291471        if (m_node->child3()) {
    14301472            result = vmCall(
    1431                 m_out.operation(operationStrCat3), m_callFrame,
     1473                m_out.int64, m_out.operation(operationStrCat3), m_callFrame,
    14321474                lowJSValue(m_node->child1(), ManualOperandSpeculation),
    14331475                lowJSValue(m_node->child2(), ManualOperandSpeculation),
     
    14351477        } else {
    14361478            result = vmCall(
    1437                 m_out.operation(operationStrCat2), m_callFrame,
     1479                m_out.int64, m_out.operation(operationStrCat2), m_callFrame,
    14381480                lowJSValue(m_node->child1(), ManualOperandSpeculation),
    14391481                lowJSValue(m_node->child2(), ManualOperandSpeculation));
     
    15781620            appendOSRExitArgumentsForPatchpointIfWillCatchException(arguments, ExceptionType::SubGenerator, 3); // left, right, and result show up in the stackmap locations.
    15791621
    1580             LValue call = m_out.call(m_out.patchpointInt64Intrinsic(), arguments);
     1622            LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments);
    15811623            setInstructionCallingConvention(call, LLVMAnyRegCallConv);
    15821624
     
    22932335        switch (m_node->arrayMode().type()) {
    22942336        case Array::Int32:
    2295             vmCall(m_out.operation(operationEnsureInt32), m_callFrame, cell);
     2337            vmCall(m_out.voidType, m_out.operation(operationEnsureInt32), m_callFrame, cell);
    22962338            break;
    22972339        case Array::Double:
    2298             vmCall(m_out.operation(operationEnsureDouble), m_callFrame, cell);
     2340            vmCall(m_out.voidType, m_out.operation(operationEnsureDouble), m_callFrame, cell);
    22992341            break;
    23002342        case Array::Contiguous:
    2301             vmCall(m_out.operation(operationEnsureContiguous), m_callFrame, cell);
     2343            vmCall(m_out.voidType, m_out.operation(operationEnsureContiguous), m_callFrame, cell);
    23022344            break;
    23032345        case Array::ArrayStorage:
    23042346        case Array::SlowPutArrayStorage:
    2305             vmCall(m_out.operation(operationEnsureArrayStorage), m_callFrame, cell);
     2347            vmCall(m_out.voidType, m_out.operation(operationEnsureArrayStorage), m_callFrame, cell);
    23062348            break;
    23072349        default:
     
    23622404            m_out.appendTo(notCellCase, continuation);
    23632405            ValueFromBlock notCellResult = m_out.anchor(vmCall(
    2364                 m_out.operation(operationGetByIdGeneric),
     2406                m_out.int64, m_out.operation(operationGetByIdGeneric),
    23652407                m_callFrame, value,
    23662408                m_out.constIntPtr(m_graph.identifiers()[m_node->identifierNumber()])));
     
    24082450        arguments.insert(0, m_out.constInt64(stackmapID));
    24092451
    2410         LValue call = m_out.call(m_out.patchpointVoidIntrinsic(), arguments);
     2452        LValue call = m_out.call(m_out.voidType, m_out.patchpointVoidIntrinsic(), arguments);
    24112453        setInstructionCallingConvention(call, LLVMAnyRegCallConv);
    24122454       
     
    24502492           
    24512493            ValueFromBlock slowResult = m_out.anchor(
    2452                 vmCall(m_out.operation(operationResolveRope), m_callFrame, cell));
     2494                vmCall(m_out.intPtr, m_out.operation(operationResolveRope), m_callFrame, cell));
    24532495           
    24542496            m_out.jump(continuation);
     
    26082650            m_out.appendTo(slowCase, continuation);
    26092651            ValueFromBlock slowResult = m_out.anchor(
    2610                 vmCall(m_out.operation(operationGetByValArrayInt), m_callFrame, base, index));
     2652                vmCall(m_out.int64, m_out.operation(operationGetByValArrayInt), m_callFrame, base, index));
    26112653            m_out.jump(continuation);
    26122654           
     
    26602702            m_out.appendTo(slowCase, continuation);
    26612703            ValueFromBlock slowResult = m_out.anchor(
    2662                 vmCall(m_out.operation(operationGetByValArrayInt), m_callFrame, base, index));
     2704                vmCall(m_out.int64, m_out.operation(operationGetByValArrayInt), m_callFrame, base, index));
    26632705            m_out.jump(continuation);
    26642706           
     
    27502792        case Array::Generic: {
    27512793            setJSValue(vmCall(
    2752                 m_out.operation(operationGetByVal), m_callFrame,
     2794                m_out.int64, m_out.operation(operationGetByVal), m_callFrame,
    27532795                lowJSValue(m_node->child1()), lowJSValue(m_node->child2())));
    27542796            return;
     
    28992941               
    29002942            vmCall(
    2901                 m_out.operation(operation), m_callFrame,
     2943                m_out.voidType, m_out.operation(operation), m_callFrame,
    29022944                lowJSValue(child1), lowJSValue(child2), lowJSValue(child3));
    29032945            return;
     
    31383180        auto uid = m_graph.identifiers()[m_node->identifierNumber()];
    31393181        vmCall(
     3182            m_out.voidType,
    31403183            m_out.operation(m_node->op() == PutGetterById ? operationPutGetterById : operationPutSetterById),
    31413184            m_callFrame, base, m_out.constIntPtr(uid), m_out.constInt32(m_node->accessorAttributes()), accessor);
     
    31493192        auto uid = m_graph.identifiers()[m_node->identifierNumber()];
    31503193        vmCall(
    3151             m_out.operation(operationPutGetterSetter),
     3194            m_out.voidType, m_out.operation(operationPutGetterSetter),
    31523195            m_callFrame, base, m_out.constIntPtr(uid), m_out.constInt32(m_node->accessorAttributes()), getter, setter);
    31533196
     
    31603203        LValue accessor = lowCell(m_node->child3());
    31613204        vmCall(
     3205            m_out.voidType,
    31623206            m_out.operation(m_node->op() == PutGetterByVal ? operationPutGetterByVal : operationPutSetterByVal),
    31633207            m_callFrame, base, subscript, m_out.constInt32(m_node->accessorAttributes()), accessor);
     
    32243268                operation = m_out.operation(operationArrayPushDouble);
    32253269            ValueFromBlock slowResult = m_out.anchor(
    3226                 vmCall(operation, m_callFrame, value, base));
     3270                vmCall(m_out.int64, operation, m_callFrame, value, base));
    32273271            m_out.jump(continuation);
    32283272           
     
    32823326            m_out.appendTo(slowCase, continuation);
    32833327            results.append(m_out.anchor(vmCall(
    3284                 m_out.operation(operationArrayPopAndRecoverLength), m_callFrame, base)));
     3328                m_out.int64, m_out.operation(operationArrayPopAndRecoverLength), m_callFrame, base)));
    32853329            m_out.jump(continuation);
    32863330           
     
    33053349        if (table->singletonScope()->isStillValid()) {
    33063350            LValue callResult = vmCall(
     3351                m_out.int64,
    33073352                m_out.operation(operationCreateActivationDirect), m_callFrame, weakPointer(structure),
    33083353                scope, weakPointer(table), m_out.constInt64(JSValue::encode(initializationValue)));
     
    33623407        if (executable->singletonFunction()->isStillValid()) {
    33633408            LValue callResult = isArrowFunction
    3364                 ? vmCall(m_out.operation(operationNewArrowFunction), m_callFrame, scope, weakPointer(executable), thisValue)
    3365                 : vmCall(m_out.operation(operationNewFunction), m_callFrame, scope, weakPointer(executable));
     3409                ? vmCall(m_out.int64, m_out.operation(operationNewArrowFunction), m_callFrame, scope, weakPointer(executable), thisValue)
     3410                : vmCall(m_out.int64, m_out.operation(operationNewFunction), m_callFrame, scope, weakPointer(executable));
    33663411            setJSValue(callResult);
    33673412            return;
     
    35283573       
    35293574        LValue result = vmCall(
    3530             m_out.operation(operationCreateScopedArguments), m_callFrame,
     3575            m_out.int64, m_out.operation(operationCreateScopedArguments), m_callFrame,
    35313576            weakPointer(
    35323577                m_graph.globalObjectFor(m_node->origin.semantic)->scopedArgumentsStructure()),
     
    35393584    {
    35403585        LValue result = vmCall(
    3541             m_out.operation(operationCreateClonedArguments), m_callFrame,
     3586            m_out.int64, m_out.operation(operationCreateClonedArguments), m_callFrame,
    35423587            weakPointer(
    35433588                m_graph.globalObjectFor(m_node->origin.semantic)->outOfBandArgumentsStructure()),
     
    36083653        if (!m_node->numChildren()) {
    36093654            setJSValue(vmCall(
    3610                 m_out.operation(operationNewEmptyArray), m_callFrame,
     3655                m_out.int64, m_out.operation(operationNewEmptyArray), m_callFrame,
    36113656                m_out.constIntPtr(structure)));
    36123657            return;
     
    36293674       
    36303675        LValue result = vmCall(
    3631             m_out.operation(operationNewArray), m_callFrame,
     3676            m_out.int64, m_out.operation(operationNewArray), m_callFrame,
    36323677            m_out.constIntPtr(structure), m_out.constIntPtr(buffer),
    36333678            m_out.constIntPtr(m_node->numChildren()));
     
    36703715       
    36713716        setJSValue(vmCall(
    3672             m_out.operation(operationNewArrayBuffer), m_callFrame,
     3717            m_out.int64, m_out.operation(operationNewArrayBuffer), m_callFrame,
    36733718            m_out.constIntPtr(structure), m_out.constIntPtr(m_node->startConstant()),
    36743719            m_out.constIntPtr(m_node->numConstants())));
     
    37823827                globalObject->arrayStructureForIndexingTypeDuringAllocation(ArrayWithArrayStorage)),
    37833828            m_out.constIntPtr(structure));
    3784         setJSValue(vmCall(m_out.operation(operationNewArrayWithSize), m_callFrame, structureValue, publicLength));
     3829        setJSValue(vmCall(m_out.int64, m_out.operation(operationNewArrayWithSize), m_callFrame, structureValue, publicLength));
    37853830    }
    37863831   
     
    38733918            else
    38743919                operation = m_out.operation(m_node->op() == ToString ? operationToString : operationCallStringConstructor);
    3875             ValueFromBlock convertedResult = m_out.anchor(vmCall(operation, m_callFrame, value));
     3920            ValueFromBlock convertedResult = m_out.anchor(vmCall(m_out.int64, operation, m_callFrame, value));
    38763921            m_out.jump(continuation);
    38773922           
     
    39093954        m_out.appendTo(isObjectCase, continuation);
    39103955        results.append(m_out.anchor(vmCall(
    3911             m_out.operation(operationToPrimitive), m_callFrame, value)));
     3956            m_out.int64, m_out.operation(operationToPrimitive), m_callFrame, value)));
    39123957        m_out.jump(continuation);
    39133958       
     
    40474092        Vector<ValueFromBlock, 4> results;
    40484093        results.append(m_out.anchor(vmCall(
    4049             m_out.operation(operationSingleCharacterString),
     4094            m_out.int64, m_out.operation(operationSingleCharacterString),
    40504095            m_callFrame, char16Bit.value())));
    40514096        m_out.jump(continuation);
     
    40894134               
    40904135            results.append(m_out.anchor(vmCall(
    4091                 m_out.operation(operationGetByValStringInt), m_callFrame, base, index)));
     4136                m_out.int64, m_out.operation(operationGetByValStringInt), m_callFrame, base, index)));
    40924137        }
    40934138           
     
    46344679        arguments.insert(0, m_out.constInt64(stackmapID));
    46354680       
    4636         LValue call = m_out.call(m_out.patchpointInt64Intrinsic(), arguments);
     4681        LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments);
    46374682        setInstructionCallingConvention(call, LLVMWebKitJSCallConv);
    46384683       
     
    46744719        exitArguments.insert(0, m_out.constInt64(stackmapID));
    46754720
    4676         LValue call =
    4677             m_out.call(m_out.patchpointVoidIntrinsic(), exitArguments);
     4721        LValue call = m_out.call(m_out.voidType, m_out.patchpointVoidIntrinsic(), exitArguments);
    46784722        setInstructionCallingConvention(call, LLVMAnyRegCallConv);
    46794723        m_out.unreachable();
     
    47274771        arguments.insert(0, m_out.constInt64(stackmapID));
    47284772       
    4729         LValue call = m_out.call(m_out.patchpointInt64Intrinsic(), arguments);
     4773        LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments);
    47304774        setInstructionCallingConvention(call, LLVMCCallConv);
    47314775       
     
    47504794       
    47514795        LValue length = vmCall(
    4752             m_out.operation(operationSizeOfVarargs), m_callFrame, jsArguments,
     4796            m_out.int32, m_out.operation(operationSizeOfVarargs), m_callFrame, jsArguments,
    47534797            m_out.constInt32(data->offset));
    47544798       
     
    47744818       
    47754819        vmCall(
    4776             m_out.operation(operationLoadVarargs), m_callFrame,
     4820            m_out.voidType, m_out.operation(operationLoadVarargs), m_callFrame,
    47774821            m_out.castToInt32(machineStart), jsArguments, m_out.constInt32(data->offset),
    47784822            length, m_out.constInt32(data->mandatoryMinimum));
     
    49705014            m_out.appendTo(needResolution, resolved);
    49715015            values.append(m_out.anchor(
    4972                 vmCall(m_out.operation(operationResolveRope), m_callFrame, stringValue)));
     5016                vmCall(m_out.intPtr, m_out.operation(operationResolveRope), m_callFrame, stringValue)));
    49735017            m_out.jump(resolved);
    49745018           
     
    50975141    void compileInvalidationPoint()
    50985142    {
     5143#if FTL_USES_B3
     5144        UNREACHABLE_FOR_PLATFORM();
     5145#else // FTL_USES_B3
    50995146        if (verboseCompilationEnabled())
    51005147            dataLog("    Invalidation point with availability: ", availabilityMap(), "\n");
     
    51135160       
    51145161        exitDescriptor.m_isInvalidationPoint = true;
     5162#endif // FTL_USES_B3
    51155163    }
    51165164   
     
    53055353           
    53065354                LValue call = m_out.call(
    5307                     m_out.patchpointInt64Intrinsic(),
     5355                    m_out.int64, m_out.patchpointInt64Intrinsic(),
    53085356                    m_out.constInt64(stackmapID), m_out.constInt32(sizeOfIn()),
    53095357                    constNull(m_out.ref8), m_out.constInt32(1), cell);
     
    53175365        }
    53185366
    5319         setJSValue(vmCall(m_out.operation(operationGenericIn), m_callFrame, cell, lowJSValue(m_node->child1())));
     5367        setJSValue(vmCall(m_out.int64, m_out.operation(operationGenericIn), m_callFrame, cell, lowJSValue(m_node->child1())));
    53205368#endif
    53215369    }
     
    54245472            ValueFromBlock slowResult = m_out.anchor(m_out.equal(
    54255473                m_out.constInt64(JSValue::encode(jsBoolean(true))),
    5426                 vmCall(m_out.operation(operationHasIndexedProperty), m_callFrame, base, index)));
     5474                vmCall(m_out.int64, m_out.operation(operationHasIndexedProperty), m_callFrame, base, index)));
    54275475            m_out.jump(continuation);
    54285476
     
    54585506            ValueFromBlock slowResult = m_out.anchor(m_out.equal(
    54595507                m_out.constInt64(JSValue::encode(jsBoolean(true))),
    5460                 vmCall(m_out.operation(operationHasIndexedProperty), m_callFrame, base, index)));
     5508                vmCall(m_out.int64, m_out.operation(operationHasIndexedProperty), m_callFrame, base, index)));
    54615509            m_out.jump(continuation);
    54625510           
     
    54765524        LValue base = lowJSValue(m_node->child1());
    54775525        LValue property = lowCell(m_node->child2());
    5478         setJSValue(vmCall(m_out.operation(operationHasGenericProperty), m_callFrame, base, property));
     5526        setJSValue(vmCall(m_out.int64, m_out.operation(operationHasGenericProperty), m_callFrame, base, property));
    54795527    }
    54805528
     
    55025550            m_out.equal(
    55035551                m_out.constInt64(JSValue::encode(jsBoolean(true))),
    5504                 vmCall(m_out.operation(operationHasGenericProperty), m_callFrame, base, property)));
     5552                vmCall(m_out.int64, m_out.operation(operationHasGenericProperty), m_callFrame, base, property)));
    55055553        m_out.jump(continuation);
    55065554
     
    55495597        m_out.appendTo(slowCase, continuation);
    55505598        ValueFromBlock slowCaseResult = m_out.anchor(
    5551             vmCall(m_out.operation(operationGetByVal), m_callFrame, base, property));
     5599            vmCall(m_out.int64, m_out.operation(operationGetByVal), m_callFrame, base, property));
    55525600        m_out.jump(continuation);
    55535601
     
    55655613    {
    55665614        LValue base = lowCell(m_node->child1());
    5567         setJSValue(vmCall(m_out.operation(operationGetPropertyEnumerator), m_callFrame, base));
     5615        setJSValue(vmCall(m_out.int64, m_out.operation(operationGetPropertyEnumerator), m_callFrame, base));
    55685616    }
    55695617
     
    56235671    {
    56245672        LValue index = lowInt32(m_node->child1());
    5625         setJSValue(vmCall(m_out.operation(operationToIndexString), m_callFrame, index));
     5673        setJSValue(vmCall(m_out.int64, m_out.operation(operationToIndexString), m_callFrame, index));
    56265674    }
    56275675   
     
    58455893       
    58465894        for (BlockIndex blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex) {
    5847             BasicBlock* block = m_graph.block(blockIndex);
     5895            DFG::BasicBlock* block = m_graph.block(blockIndex);
    58485896            if (!block)
    58495897                continue;
     
    61976245        if (previousStructure->couldHaveIndexingHeader()) {
    61986246            return vmCall(
     6247                m_out.intPtr,
    61996248                m_out.operation(
    62006249                    operationReallocateButterflyToHavePropertyStorageWithInitialCapacity),
     
    62176266        if (previous->couldHaveIndexingHeader()) {
    62186267            LValue newAllocSize = m_out.constIntPtr(newSize);                   
    6219             return vmCall(m_out.operation(operationReallocateButterflyToGrowPropertyStorage), m_callFrame, object, newAllocSize);
     6268            return vmCall(m_out.intPtr, m_out.operation(operationReallocateButterflyToGrowPropertyStorage), m_callFrame, object, newAllocSize);
    62206269        }
    62216270       
     
    63056354        arguments.insert(0, m_out.constInt64(stackmapID));
    63066355
    6307         LValue call = m_out.call(m_out.patchpointInt64Intrinsic(), arguments);
     6356        LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments);
    63086357        setInstructionCallingConvention(call, LLVMAnyRegCallConv);
    63096358       
     
    65326581        m_out.appendTo(slowPath, continuation);
    65336582        ValueFromBlock slowResult = m_out.anchor(m_out.notNull(vmCall(
    6534             m_out.operation(helperFunction), m_callFrame, left, right)));
     6583            m_out.boolean, m_out.operation(helperFunction), m_callFrame, left, right)));
    65356584        m_out.jump(continuation);
    65366585       
     
    70337082                   
    70347083                vmCall(
    7035                     m_out.operation(slowPathFunction),
     7084                    m_out.voidType, m_out.operation(slowPathFunction),
    70367085                    m_callFrame, base, index, value);
    70377086                   
     
    73097358       
    73107359        LValue branchOffset = vmCall(
    7311             m_out.operation(operationSwitchStringAndGetBranchOffset),
     7360            m_out.int32, m_out.operation(operationSwitchStringAndGetBranchOffset),
    73127361            m_callFrame, m_out.constIntPtr(data->switchTableIndex), string);
    73137362       
     
    75347583       
    75357584        m_out.appendTo(slowPath, continuation);
    7536         results.append(m_out.anchor(m_out.call(m_out.operation(toInt32), doubleValue)));
     7585        results.append(m_out.anchor(m_out.call(m_out.int32, m_out.operation(toInt32), doubleValue)));
    75377586        m_out.jump(continuation);
    75387587       
     
    75637612        LBasicBlock lastNext = m_out.appendTo(slowPath, continuation);
    75647613        ValueFromBlock slowResult = m_out.anchor(
    7565             m_out.call(m_out.operation(toInt32), doubleValue));
     7614            m_out.call(m_out.int32, m_out.operation(toInt32), doubleValue));
    75667615        m_out.jump(continuation);
    75677616       
     
    76797728        appendOSRExitArgumentsForPatchpointIfWillCatchException(arguments, ExceptionType::LazySlowPath, userArguments.size() + 1); // All the arguments plus the result show up in the stackmap locations.
    76807729
    7681         LValue call = m_out.call(m_out.patchpointInt64Intrinsic(), arguments);
     7730        LValue call = m_out.call(m_out.int64, m_out.patchpointInt64Intrinsic(), arguments);
    76827731        setInstructionCallingConvention(call, LLVMAnyRegCallConv);
    76837732       
     
    81188167       
    81198168        LValue possibleResult = m_out.call(
    8120             m_out.operation(operationConvertBoxedDoubleToInt52), boxedValue);
     8169            m_out.int64, m_out.operation(operationConvertBoxedDoubleToInt52), boxedValue);
    81218170        FTL_TYPE_CHECK(
    81228171            jsValueValue(boxedValue), edge, SpecInt32 | SpecInt52AsDouble,
     
    81348183    {
    81358184        LValue possibleResult = m_out.call(
    8136             m_out.operation(operationConvertDoubleToInt52), value);
     8185            m_out.int64, m_out.operation(operationConvertDoubleToInt52), value);
    81378186        FTL_TYPE_CHECK(
    81388187            doubleValue(value), edge, SpecInt52AsDouble,
     
    88618910
    88628911    template<typename... Args>
    8863     LValue vmCall(LValue function, Args... args)
     8912    LValue vmCall(LType type, LValue function, Args... args)
    88648913    {
    88658914        callPreflight();
    8866         LValue result = m_out.call(function, args...);
     8915        LValue result = m_out.call(type, function, args...);
    88678916        callCheck();
    88688917        return result;
    88698918    }
    88708919   
    8871     template<typename... Args>
    8872     LValue vmCallNoExceptions(LValue function, Args... args)
    8873     {
    8874         callPreflight();
    8875         LValue result = m_out.call(function, args...);
    8876         return result;
    8877     }
    8878 
    88798920    void callPreflight(CodeOrigin codeOrigin)
    88808921    {
     
    89108951    {
    89118952        if (Options::useExceptionFuzz())
    8912             m_out.call(m_out.operation(operationExceptionFuzz), m_callFrame);
     8953            m_out.call(m_out.voidType, m_out.operation(operationExceptionFuzz), m_callFrame);
    89138954       
    89148955        LValue exception = m_out.load64(m_out.absolute(vm().addressOfException()));
     
    89588999    }
    89599000   
    8960     LBasicBlock lowBlock(BasicBlock* block)
     9001    LBasicBlock lowBlock(DFG::BasicBlock* block)
    89619002    {
    89629003        return m_blocks.get(block);
     
    90099050        OSRExitDescriptor& exitDescriptor = m_ftlState.jitCode->osrExitDescriptors.last();
    90109051
     9052#if FTL_USES_B3
     9053        StackmapArgumentList arguments;
     9054
     9055        CodeOrigin codeOrigin = exitDescriptor.m_codeOrigin;
     9056
     9057        buildExitArguments(exitDescriptor, arguments, lowValue, codeOrigin);
     9058
     9059        m_out.check(
     9060            failCondition, arguments,
     9061            [&] (CCallHelpers& jit, const B3::StackmapGenerationParams&) {
     9062                jit.oops();
     9063            });
     9064#else // FTL_USES_B3
    90119065        if (failCondition == m_out.booleanTrue) {
    90129066            emitOSRExitCall(exitDescriptor, lowValue);
     
    90299083       
    90309084        m_out.appendTo(continuation, lastNext);
    9031     }
    9032    
     9085#endif // FTL_USES_B3
     9086    }
     9087
     9088#if !FTL_USES_B3
    90339089    void emitOSRExitCall(OSRExitDescriptor& exitDescriptor, FormattedValue lowValue)
    90349090    {
     
    90419097        callStackmap(exitDescriptor, arguments);
    90429098    }
     9099#endif
    90439100   
    90449101    void buildExitArguments(
     
    91059162        }
    91069163    }
    9107    
     9164
     9165#if !FTL_USES_B3
    91089166    void callStackmap(OSRExitDescriptor& exitDescriptor, StackmapArgumentList& arguments)
    91099167    {
     
    91129170        arguments.insert(0, m_out.constInt64(exitDescriptor.m_stackmapID));
    91139171       
    9114         m_out.call(m_out.stackmapIntrinsic(), arguments);
    9115     }
     9172        m_out.call(m_out.voidType, m_out.stackmapIntrinsic(), arguments);
     9173    }
     9174#endif // !FTL_USES_B3
    91169175   
    91179176    ExitValue exitValueForAvailability(
     
    94769535        uint32_t stackmapID = m_stackmapIDs++;
    94779536        m_ftlState.probes.append(ProbeDescriptor(stackmapID, probeFunc));
    9478         m_out.call(m_out.stackmapIntrinsic(), m_out.constInt64(stackmapID), m_out.constInt32(sizeOfProbe()));
     9537        m_out.call(m_out.voidType, m_out.stackmapIntrinsic(), m_out.constInt64(stackmapID), m_out.constInt32(sizeOfProbe()));
    94799538    }
    94809539#endif
     
    94879546    {
    94889547#if ASSERT_DISABLED
    9489         m_out.call(m_out.operation(ftlUnreachable));
     9548        m_out.call(m_out.voidType, m_out.operation(ftlUnreachable));
    94909549        UNUSED_PARAM(blockIndex);
    94919550        UNUSED_PARAM(nodeIndex);
     
    94989557#else
    94999558        m_out.call(
     9559            m_out.voidType,
    95009560            m_out.intToPtr(
    95019561                m_out.constIntPtr(ftlUnreachable),
     
    95199579    AbstractHeapRepository m_heaps;
    95209580    Output m_out;
     9581#if FTL_USES_B3
     9582    Procedure& m_proc;
     9583#endif
    95219584   
    95229585    LBasicBlock m_prologue;
    95239586    LBasicBlock m_handleExceptions;
    9524     HashMap<BasicBlock*, LBasicBlock> m_blocks;
     9587    HashMap<DFG::BasicBlock*, LBasicBlock> m_blocks;
    95259588   
    95269589    LValue m_callFrame;
     
    95509613    InPlaceAbstractState m_state;
    95519614    AbstractInterpreter<InPlaceAbstractState> m_interpreter;
    9552     BasicBlock* m_highBlock;
    9553     BasicBlock* m_nextHighBlock;
     9615    DFG::BasicBlock* m_highBlock;
     9616    DFG::BasicBlock* m_nextHighBlock;
    95549617    LBasicBlock m_nextLowBlock;
    95559618
     
    95699632void lowerDFGToLLVM(State& state)
    95709633{
     9634#if FTL_USES_B3
     9635    state.proc = std::make_unique<Procedure>();
     9636#endif
     9637
    95719638    LowerDFGToLLVM lowering(state);
    95729639    lowering.lower();
  • trunk/Source/JavaScriptCore/ftl/FTLOutput.cpp

    r192591 r192605  
    8080    RELEASE_ASSERT(isX86());
    8181    return call(
     82        int32,
    8283        x86SSE2CvtTSD2SIIntrinsic(),
    8384        insertElement(
  • trunk/Source/JavaScriptCore/ftl/FTLOutput.h

    r192591 r192605  
    146146    LValue ceil64(LValue operand)
    147147    {
    148         return call(ceil64Intrinsic(), operand);
     148        return call(doubleType, ceil64Intrinsic(), operand);
    149149    }
    150150    LValue ctlz32(LValue xOperand, LValue yOperand)
    151151    {
    152         return call(ctlz32Intrinsic(), xOperand, yOperand);
     152        return call(int32, ctlz32Intrinsic(), xOperand, yOperand);
    153153    }
    154154    LValue addWithOverflow32(LValue left, LValue right)
    155155    {
    156         return call(addWithOverflow32Intrinsic(), left, right);
     156        return call(int32, addWithOverflow32Intrinsic(), left, right);
    157157    }
    158158    LValue subWithOverflow32(LValue left, LValue right)
    159159    {
    160         return call(subWithOverflow32Intrinsic(), left, right);
     160        return call(int32, subWithOverflow32Intrinsic(), left, right);
    161161    }
    162162    LValue mulWithOverflow32(LValue left, LValue right)
    163163    {
    164         return call(mulWithOverflow32Intrinsic(), left, right);
     164        return call(int32, mulWithOverflow32Intrinsic(), left, right);
    165165    }
    166166    LValue addWithOverflow64(LValue left, LValue right)
    167167    {
    168         return call(addWithOverflow64Intrinsic(), left, right);
     168        return call(int64, addWithOverflow64Intrinsic(), left, right);
    169169    }
    170170    LValue subWithOverflow64(LValue left, LValue right)
    171171    {
    172         return call(subWithOverflow64Intrinsic(), left, right);
     172        return call(int64, subWithOverflow64Intrinsic(), left, right);
    173173    }
    174174    LValue mulWithOverflow64(LValue left, LValue right)
    175175    {
    176         return call(mulWithOverflow64Intrinsic(), left, right);
     176        return call(int64, mulWithOverflow64Intrinsic(), left, right);
    177177    }
    178178    LValue doubleAbs(LValue value)
    179179    {
    180         return call(doubleAbsIntrinsic(), value);
     180        return call(doubleType, doubleAbsIntrinsic(), value);
    181181    }
    182182
    183183    LValue doubleSin(LValue value)
    184184    {
    185         return call(doubleSinIntrinsic(), value);
     185        return call(doubleType, doubleSinIntrinsic(), value);
    186186    }
    187187    LValue doubleCos(LValue value)
    188188    {
    189         return call(doubleCosIntrinsic(), value);
     189        return call(doubleType, doubleCosIntrinsic(), value);
    190190    }
    191191
    192192    LValue doublePow(LValue xOperand, LValue yOperand)
    193193    {
    194         return call(doublePowIntrinsic(), xOperand, yOperand);
     194        return call(doubleType, doublePowIntrinsic(), xOperand, yOperand);
    195195    }
    196196
    197197    LValue doublePowi(LValue xOperand, LValue yOperand)
    198198    {
    199         return call(doublePowiIntrinsic(), xOperand, yOperand);
     199        return call(doubleType, doublePowiIntrinsic(), xOperand, yOperand);
    200200    }
    201201
    202202    LValue doubleSqrt(LValue value)
    203203    {
    204         return call(doubleSqrtIntrinsic(), value);
     204        return call(doubleType, doubleSqrtIntrinsic(), value);
    205205    }
    206206
    207207    LValue doubleLog(LValue value)
    208208    {
    209         return call(doubleLogIntrinsic(), value);
     209        return call(doubleType, doubleLogIntrinsic(), value);
    210210    }
    211211
     
    376376   
    377377    template<typename VectorType>
    378     LValue call(LValue function, const VectorType& vector) { return buildCall(m_builder, function, vector); }
    379     LValue call(LValue function) { return buildCall(m_builder, function); }
    380     LValue call(LValue function, LValue arg1) { return buildCall(m_builder, function, arg1); }
     378    LValue call(LType, LValue function, const VectorType& vector) { return buildCall(m_builder, function, vector); }
     379    LValue call(LType, LValue function) { return buildCall(m_builder, function); }
     380    LValue call(LType, LValue function, LValue arg1) { return buildCall(m_builder, function, arg1); }
    381381    template<typename... Args>
    382     LValue call(LValue function, LValue arg1, Args... args) { return buildCall(m_builder, function, arg1, args...); }
     382    LValue call(LType, LValue function, LValue arg1, Args... args) { return buildCall(m_builder, function, arg1, args...); }
    383383   
    384384    template<typename FunctionType>
     
    432432    void trap()
    433433    {
    434         call(trapIntrinsic());
     434        call(voidType, trapIntrinsic());
    435435    }
    436436   
  • trunk/Source/JavaScriptCore/ftl/FTLState.cpp

    r192591 r192605  
    4747    , function(0)
    4848    , generatedFunction(0)
    49     , handleStackOverflowExceptionStackmapID(UINT_MAX)
    50     , handleExceptionStackmapID(UINT_MAX)
    51     , capturedStackmapID(UINT_MAX)
    52     , varargsSpillSlotsStackmapID(UINT_MAX)
    53     , exceptionHandlingSpillSlotStackmapID(UINT_MAX)
    5449    , unwindDataSection(0)
    5550    , unwindDataSectionSize(0)
  • trunk/Source/JavaScriptCore/ftl/FTLState.h

    r192561 r192605  
    7676    GeneratedFunction generatedFunction;
    7777    JITFinalizer* finalizer;
    78     unsigned handleStackOverflowExceptionStackmapID;
    79     unsigned handleExceptionStackmapID;
    80     unsigned capturedStackmapID;
    81     unsigned varargsSpillSlotsStackmapID;
    82     unsigned exceptionHandlingSpillSlotStackmapID;
     78#if FTL_USES_B3
     79    LValue handleStackOverflowExceptionValue { nullptr };
     80    LValue handleExceptionValue { nullptr };
     81    LValue capturedValue { nullptr };
     82    LValue varargsSpillSlotsValue { nullptr };
     83    LValue exceptionHandlingSpillSlotValue { nullptr };
     84#else // FTL_USES_B3
     85    unsigned handleStackOverflowExceptionStackmapID { UINT_MAX };
     86    unsigned handleExceptionStackmapID { UINT_MAX };
     87    unsigned capturedStackmapID { UINT_MAX };
     88    unsigned varargsSpillSlotsStackmapID { UINT_MAX };
     89    unsigned exceptionHandlingSpillSlotStackmapID { UINT_MAX };
     90#endif // FTL_USE_B3
    8391    SegmentedVector<GetByIdDescriptor> getByIds;
    8492    SegmentedVector<PutByIdDescriptor> putByIds;
  • trunk/Source/JavaScriptCore/ftl/FTLWeight.h

    r183525 r192605  
    2929#if ENABLE(FTL_JIT)
    3030
     31#include "B3FrequencyClass.h"
    3132#include <wtf/MathExtras.h>
    3233#include <wtf/StdLibExtras.h>
     
    5051   
    5152    float value() const { return m_value; }
     53
     54#if FTL_USES_B3
     55    B3::FrequencyClass frequencyClass() const { return value() ? B3::FrequencyClass::Normal : B3::FrequencyClass::Rare; }
     56#endif
    5257   
    5358    unsigned scaleToTotal(double total) const
Note: See TracChangeset for help on using the changeset viewer.