• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef ECMASCRIPT_RUNTIME_STUB_LIST_H
17 #define ECMASCRIPT_RUNTIME_STUB_LIST_H
18 
19 #include "ecmascript/stubs/test_runtime_stubs.h"
20 
21 namespace panda::ecmascript {
22 
23 #define RUNTIME_ASM_STUB_LIST(V)             \
24     JS_CALL_TRAMPOLINE_LIST(V)               \
25     FAST_CALL_TRAMPOLINE_LIST(V)             \
26     ASM_INTERPRETER_TRAMPOLINE_LIST(V)       \
27     BASELINE_TRAMPOLINE_LIST(V)
28 
29 #define ASM_INTERPRETER_TRAMPOLINE_LIST(V)   \
30     V(AsmInterpreterEntry)                   \
31     V(GeneratorReEnterAsmInterp)             \
32     V(PushCallArgsAndDispatchNative)         \
33     V(PushCallArg0AndDispatch)               \
34     V(PushCallArg1AndDispatch)               \
35     V(PushCallArgs2AndDispatch)              \
36     V(PushCallArgs3AndDispatch)              \
37     V(PushCallThisArg0AndDispatch)           \
38     V(PushCallThisArg1AndDispatch)           \
39     V(PushCallThisArgs2AndDispatch)          \
40     V(PushCallThisArgs3AndDispatch)          \
41     V(PushCallRangeAndDispatch)              \
42     V(PushCallNewAndDispatch)                \
43     V(PushSuperCallAndDispatch)              \
44     V(PushCallNewAndDispatchNative)          \
45     V(PushNewTargetAndDispatchNative)        \
46     V(PushCallRangeAndDispatchNative)        \
47     V(PushCallThisRangeAndDispatch)          \
48     V(ResumeRspAndDispatch)                  \
49     V(ResumeRspAndReturn)                    \
50     V(ResumeRspAndReturnBaseline)            \
51     V(ResumeCaughtFrameAndDispatch)          \
52     V(ResumeUncaughtFrameAndReturn)          \
53     V(ResumeRspAndRollback)                  \
54     V(CallSetter)                            \
55     V(CallGetter)                            \
56     V(CallContainersArgs2)                   \
57     V(CallContainersArgs3)                   \
58     V(CallReturnWithArgv)                    \
59     V(ASMFastWriteBarrier)                   \
60     V(ASMWriteBarrierWithEden)
61 
62 #define BASELINE_TRAMPOLINE_LIST(V)                   \
63     V(CallArg0AndCheckToBaseline)                     \
64     V(CallArg1AndCheckToBaseline)                     \
65     V(CallArgs2AndCheckToBaseline)                    \
66     V(CallArgs3AndCheckToBaseline)                    \
67     V(CallThisArg0AndCheckToBaseline)                 \
68     V(CallThisArg1AndCheckToBaseline)                 \
69     V(CallThisArgs2AndCheckToBaseline)                \
70     V(CallThisArgs3AndCheckToBaseline)                \
71     V(CallRangeAndCheckToBaseline)                    \
72     V(CallNewAndCheckToBaseline)                      \
73     V(SuperCallAndCheckToBaseline)                    \
74     V(CallThisRangeAndCheckToBaseline)                \
75     V(CallArg0AndDispatchFromBaseline)                \
76     V(CallArg1AndDispatchFromBaseline)                \
77     V(CallArgs2AndDispatchFromBaseline)               \
78     V(CallArgs3AndDispatchFromBaseline)               \
79     V(CallThisArg0AndDispatchFromBaseline)            \
80     V(CallThisArg1AndDispatchFromBaseline)            \
81     V(CallThisArgs2AndDispatchFromBaseline)           \
82     V(CallThisArgs3AndDispatchFromBaseline)           \
83     V(CallRangeAndDispatchFromBaseline)               \
84     V(CallNewAndDispatchFromBaseline)                 \
85     V(SuperCallAndDispatchFromBaseline)               \
86     V(CallThisRangeAndDispatchFromBaseline)           \
87     V(CallArg0AndCheckToBaselineFromBaseline)         \
88     V(CallArg1AndCheckToBaselineFromBaseline)         \
89     V(CallArgs2AndCheckToBaselineFromBaseline)        \
90     V(CallArgs3AndCheckToBaselineFromBaseline)        \
91     V(CallThisArg0AndCheckToBaselineFromBaseline)     \
92     V(CallThisArg1AndCheckToBaselineFromBaseline)     \
93     V(CallThisArgs2AndCheckToBaselineFromBaseline)    \
94     V(CallThisArgs3AndCheckToBaselineFromBaseline)    \
95     V(CallRangeAndCheckToBaselineFromBaseline)        \
96     V(CallNewAndCheckToBaselineFromBaseline)          \
97     V(SuperCallAndCheckToBaselineFromBaseline)        \
98     V(CallThisRangeAndCheckToBaselineFromBaseline)    \
99     V(GetBaselineBuiltinFp)
100 
101 #define JS_CALL_TRAMPOLINE_LIST(V)           \
102     V(CallRuntime)                           \
103     V(CallRuntimeWithArgv)                   \
104     V(JSFunctionEntry)                       \
105     V(JSCall)                                \
106     V(JSCallWithArgV)                        \
107     V(JSCallWithArgVAndPushArgv)             \
108     V(JSProxyCallInternalWithArgV)           \
109     V(SuperCallWithArgV)                     \
110     V(OptimizedCallAndPushArgv)              \
111     V(DeoptHandlerAsm)                       \
112     V(JSCallNew)                             \
113     V(CallOptimized)                         \
114     V(AOTCallToAsmInterBridge)               \
115     V(FastCallToAsmInterBridge)
116 
117 #define FAST_CALL_TRAMPOLINE_LIST(V)         \
118     V(OptimizedFastCallEntry)                \
119     V(OptimizedFastCallAndPushArgv)          \
120     V(JSFastCallWithArgV)                    \
121     V(JSFastCallWithArgVAndPushArgv)
122 
123 
124 #define RUNTIME_STUB_WITHOUT_GC_LIST(V)        \
125     V(Dump)                                    \
126     V(DebugDump)                               \
127     V(DumpWithHint)                            \
128     V(DebugDumpWithHint)                       \
129     V(DebugPrint)                              \
130     V(DebugPrintCustom)                        \
131     V(DebugPrintInstruction)                   \
132     V(DebugOsrEntry)                           \
133     V(Comment)                                 \
134     V(FatalPrint)                              \
135     V(FatalPrintCustom)                        \
136     V(GetActualArgvNoGC)                       \
137     V(InsertOldToNewRSet)                      \
138     V(InsertLocalToShareRSet)                  \
139     V(InsertNewToEdenRSet)                     \
140     V(SetBitAtomic)                            \
141     V(MarkingBarrier)                          \
142     V(MarkingBarrierWithEden)                  \
143     V(SharedGCMarkingBarrier)                  \
144     V(StoreBarrier)                            \
145     V(DoubleToInt)                             \
146     V(DoubleToLength)                          \
147     V(FloatMod)                                \
148     V(FloatAcos)                               \
149     V(FloatAcosh)                              \
150     V(FloatAsin)                               \
151     V(FloatAsinh)                              \
152     V(FloatAtan)                               \
153     V(FloatAtan2)                              \
154     V(FloatAtanh)                              \
155     V(FloatCos)                                \
156     V(FloatCosh)                               \
157     V(FloatSin)                                \
158     V(FloatSinh)                               \
159     V(FloatTan)                                \
160     V(FloatTanh)                               \
161     V(FloatTrunc)                              \
162     V(FloatLog)                                \
163     V(FloatLog2)                               \
164     V(FloatLog10)                              \
165     V(FloatLog1p)                              \
166     V(FloatExp)                                \
167     V(FloatExpm1)                              \
168     V(FloatCbrt)                               \
169     V(FloatFloor)                              \
170     V(FloatPow)                                \
171     V(FloatCeil)                               \
172     V(CallDateNow)                             \
173     V(NumberIsFinite)                          \
174     V(FindElementWithCache)                    \
175     V(UpdateFieldType)                         \
176     V(CreateArrayFromList)                     \
177     V(StringsAreEquals)                        \
178     V(BigIntEquals)                            \
179     V(TimeClip)                                \
180     V(SetDateValues)                           \
181     V(StartCallTimer)                          \
182     V(EndCallTimer)                            \
183     V(BigIntSameValueZero)                     \
184     V(JSHClassFindProtoTransitions)            \
185     V(NumberHelperStringToDouble)              \
186     V(GetStringToListCacheArray)               \
187     V(FastArraySort)                           \
188     V(StringToNumber)                          \
189     V(StringGetStart)                          \
190     V(StringGetEnd)                            \
191     V(ArrayTrim)                               \
192     V(CopyTypedArrayBuffer)
193 
194 #define RUNTIME_STUB_WITH_GC_LIST(V)      \
195     V(AddElementInternal)                       \
196     V(AllocateInYoung)                          \
197     V(AllocateInSOld)                           \
198     V(AllocateInSNonMovable)                    \
199     V(TypedArraySpeciesCreate)                  \
200     V(CallInternalGetter)                       \
201     V(CallInternalSetter)                       \
202     V(CallGetPrototype)                         \
203     V(RegularJSObjDeletePrototype)              \
204     V(CallJSObjDeletePrototype)                 \
205     V(ToPropertyKey)                            \
206     V(ToPropertyKeyValue)                       \
207     V(ToPropertyKeyWritable)                    \
208     V(ToPropertyKeyEnumerable)                  \
209     V(ToPropertyKeyConfigurable)                \
210     V(NewJSPrimitiveRef)                        \
211     V(ThrowTypeError)                           \
212     V(GetHash32)                                \
213     V(ComputeHashcode)                          \
214     V(GetTaggedArrayPtrTest)                    \
215     V(NewInternalString)                        \
216     V(NewTaggedArray)                           \
217     V(NewCOWTaggedArray)                        \
218     V(NewMutantTaggedArray)                     \
219     V(NewCOWMutantTaggedArray)                  \
220     V(CopyArray)                                \
221     V(NumberToString)                           \
222     V(IntToString)                              \
223     V(RTSubstitution)                           \
224     V(NameDictPutIfAbsent)                      \
225     V(NameDictionaryGetAllEnumKeys)             \
226     V(NumberDictionaryGetAllEnumKeys)           \
227     V(PropertiesSetValue)                       \
228     V(TaggedArraySetValue)                      \
229     V(JSArrayReduceUnStable)                    \
230     V(JSArrayFilterUnStable)                    \
231     V(JSArrayMapUnStable)                       \
232     V(CheckAndCopyArray)                        \
233     V(NewEcmaHClass)                            \
234     V(UpdateLayOutAndAddTransition)             \
235     V(CopyAndUpdateObjLayout)                   \
236     V(UpdateHClassForElementsKind)              \
237     V(SetValueWithElementsKind)                 \
238     V(UpdateArrayHClassAndMigrateArrayWithKind) \
239     V(MigrateArrayWithKind)                     \
240     V(GetTaggedValueWithElementsKind)           \
241     V(RuntimeDump)                              \
242     V(ForceGC)                                  \
243     V(NoticeThroughChainAndRefreshUser)         \
244     V(JumpToCInterpreter)                       \
245     V(StGlobalRecord)                           \
246     V(SetFunctionNameNoPrefix)                  \
247     V(StOwnByValueWithNameSet)                  \
248     V(StOwnByName)                              \
249     V(StOwnByNameWithNameSet)                   \
250     V(SuspendGenerator)                         \
251     V(UpFrame)                                  \
252     V(Neg)                                      \
253     V(Not)                                      \
254     V(Inc)                                      \
255     V(Dec)                                      \
256     V(Shl2)                                     \
257     V(Shr2)                                     \
258     V(Ashr2)                                    \
259     V(Or2)                                      \
260     V(Xor2)                                     \
261     V(And2)                                     \
262     V(Exp)                                      \
263     V(IsIn)                                     \
264     V(InstanceOf)                               \
265     V(CreateGeneratorObj)                       \
266     V(ThrowConstAssignment)                     \
267     V(GetTemplateObject)                        \
268     V(CreateStringIterator)                     \
269     V(NewJSArrayIterator)                       \
270     V(NewJSTypedArrayIterator)                  \
271     V(MapIteratorNext)                          \
272     V(SetIteratorNext)                          \
273     V(StringIteratorNext)                       \
274     V(ArrayIteratorNext)                        \
275     V(IteratorReturn)                           \
276     V(GetNextPropName)                          \
277     V(GetNextPropNameSlowpath)                  \
278     V(ThrowIfNotObject)                         \
279     V(IterNext)                                 \
280     V(CloseIterator)                            \
281     V(SuperCallSpread)                          \
282     V(OptSuperCallSpread)                       \
283     V(GetCallSpreadArgs)                        \
284     V(DelObjProp)                               \
285     V(NewObjApply)                              \
286     V(CreateIterResultObj)                      \
287     V(AsyncFunctionAwaitUncaught)               \
288     V(AsyncFunctionResolveOrReject)             \
289     V(ThrowUndefinedIfHole)                     \
290     V(CopyDataProperties)                       \
291     V(StArraySpread)                            \
292     V(GetIteratorNext)                          \
293     V(SetObjectWithProto)                       \
294     V(LoadICByValue)                            \
295     V(StoreICByValue)                           \
296     V(StOwnByValue)                             \
297     V(LdSuperByValue)                           \
298     V(StSuperByValue)                           \
299     V(LdObjByIndex)                             \
300     V(StObjByIndex)                             \
301     V(StOwnByIndex)                             \
302     V(CreateClassWithBuffer)                    \
303     V(CreateSharedClass)                        \
304     V(LdSendableClass)                          \
305     V(SetClassConstructorLength)                \
306     V(LoadICByName)                             \
307     V(StoreICByName)                            \
308     V(UpdateHotnessCounter)                     \
309     V(CheckSafePoint)                           \
310     V(PGODump)                                  \
311     V(PGOPreDump)                               \
312     V(JitCompile)                               \
313     V(CountInterpExecFuncs)                     \
314     V(JitReuseCompiledFunc)                     \
315     V(BaselineJitCompile)                       \
316     V(UpdateHotnessCounterWithProf)             \
317     V(GetModuleNamespaceByIndex)                \
318     V(GetModuleNamespaceByIndexOnJSFunc)        \
319     V(GetModuleNamespace)                       \
320     V(StModuleVarByIndex)                       \
321     V(StModuleVarByIndexOnJSFunc)               \
322     V(StModuleVar)                              \
323     V(LdLocalModuleVarByIndex)                  \
324     V(LdLocalModuleVarByIndexWithModule)        \
325     V(LdExternalModuleVarByIndex)               \
326     V(LdExternalModuleVarByIndexWithModule)     \
327     V(LdSendableExternalModuleVarByIndex)       \
328     V(LdLazyExternalModuleVarByIndex)           \
329     V(LdLazySendableExternalModuleVarByIndex)   \
330     V(LdLocalModuleVarByIndexOnJSFunc)          \
331     V(LdExternalModuleVarByIndexOnJSFunc)       \
332     V(LdModuleVar)                              \
333     V(Throw)                                    \
334     V(GetPropIterator)                          \
335     V(GetPropIteratorSlowpath)                  \
336     V(PrimitiveStringCreate)                    \
337     V(AsyncFunctionEnter)                       \
338     V(GetIterator)                              \
339     V(GetAsyncIterator)                         \
340     V(SetGeneratorState)                        \
341     V(ThrowThrowNotExists)                      \
342     V(ThrowPatternNonCoercible)                 \
343     V(ThrowDeleteSuperProperty)                 \
344     V(Eq)                                       \
345     V(TryLdGlobalICByName)                      \
346     V(LoadMiss)                                 \
347     V(StoreMiss)                                \
348     V(TryUpdateGlobalRecord)                    \
349     V(ThrowReferenceError)                      \
350     V(StGlobalVar)                              \
351     V(LdGlobalICVar)                            \
352     V(ToNumber)                                 \
353     V(ToBoolean)                                \
354     V(NotEq)                                    \
355     V(Less)                                     \
356     V(LessEq)                                   \
357     V(Greater)                                  \
358     V(GreaterEq)                                \
359     V(Add2)                                     \
360     V(Sub2)                                     \
361     V(Mul2)                                     \
362     V(Div2)                                     \
363     V(Mod2)                                     \
364     V(CreateEmptyObject)                        \
365     V(CreateEmptyArray)                         \
366     V(GetSymbolFunction)                        \
367     V(GetUnmapedArgs)                           \
368     V(CopyRestArgs)                             \
369     V(CreateArrayWithBuffer)                    \
370     V(CreateObjectWithBuffer)                   \
371     V(NewThisObject)                            \
372     V(NewObjRange)                              \
373     V(DefineFunc)                               \
374     V(CreateRegExpWithLiteral)                  \
375     V(ThrowIfSuperNotCorrectCall)               \
376     V(CreateObjectHavingMethod)                 \
377     V(CreateObjectWithExcludedKeys)             \
378     V(DefineMethod)                             \
379     V(SetPatchModule)                           \
380     V(ThrowSetterIsUndefinedException)          \
381     V(ThrowNotCallableException)                \
382     V(ThrowCallConstructorException)            \
383     V(ThrowNonConstructorException)             \
384     V(ThrowStackOverflowException)              \
385     V(ThrowDerivedMustReturnException)          \
386     V(CallSpread)                               \
387     V(DefineGetterSetterByValue)                \
388     V(SuperCall)                                \
389     V(OptSuperCall)                             \
390     V(LdBigInt)                                 \
391     V(ToNumeric)                                \
392     V(ToNumericConvertBigInt)                   \
393     V(CallBigIntAsIntN)                         \
394     V(CallBigIntAsUintN)                        \
395     V(DynamicImport)                            \
396     V(CreateAsyncGeneratorObj)                  \
397     V(AsyncGeneratorResolve)                    \
398     V(AsyncGeneratorReject)                     \
399     V(NewLexicalEnvWithName)                    \
400     V(NewSendableEnv)                           \
401     V(OptGetUnmapedArgs)                        \
402     V(OptCopyRestArgs)                          \
403     V(NotifyBytecodePcChanged)                  \
404     V(NotifyDebuggerStatement)                  \
405     V(MethodEntry)                              \
406     V(MethodExit)                               \
407     V(OptNewLexicalEnvWithName)                 \
408     V(OptSuspendGenerator)                      \
409     V(OptAsyncGeneratorResolve)                 \
410     V(OptCreateObjectWithExcludedKeys)          \
411     V(OptNewObjRange)                           \
412     V(GetTypeArrayPropertyByIndex)              \
413     V(SetTypeArrayPropertyByIndex)              \
414     V(FastCopyElementToArray)                   \
415     V(GetPropertyByName)                        \
416     V(JSObjectGetMethod)                        \
417     V(DebugAOTPrint)                            \
418     V(ProfileOptimizedCode)                     \
419     V(ProfileTypedOp)                           \
420     V(VerifyVTableLoading)                      \
421     V(VerifyVTableStoring)                      \
422     V(GetMethodFromCache)                       \
423     V(GetArrayLiteralFromCache)                 \
424     V(GetObjectLiteralFromCache)                \
425     V(GetStringFromCache)                       \
426     V(OptLdSuperByValue)                        \
427     V(OptStSuperByValue)                        \
428     V(BigIntEqual)                              \
429     V(StringEqual)                              \
430     V(StringIndexOf)                            \
431     V(LdPatchVar)                               \
432     V(StPatchVar)                               \
433     V(DeoptHandler)                             \
434     V(ContainerRBTreeForEach)                   \
435     V(InsertStringToTable)                      \
436     V(SlowFlattenString)                        \
437     V(NotifyConcurrentResult)                   \
438     V(DefineField)                              \
439     V(CreatePrivateProperty)                    \
440     V(DefinePrivateProperty)                    \
441     V(LdPrivateProperty)                        \
442     V(StPrivateProperty)                        \
443     V(TestIn)                                   \
444     V(UpdateAOTHClass)                          \
445     V(AotInlineTrace)                           \
446     V(AotInlineBuiltinTrace)                    \
447     V(LocaleCompare)                            \
448     V(ArraySort)                                \
449     V(FastStringify)                            \
450     V(ObjectSlowAssign)                         \
451     V(GetLinkedHash)                            \
452     V(LinkedHashMapComputeCapacity)             \
453     V(LinkedHashSetComputeCapacity)             \
454     V(JSObjectGrowElementsCapacity)             \
455     V(HClassCloneWithAddProto)                  \
456     V(LocaleCompareWithGc)                      \
457     V(ParseInt)                                 \
458     V(LocaleCompareCacheable)                   \
459     V(ArrayForEachContinue)                     \
460     V(NumberDictionaryPut)                      \
461     V(ThrowRangeError)                          \
462     V(InitializeGeneratorFunction)              \
463     V(FunctionDefineOwnProperty)                \
464     V(DefineOwnProperty)                        \
465     V(AOTEnableProtoChangeMarker)               \
466     V(HasProperty)                              \
467     V(DumpObject)                               \
468     V(TryGetInternString)                       \
469     V(TryToElementsIndexOrFindInStringTable)    \
470     V(BigIntConstructor)                        \
471     V(ObjectPrototypeHasOwnProperty)            \
472     V(ReflectHas)                               \
473     V(ReflectConstruct)                         \
474     V(ReflectApply)                             \
475     V(FunctionPrototypeApply)                   \
476     V(FunctionPrototypeBind)                    \
477     V(FunctionPrototypeCall)                    \
478     V(SetPrototypeTransition)                   \
479     V(GetSharedModule)
480 
481 #define RUNTIME_STUB_LIST(V)                     \
482     RUNTIME_ASM_STUB_LIST(V)                     \
483     RUNTIME_STUB_WITHOUT_GC_LIST(V)              \
484     RUNTIME_STUB_WITH_GC_LIST(V)                 \
485     TEST_RUNTIME_STUB_GC_LIST(V)
486 
487 }  // namespace panda::ecmascript
488 #endif // ECMASCRIPT_RUNTIME_STUB_LIST_H
489