1 /* 2 * Copyright (c) 2021-2022 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_CALL_ID_H 17 #define ECMASCRIPT_RUNTIME_CALL_ID_H 18 19 #include "ecmascript/base/config.h" 20 #include "ecmascript/dfx/vmstat/runtime_stat.h" 21 #include "ecmascript/stubs/runtime_stubs.h" 22 23 namespace panda::ecmascript { 24 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 25 #define INTERPRETER_CALLER_LIST(V) \ 26 V(RunInternal) \ 27 V(Ldnan) \ 28 V(Ldinfinity) \ 29 V(Ldundefined) \ 30 V(Ldboolean) \ 31 V(Ldnumber) \ 32 V(Ldstring) \ 33 V(Ldnull) \ 34 V(Ldsymbol) \ 35 V(Ldfunction) \ 36 V(Ldglobal) \ 37 V(Ldtrue) \ 38 V(Ldfalse) \ 39 V(Tonumber) \ 40 V(Toboolean) \ 41 V(Add2) \ 42 V(Sub2) \ 43 V(Mul2) \ 44 V(Div2) \ 45 V(Mod2) \ 46 V(Eq) \ 47 V(NotEq) \ 48 V(Less) \ 49 V(LessEq) \ 50 V(Greater) \ 51 V(GreaterEq) \ 52 V(StrictNotEq) \ 53 V(StrictEq) \ 54 V(Shl2) \ 55 V(Shr2) \ 56 V(Ashr2) \ 57 V(And2) \ 58 V(Or2) \ 59 V(Xor2) \ 60 V(Neg) \ 61 V(Not) \ 62 V(Inc) \ 63 V(Dec) \ 64 V(Exp) \ 65 V(Throw) \ 66 V(LdObjByIndex) \ 67 V(StObjByIndex) \ 68 V(LdObjByName) \ 69 V(StObjByName) \ 70 V(LdObjByValue) \ 71 V(StObjByValue) \ 72 V(StOwnByName) \ 73 V(StOwnById) \ 74 V(StOwnByValue) \ 75 V(Trygetobjprop) \ 76 V(Delobjprop) \ 77 V(Defineglobalvar) \ 78 V(Definelocalvar) \ 79 V(Definefuncexpr) \ 80 V(DefineFunc) \ 81 V(NewobjRange) \ 82 V(Refeq) \ 83 V(Typeof) \ 84 V(Ldnewobjrange) \ 85 V(IsIn) \ 86 V(Instanceof) \ 87 V(InstanceofByHandler) \ 88 V(NewObjApply) \ 89 V(CallArg0) \ 90 V(CallArg1) \ 91 V(CallArg2) \ 92 V(CallArg3) \ 93 V(CallThisRange) \ 94 V(CallRange) \ 95 V(CallSpread) \ 96 V(Newlexenv) \ 97 V(NewlexenvwithName) \ 98 V(Stlexvar) \ 99 V(Ldlexvar) \ 100 V(Ldlexenv) \ 101 V(GetPropIterator) \ 102 V(CreateIterResultObj) \ 103 V(SuspendGenerator) \ 104 V(ResumeGenerator) \ 105 V(GetResumeMode) \ 106 V(CreateGeneratorObj) \ 107 V(DefineGetterSetterByValue) \ 108 V(AsyncFunctionEnter) \ 109 V(AsyncFunctionAwaitUncaught) \ 110 V(AsyncFunctionResolveOrReject) \ 111 V(ThrowUndefined) \ 112 V(ThrowConstAssignment) \ 113 V(ThrowUndefinedIfHole) \ 114 V(Copyrestargs) \ 115 V(Trystobjprop) \ 116 V(GetTemplateObject) \ 117 V(GetIterator) \ 118 V(GetAsyncIterator) \ 119 V(ThrowIfNotObject) \ 120 V(ThrowThrowNotExists) \ 121 V(CreateObjectWithExcludedKeys) \ 122 V(ThrowPatternNonCoercible) \ 123 V(IterNext) \ 124 V(CloseIterator) \ 125 V(StArraySpread) \ 126 V(GetCallSpreadArgs) \ 127 V(TryLoadICByName) \ 128 V(LoadICByName) \ 129 V(GetPropertyByName) \ 130 V(TryLoadICByValue) \ 131 V(LoadICByValue) \ 132 V(TryStoreICByName) \ 133 V(StoreICByName) \ 134 V(TryStoreICByValue) \ 135 V(StoreICByValue) \ 136 V(NotifyInlineCache) \ 137 V(LoadGlobalICByName) \ 138 V(StoreGlobalICByName) \ 139 V(StoreICWithHandler) \ 140 V(StorePrototype) \ 141 V(StoreWithTransition) \ 142 V(StoreTransWithProto) \ 143 V(StoreWithAOT) \ 144 V(StoreField) \ 145 V(StoreGlobal) \ 146 V(LoadPrototype) \ 147 V(LoadICWithHandler) \ 148 V(StoreElement) \ 149 V(CallGetter) \ 150 V(CallSetter) \ 151 V(AddPropertyByName) \ 152 V(AddPropertyByIndex) \ 153 V(GetPropertyByIndex) \ 154 V(GetPropertyByValue) \ 155 V(SetPropertyByIndex) \ 156 V(SetPropertyByValue) \ 157 V(FastTypeOf) \ 158 V(FastSetPropertyByIndex) \ 159 V(FastSetPropertyByValue) \ 160 V(FastGetPropertyByName) \ 161 V(FastGetPropertyByValue) \ 162 V(FastGetPropertyByIndex) \ 163 V(NewLexicalEnv) \ 164 V(ExecuteNative) \ 165 V(Execute) \ 166 V(AsmExecute) \ 167 V(ExecuteAot) \ 168 V(ToJSTaggedValueWithInt32) \ 169 V(ToJSTaggedValueWithUint32) \ 170 V(ThrowIfSuperNotCorrectCall) \ 171 V(CreateEmptyArray) \ 172 V(CreateEmptyObject) \ 173 V(CreateObjectWithBuffer) \ 174 V(CreateObjectHavingMethod) \ 175 V(SetObjectWithProto) \ 176 V(getmodulenamespace) \ 177 V(StModuleVar) \ 178 V(LdModuleVar) \ 179 V(CreateRegExpWithLiteral) \ 180 V(CreateArrayWithBuffer) \ 181 V(GetNextPropName) \ 182 V(CopyDataProperties) \ 183 V(GetUnmapedArgs) \ 184 V(TryStGlobalByName) \ 185 V(LdGlobalVar) \ 186 V(StGlobalVar) \ 187 V(TryUpdateGlobalRecord) \ 188 V(LdGlobalRecord) \ 189 V(StGlobalRecord) \ 190 V(ThrowReferenceError) \ 191 V(ThrowTypeError) \ 192 V(ThrowSyntaxError) \ 193 V(NewClassFunc) \ 194 V(DefineClass) \ 195 V(SuperCall) \ 196 V(SuperCallSpread) \ 197 V(DefineMethod) \ 198 V(LdSuperByValue) \ 199 V(StSuperByValue) \ 200 V(ThrowDeleteSuperProperty) \ 201 V(ModWithTSType) \ 202 V(MulWithTSType) \ 203 V(SubWithTSType) \ 204 V(DivWithTSType) \ 205 V(AddWithTSType) \ 206 V(GetBitOPDate) \ 207 V(ShlWithTSType) \ 208 V(ShrWithTSType) \ 209 V(AshrWithTSType) \ 210 V(AndWithTSType) \ 211 V(OrWithTSType) \ 212 V(XorWithTSType) \ 213 V(EqualWithIC) \ 214 V(NotEqualWithIC) \ 215 V(Compare) \ 216 V(LessWithIC) \ 217 V(LessEqWithIC) \ 218 V(GreaterWithIC) \ 219 V(SetPropertyByName) \ 220 V(GreaterEqWithIC) \ 221 V(LdBigInt) \ 222 V(Tonumeric) \ 223 V(CreateAsyncGeneratorObj) \ 224 V(AsyncGeneratorResolve) \ 225 V(GetSuperConstructor) \ 226 V(DynamicImport) \ 227 V(LdPatchVar) \ 228 V(StPatchVar) \ 229 V(AsyncGeneratorReject) \ 230 V(NotifyConcurrentResult) \ 231 V(SetGeneratorState) 232 233 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 234 #define BUILTINS_API_LIST(V) \ 235 V(Array, Constructor) \ 236 V(Array, From) \ 237 V(Array, Of) \ 238 V(Array, IsArray) \ 239 V(Array, Entries) \ 240 V(Array, Species) \ 241 V(Array, Concat) \ 242 V(Array, CopyWithin) \ 243 V(Array, Every) \ 244 V(Array, Fill) \ 245 V(Array, Filter) \ 246 V(Array, Find) \ 247 V(Array, FindIndex) \ 248 V(Array, FindLast) \ 249 V(Array, FindLastIndex) \ 250 V(Array, ForEach) \ 251 V(Array, IndexOf) \ 252 V(Array, Join) \ 253 V(Array, Keys) \ 254 V(Array, LastIndexOf) \ 255 V(Array, Map) \ 256 V(Array, Pop) \ 257 V(Array, Push) \ 258 V(Array, Reduce) \ 259 V(Array, ReduceRight) \ 260 V(Array, Reverse) \ 261 V(Array, Shift) \ 262 V(Array, Slice) \ 263 V(Array, Some) \ 264 V(Array, Sort) \ 265 V(Array, Splice) \ 266 V(Array, ToLocaleString) \ 267 V(Array, ToString) \ 268 V(Array, Unscopables) \ 269 V(Array, Unshift) \ 270 V(Array, Values) \ 271 V(Array, Includes) \ 272 V(Array, Flat) \ 273 V(Array, FlatMap) \ 274 V(Array, At) \ 275 V(Array, ToReversed) \ 276 V(Array, With) \ 277 V(Array, ToSorted) \ 278 V(Array, ToSpliced) \ 279 V(ArrayBuffer, Constructor) \ 280 V(ArrayBuffer, Slice) \ 281 V(ArrayBuffer, Species) \ 282 V(ArrayBuffer, GetByteLength) \ 283 V(ArrayBuffer, GetValueFromBuffer) \ 284 V(ArrayBuffer, SetValueInBuffer) \ 285 V(ArrayBuffer, CloneArrayBuffer) \ 286 V(ArrayBuffer, AllocateArrayBuffer) \ 287 V(ArrayBuffer, IsView) \ 288 V(SharedArrayBuffer, Constructor) \ 289 V(SharedArrayBuffer, Slice) \ 290 V(SharedArrayBuffer, AllocateSharedArrayBuffer) \ 291 V(SharedArrayBuffer, IsSharedArrayBuffer) \ 292 V(SharedArrayBuffer, IsView) \ 293 V(SharedArrayBuffer, Species) \ 294 V(SharedArrayBuffer, GetByteLength) \ 295 V(AsyncFromSyncIterator, Next) \ 296 V(AsyncFromSyncIterator, Throw) \ 297 V(AsyncFromSyncIterator, Return) \ 298 V(AsyncFunction, Constructor) \ 299 V(Boolean, BooleanPrototypeToString) \ 300 V(Boolean, BooleanPrototypeValueOf) \ 301 V(Boolean, Constructor) \ 302 V(Boolean, ThisBooleanValue) \ 303 V(CjsExports, CjsExportsConstructor) \ 304 V(CjsModule, CjsModuleConstructor) \ 305 V(CjsModule, Compiler) \ 306 V(CjsModule, Load) \ 307 V(CjsModule, ResolveFilename) \ 308 V(CjsModule, Require) \ 309 V(CjsModule, GetExportsForCircularRequire) \ 310 V(CjsModule, UpdateChildren) \ 311 V(CjsRequire, CjsRequireConstructor) \ 312 V(CjsRequire, Main) \ 313 V(CjsRequire, Resolve) \ 314 V(Collator, CollatorConstructor) \ 315 V(Collator, SupportedLocalesOf) \ 316 V(Collator, Compare) \ 317 V(Collator, AnonymousCollator) \ 318 V(Collator, ResolvedOptions) \ 319 V(DataView, Constructor) \ 320 V(DataView, GetBuffer) \ 321 V(DataView, GetByteLength) \ 322 V(DataView, GetOffset) \ 323 V(DataView, GetViewValue) \ 324 V(DataView, SetViewValue) \ 325 V(DataView, GetFloat32) \ 326 V(DataView, GetFloat64) \ 327 V(DataView, GetInt8) \ 328 V(DataView, GetInt16) \ 329 V(DataView, GetInt32) \ 330 V(DataView, GetUint8) \ 331 V(DataView, GetUint16) \ 332 V(DataView, GetUint32) \ 333 V(DataView, GetBigInt64) \ 334 V(DataView, GetBigUint64) \ 335 V(DataView, SetFloat32) \ 336 V(DataView, SetFloat64) \ 337 V(DataView, SetInt8) \ 338 V(DataView, SetInt16) \ 339 V(DataView, SetInt32) \ 340 V(DataView, SetUint8) \ 341 V(DataView, SetUint16) \ 342 V(DataView, SetUint32) \ 343 V(DataView, SetBigInt64) \ 344 V(DataView, SetBigUint64) \ 345 V(DataView, GetTypedValue) \ 346 V(DataView, SetTypedValue) \ 347 V(Date, Constructor) \ 348 V(Date, Now) \ 349 V(Date, UTC) \ 350 V(Date, Parse) \ 351 V(Date, GetDateField) \ 352 V(Date, GetTime) \ 353 V(Date, SetTime) \ 354 V(Date, ToJSON) \ 355 V(Date, ValueOf) \ 356 V(Date, ToPrimitive) \ 357 V(Date, ToLocaleString) \ 358 V(Date, ToLocaleDateString) \ 359 V(Date, ToLocaleTimeString) \ 360 V(DateTimeFormat, Constructor) \ 361 V(DateTimeFormat, SupportedLocalesOf) \ 362 V(DateTimeFormat, Format) \ 363 V(DateTimeFormat, AnonymousDateTimeFormat) \ 364 V(DateTimeFormat, FormatToParts) \ 365 V(DateTimeFormat, ResolvedOptions) \ 366 V(DateTimeFormat, FormatRange) \ 367 V(DateTimeFormat, FormatRangeToParts) \ 368 V(DisplayNames, Constructor) \ 369 V(DisplayNames, SupportedLocalesOf) \ 370 V(DisplayNames, Of) \ 371 V(DisplayNames, ResolvedOptions) \ 372 V(Error, ErrorConstructor) \ 373 V(Error, ErrorToString) \ 374 V(Error, RangeErrorConstructor) \ 375 V(Error, RangeErrorToString) \ 376 V(Error, ReferenceErrorConstructor) \ 377 V(Error, ReferenceErrorToString) \ 378 V(Error, TypeErrorConstructor) \ 379 V(Error, TypeErrorToString) \ 380 V(Error, ThrowTypeError) \ 381 V(Error, URIErrorConstructor) \ 382 V(Error, URIErrorToString) \ 383 V(Error, SyntaxErrorConstructor) \ 384 V(Error, SyntaxErrorToString) \ 385 V(Error, EvalErrorConstructor) \ 386 V(Error, EvalErrorToString) \ 387 V(Error, AggregateErrorConstructor) \ 388 V(Error, AggregateErrorToString) \ 389 V(Error, OOMErrorConstructor) \ 390 V(Error, OOMErrorToString) \ 391 V(Function, Constructor) \ 392 V(Function, PrototypeApply) \ 393 V(Function, PrototypeBind) \ 394 V(Function, PrototypeCall) \ 395 V(Function, PrototypeToString) \ 396 V(Function, PrototypeHasInstance) \ 397 V(Function, PrototypeInvokeSelf) \ 398 V(Generator, Constructor) \ 399 V(Generator, PrototypeNext) \ 400 V(Generator, PrototypeReturn) \ 401 V(Generator, PrototypeThrow) \ 402 V(Global, IsFinite) \ 403 V(Global, NotSupportEval) \ 404 V(Global, Encode) \ 405 V(Global, IsNaN) \ 406 V(Global, PrintEntryPoint) \ 407 V(Global, NewobjRange) \ 408 V(Global, Decode) \ 409 V(Global, PrintString) \ 410 V(Global, StartRuntimeStat) \ 411 V(Global, StopRuntimeStat) \ 412 V(Global, PrintOptStat) \ 413 V(Global, PrintFunctionCallStat) \ 414 V(Global, CallJsBoundFunction) \ 415 V(Global, CallJsProxy) \ 416 V(Global, DecodeURI) \ 417 V(Global, EncodeURI) \ 418 V(Global, DecodeURIComponent) \ 419 V(Global, EncodeURIComponent) \ 420 V(Intl, GetCanonicalLocales) \ 421 V(Iterator, Constructor) \ 422 V(Iterator, Next) \ 423 V(Iterator, Throw) \ 424 V(Iterator, Return) \ 425 V(Iterator, GetObj) \ 426 V(Locale, Constructor) \ 427 V(Locale, Maximize) \ 428 V(Locale, Minimize) \ 429 V(Locale, ToString) \ 430 V(Locale, GetBaseName) \ 431 V(Locale, GetCalendar) \ 432 V(Locale, GetCaseFirst) \ 433 V(Locale, GetCollation) \ 434 V(Locale, GetHourCycle) \ 435 V(Locale, GetNumeric) \ 436 V(Locale, GetNumberingSystem) \ 437 V(Locale, GetLanguage) \ 438 V(Locale, GetScript) \ 439 V(Locale, GetRegion) \ 440 V(AsyncIterator, Constructor) \ 441 V(AsyncIterator, Next) \ 442 V(AsyncIterator, Throw) \ 443 V(AsyncIterator, Return) \ 444 V(AsyncIterator, GetObj) \ 445 V(Json, Parse) \ 446 V(Json, Stringify) \ 447 V(Map, Constructor) \ 448 V(Map, Species) \ 449 V(Map, Clear) \ 450 V(Map, Delete) \ 451 V(Map, Entries) \ 452 V(Map, Get) \ 453 V(Map, Has) \ 454 V(Map, Keys) \ 455 V(Map, Set) \ 456 V(Map, GetSize) \ 457 V(Map, Values) \ 458 V(Map, ForEach) \ 459 V(Map, AddEntriesFromIterable) \ 460 V(Math, Abs) \ 461 V(Math, Acos) \ 462 V(Math, Acosh) \ 463 V(Math, Asin) \ 464 V(Math, Asinh) \ 465 V(Math, Atan) \ 466 V(Math, Atanh) \ 467 V(Math, Atan2) \ 468 V(Math, Cbrt) \ 469 V(Math, Ceil) \ 470 V(Math, Clz32) \ 471 V(Math, Cos) \ 472 V(Math, Cosh) \ 473 V(Math, Exp) \ 474 V(Math, Expm1) \ 475 V(Math, Floor) \ 476 V(Math, Fround) \ 477 V(Math, Hypot) \ 478 V(Math, Imul) \ 479 V(Math, Log) \ 480 V(Math, Log1p) \ 481 V(Math, Log10) \ 482 V(Math, Log2) \ 483 V(Math, Max) \ 484 V(Math, Min) \ 485 V(Math, Pow) \ 486 V(Math, Random) \ 487 V(Math, Round) \ 488 V(Math, Sign) \ 489 V(Math, Sin) \ 490 V(Math, Sinh) \ 491 V(Math, Sqrt) \ 492 V(Math, Tan) \ 493 V(Math, Tanh) \ 494 V(Math, Trunc) \ 495 V(NumberFormat, Constructor) \ 496 V(NumberFormat, SupportedLocalesOf) \ 497 V(NumberFormat, Format) \ 498 V(NumberFormat, FormatToParts) \ 499 V(NumberFormat, ResolvedOptions) \ 500 V(Atomics, AtomicReadModifyWrite) \ 501 V(Atomics, AtomicReadModifyWriteCase) \ 502 V(Atomics, Add) \ 503 V(Atomics, And) \ 504 V(Atomics, DoWait) \ 505 V(Atomics, HandleWithUint8) \ 506 V(Atomics, HandleWithInt8) \ 507 V(Atomics, HandleWithUint16) \ 508 V(Atomics, HandleWithInt16) \ 509 V(Atomics, HandleWithUint32) \ 510 V(Atomics, HandleWithInt32) \ 511 V(Atomics, HandleWithBigInt64) \ 512 V(Atomics, HandleWithBigUint64) \ 513 V(Atomics, Or) \ 514 V(Atomics, Xor) \ 515 V(Atomics, Sub) \ 516 V(Atomics, Exchange) \ 517 V(Atomics, CompareExchange) \ 518 V(Atomics, Store) \ 519 V(Atomics, Load) \ 520 V(Atomics, IsLockFree) \ 521 V(Atomics, Wait) \ 522 V(Atomics, Notify) \ 523 V(Number, Constructor) \ 524 V(Number, IsFinite) \ 525 V(Number, IsInteger) \ 526 V(Number, IsNaN) \ 527 V(Number, IsSafeInteger) \ 528 V(Number, ParseFloat) \ 529 V(Number, ParseInt) \ 530 V(Number, ToExponential) \ 531 V(Number, ToFixed) \ 532 V(Number, ToLocaleString) \ 533 V(Number, ToPrecision) \ 534 V(Number, ToString) \ 535 V(Number, ValueOf) \ 536 V(Number, ThisNumberValue) \ 537 V(BigInt, Constructor) \ 538 V(BigInt, AsUintN) \ 539 V(BigInt, AsIntN) \ 540 V(BigInt, ToLocaleString) \ 541 V(BigInt, ToString) \ 542 V(BigInt, ValueOf) \ 543 V(BigInt, ThisBigIntValue) \ 544 V(AsyncGenerator, Constructor) \ 545 V(AsyncGenerator, PrototypeNext) \ 546 V(AsyncGenerator, PrototypeReturn) \ 547 V(AsyncGenerator, PrototypeThrow) \ 548 V(Object, Constructor) \ 549 V(Object, Assign) \ 550 V(Object, Create) \ 551 V(Object, CreateDataPropertyOnObjectFunctions) \ 552 V(Object, DefineProperties) \ 553 V(Object, DefineProperty) \ 554 V(Object, Freeze) \ 555 V(Object, FromEntries) \ 556 V(Object, GetOwnPropertyDescriptor) \ 557 V(Object, GetOwnPropertyKeys) \ 558 V(Object, GetOwnPropertyNames) \ 559 V(Object, GetOwnPropertySymbols) \ 560 V(Object, GetPrototypeOf) \ 561 V(Object, Is) \ 562 V(Object, IsExtensible) \ 563 V(Object, IsFrozen) \ 564 V(Object, IsSealed) \ 565 V(Object, PropertyIsEnumerable) \ 566 V(Object, CreateRealm) \ 567 V(Object, Keys) \ 568 V(Object, Values) \ 569 V(Object, PreventExtensions) \ 570 V(Object, Seal) \ 571 V(Object, SetPrototypeOf) \ 572 V(Object, HasOwnProperty) \ 573 V(Object, HasOwn) \ 574 V(Object, IsPrototypeOf) \ 575 V(Object, ToLocaleString) \ 576 V(Object, GetBuiltinTag) \ 577 V(Object, ToString) \ 578 V(Object, ValueOf) \ 579 V(Object, ProtoGetter) \ 580 V(Object, ProtoSetter) \ 581 V(PluralRules, Constructor) \ 582 V(PluralRules, SupportedLocalesOf) \ 583 V(PluralRules, Select) \ 584 V(PluralRules, ResolvedOptions) \ 585 V(PromiseHandler, Resolve) \ 586 V(PromiseHandler, Reject) \ 587 V(PromiseHandler, Executor) \ 588 V(PromiseHandler, ResolveElementFunction) \ 589 V(PromiseHandler, AllSettledResolveElementFunction) \ 590 V(PromiseHandler, AllSettledRejectElementFunction) \ 591 V(PromiseHandler, AnyRejectElementFunction) \ 592 V(PromiseHandler, AsyncAwaitRejected) \ 593 V(PromiseHandler, AsyncAwaitFulfilled) \ 594 V(PromiseHandler, valueThunkFunction) \ 595 V(PromiseHandler, throwerFunction) \ 596 V(PromiseHandler, ThenFinally) \ 597 V(PromiseHandler, CatchFinally) \ 598 V(PromiseHandler, PromiseResolve) \ 599 V(PromiseJob, Reaction) \ 600 V(PromiseJob, ResolveThenableJob) \ 601 V(PromiseJob, DynamicImportJob) \ 602 V(PromiseJob, CatchException) \ 603 V(Promise, Constructor) \ 604 V(Promise, All) \ 605 V(Promise, Race) \ 606 V(Promise, Reject) \ 607 V(Promise, Resolve) \ 608 V(Promise, GetSpecies) \ 609 V(Promise, GetPromiseResolve) \ 610 V(Promise, Catch) \ 611 V(Promise, Then) \ 612 V(Promise, PerformPromiseThen) \ 613 V(Promise, Finally) \ 614 V(Promise, Any) \ 615 V(Promise, PerformPromiseAny) \ 616 V(Promise, AllSettled) \ 617 V(Promise, PerformPromiseRace) \ 618 V(Promise, PerformPromiseAll) \ 619 V(Promise, PerformPromiseAllSettled) \ 620 V(Proxy, Constructor) \ 621 V(Proxy, Revocable) \ 622 V(Proxy, InvalidateProxyFunction) \ 623 V(Reflect, Apply) \ 624 V(Reflect, Constructor) \ 625 V(Reflect, DefineProperty) \ 626 V(Reflect, DeleteProperty) \ 627 V(Reflect, Get) \ 628 V(Reflect, GetOwnPropertyDescriptor) \ 629 V(Reflect, GetPrototypeOf) \ 630 V(Reflect, Has) \ 631 V(Reflect, OwnKeys) \ 632 V(Reflect, PreventExtensions) \ 633 V(Reflect, Set) \ 634 V(Reflect, SetPrototypeOf) \ 635 V(RegExp, Constructor) \ 636 V(RegExp, Exec) \ 637 V(RegExp, Test) \ 638 V(RegExp, ToString) \ 639 V(RegExp, GetFlags) \ 640 V(RegExp, GetSpecies) \ 641 V(RegExp, Match) \ 642 V(RegExp, MatchAll) \ 643 V(RegExp, Replace) \ 644 V(RegExp, Search) \ 645 V(RegExp, Split) \ 646 V(RegExp, Create) \ 647 V(RegExp, GetGlobal) \ 648 V(RegExp, GetIgnoreCase) \ 649 V(RegExp, GetMultiline) \ 650 V(RegExp, GetDotAll) \ 651 V(RegExp, GetSource) \ 652 V(RegExp, GetSticky) \ 653 V(RegExp, GetUnicode) \ 654 V(RegExp, RegExpReplaceFast) \ 655 V(RegExp, Matcher) \ 656 V(RegExp, GetFlagsInternal) \ 657 V(RegExp, RegExpBuiltinExec) \ 658 V(RegExp, RegExpExec) \ 659 V(RegExp, UpdateExpressionFlags) \ 660 V(RegExp, RegExpAlloc) \ 661 V(RegExp, GetDollarString) \ 662 V(RegExp, RegExpInitialize) \ 663 V(RegExp, EscapeRegExpPattern) \ 664 V(RegExp, FlagsBitsToString) \ 665 V(RelativeTimeFormat, Constructor) \ 666 V(RelativeTimeFormat, SupportedLocalesOf) \ 667 V(RelativeTimeFormat, Format) \ 668 V(RelativeTimeFormat, FormatToParts) \ 669 V(RelativeTimeFormat, ResolvedOptions) \ 670 V(Set, Constructor) \ 671 V(Set, Species) \ 672 V(Set, Add) \ 673 V(Set, Clear) \ 674 V(Set, Delete) \ 675 V(Set, Entries) \ 676 V(Set, Has) \ 677 V(Set, GetSize) \ 678 V(Set, Values) \ 679 V(Set, ForEach) \ 680 V(StringIterator, Next) \ 681 V(String, Constructor) \ 682 V(String, FromCharCode) \ 683 V(String, FromCodePoint) \ 684 V(String, Raw) \ 685 V(String, GetSubstitution) \ 686 V(String, At) \ 687 V(String, CharAt) \ 688 V(String, CharCodeAt) \ 689 V(String, CodePointAt) \ 690 V(String, Concat) \ 691 V(String, EndsWith) \ 692 V(String, Includes) \ 693 V(String, IndexOf) \ 694 V(String, LastIndexOf) \ 695 V(String, LocaleCompare) \ 696 V(String, Match) \ 697 V(String, MatchAll) \ 698 V(String, Normalize) \ 699 V(String, PadStart) \ 700 V(String, PadEnd) \ 701 V(String, Repeat) \ 702 V(String, Replace) \ 703 V(String, ReplaceAll) \ 704 V(String, Search) \ 705 V(String, Slice) \ 706 V(String, Split) \ 707 V(String, StartsWith) \ 708 V(String, Substring) \ 709 V(String, ToLocaleLowerCase) \ 710 V(String, ToLocaleUpperCase) \ 711 V(String, ToLowerCase) \ 712 V(String, ToString) \ 713 V(String, ToUpperCase) \ 714 V(String, Trim) \ 715 V(String, TrimStart) \ 716 V(String, TrimEnd) \ 717 V(String, TrimLeft) \ 718 V(String, TrimRight) \ 719 V(String, GetStringIterator) \ 720 V(String, SubStr) \ 721 V(String, GetLength) \ 722 V(String, ThisStringValue) \ 723 V(String, Pad) \ 724 V(Symbol, Constructor) \ 725 V(Symbol, ToString) \ 726 V(Symbol, ValueOf) \ 727 V(Symbol, For) \ 728 V(Symbol, KeyFor) \ 729 V(Symbol, DescriptionGetter) \ 730 V(Symbol, ThisSymbolValue) \ 731 V(Symbol, ToPrimitive) \ 732 V(Symbol, SymbolDescriptiveString) \ 733 V(TypedArray, BaseConstructor) \ 734 V(TypedArray, Int8ArrayConstructor) \ 735 V(TypedArray, Uint8ArrayConstructor) \ 736 V(TypedArray, Uint8ClampedArrayConstructor) \ 737 V(TypedArray, Int16ArrayConstructor) \ 738 V(TypedArray, Uint16ArrayConstructor) \ 739 V(TypedArray, Int32ArrayConstructor) \ 740 V(TypedArray, Uint32ArrayConstructor) \ 741 V(TypedArray, Float32ArrayConstructor) \ 742 V(TypedArray, Float64ArrayConstructor) \ 743 V(TypedArray, BigInt64ArrayConstructor) \ 744 V(TypedArray, BigUint64ArrayConstructor) \ 745 V(TypedArray, Fill) \ 746 V(TypedArray, Find) \ 747 V(TypedArray, FindIndex) \ 748 V(TypedArray, FindLast) \ 749 V(TypedArray, FindLastIndex) \ 750 V(TypedArray, IndexOf) \ 751 V(TypedArray, LastIndexOf) \ 752 V(TypedArray, Reduce) \ 753 V(TypedArray, ReduceRight) \ 754 V(TypedArray, Reverse) \ 755 V(TypedArray, Some) \ 756 V(TypedArray, ToLocaleString) \ 757 V(TypedArray, ToString) \ 758 V(TypedArray, Includes) \ 759 V(TypedArray, From) \ 760 V(TypedArray, Of) \ 761 V(TypedArray, Species) \ 762 V(TypedArray, GetBuffer) \ 763 V(TypedArray, GetByteLength) \ 764 V(TypedArray, GetByteOffset) \ 765 V(TypedArray, CopyWithin) \ 766 V(TypedArray, Entries) \ 767 V(TypedArray, Every) \ 768 V(TypedArray, Filter) \ 769 V(TypedArray, ForEach) \ 770 V(TypedArray, Join) \ 771 V(TypedArray, Keys) \ 772 V(TypedArray, GetLength) \ 773 V(TypedArray, Map) \ 774 V(TypedArray, Set) \ 775 V(TypedArray, Slice) \ 776 V(TypedArray, Sort) \ 777 V(TypedArray, ToSorted) \ 778 V(TypedArray, Subarray) \ 779 V(TypedArray, Values) \ 780 V(TypedArray, With) \ 781 V(TypedArray, ToStringTag) \ 782 V(TypedArray, At) \ 783 V(TypedArray, ToReversed) \ 784 V(WeakMap, Constructor) \ 785 V(WeakMap, Delete) \ 786 V(WeakMap, Get) \ 787 V(WeakMap, Has) \ 788 V(WeakMap, Set) \ 789 V(WeakSet, Constructor) \ 790 V(WeakSet, Delete) \ 791 V(WeakSet, Add) \ 792 V(WeakSet, Has) \ 793 V(WeakRef, Constructor) \ 794 V(WeakRef, Deref) \ 795 V(FinalizationRegistry, Constructor) \ 796 V(FinalizationRegistry, Register) \ 797 V(FinalizationRegistry, Unregister) \ 798 V(ArrayList, Constructor) \ 799 V(ArrayList, Add) \ 800 V(ArrayList, Insert) \ 801 V(ArrayList, Clear) \ 802 V(ArrayList, Clone) \ 803 V(ArrayList, Has) \ 804 V(ArrayList, GetCapacity) \ 805 V(ArrayList, IncreaseCapacityTo) \ 806 V(ArrayList, TrimToCurrentLength) \ 807 V(ArrayList, GetIndexOf) \ 808 V(ArrayList, IsEmpty) \ 809 V(ArrayList, GetLastIndexOf) \ 810 V(ArrayList, RemoveByIndex) \ 811 V(ArrayList, Remove) \ 812 V(ArrayList, RemoveByRange) \ 813 V(ArrayList, ReplaceAllElements) \ 814 V(ArrayList, Sort) \ 815 V(ArrayList, SubArrayList) \ 816 V(ArrayList, ConvertToArray) \ 817 V(ArrayList, ForEach) \ 818 V(ArrayList, GetIteratorObj) \ 819 V(ArrayList, Get) \ 820 V(ArrayList, Set) \ 821 V(ArrayList, GetSize) \ 822 V(ListFormat, Constructor) \ 823 V(ListFormat, SupportedLocalesOf) \ 824 V(ListFormat, Format) \ 825 V(ListFormat, FormatToParts) \ 826 V(ListFormat, ResolvedOptions) \ 827 V(LightWeightMap, Constructor) \ 828 V(LightWeightMap, HasAll) \ 829 V(LightWeightMap, HasKey) \ 830 V(LightWeightMap, HasValue) \ 831 V(LightWeightMap, IncreaseCapacityTo) \ 832 V(LightWeightMap, Entries) \ 833 V(LightWeightMap, Get) \ 834 V(LightWeightMap, GetIndexOfKey) \ 835 V(LightWeightMap, GetIndexOfValue) \ 836 V(LightWeightMap, IsEmpty) \ 837 V(LightWeightMap, GetKeyAt) \ 838 V(LightWeightMap, Keys) \ 839 V(LightWeightMap, SetAll) \ 840 V(LightWeightMap, Set) \ 841 V(LightWeightMap, Remove) \ 842 V(LightWeightMap, RemoveAt) \ 843 V(LightWeightMap, Clear) \ 844 V(LightWeightMap, SetValueAt) \ 845 V(LightWeightMap, ForEach) \ 846 V(LightWeightMap, ToString) \ 847 V(LightWeightMap, GetValueAt) \ 848 V(LightWeightMap, Length) \ 849 V(LightWeightSet, Constructor) \ 850 V(LightWeightSet, Add) \ 851 V(LightWeightSet, AddAll) \ 852 V(LightWeightSet, IsEmpty) \ 853 V(LightWeightSet, GetValueAt) \ 854 V(LightWeightSet, HasAll) \ 855 V(LightWeightSet, Has) \ 856 V(LightWeightSet, HasHash) \ 857 V(LightWeightSet, Equal) \ 858 V(LightWeightSet, IncreaseCapacityTo) \ 859 V(LightWeightSet, GetIteratorObj) \ 860 V(LightWeightSet, Values) \ 861 V(LightWeightSet, Entries) \ 862 V(LightWeightSet, ForEach) \ 863 V(LightWeightSet, GetIndexOf) \ 864 V(LightWeightSet, Remove) \ 865 V(LightWeightSet, RemoveAt) \ 866 V(LightWeightSet, Clear) \ 867 V(LightWeightSet, ToString) \ 868 V(LightWeightSet, ToArray) \ 869 V(LightWeightSet, GetSize) \ 870 V(PlainArray, Constructor) \ 871 V(PlainArray, Add) \ 872 V(PlainArray, Clear) \ 873 V(PlainArray, Clone) \ 874 V(PlainArray, Has) \ 875 V(PlainArray, Get) \ 876 V(PlainArray, GetIteratorObj) \ 877 V(PlainArray, ForEach) \ 878 V(PlainArray, ToString) \ 879 V(PlainArray, GetIndexOfKey) \ 880 V(PlainArray, GetIndexOfValue) \ 881 V(PlainArray, IsEmpty) \ 882 V(PlainArray, GetKeyAt) \ 883 V(PlainArray, Remove) \ 884 V(PlainArray, RemoveAt) \ 885 V(PlainArray, RemoveRangeFrom) \ 886 V(PlainArray, SetValueAt) \ 887 V(PlainArray, GetValueAt) \ 888 V(PlainArray, GetSize) \ 889 V(HashMap, Constructor) \ 890 V(HashMap, HasKey) \ 891 V(HashMap, HasValue) \ 892 V(HashMap, Replace) \ 893 V(HashMap, Keys) \ 894 V(HashMap, Values) \ 895 V(HashMap, Entries) \ 896 V(HashMap, ForEach) \ 897 V(HashMap, Set) \ 898 V(HashMap, SetAll) \ 899 V(HashMap, Remove) \ 900 V(HashMap, Get) \ 901 V(HashMap, Clear) \ 902 V(HashMap, GetLength) \ 903 V(HashMap, IsEmpty) \ 904 V(HashSet, Constructor) \ 905 V(HashSet, IsEmpty) \ 906 V(HashSet, Has) \ 907 V(HashSet, Add) \ 908 V(HashSet, Remove) \ 909 V(HashSet, Clear) \ 910 V(HashSet, GetLength) \ 911 V(HashSet, Values) \ 912 V(HashSet, Entries) \ 913 V(HashSet, ForEach) \ 914 V(TreeMap, Constructor) \ 915 V(TreeMap, HasKey) \ 916 V(TreeMap, HasValue) \ 917 V(TreeMap, GetFirstKey) \ 918 V(TreeMap, GetLastKey) \ 919 V(TreeMap, Set) \ 920 V(TreeMap, Get) \ 921 V(TreeMap, SetAll) \ 922 V(TreeMap, Remove) \ 923 V(TreeMap, Clear) \ 924 V(TreeMap, GetLowerKey) \ 925 V(TreeMap, GetHigherKey) \ 926 V(TreeMap, Replace) \ 927 V(TreeMap, IsEmpty) \ 928 V(TreeMap, GetLength) \ 929 V(TreeMap, Keys) \ 930 V(TreeMap, Values) \ 931 V(TreeMap, Entries) \ 932 V(TreeMap, ForEach) \ 933 V(TreeSet, Constructor) \ 934 V(TreeSet, Add) \ 935 V(TreeSet, Remove) \ 936 V(TreeSet, Clear) \ 937 V(TreeSet, Has) \ 938 V(TreeSet, GetFirstValue) \ 939 V(TreeSet, GetLastValue) \ 940 V(TreeSet, GetLowerValue) \ 941 V(TreeSet, GetHigherValue) \ 942 V(TreeSet, PopFirst) \ 943 V(TreeSet, PopLast) \ 944 V(TreeSet, IsEmpty) \ 945 V(TreeSet, GetLength) \ 946 V(TreeSet, Values) \ 947 V(TreeSet, ForEach) \ 948 V(TreeSet, Entries) \ 949 V(Deque, Constructor) \ 950 V(Deque, InsertFront) \ 951 V(Deque, InsertEnd) \ 952 V(Deque, GetFirst) \ 953 V(Deque, GetLast) \ 954 V(Deque, GetFront) \ 955 V(Deque, GetTail) \ 956 V(Deque, Has) \ 957 V(Deque, PopFirst) \ 958 V(Deque, PopLast) \ 959 V(Deque, ForEach) \ 960 V(Deque, GetIteratorObj) \ 961 V(Deque, GetSize) \ 962 V(Stack, Constructor) \ 963 V(Stack, Iterator) \ 964 V(Stack, IsEmpty) \ 965 V(Stack, Push) \ 966 V(Stack, Peek) \ 967 V(Stack, Pop) \ 968 V(Stack, Locate) \ 969 V(Stack, ForEach) \ 970 V(Stack, GetLength) \ 971 V(Vector, Constructor) \ 972 V(Vector, Add) \ 973 V(Vector, Insert) \ 974 V(Vector, SetLength) \ 975 V(Vector, GetCapacity) \ 976 V(Vector, IncreaseCapacityTo) \ 977 V(Vector, Get) \ 978 V(Vector, GetIndexOf) \ 979 V(Vector, GetIndexFrom) \ 980 V(Vector, IsEmpty) \ 981 V(Vector, GetLastElement) \ 982 V(Vector, GetLastIndexOf) \ 983 V(Vector, GetLastIndexFrom) \ 984 V(Vector, Remove) \ 985 V(Vector, RemoveByIndex) \ 986 V(Vector, RemoveByRange) \ 987 V(Vector, Set) \ 988 V(Vector, SubVector) \ 989 V(Vector, ToString) \ 990 V(Vector, GetSize) \ 991 V(Vector, ForEach) \ 992 V(Vector, ReplaceAllElements) \ 993 V(Vector, Has) \ 994 V(Vector, Sort) \ 995 V(Vector, Clear) \ 996 V(Vector, Clone) \ 997 V(Vector, CopyToArray) \ 998 V(Vector, ConvertToArray) \ 999 V(Vector, GetFirstElement) \ 1000 V(Vector, TrimToCurrentLength) \ 1001 V(Vector, GetIteratorObj) \ 1002 V(Queue, Constructor) \ 1003 V(Queue, Add) \ 1004 V(Queue, GetFirst) \ 1005 V(Queue, Pop) \ 1006 V(Queue, ForEach) \ 1007 V(Queue, GetIteratorObj) \ 1008 V(Queue, GetSize) \ 1009 V(List, Constructor) \ 1010 V(List, Add) \ 1011 V(List, GetFirst) \ 1012 V(List, GetLast) \ 1013 V(List, Insert) \ 1014 V(List, Clear) \ 1015 V(List, RemoveByIndex) \ 1016 V(List, Remove) \ 1017 V(List, Has) \ 1018 V(List, IsEmpty) \ 1019 V(List, Get) \ 1020 V(List, GetIndexOf) \ 1021 V(List, GetLastIndexOf) \ 1022 V(List, Set) \ 1023 V(List, ForEach) \ 1024 V(List, ReplaceAllElements) \ 1025 V(List, GetIteratorObj) \ 1026 V(List, Equal) \ 1027 V(List, Sort) \ 1028 V(List, ConvertToArray) \ 1029 V(List, GetSubList) \ 1030 V(List, Length) \ 1031 V(LinkedList, Constructor) \ 1032 V(LinkedList, Length) \ 1033 V(LinkedList, Add) \ 1034 V(LinkedList, GetFirst) \ 1035 V(LinkedList, GetLast) \ 1036 V(LinkedList, Insert) \ 1037 V(LinkedList, AddFirst) \ 1038 V(LinkedList, Clear) \ 1039 V(LinkedList, Clone) \ 1040 V(LinkedList, Has) \ 1041 V(LinkedList, Get) \ 1042 V(LinkedList, GetIndexOf) \ 1043 V(LinkedList, GetLastIndexOf) \ 1044 V(LinkedList, RemoveByIndex) \ 1045 V(LinkedList, Remove) \ 1046 V(LinkedList, RemoveFirst) \ 1047 V(LinkedList, RemoveLast) \ 1048 V(LinkedList, RemoveFirstFound) \ 1049 V(LinkedList, RemoveLastFound) \ 1050 V(LinkedList, Set) \ 1051 V(LinkedList, ConvertToArray) \ 1052 V(LinkedList, ForEach) \ 1053 V(LinkedList, GetIteratorObj) 1054 1055 #define ABSTRACT_OPERATION_LIST(V) \ 1056 V(JSTaggedValue, ToString) \ 1057 1058 #define MEM_ALLOCATE_AND_GC_LIST(V) \ 1059 V(FullGC_RunPhases) \ 1060 V(PartialGC_RunPhases) \ 1061 V(STWYoungGC_RunPhases) \ 1062 V(ConcurrentMarking) \ 1063 V(ConcurrentMarkingInitialize) \ 1064 V(IncrementalMarking) \ 1065 V(IncrementalMarkingInitialize) \ 1066 V(WaitConcurrentMarkingFinished) \ 1067 V(ReMarking) \ 1068 V(ConcurrentSweepingInitialize) \ 1069 V(ConcurrentSweepingWait) \ 1070 V(ParallelEvacuationInitialize) \ 1071 V(ParallelEvacuation) \ 1072 V(ParallelUpdateReference) \ 1073 V(WaitUpdateFinished) \ 1074 V(UpdateRoot) \ 1075 V(UpdateWeakReference) \ 1076 V(ParallelEvacuator) \ 1077 V(ParallelEvacuatorInitialize) \ 1078 V(ParallelEvacuatorFinalize) \ 1079 V(HugeSpaceExpand) \ 1080 V(NonMovableSpaceExpand) \ 1081 V(HeapPrepare) \ 1082 1083 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 1084 #define INTERPRETER_CALLER_ID(name) INTERPRETER_ID_##name, 1085 #define RUNTIME_CALLER_ID(name) RUNTIME_ID_##name, 1086 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 1087 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 1088 #define BUILTINS_API_ID(class, name) BUILTINS_ID_##class##_##name, 1089 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 1090 #define ABSTRACT_OPERATION_ID(class, name) ABSTRACT_ID_##class##_##name, 1091 1092 #define MEM_ALLOCATE_AND_GC_ID(name) MEM_ID##name, 1093 1094 enum EcmaRuntimeCallerId { 1095 INTERPRETER_CALLER_LIST(INTERPRETER_CALLER_ID) BUILTINS_API_LIST(BUILTINS_API_ID) 1096 ABSTRACT_OPERATION_LIST(ABSTRACT_OPERATION_ID) 1097 MEM_ALLOCATE_AND_GC_LIST(MEM_ALLOCATE_AND_GC_ID) 1098 #define DEF_RUNTIME_ID(name) RUNTIME_ID_##name, 1099 RUNTIME_STUB_WITH_GC_LIST(DEF_RUNTIME_ID) 1100 #undef DEF_RUNTIME_ID 1101 RUNTIME_CALLER_NUMBER, 1102 }; 1103 1104 #if ECMASCRIPT_ENABLE_INTERPRETER_RUNTIME_STAT 1105 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 1106 #define INTERPRETER_TRACE(thread, name) \ 1107 [[maybe_unused]] JSThread *_js_thread_ = thread; \ 1108 [[maybe_unused]] EcmaRuntimeStat *_run_stat_ = _js_thread_->GetCurrentEcmaContext()->GetRuntimeStat(); \ 1109 RuntimeTimerScope interpret_##name##_scope_(INTERPRETER_CALLER_ID(name) _run_stat_) 1110 #if defined(ECMASCRIPT_SUPPORT_CPUPROFILER) 1111 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 1112 #define RUNTIME_TRACE(thread, name) \ 1113 [[maybe_unused]] JSThread *_js_thread_ = thread; \ 1114 [[maybe_unused]] EcmaRuntimeStat *_run_stat_ = _js_thread_->GetCurrentEcmaContext()->GetRuntimeStat(); \ 1115 RuntimeTimerScope interpret_##name##_scope_(RUNTIME_CALLER_ID(name) _run_stat_); \ 1116 [[maybe_unused]] RuntimeStateScope _runtime_state_##name##_scope_(_js_thread_) 1117 #else 1118 #define RUNTIME_TRACE(thread, name) \ 1119 [[maybe_unused]] JSThread *_js_thread_ = thread; \ 1120 [[maybe_unused]] EcmaRuntimeStat *_run_stat_ = _js_thread_->GetCurrentEcmaContext()->GetRuntimeStat(); \ 1121 RuntimeTimerScope interpret_##name##_scope_(RUNTIME_CALLER_ID(name) _run_stat_); 1122 #endif 1123 #else 1124 #define INTERPRETER_TRACE(thread, name) static_cast<void>(0) // NOLINT(cppcoreguidelines-macro-usage) 1125 #if defined(ECMASCRIPT_SUPPORT_CPUPROFILER) 1126 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 1127 #define RUNTIME_TRACE(thread, name) \ 1128 [[maybe_unused]] JSThread *_js_thread_ = thread; \ 1129 [[maybe_unused]] RuntimeStateScope _runtime_state_##name##_scope_(_js_thread_) 1130 #else 1131 #define RUNTIME_TRACE(thread, name) static_cast<void>(0) // NOLINT(cppcoreguidelines-macro-usage) 1132 #endif // defined(ECMASCRIPT_SUPPORT_CPUPROFILER) 1133 #endif // ECMASCRIPT_ENABLE_INTERPRETER_RUNTIME_STAT 1134 1135 #if ECMASCRIPT_ENABLE_BUILTINS_RUNTIME_STAT 1136 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 1137 #define BUILTINS_API_TRACE(thread, class, name) \ 1138 [[maybe_unused]] JSThread *_js_thread_ = thread; \ 1139 [[maybe_unused]] EcmaRuntimeStat *_run_stat_ = _js_thread_->GetCurrentEcmaContext()->GetRuntimeStat(); \ 1140 RuntimeTimerScope builtins_##class##name##_scope_(BUILTINS_API_ID(class, name) _run_stat_) 1141 1142 // NOLINTNEXTLINE(cppcoreguidelines-macro-usage) 1143 #define ABSTRACT_OPERATION_TRACE(thread, class, name) \ 1144 [[maybe_unused]] JSThread *_js_thread_ = thread; \ 1145 [[maybe_unused]] EcmaRuntimeStat *_run_stat_ = _js_thread_->GetCurrentEcmaContext()->GetRuntimeStat(); \ 1146 RuntimeTimerScope abstract_##class##name##_scope_(ABSTRACT_OPERATION_ID(class, name) _run_stat_) 1147 #else 1148 #define BUILTINS_API_TRACE(thread, class, name) static_cast<void>(0) // NOLINT(cppcoreguidelines-macro-usage) 1149 #define ABSTRACT_OPERATION_TRACE(class, name) static_cast<void>(0) // NOLINT(cppcoreguidelines-macro-usage) 1150 #endif // ECMASCRIPT_ENABLE_BUILTINS_RUNTIME_STAT 1151 1152 #if ECMASCRIPT_ENABLE_ALLOCATE_AND_GC_RUNTIME_STAT 1153 #define MEM_ALLOCATE_AND_GC_TRACE(vm, name) \ 1154 CHECK_JS_THREAD(vm); \ 1155 EcmaRuntimeStat *_run_stat_ = vm->GetJSThread()->GetCurrentEcmaContext()->GetRuntimeStat(); \ 1156 RuntimeTimerScope mem_##name##_scope_(MEM_ALLOCATE_AND_GC_ID(name) _run_stat_) 1157 #else 1158 #define MEM_ALLOCATE_AND_GC_TRACE(vm, name) static_cast<void>(0) // NOLINT(cppcoreguidelines-macro-usage) 1159 #endif // ECMASCRIPT_ENABLE_ALLOCATE_AND_GC_RUNTIME_STAT 1160 } // namespace panda::ecmascript 1161 #endif 1162