tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

VMFunctionList-inl.h (29763B)


      1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*-
      2 * vim: set ts=8 sts=2 et sw=2 tw=80:
      3 * This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 #ifndef jit_VMFunctionList_inl_h
      8 #define jit_VMFunctionList_inl_h
      9 
     10 #include "mozilla/MacroArgs.h"  // MOZ_CONCAT
     11 
     12 #include "builtin/Eval.h"
     13 #include "builtin/ModuleObject.h"  // js::GetOrCreateModuleMetaObject
     14 #include "builtin/Object.h"        // js::ObjectCreateWithTemplate
     15 #include "builtin/Promise.h"       // js::AsyncFunctionAwait
     16 #include "builtin/RegExp.h"
     17 #include "builtin/String.h"
     18 #include "builtin/TestingFunctions.h"
     19 #include "jit/BaselineIC.h"
     20 #include "jit/Ion.h"
     21 #include "jit/IonIC.h"
     22 #include "jit/TrialInlining.h"
     23 #include "jit/VMFunctions.h"
     24 #include "vm/AsyncFunction.h"
     25 #include "vm/AsyncIteration.h"
     26 #include "vm/BigIntType.h"
     27 #include "vm/BoundFunctionObject.h"
     28 #include "vm/EqualityOperations.h"
     29 #include "vm/Interpreter.h"
     30 #include "vm/Iteration.h"
     31 #include "vm/TypedArrayObject.h"
     32 
     33 #include "jit/BaselineFrame-inl.h"
     34 #include "vm/Interpreter-inl.h"
     35 
     36 namespace js {
     37 namespace jit {
     38 
     39 #ifdef FUZZING_JS_FUZZILLI
     40 #  define VMFUNCTION_FUZZILLI_LIST(_)             \
     41    _(FuzzilliHashObject, js::FuzzilliHashObject) \
     42    _(FuzzilliHashObjectInl, js::FuzzilliHashObjectInl)
     43 #else
     44 #  define VMFUNCTION_FUZZILLI_LIST(_)
     45 #endif
     46 
     47 // List of all VM functions to be used with callVM. Each entry stores the name
     48 // (must be unique, used for the VMFunctionId enum and profiling) and the C++
     49 // function to be called.  If a third argument is specified, it is the number of
     50 // non-argument Values the VM wrapper should pop from the stack. This is used
     51 // for tail calls for Baseline ICs. This list must be sorted on the name field.
     52 #define VMFUNCTION_LIST(_)                                                     \
     53  IF_EXPLICIT_RESOURCE_MANAGEMENT(_(AddDisposableResourceToCapability,         \
     54                                    js::AddDisposableResourceToCapability))    \
     55  _(AddOrUpdateSparseElementHelper, js::AddOrUpdateSparseElementHelper)        \
     56  _(AddSlotAndCallAddPropHook, js::AddSlotAndCallAddPropHook)                  \
     57  _(ArgumentsObjectCreateForInlinedIon,                                        \
     58    js::ArgumentsObject::createForInlinedIon)                                  \
     59  _(ArgumentsObjectCreateForIon, js::ArgumentsObject::createForIon)            \
     60  _(ArgumentsSliceDense, js::ArgumentsSliceDense)                              \
     61  _(ArrayConstructorOneArg, js::ArrayConstructorOneArg)                        \
     62  _(ArrayFromArgumentsObject, js::ArrayFromArgumentsObject)                    \
     63  _(ArrayJoin, js::jit::ArrayJoin)                                             \
     64  _(ArraySliceDense, js::ArraySliceDense)                                      \
     65  _(AsyncFunctionAwait, js::AsyncFunctionAwait)                                \
     66  _(AsyncFunctionReject, js::AsyncFunctionReject)                              \
     67  _(AsyncFunctionResolve, js::AsyncFunctionResolve)                            \
     68  _(AtomicsAdd64, js::jit::AtomicsAdd64)                                       \
     69  _(AtomicsAnd64, js::jit::AtomicsAnd64)                                       \
     70  _(AtomicsCompareExchange64, js::jit::AtomicsCompareExchange64)               \
     71  _(AtomicsExchange64, js::jit::AtomicsExchange64)                             \
     72  _(AtomicsLoad64, js::jit::AtomicsLoad64)                                     \
     73  _(AtomicsOr64, js::jit::AtomicsOr64)                                         \
     74  _(AtomicsSub64, js::jit::AtomicsSub64)                                       \
     75  _(AtomicsXor64, js::jit::AtomicsXor64)                                       \
     76  _(AtomizeString, js::AtomizeString)                                          \
     77  _(BaselineCompileFromBaselineInterpreter,                                    \
     78    js::jit::BaselineCompileFromBaselineInterpreter)                           \
     79  _(BaselineDebugPrologue, js::jit::DebugPrologue)                             \
     80  _(BaselineGetFunctionThis, js::jit::BaselineGetFunctionThis)                 \
     81  _(BaselineScriptOSREntryForFrame, js::jit::BaselineScript::OSREntryForFrame) \
     82  _(BigIntAdd, JS::BigInt::add)                                                \
     83  _(BigIntAsIntN, js::jit::BigIntAsIntN)                                       \
     84  _(BigIntAsUintN, js::jit::BigIntAsUintN)                                     \
     85  _(BigIntBitAnd, JS::BigInt::bitAnd)                                          \
     86  _(BigIntBitNot, JS::BigInt::bitNot)                                          \
     87  _(BigIntBitOr, JS::BigInt::bitOr)                                            \
     88  _(BigIntBitXor, JS::BigInt::bitXor)                                          \
     89  _(BigIntCreateFromIntPtr, JS::BigInt::createFromIntPtr)                      \
     90  _(BigIntDec, JS::BigInt::dec)                                                \
     91  _(BigIntDiv, JS::BigInt::div)                                                \
     92  _(BigIntInc, JS::BigInt::inc)                                                \
     93  _(BigIntLeftShift, JS::BigInt::lsh)                                          \
     94  _(BigIntMod, JS::BigInt::mod)                                                \
     95  _(BigIntMul, JS::BigInt::mul)                                                \
     96  _(BigIntNeg, JS::BigInt::neg)                                                \
     97  _(BigIntPow, JS::BigInt::pow)                                                \
     98  _(BigIntRightShift, JS::BigInt::rsh)                                         \
     99  _(BigIntStringEqual,                                                         \
    100    js::jit::BigIntStringEqual<js::jit::EqualityKind::Equal>)                  \
    101  _(BigIntStringGreaterThanOrEqual,                                            \
    102    js::jit::BigIntStringCompare<js::jit::ComparisonKind::GreaterThanOrEqual>) \
    103  _(BigIntStringLessThan,                                                      \
    104    js::jit::BigIntStringCompare<js::jit::ComparisonKind::LessThan>)           \
    105  _(BigIntStringNotEqual,                                                      \
    106    js::jit::BigIntStringEqual<js::jit::EqualityKind::NotEqual>)               \
    107  _(BigIntSub, JS::BigInt::sub)                                                \
    108  _(BindVarOperation, js::BindVarOperation)                                    \
    109  _(BlockLexicalEnvironmentObjectCreateWithoutEnclosing,                       \
    110    js::BlockLexicalEnvironmentObject::createWithoutEnclosing)                 \
    111  _(BoxBoxableValue, js::wasm::AnyRef::boxValue)                               \
    112  _(BoxNonStrictThis, js::BoxNonStrictThis)                                    \
    113  _(BuiltinObjectOperation, js::BuiltinObjectOperation)                        \
    114  _(CallDOMGetter, js::jit::CallDOMGetter)                                     \
    115  _(CallDOMSetter, js::jit::CallDOMSetter)                                     \
    116  _(CallNativeGetter, js::jit::CallNativeGetter)                               \
    117  _(CallNativeSetter, js::jit::CallNativeSetter)                               \
    118  _(CallObjectCreateWithShape, js::CallObject::createWithShape)                \
    119  _(CanSkipAwait, js::CanSkipAwait)                                            \
    120  _(CharCodeAt, js::jit::CharCodeAt)                                           \
    121  _(CharCodeToLowerCase, js::jit::CharCodeToLowerCase)                         \
    122  _(CharCodeToUpperCase, js::jit::CharCodeToUpperCase)                         \
    123  _(CheckClassHeritageOperation, js::CheckClassHeritageOperation)              \
    124  _(CheckOverRecursed, js::jit::CheckOverRecursed)                             \
    125  _(CheckOverRecursedBaseline, js::jit::CheckOverRecursedBaseline)             \
    126  _(CheckPrivateFieldOperation, js::CheckPrivateFieldOperation)                \
    127  _(CheckProxyGetByValueResult, js::jit::CheckProxyGetByValueResult)           \
    128  _(ClassBodyLexicalEnvironmentObjectCreateWithoutEnclosing,                   \
    129    js::ClassBodyLexicalEnvironmentObject::createWithoutEnclosing)             \
    130  _(CloneRegExpObject, js::CloneRegExpObject)                                  \
    131  _(CloseIterOperation, js::CloseIterOperation)                                \
    132  _(CodePointAt, js::jit::CodePointAt)                                         \
    133  _(ConcatStrings, js::ConcatStrings<js::CanGC>)                               \
    134  _(CreateAsyncFromSyncIterator, js::CreateAsyncFromSyncIterator)              \
    135  _(CreateBigIntFromInt32, js::jit::CreateBigIntFromInt32)                     \
    136  _(CreateBigIntFromInt64, js::jit::CreateBigIntFromInt64)                     \
    137  _(CreateBigIntFromUint64, js::jit::CreateBigIntFromUint64)                   \
    138  _(CreateGenerator, js::jit::CreateGenerator)                                 \
    139  _(CreateGeneratorFromFrame, js::jit::CreateGeneratorFromFrame)               \
    140  IF_EXPLICIT_RESOURCE_MANAGEMENT(                                             \
    141      _(CreateSuppressedError, js::CreateSuppressedError))                     \
    142  _(CreateThisFromIC, js::jit::CreateThisFromIC)                               \
    143  _(CreateThisFromIon, js::jit::CreateThisFromIon)                             \
    144  _(DebugAfterYield, js::jit::DebugAfterYield)                                 \
    145  _(DebugEpilogueOnBaselineReturn, js::jit::DebugEpilogueOnBaselineReturn)     \
    146  _(DebugLeaveLexicalEnv, js::jit::DebugLeaveLexicalEnv)                       \
    147  _(DebugLeaveThenPopLexicalEnv, js::jit::DebugLeaveThenPopLexicalEnv)         \
    148  _(Debug_CheckSelfHosted, js::Debug_CheckSelfHosted)                          \
    149  _(DebuggeeFreshenLexicalEnv, js::jit::DebuggeeFreshenLexicalEnv)             \
    150  _(DebuggeeRecreateLexicalEnv, js::jit::DebuggeeRecreateLexicalEnv)           \
    151  _(DelElemOperationNonStrict, js::DelElemOperation<false>)                    \
    152  _(DelElemOperationStrict, js::DelElemOperation<true>)                        \
    153  _(DelPropOperationNonStrict, js::DelPropOperation<false>)                    \
    154  _(DelPropOperationStrict, js::DelPropOperation<true>)                        \
    155  _(DeleteNameOperation, js::DeleteNameOperation)                              \
    156  _(DispatchOffThreadBaselineBatch, js::jit::DispatchOffThreadBaselineBatch)   \
    157  _(DoBinaryArithFallback, js::jit::DoBinaryArithFallback, 2)                  \
    158  _(DoBindNameFallback, js::jit::DoBindNameFallback)                           \
    159  _(DoCallFallback, js::jit::DoCallFallback)                                   \
    160  _(DoCheckPrivateFieldFallback, js::jit::DoCheckPrivateFieldFallback, 2)      \
    161  _(DoCloseIterFallback, js::jit::DoCloseIterFallback)                         \
    162  _(DoCompareFallback, js::jit::DoCompareFallback, 2)                          \
    163  _(DoConcatStringObject, js::jit::DoConcatStringObject)                       \
    164  _(DoGetElemFallback, js::jit::DoGetElemFallback, 2)                          \
    165  _(DoGetElemSuperFallback, js::jit::DoGetElemSuperFallback, 3)                \
    166  _(DoGetImportFallback, js::jit::DoGetImportFallback)                         \
    167  _(DoGetIteratorFallback, js::jit::DoGetIteratorFallback, 1)                  \
    168  _(DoGetNameFallback, js::jit::DoGetNameFallback)                             \
    169  _(DoGetPropFallback, js::jit::DoGetPropFallback, 1)                          \
    170  _(DoGetPropSuperFallback, js::jit::DoGetPropSuperFallback)                   \
    171  _(DoHasOwnFallback, js::jit::DoHasOwnFallback, 2)                            \
    172  _(DoInFallback, js::jit::DoInFallback, 2)                                    \
    173  _(DoInstanceOfFallback, js::jit::DoInstanceOfFallback, 2)                    \
    174  _(DoLambdaFallback, js::jit::DoLambdaFallback)                               \
    175  _(DoLazyConstantFallback, js::jit::DoLazyConstantFallback)                   \
    176  _(DoNewArrayFallback, js::jit::DoNewArrayFallback)                           \
    177  _(DoNewObjectFallback, js::jit::DoNewObjectFallback)                         \
    178  _(DoOptimizeGetIteratorFallback, js::jit::DoOptimizeGetIteratorFallback)     \
    179  _(DoOptimizeSpreadCallFallback, js::jit::DoOptimizeSpreadCallFallback)       \
    180  _(DoRestFallback, js::jit::DoRestFallback)                                   \
    181  _(DoSetElemFallback, js::jit::DoSetElemFallback, 2)                          \
    182  _(DoSetPropFallback, js::jit::DoSetPropFallback, 1)                          \
    183  _(DoSpreadCallFallback, js::jit::DoSpreadCallFallback)                       \
    184  _(DoStringToInt64, js::jit::DoStringToInt64)                                 \
    185  _(DoToBoolFallback, js::jit::DoToBoolFallback)                               \
    186  _(DoToPropertyKeyFallback, js::jit::DoToPropertyKeyFallback)                 \
    187  _(DoTrialInlining, js::jit::DoTrialInlining)                                 \
    188  _(DoTypeOfEqFallback, js::jit::DoTypeOfEqFallback)                           \
    189  _(DoTypeOfFallback, js::jit::DoTypeOfFallback)                               \
    190  _(DoUnaryArithFallback, js::jit::DoUnaryArithFallback, 1)                    \
    191  _(EnterWith, js::jit::EnterWith)                                             \
    192  _(ExtractAwaitValue, js::ExtractAwaitValue)                                  \
    193  _(FinalSuspend, js::jit::FinalSuspend)                                       \
    194  _(FreshenLexicalEnv, js::jit::FreshenLexicalEnv)                             \
    195  _(FunWithProtoOperation, js::FunWithProtoOperation)                          \
    196  _(FunctionBindCreate, js::BoundFunctionObject::createWithTemplate)           \
    197  _(FunctionBindImpl, js::BoundFunctionObject::functionBindImpl)               \
    198  _(FunctionBindSpecializedBaseline,                                           \
    199    js::BoundFunctionObject::functionBindSpecializedBaseline)                  \
    200  VMFUNCTION_FUZZILLI_LIST(_)                                                  \
    201  _(GeneratorThrowOrReturn, js::jit::GeneratorThrowOrReturn)                   \
    202  _(GetAndClearException, js::GetAndClearException)                            \
    203  _(GetElemMaybeCached, js::jit::GetElemMaybeCached)                           \
    204  _(GetFirstDollarIndexRaw, js::GetFirstDollarIndexRaw)                        \
    205  _(GetImportOperation, js::GetImportOperation)                                \
    206  _(GetIntrinsicValue, js::jit::GetIntrinsicValue)                             \
    207  _(GetIterator, js::GetIterator)                                              \
    208  _(GetIteratorForObjectKeys, js::GetIteratorForObjectKeys)                    \
    209  _(GetIteratorWithIndices, js::GetIteratorWithIndices)                        \
    210  _(GetIteratorWithIndicesForObjectKeys,                                       \
    211    js::GetIteratorWithIndicesForObjectKeys)                                   \
    212  _(GetNonSyntacticGlobalThis, js::GetNonSyntacticGlobalThis)                  \
    213  _(GetOrCreateModuleMetaObject, js::GetOrCreateModuleMetaObject)              \
    214  _(GetPendingExceptionStack, js::GetPendingExceptionStack)                    \
    215  _(GetPropMaybeCached, js::jit::GetPropMaybeCached)                           \
    216  _(GetPrototypeOf, js::jit::GetPrototypeOf)                                   \
    217  _(GetSparseElementHelper, js::GetSparseElementHelper)                        \
    218  _(GlobalDeclInstantiationFromIon, js::jit::GlobalDeclInstantiationFromIon)   \
    219  _(GlobalOrEvalDeclInstantiation, js::GlobalOrEvalDeclInstantiation)          \
    220  _(HandleDebugTrap, js::jit::HandleDebugTrap)                                 \
    221  _(ImplicitThisOperation, js::ImplicitThisOperation)                          \
    222  _(ImportMetaOperation, js::ImportMetaOperation)                              \
    223  _(InitElemGetterSetterOperation, js::InitElemGetterSetterOperation)          \
    224  _(InitFunctionEnvironmentObjects, js::jit::InitFunctionEnvironmentObjects)   \
    225  _(InitPropGetterSetterOperation, js::InitPropGetterSetterOperation)          \
    226  _(InitRestParameter, js::jit::InitRestParameter)                             \
    227  _(Int32ToString, js::Int32ToString<js::CanGC>)                               \
    228  _(Int32ToStringWithBase, js::Int32ToStringWithBase<js::CanGC>)               \
    229  _(InterpretResume, js::jit::InterpretResume)                                 \
    230  _(InterruptCheck, js::jit::InterruptCheck)                                   \
    231  _(InvokeFunction, js::jit::InvokeFunction)                                   \
    232  _(IonBinaryArithICUpdate, js::jit::IonBinaryArithIC::update)                 \
    233  _(IonBindNameICUpdate, js::jit::IonBindNameIC::update)                       \
    234  _(IonCheckPrivateFieldICUpdate, js::jit::IonCheckPrivateFieldIC::update)     \
    235  _(IonCloseIterICUpdate, js::jit::IonCloseIterIC::update)                     \
    236  _(IonCompareICUpdate, js::jit::IonCompareIC::update)                         \
    237  _(IonCompileScriptForBaselineAtEntry,                                        \
    238    js::jit::IonCompileScriptForBaselineAtEntry)                               \
    239  _(IonCompileScriptForBaselineOSR, js::jit::IonCompileScriptForBaselineOSR)   \
    240  _(IonGetIteratorICUpdate, js::jit::IonGetIteratorIC::update)                 \
    241  _(IonGetNameICUpdate, js::jit::IonGetNameIC::update)                         \
    242  _(IonGetPropSuperICUpdate, js::jit::IonGetPropSuperIC::update)               \
    243  _(IonGetPropertyICUpdate, js::jit::IonGetPropertyIC::update)                 \
    244  _(IonHasOwnICUpdate, js::jit::IonHasOwnIC::update)                           \
    245  _(IonInICUpdate, js::jit::IonInIC::update)                                   \
    246  _(IonInstanceOfICUpdate, js::jit::IonInstanceOfIC::update)                   \
    247  _(IonOptimizeGetIteratorICUpdate, js::jit::IonOptimizeGetIteratorIC::update) \
    248  _(IonOptimizeSpreadCallICUpdate, js::jit::IonOptimizeSpreadCallIC::update)   \
    249  _(IonSetPropertyICUpdate, js::jit::IonSetPropertyIC::update)                 \
    250  _(IonToPropertyKeyICUpdate, js::jit::IonToPropertyKeyIC::update)             \
    251  _(IonUnaryArithICUpdate, js::jit::IonUnaryArithIC::update)                   \
    252  _(IsArrayFromJit, js::IsArrayFromJit)                                        \
    253  _(IsPossiblyWrappedTypedArray, js::jit::IsPossiblyWrappedTypedArray)         \
    254  _(IsPrototypeOf, js::IsPrototypeOf)                                          \
    255  _(LambdaBaselineFallback, js::LambdaBaselineFallback)                        \
    256  _(LambdaOptimizedFallback, js::LambdaOptimizedFallback)                      \
    257  _(LeaveWith, js::jit::LeaveWith)                                             \
    258  _(LinearizeForCharAccess, js::jit::LinearizeForCharAccess)                   \
    259  _(LoadAliasedDebugVar, js::LoadAliasedDebugVar)                              \
    260  _(MapObjectCreate, js::MapObject::create)                                    \
    261  _(MapObjectCreateFromIterable, js::MapObject::createFromIterable)            \
    262  _(MapObjectDelete, js::jit::MapObjectDelete)                                 \
    263  _(MapObjectGet, js::jit::MapObjectGet)                                       \
    264  _(MapObjectHas, js::jit::MapObjectHas)                                       \
    265  _(MapObjectSet, js::jit::MapObjectSet)                                       \
    266  _(MapObjectSetFromIC, js::jit::MapObjectSetFromIC)                           \
    267  _(MutatePrototype, js::jit::MutatePrototype)                                 \
    268  _(NamedLambdaObjectCreateWithoutEnclosing,                                   \
    269    js::NamedLambdaObject::createWithoutEnclosing)                             \
    270  _(NativeGetElement, js::NativeGetElement)                                    \
    271  _(NewArgumentsObject, js::jit::NewArgumentsObject)                           \
    272  _(NewArrayIterator, js::NewArrayIterator)                                    \
    273  _(NewArrayObjectBaselineFallback, js::NewArrayObjectBaselineFallback)        \
    274  _(NewArrayObjectEnsureDenseInitLength,                                       \
    275    js::jit::NewArrayObjectEnsureDenseInitLength)                              \
    276  _(NewArrayObjectOptimzedFallback, js::NewArrayObjectOptimizedFallback)       \
    277  _(NewArrayOperation, js::NewArrayOperation)                                  \
    278  _(NewArrayWithShape, js::NewArrayWithShape)                                  \
    279  _(NewObjectOperation, js::NewObjectOperation)                                \
    280  _(NewPlainObjectBaselineFallback, js::NewPlainObjectBaselineFallback)        \
    281  _(NewPlainObjectOptimizedFallback, js::NewPlainObjectOptimizedFallback)      \
    282  _(NewPrivateName, js::NewPrivateName)                                        \
    283  _(NewRegExpStringIterator, js::NewRegExpStringIterator)                      \
    284  _(NewStringIterator, js::NewStringIterator)                                  \
    285  _(NewStringObject, js::jit::NewStringObject)                                 \
    286  _(NewTypedArrayWithTemplateAndArray, js::NewTypedArrayWithTemplateAndArray)  \
    287  _(NewTypedArrayWithTemplateAndBuffer,                                        \
    288    js::NewTypedArrayWithTemplateAndBuffer)                                    \
    289  _(NewTypedArrayWithTemplateAndLength,                                        \
    290    js::NewTypedArrayWithTemplateAndLength)                                    \
    291  _(NormalSuspend, js::jit::NormalSuspend)                                     \
    292  _(NumberParseInt, js::NumberParseInt)                                        \
    293  _(NumberToString, js::NumberToString<js::CanGC>)                             \
    294  _(ObjectCreateWithTemplate, js::ObjectCreateWithTemplate)                    \
    295  _(ObjectKeys, js::jit::ObjectKeys)                                           \
    296  _(ObjectKeysLength, js::jit::ObjectKeysLength)                               \
    297  _(ObjectWithProtoOperation, js::ObjectWithProtoOperation)                    \
    298  _(OnDebuggerStatement, js::jit::OnDebuggerStatement)                         \
    299  _(ProxyGetProperty, js::ProxyGetProperty)                                    \
    300  _(ProxyGetPropertyByValue, js::ProxyGetPropertyByValue)                      \
    301  _(ProxyHas, js::ProxyHas)                                                    \
    302  _(ProxyHasOwn, js::ProxyHasOwn)                                              \
    303  _(ProxySetProperty, js::ProxySetProperty)                                    \
    304  _(ProxySetPropertyByValue, js::ProxySetPropertyByValue)                      \
    305  _(PushClassBodyEnv, js::jit::PushClassBodyEnv)                               \
    306  _(PushLexicalEnv, js::jit::PushLexicalEnv)                                   \
    307  _(PushVarEnv, js::jit::PushVarEnv)                                           \
    308  _(RecreateLexicalEnv, js::jit::RecreateLexicalEnv)                           \
    309  _(RegExpBuiltinExecMatchFromJit, js::RegExpBuiltinExecMatchFromJit)          \
    310  _(RegExpBuiltinExecTestFromJit, js::RegExpBuiltinExecTestFromJit)            \
    311  _(RegExpHasCaptureGroups, js::RegExpHasCaptureGroups)                        \
    312  _(RegExpMatcherRaw, js::RegExpMatcherRaw)                                    \
    313  _(RegExpSearcherRaw, js::RegExpSearcherRaw)                                  \
    314  _(SameValue, js::SameValue)                                                  \
    315  _(SetArrayLength, js::jit::SetArrayLength)                                   \
    316  _(SetElementMegamorphicNoCache, js::jit::SetElementMegamorphic<false>)       \
    317  _(SetElementMegamorphicYesCache, js::jit::SetElementMegamorphic<true>)       \
    318  _(SetElementSuper, js::SetElementSuper)                                      \
    319  _(SetFunctionName, js::SetFunctionName)                                      \
    320  _(SetIntrinsicOperation, js::SetIntrinsicOperation)                          \
    321  _(SetObjectAdd, js::jit::SetObjectAdd)                                       \
    322  _(SetObjectAddFromIC, js::jit::SetObjectAddFromIC)                           \
    323  _(SetObjectCreate, js::SetObject::create)                                    \
    324  _(SetObjectCreateFromIterable, js::SetObject::createFromIterable)            \
    325  _(SetObjectDelete, js::jit::SetObjectDelete)                                 \
    326  _(SetObjectHas, js::jit::SetObjectHas)                                       \
    327  _(SetPropertyMegamorphicNoCache, js::jit::SetPropertyMegamorphic<false>)     \
    328  _(SetPropertyMegamorphicYesCache, js::jit::SetPropertyMegamorphic<true>)     \
    329  _(SetPropertySuper, js::SetPropertySuper)                                    \
    330  _(StartDynamicModuleImport, js::StartDynamicModuleImport)                    \
    331  _(StringBigIntGreaterThanOrEqual,                                            \
    332    js::jit::StringBigIntCompare<js::jit::ComparisonKind::GreaterThanOrEqual>) \
    333  _(StringBigIntLessThan,                                                      \
    334    js::jit::StringBigIntCompare<js::jit::ComparisonKind::LessThan>)           \
    335  _(StringEndsWith, js::StringEndsWith)                                        \
    336  _(StringFlatReplaceString, js::StringFlatReplaceString)                      \
    337  _(StringFromCharCode, js::StringFromCharCode)                                \
    338  _(StringFromCodePoint, js::StringFromCodePoint)                              \
    339  _(StringIncludes, js::StringIncludes)                                        \
    340  _(StringIndexOf, js::StringIndexOf)                                          \
    341  _(StringLastIndexOf, js::StringLastIndexOf)                                  \
    342  _(StringReplace, js::jit::StringReplace)                                     \
    343  _(StringSplitString, js::StringSplitString)                                  \
    344  _(StringStartsWith, js::StringStartsWith)                                    \
    345  _(StringToLowerCase, js::StringToLowerCase)                                  \
    346  _(StringToNumber, js::StringToNumber)                                        \
    347  _(StringToUpperCase, js::StringToUpperCase)                                  \
    348  _(StringTrim, js::StringTrim)                                                \
    349  _(StringTrimEnd, js::StringTrimEnd)                                          \
    350  _(StringTrimStart, js::StringTrimStart)                                      \
    351  _(StringsCompareGreaterThanOrEquals,                                         \
    352    js::jit::StringsCompare<js::jit::ComparisonKind::GreaterThanOrEqual>)      \
    353  _(StringsCompareLessThan,                                                    \
    354    js::jit::StringsCompare<js::jit::ComparisonKind::LessThan>)                \
    355  _(StringsEqual, js::jit::StringsEqual<js::jit::EqualityKind::Equal>)         \
    356  _(StringsNotEqual, js::jit::StringsEqual<js::jit::EqualityKind::NotEqual>)   \
    357  _(SubstringKernel, js::SubstringKernel)                                      \
    358  _(ThrowBadDerivedReturnOrUninitializedThis,                                  \
    359    js::jit::ThrowBadDerivedReturnOrUninitializedThis)                         \
    360  _(ThrowCheckIsObject, js::ThrowCheckIsObject)                                \
    361  _(ThrowInitializedThis, js::ThrowInitializedThis)                            \
    362  _(ThrowMsgOperation, js::ThrowMsgOperation)                                  \
    363  _(ThrowObjectCoercible, js::ThrowObjectCoercible)                            \
    364  _(ThrowOperation, js::ThrowOperation)                                        \
    365  _(ThrowRuntimeLexicalError, js::jit::ThrowRuntimeLexicalError)               \
    366  _(ThrowUninitializedThis, js::ThrowUninitializedThis)                        \
    367  _(ThrowWithStackOperation, js::ThrowWithStackOperation)                      \
    368  _(ToBigInt, js::ToBigInt)                                                    \
    369  _(ToStringSlow, js::ToStringSlow<js::CanGC>)                                 \
    370  _(TypedArraySet, js::TypedArraySet)                                          \
    371  _(TypedArraySetFromSubarray, js::TypedArraySetFromSubarray)                  \
    372  _(TypedArraySubarray, js::TypedArraySubarray)                                \
    373  _(TypedArraySubarrayWithLength, js::TypedArraySubarrayWithLength)            \
    374  _(ValueToIterator, js::ValueToIterator)                                      \
    375  _(VarEnvironmentObjectCreateWithoutEnclosing,                                \
    376    js::VarEnvironmentObject::createWithoutEnclosing)
    377 
    378 #define DEF_ID(name, ...) name,
    379 enum class VMFunctionId { VMFUNCTION_LIST(DEF_ID) Count };
    380 #undef DEF_ID
    381 
    382 // Define the VMFunctionToId template to map from signature + function to
    383 // the VMFunctionId. This lets us verify the consumer/codegen code matches
    384 // the C++ signature.
    385 template <typename Function, Function fun>
    386 struct VMFunctionToId;  // Error here? Update VMFUNCTION_LIST?
    387 
    388 // GCC warns when the signature does not have matching attributes (for example
    389 // [[nodiscard]]). Squelch this warning to avoid a GCC-only footgun.
    390 #if MOZ_IS_GCC
    391 #  pragma GCC diagnostic push
    392 #  pragma GCC diagnostic ignored "-Wignored-attributes"
    393 #endif
    394 
    395 // Note: the use of ::fp instead of fp is intentional to enforce use of
    396 // fully-qualified names in the list above.
    397 #define DEF_TEMPLATE(name, fp, ...)                        \
    398  template <>                                              \
    399  struct VMFunctionToId<decltype(&fp), fp> {               \
    400    static constexpr VMFunctionId id = VMFunctionId::name; \
    401  };
    402 VMFUNCTION_LIST(DEF_TEMPLATE)
    403 #undef DEF_TEMPLATE
    404 
    405 #if MOZ_IS_GCC
    406 #  pragma GCC diagnostic pop
    407 #endif
    408 
    409 }  // namespace jit
    410 }  // namespace js
    411 
    412 // Make sure that all names are fully qualified (or at least, are resolvable
    413 // within the toplevel namespace).
    414 namespace check_fully_qualified {
    415 #define CHECK_NS_VISIBILITY(name, fp, ...)                    \
    416  [[maybe_unused]] static constexpr decltype(&fp) MOZ_CONCAT( \
    417      fp_, __COUNTER__) = nullptr;
    418 VMFUNCTION_LIST(CHECK_NS_VISIBILITY)
    419 #undef CHECK_NS_VISIBILITY
    420 }  // namespace check_fully_qualified
    421 
    422 #endif  // jit_VMFunctionList_inl_h