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