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(CallGetterToBaseline) \ 60 V(CallSetterToBaseline) \ 61 V(CallContainersArgs2ToBaseline) \ 62 V(CallContainersArgs3ToBaseline) \ 63 V(CallReturnWithArgvToBaseline) \ 64 V(ASMFastWriteBarrier) 65 66 #define BASELINE_TRAMPOLINE_LIST(V) \ 67 V(CallArg0AndCheckToBaseline) \ 68 V(CallArg1AndCheckToBaseline) \ 69 V(CallArgs2AndCheckToBaseline) \ 70 V(CallArgs3AndCheckToBaseline) \ 71 V(CallThisArg0AndCheckToBaseline) \ 72 V(CallThisArg1AndCheckToBaseline) \ 73 V(CallThisArgs2AndCheckToBaseline) \ 74 V(CallThisArgs3AndCheckToBaseline) \ 75 V(CallRangeAndCheckToBaseline) \ 76 V(CallNewAndCheckToBaseline) \ 77 V(SuperCallAndCheckToBaseline) \ 78 V(CallThisRangeAndCheckToBaseline) \ 79 V(CallArg0AndDispatchFromBaseline) \ 80 V(CallArg1AndDispatchFromBaseline) \ 81 V(CallArgs2AndDispatchFromBaseline) \ 82 V(CallArgs3AndDispatchFromBaseline) \ 83 V(CallThisArg0AndDispatchFromBaseline) \ 84 V(CallThisArg1AndDispatchFromBaseline) \ 85 V(CallThisArgs2AndDispatchFromBaseline) \ 86 V(CallThisArgs3AndDispatchFromBaseline) \ 87 V(CallRangeAndDispatchFromBaseline) \ 88 V(CallNewAndDispatchFromBaseline) \ 89 V(SuperCallAndDispatchFromBaseline) \ 90 V(CallThisRangeAndDispatchFromBaseline) \ 91 V(CallArg0AndCheckToBaselineFromBaseline) \ 92 V(CallArg1AndCheckToBaselineFromBaseline) \ 93 V(CallArgs2AndCheckToBaselineFromBaseline) \ 94 V(CallArgs3AndCheckToBaselineFromBaseline) \ 95 V(CallThisArg0AndCheckToBaselineFromBaseline) \ 96 V(CallThisArg1AndCheckToBaselineFromBaseline) \ 97 V(CallThisArgs2AndCheckToBaselineFromBaseline) \ 98 V(CallThisArgs3AndCheckToBaselineFromBaseline) \ 99 V(CallRangeAndCheckToBaselineFromBaseline) \ 100 V(CallNewAndCheckToBaselineFromBaseline) \ 101 V(SuperCallAndCheckToBaselineFromBaseline) \ 102 V(CallThisRangeAndCheckToBaselineFromBaseline) \ 103 V(GetBaselineBuiltinFp) 104 105 #define JS_CALL_TRAMPOLINE_LIST(V) \ 106 V(CallRuntime) \ 107 V(CallRuntimeWithArgv) \ 108 V(JSFunctionEntry) \ 109 V(JSCall) \ 110 V(JSCallWithArgV) \ 111 V(JSCallWithArgVAndPushArgv) \ 112 V(JSProxyCallInternalWithArgV) \ 113 V(SuperCallWithArgV) \ 114 V(OptimizedCallAndPushArgv) \ 115 V(DeoptHandlerAsm) \ 116 V(JSCallNew) \ 117 V(CallOptimized) \ 118 V(AOTCallToAsmInterBridge) \ 119 V(FastCallToAsmInterBridge) 120 121 #define FAST_CALL_TRAMPOLINE_LIST(V) \ 122 V(OptimizedFastCallEntry) \ 123 V(OptimizedFastCallAndPushArgv) \ 124 V(JSFastCallWithArgV) \ 125 V(JSFastCallWithArgVAndPushArgv) 126 127 #define RUNTIME_STUB_WITH_DFX(V) \ 128 V(TraceLoadGetter) \ 129 V(TraceLoadSlowPath) \ 130 V(TraceLoadDetail) \ 131 V(TraceLoadEnd) 132 133 #define RUNTIME_STUB_WITHOUT_GC_LIST(V) \ 134 V(Dump) \ 135 V(DebugDump) \ 136 V(DumpWithHint) \ 137 V(DebugDumpWithHint) \ 138 V(DebugPrint) \ 139 V(DebugPrintCustom) \ 140 V(DebugPrintInstruction) \ 141 V(CollectingOpcodes) \ 142 V(DebugOsrEntry) \ 143 V(Comment) \ 144 V(FatalPrint) \ 145 V(FatalPrintCustom) \ 146 V(GetActualArgvNoGC) \ 147 V(InsertOldToNewRSet) \ 148 V(InsertLocalToShareRSet) \ 149 V(SetBitAtomic) \ 150 V(MarkingBarrier) \ 151 V(SharedGCMarkingBarrier) \ 152 V(DoubleToInt) \ 153 V(SaturateTruncDoubleToInt32) \ 154 V(FloatMod) \ 155 V(FloatAcos) \ 156 V(FloatAcosh) \ 157 V(FloatAsin) \ 158 V(FloatAsinh) \ 159 V(FloatAtan) \ 160 V(FloatAtan2) \ 161 V(FloatAtanh) \ 162 V(FloatCos) \ 163 V(FloatCosh) \ 164 V(FloatSin) \ 165 V(FloatSinh) \ 166 V(FloatTan) \ 167 V(FloatTanh) \ 168 V(FloatTrunc) \ 169 V(FloatLog) \ 170 V(FloatLog2) \ 171 V(FloatLog10) \ 172 V(FloatLog1p) \ 173 V(FloatExp) \ 174 V(FloatExpm1) \ 175 V(FloatCbrt) \ 176 V(FloatFloor) \ 177 V(FloatPow) \ 178 V(FloatCeil) \ 179 V(CallDateNow) \ 180 V(UpdateFieldType) \ 181 V(BigIntEquals) \ 182 V(TimeClip) \ 183 V(SetDateValues) \ 184 V(StartCallTimer) \ 185 V(EndCallTimer) \ 186 V(BigIntSameValueZero) \ 187 V(JSHClassFindProtoTransitions) \ 188 V(FinishObjSizeTracking) \ 189 V(NumberHelperStringToDouble) \ 190 V(GetStringToListCacheArray) \ 191 V(IntLexicographicCompare) \ 192 V(DoubleLexicographicCompare) \ 193 V(FastArraySortString) \ 194 V(StringToNumber) \ 195 V(StringGetStart) \ 196 V(StringGetEnd) \ 197 V(ArrayTrim) \ 198 V(SortTypedArray) \ 199 V(ReverseTypedArray) \ 200 V(CopyTypedArrayBuffer) \ 201 V(IsFastRegExp) \ 202 V(CreateLocalToShare) \ 203 V(CreateOldToNew) \ 204 V(ObjectCopy) \ 205 V(FillObject) \ 206 V(ReverseArray) \ 207 V(LrInt) 208 209 #define RUNTIME_STUB_WITH_GC_LIST(V) \ 210 V(HeapAlloc) \ 211 V(AllocateInYoung) \ 212 V(AllocateInOld) \ 213 V(AllocateInSOld) \ 214 V(AllocateInSNonMovable) \ 215 V(TypedArraySpeciesCreate) \ 216 V(TypedArrayCreateSameType) \ 217 V(CallInternalGetter) \ 218 V(CallInternalSetter) \ 219 V(CallGetPrototype) \ 220 V(RegularJSObjDeletePrototype) \ 221 V(CallJSObjDeletePrototype) \ 222 V(ToPropertyKey) \ 223 V(NewJSPrimitiveRef) \ 224 V(ThrowTypeError) \ 225 V(MismatchError) \ 226 V(GetHash32) \ 227 V(ComputeHashcode) \ 228 V(NewInternalString) \ 229 V(NewTaggedArray) \ 230 V(NewCOWTaggedArray) \ 231 V(NewMutantTaggedArray) \ 232 V(NewCOWMutantTaggedArray) \ 233 V(CopyArray) \ 234 V(NumberToString) \ 235 V(IntToString) \ 236 V(RTSubstitution) \ 237 V(NameDictPutIfAbsent) \ 238 V(NameDictionaryGetAllEnumKeys) \ 239 V(NumberDictionaryGetAllEnumKeys) \ 240 V(PropertiesSetValue) \ 241 V(JSArrayReduceUnStable) \ 242 V(JSArrayFilterUnStable) \ 243 V(JSArrayMapUnStable) \ 244 V(CheckAndCopyArray) \ 245 V(NewEcmaHClass) \ 246 V(UpdateLayOutAndAddTransition) \ 247 V(CopyAndUpdateObjLayout) \ 248 V(UpdateHClassForElementsKind) \ 249 V(RuntimeDump) \ 250 V(ForceGC) \ 251 V(NoticeThroughChainAndRefreshUser) \ 252 V(JumpToCInterpreter) \ 253 V(StGlobalRecord) \ 254 V(SetFunctionNameNoPrefix) \ 255 V(StOwnByValueWithNameSet) \ 256 V(StOwnByName) \ 257 V(StOwnByNameWithNameSet) \ 258 V(SuspendGenerator) \ 259 V(UpFrame) \ 260 V(Neg) \ 261 V(Not) \ 262 V(Inc) \ 263 V(Dec) \ 264 V(Shl2) \ 265 V(Shr2) \ 266 V(Ashr2) \ 267 V(Or2) \ 268 V(Xor2) \ 269 V(And2) \ 270 V(Exp) \ 271 V(IsIn) \ 272 V(InstanceOf) \ 273 V(CreateGeneratorObj) \ 274 V(ThrowConstAssignment) \ 275 V(GetTemplateObject) \ 276 V(CreateStringIterator) \ 277 V(NewJSArrayIterator) \ 278 V(NewJSTypedArrayIterator) \ 279 V(MapIteratorNext) \ 280 V(SetIteratorNext) \ 281 V(StringIteratorNext) \ 282 V(ArrayIteratorNext) \ 283 V(IteratorReturn) \ 284 V(GetNextPropName) \ 285 V(GetNextPropNameSlowpath) \ 286 V(ThrowIfNotObject) \ 287 V(IterNext) \ 288 V(CloseIterator) \ 289 V(SuperCallSpread) \ 290 V(OptSuperCallSpread) \ 291 V(GetCallSpreadArgs) \ 292 V(DelObjProp) \ 293 V(NewObjApply) \ 294 V(CreateIterResultObj) \ 295 V(AsyncFunctionAwaitUncaught) \ 296 V(AsyncFunctionResolveOrReject) \ 297 V(ThrowUndefinedIfHole) \ 298 V(CopyDataProperties) \ 299 V(StArraySpread) \ 300 V(GetIteratorNext) \ 301 V(SetObjectWithProto) \ 302 V(LoadICByValue) \ 303 V(StoreICByValue) \ 304 V(StoreOwnICByValue) \ 305 V(StOwnByValue) \ 306 V(LdSuperByValue) \ 307 V(StSuperByValue) \ 308 V(StObjByValue) \ 309 V(LdObjByIndex) \ 310 V(StObjByIndex) \ 311 V(StOwnByIndex) \ 312 V(CreateClassWithBuffer) \ 313 V(CreateSharedClass) \ 314 V(LdSendableClass) \ 315 V(SetClassConstructorLength) \ 316 V(LoadICByName) \ 317 V(StoreICByName) \ 318 V(UpdateHotnessCounter) \ 319 V(CheckSafePoint) \ 320 V(PGODump) \ 321 V(PGOPreDump) \ 322 V(JitCompile) \ 323 V(CountInterpExecFuncs) \ 324 V(BaselineJitCompile) \ 325 V(UpdateHotnessCounterWithProf) \ 326 V(GetModuleNamespaceByIndex) \ 327 V(GetModuleNamespaceByIndexOnJSFunc) \ 328 V(GetModuleNamespace) \ 329 V(StModuleVarByIndex) \ 330 V(StModuleVarByIndexOnJSFunc) \ 331 V(StModuleVar) \ 332 V(LdLocalModuleVarByIndex) \ 333 V(LdLocalModuleVarByIndexWithModule) \ 334 V(LdExternalModuleVarByIndex) \ 335 V(LdExternalModuleVarByIndexWithModule) \ 336 V(LdSendableExternalModuleVarByIndex) \ 337 V(LdSendableLocalModuleVarByIndex) \ 338 V(LdLazyExternalModuleVarByIndex) \ 339 V(LdLazySendableExternalModuleVarByIndex) \ 340 V(LdLocalModuleVarByIndexOnJSFunc) \ 341 V(LdExternalModuleVarByIndexOnJSFunc) \ 342 V(LdModuleVar) \ 343 V(Throw) \ 344 V(GetPropIterator) \ 345 V(GetPropIteratorSlowpath) \ 346 V(PrimitiveStringCreate) \ 347 V(AsyncFunctionEnter) \ 348 V(GetIterator) \ 349 V(GetAsyncIterator) \ 350 V(SetGeneratorState) \ 351 V(ThrowThrowNotExists) \ 352 V(ThrowPatternNonCoercible) \ 353 V(ThrowDeleteSuperProperty) \ 354 V(Eq) \ 355 V(TryLdGlobalICByName) \ 356 V(LoadMiss) \ 357 V(StoreMiss) \ 358 V(TryUpdateGlobalRecord) \ 359 V(ThrowReferenceError) \ 360 V(StGlobalVar) \ 361 V(LdGlobalICVar) \ 362 V(ToIndex) \ 363 V(NewJSObjectByConstructor) \ 364 V(CloneHclass) \ 365 V(AllocateTypedArrayBuffer) \ 366 V(ToNumber) \ 367 V(ToBoolean) \ 368 V(NotEq) \ 369 V(Less) \ 370 V(LessEq) \ 371 V(Greater) \ 372 V(GreaterEq) \ 373 V(Add2) \ 374 V(Sub2) \ 375 V(Mul2) \ 376 V(Div2) \ 377 V(Mod2) \ 378 V(CreateEmptyObject) \ 379 V(CreateEmptyArray) \ 380 V(GetSymbolFunction) \ 381 V(GetUnmapedArgs) \ 382 V(CopyRestArgs) \ 383 V(CreateArrayWithBuffer) \ 384 V(CreateObjectWithBuffer) \ 385 V(NewThisObject) \ 386 V(NewObjRange) \ 387 V(DefineFunc) \ 388 V(CreateRegExpWithLiteral) \ 389 V(ThrowIfSuperNotCorrectCall) \ 390 V(CreateObjectHavingMethod) \ 391 V(CreateObjectWithExcludedKeys) \ 392 V(DefineMethod) \ 393 V(SetPatchModule) \ 394 V(ThrowSetterIsUndefinedException) \ 395 V(ThrowNotCallableException) \ 396 V(ThrowCallConstructorException) \ 397 V(ThrowNonConstructorException) \ 398 V(ThrowStackOverflowException) \ 399 V(ThrowDerivedMustReturnException) \ 400 V(CallSpread) \ 401 V(DefineGetterSetterByValue) \ 402 V(SuperCall) \ 403 V(OptSuperCall) \ 404 V(LdBigInt) \ 405 V(ToNumeric) \ 406 V(ToNumericConvertBigInt) \ 407 V(CallBigIntAsIntN) \ 408 V(CallBigIntAsUintN) \ 409 V(DynamicImport) \ 410 V(CreateAsyncGeneratorObj) \ 411 V(AsyncGeneratorResolve) \ 412 V(AsyncGeneratorReject) \ 413 V(NewLexicalEnvWithName) \ 414 V(NewSendableEnv) \ 415 V(OptGetUnmapedArgs) \ 416 V(OptCopyRestArgs) \ 417 V(NotifyBytecodePcChanged) \ 418 V(NotifyDebuggerStatement) \ 419 V(MethodEntry) \ 420 V(MethodExit) \ 421 V(OptNewLexicalEnvWithName) \ 422 V(OptSuspendGenerator) \ 423 V(OptAsyncGeneratorResolve) \ 424 V(OptCreateObjectWithExcludedKeys) \ 425 V(OptNewObjRange) \ 426 V(GetTypeArrayPropertyByIndex) \ 427 V(SetTypeArrayPropertyByIndex) \ 428 V(FastCopyElementToArray) \ 429 V(GetPropertyByName) \ 430 V(JSObjectGetMethod) \ 431 V(DebugAOTPrint) \ 432 V(ProfileOptimizedCode) \ 433 V(ProfileTypedOp) \ 434 V(VerifyVTableLoading) \ 435 V(VerifyVTableStoring) \ 436 V(GetMethodFromCache) \ 437 V(GetArrayLiteralFromCache) \ 438 V(GetObjectLiteralFromCache) \ 439 V(GetStringFromCache) \ 440 V(OptLdSuperByValue) \ 441 V(OptStSuperByValue) \ 442 V(BigIntEqual) \ 443 V(StringEqual) \ 444 V(StringIndexOf) \ 445 V(LdPatchVar) \ 446 V(StPatchVar) \ 447 V(DeoptHandler) \ 448 V(ContainerRBTreeForEach) \ 449 V(InsertStringToTable) \ 450 V(SlowFlattenString) \ 451 V(NotifyConcurrentResult) \ 452 V(DefineField) \ 453 V(CreatePrivateProperty) \ 454 V(DefinePrivateProperty) \ 455 V(LdPrivateProperty) \ 456 V(StPrivateProperty) \ 457 V(TestIn) \ 458 V(UpdateAOTHClass) \ 459 V(AotInlineTrace) \ 460 V(AotInlineBuiltinTrace) \ 461 V(LocaleCompare) \ 462 V(ArraySort) \ 463 V(FastStringify) \ 464 V(ObjectSlowAssign) \ 465 V(GetLinkedHash) \ 466 V(LinkedHashMapComputeCapacity) \ 467 V(LinkedHashSetComputeCapacity) \ 468 V(JSObjectGrowElementsCapacity) \ 469 V(HClassCloneWithAddProto) \ 470 V(LocaleCompareWithGc) \ 471 V(ParseInt) \ 472 V(LocaleCompareCacheable) \ 473 V(ArrayForEachContinue) \ 474 V(NumberDictionaryPut) \ 475 V(ThrowRangeError) \ 476 V(InitializeGeneratorFunction) \ 477 V(FunctionDefineOwnProperty) \ 478 V(DefineOwnProperty) \ 479 V(AOTEnableProtoChangeMarker) \ 480 V(JSProxyHasProperty) \ 481 V(JSTypedArrayHasProperty) \ 482 V(ModuleNamespaceHasProperty) \ 483 V(JSObjectHasProperty) \ 484 V(HasProperty) \ 485 V(DumpObject) \ 486 V(TryGetInternString) \ 487 V(FastCopyFromArrayToTypedArray) \ 488 V(BigIntConstructor) \ 489 V(ObjectPrototypeHasOwnProperty) \ 490 V(ReflectHas) \ 491 V(ReflectConstruct) \ 492 V(ReflectApply) \ 493 V(FunctionPrototypeApply) \ 494 V(FunctionPrototypeBind) \ 495 V(FunctionPrototypeCall) \ 496 V(SetPrototypeTransition) \ 497 V(GetSharedModule) \ 498 V(SuperCallForwardAllArgs) \ 499 V(OptSuperCallForwardAllArgs) \ 500 V(GetCollationValueFromIcuCollator) \ 501 V(DecodeURIComponent) \ 502 V(GetAllFlagsInternal) \ 503 V(SlowSharedObjectStoreBarrier) \ 504 V(GetNativePcOfstForBaseline) \ 505 V(AotCallBuiltinTrace) \ 506 V(NumberBigIntNativePointerToString) 507 508 #define RUNTIME_STUB_LIST(V) \ 509 RUNTIME_ASM_STUB_LIST(V) \ 510 RUNTIME_STUB_WITHOUT_GC_LIST(V) \ 511 RUNTIME_STUB_WITH_GC_LIST(V) \ 512 RUNTIME_STUB_WITH_DFX(V) \ 513 TEST_RUNTIME_STUB_GC_LIST(V) 514 515 } // namespace panda::ecmascript 516 #endif // ECMASCRIPT_RUNTIME_STUB_LIST_H 517