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