1 /* 2 * Copyright (c) 2021 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_STUBS_H 17 #define ECMASCRIPT_RUNTIME_STUBS_H 18 19 #include "ecmascript/compiler/call_signature.h" 20 #include "ecmascript/frames.h" 21 #include "ecmascript/stubs/test_runtime_stubs.h" 22 #include "ecmascript/ecma_macros.h" 23 #include "ecmascript/js_tagged_value.h" 24 #include "ecmascript/jspandafile/class_literal.h" 25 #include "ecmascript/method.h" 26 #include "ecmascript/mem/region.h" 27 28 namespace panda::ecmascript { 29 using kungfu::CallSignature; 30 class EcmaVM; 31 class GlobalEnv; 32 class JSThread; 33 class JSFunction; 34 class ObjectFactory; 35 class JSBoundFunction; 36 class JSProxy; 37 38 class GeneratorContext; 39 struct EcmaRuntimeCallInfo; 40 41 using JSFunctionEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, const JSTaggedType argV[], 42 uintptr_t prevFp, bool needPushUndefined); 43 using FastCallAotEntryType = JSTaggedValue (*)(uintptr_t glue, uint32_t argc, const JSTaggedType argV[], 44 uintptr_t prevFp); 45 46 #define RUNTIME_ASM_STUB_LIST(V) \ 47 JS_CALL_TRAMPOLINE_LIST(V) \ 48 FAST_CALL_TRAMPOLINE_LIST(V) \ 49 ASM_INTERPRETER_TRAMPOLINE_LIST(V) 50 51 #define ASM_INTERPRETER_TRAMPOLINE_LIST(V) \ 52 V(AsmInterpreterEntry) \ 53 V(GeneratorReEnterAsmInterp) \ 54 V(PushCallArgsAndDispatchNative) \ 55 V(PushCallArg0AndDispatch) \ 56 V(PushCallArg1AndDispatch) \ 57 V(PushCallArgs2AndDispatch) \ 58 V(PushCallArgs3AndDispatch) \ 59 V(PushCallThisArg0AndDispatch) \ 60 V(PushCallThisArg1AndDispatch) \ 61 V(PushCallThisArgs2AndDispatch) \ 62 V(PushCallThisArgs3AndDispatch) \ 63 V(PushCallRangeAndDispatch) \ 64 V(PushCallNewAndDispatch) \ 65 V(PushSuperCallAndDispatch) \ 66 V(PushCallNewAndDispatchNative) \ 67 V(PushNewTargetAndDispatchNative) \ 68 V(PushCallRangeAndDispatchNative) \ 69 V(PushCallThisRangeAndDispatch) \ 70 V(ResumeRspAndDispatch) \ 71 V(ResumeRspAndReturn) \ 72 V(ResumeCaughtFrameAndDispatch) \ 73 V(ResumeUncaughtFrameAndReturn) \ 74 V(ResumeRspAndRollback) \ 75 V(CallSetter) \ 76 V(CallGetter) \ 77 V(CallContainersArgs3) \ 78 V(CallReturnWithArgv) 79 80 #define JS_CALL_TRAMPOLINE_LIST(V) \ 81 V(CallRuntime) \ 82 V(CallRuntimeWithArgv) \ 83 V(JSFunctionEntry) \ 84 V(JSCall) \ 85 V(JSCallWithArgV) \ 86 V(JSCallWithArgVAndPushUndefined) \ 87 V(JSProxyCallInternalWithArgV) \ 88 V(OptimizedCallAndPushUndefined) \ 89 V(DeoptHandlerAsm) \ 90 V(JSCallNew) \ 91 V(CallOptimized) 92 93 #define FAST_CALL_TRAMPOLINE_LIST(V) \ 94 V(OptimizedFastCallEntry) \ 95 V(OptimizedFastCallAndPushUndefined) \ 96 V(JSFastCallWithArgV) \ 97 V(JSFastCallWithArgVAndPushUndefined) 98 99 100 #define RUNTIME_STUB_WITHOUT_GC_LIST(V) \ 101 V(Dump) \ 102 V(DebugDump) \ 103 V(DumpWithHint) \ 104 V(DebugDumpWithHint) \ 105 V(DebugPrint) \ 106 V(DebugPrintCustom) \ 107 V(DebugPrintInstruction) \ 108 V(Comment) \ 109 V(FatalPrint) \ 110 V(FatalPrintCustom) \ 111 V(GetActualArgvNoGC) \ 112 V(InsertOldToNewRSet) \ 113 V(MarkingBarrier) \ 114 V(StoreBarrier) \ 115 V(DoubleToInt) \ 116 V(DoubleToLength) \ 117 V(FloatMod) \ 118 V(FloatSqrt) \ 119 V(FloatCos) \ 120 V(FloatSin) \ 121 V(FloatACos) \ 122 V(FloatATan) \ 123 V(FloatFloor) \ 124 V(FindElementWithCache) \ 125 V(TryToElementsIndexOrFindInStringTable) \ 126 V(TryGetInternString) \ 127 V(CreateArrayFromList) \ 128 V(StringsAreEquals) \ 129 V(BigIntEquals) \ 130 V(TimeClip) \ 131 V(SetDateValues) \ 132 V(StartCallTimer) \ 133 V(EndCallTimer) \ 134 V(BigIntSameValueZero) \ 135 V(JSHClassFindProtoTransitions) \ 136 V(NumberHelperStringToDouble) \ 137 V(GetStringToListCacheArray) \ 138 V(FastArraySort) \ 139 V(LocaleCompareNoGc) \ 140 V(StringGetStart) \ 141 V(StringGetEnd) \ 142 V(ArrayTrim) 143 144 #define RUNTIME_STUB_WITH_GC_LIST(V) \ 145 V(AddElementInternal) \ 146 V(AllocateInYoung) \ 147 V(CallInternalGetter) \ 148 V(CallInternalSetter) \ 149 V(CallGetPrototype) \ 150 V(RegularJSObjDeletePrototype) \ 151 V(CallJSObjDeletePrototype) \ 152 V(ToPropertyKey) \ 153 V(NewJSPrimitiveRef) \ 154 V(ThrowTypeError) \ 155 V(GetHash32) \ 156 V(ComputeHashcode) \ 157 V(GetTaggedArrayPtrTest) \ 158 V(NewInternalString) \ 159 V(NewTaggedArray) \ 160 V(CopyArray) \ 161 V(IntToString) \ 162 V(RTSubstitution) \ 163 V(NameDictPutIfAbsent) \ 164 V(NameDictionaryGetAllEnumKeys) \ 165 V(NumberDictionaryGetAllEnumKeys) \ 166 V(PropertiesSetValue) \ 167 V(TaggedArraySetValue) \ 168 V(JSArrayReduceUnStable) \ 169 V(JSArrayFilterUnStable) \ 170 V(CheckAndCopyArray) \ 171 V(NewEcmaHClass) \ 172 V(UpdateLayOutAndAddTransition) \ 173 V(CopyAndUpdateObjLayout) \ 174 V(UpdateHClassForElementsKind) \ 175 V(SetValueWithElementsKind) \ 176 V(MigrateArrayWithKind) \ 177 V(GetTaggedValueWithElementsKind) \ 178 V(TryRestoreElementsKind) \ 179 V(NewMutantTaggedArray) \ 180 V(RuntimeDump) \ 181 V(NoticeThroughChainAndRefreshUser) \ 182 V(JumpToCInterpreter) \ 183 V(StGlobalRecord) \ 184 V(SetFunctionNameNoPrefix) \ 185 V(StOwnByValueWithNameSet) \ 186 V(StOwnByName) \ 187 V(StOwnByNameWithNameSet) \ 188 V(SuspendGenerator) \ 189 V(UpFrame) \ 190 V(Neg) \ 191 V(Not) \ 192 V(Inc) \ 193 V(Dec) \ 194 V(Shl2) \ 195 V(Shr2) \ 196 V(Ashr2) \ 197 V(Or2) \ 198 V(Xor2) \ 199 V(And2) \ 200 V(Exp) \ 201 V(IsIn) \ 202 V(InstanceOf) \ 203 V(CreateGeneratorObj) \ 204 V(ThrowConstAssignment) \ 205 V(GetTemplateObject) \ 206 V(CreateStringIterator) \ 207 V(NewJSArrayIterator) \ 208 V(NewJSTypedArrayIterator) \ 209 V(MapIteratorNext) \ 210 V(SetIteratorNext) \ 211 V(StringIteratorNext) \ 212 V(ArrayIteratorNext) \ 213 V(GetNextPropName) \ 214 V(GetNextPropNameSlowpath) \ 215 V(ThrowIfNotObject) \ 216 V(IterNext) \ 217 V(CloseIterator) \ 218 V(SuperCallSpread) \ 219 V(OptSuperCallSpread) \ 220 V(GetCallSpreadArgs) \ 221 V(DelObjProp) \ 222 V(NewObjApply) \ 223 V(CreateIterResultObj) \ 224 V(AsyncFunctionAwaitUncaught) \ 225 V(AsyncFunctionResolveOrReject) \ 226 V(ThrowUndefinedIfHole) \ 227 V(CopyDataProperties) \ 228 V(StArraySpread) \ 229 V(GetIteratorNext) \ 230 V(SetObjectWithProto) \ 231 V(LoadICByValue) \ 232 V(StoreICByValue) \ 233 V(StoreOwnICByValue) \ 234 V(StOwnByValue) \ 235 V(LdSuperByValue) \ 236 V(StSuperByValue) \ 237 V(LdObjByIndex) \ 238 V(StObjByIndex) \ 239 V(StOwnByIndex) \ 240 V(CreateClassWithBuffer) \ 241 V(CreateSharedClass) \ 242 V(LdSendableClass) \ 243 V(SetClassConstructorLength) \ 244 V(LoadICByName) \ 245 V(StoreICByName) \ 246 V(UpdateHotnessCounter) \ 247 V(CheckSafePoint) \ 248 V(PGODump) \ 249 V(PGOPreDump) \ 250 V(JitCompile) \ 251 V(UpdateHotnessCounterWithProf) \ 252 V(GetModuleNamespaceByIndex) \ 253 V(GetModuleNamespaceByIndexOnJSFunc) \ 254 V(GetModuleNamespace) \ 255 V(StModuleVarByIndex) \ 256 V(StModuleVarByIndexOnJSFunc) \ 257 V(StModuleVar) \ 258 V(LdLocalModuleVarByIndex) \ 259 V(LdExternalModuleVarByIndex) \ 260 V(LdLocalModuleVarByIndexOnJSFunc) \ 261 V(LdExternalModuleVarByIndexOnJSFunc) \ 262 V(LdModuleVar) \ 263 V(Throw) \ 264 V(GetPropIterator) \ 265 V(GetPropIteratorSlowpath) \ 266 V(PrimitiveStringCreate) \ 267 V(AsyncFunctionEnter) \ 268 V(GetIterator) \ 269 V(GetAsyncIterator) \ 270 V(SetGeneratorState) \ 271 V(ThrowThrowNotExists) \ 272 V(ThrowPatternNonCoercible) \ 273 V(ThrowDeleteSuperProperty) \ 274 V(Eq) \ 275 V(TryLdGlobalICByName) \ 276 V(LoadMiss) \ 277 V(StoreMiss) \ 278 V(TryUpdateGlobalRecord) \ 279 V(ThrowReferenceError) \ 280 V(StGlobalVar) \ 281 V(LdGlobalICVar) \ 282 V(ToNumber) \ 283 V(ToBoolean) \ 284 V(NotEq) \ 285 V(Less) \ 286 V(LessEq) \ 287 V(Greater) \ 288 V(GreaterEq) \ 289 V(Add2) \ 290 V(Sub2) \ 291 V(Mul2) \ 292 V(Div2) \ 293 V(Mod2) \ 294 V(CreateEmptyObject) \ 295 V(CreateEmptyArray) \ 296 V(GetSymbolFunction) \ 297 V(GetUnmapedArgs) \ 298 V(CopyRestArgs) \ 299 V(CreateArrayWithBuffer) \ 300 V(CreateObjectWithBuffer) \ 301 V(NewThisObject) \ 302 V(NewObjRange) \ 303 V(DefineFunc) \ 304 V(CreateRegExpWithLiteral) \ 305 V(ThrowIfSuperNotCorrectCall) \ 306 V(CreateObjectHavingMethod) \ 307 V(CreateObjectWithExcludedKeys) \ 308 V(DefineMethod) \ 309 V(ThrowSetterIsUndefinedException) \ 310 V(ThrowNotCallableException) \ 311 V(ThrowCallConstructorException) \ 312 V(ThrowNonConstructorException) \ 313 V(ThrowStackOverflowException) \ 314 V(ThrowDerivedMustReturnException) \ 315 V(CallSpread) \ 316 V(DefineGetterSetterByValue) \ 317 V(SuperCall) \ 318 V(OptSuperCall) \ 319 V(LdBigInt) \ 320 V(ToNumeric) \ 321 V(ToNumericConvertBigInt) \ 322 V(DynamicImport) \ 323 V(CreateAsyncGeneratorObj) \ 324 V(AsyncGeneratorResolve) \ 325 V(AsyncGeneratorReject) \ 326 V(NewLexicalEnvWithName) \ 327 V(OptGetUnmapedArgs) \ 328 V(OptCopyRestArgs) \ 329 V(NotifyBytecodePcChanged) \ 330 V(NotifyDebuggerStatement) \ 331 V(MethodEntry) \ 332 V(MethodExit) \ 333 V(OptNewLexicalEnvWithName) \ 334 V(OptSuspendGenerator) \ 335 V(OptAsyncGeneratorResolve) \ 336 V(OptCreateObjectWithExcludedKeys) \ 337 V(OptNewObjRange) \ 338 V(GetTypeArrayPropertyByIndex) \ 339 V(SetTypeArrayPropertyByIndex) \ 340 V(FastCopyElementToArray) \ 341 V(GetPropertyByName) \ 342 V(JSObjectGetMethod) \ 343 V(DebugAOTPrint) \ 344 V(ProfileOptimizedCode) \ 345 V(ProfileTypedOp) \ 346 V(VerifyVTableLoading) \ 347 V(VerifyVTableStoring) \ 348 V(GetMethodFromCache) \ 349 V(GetArrayLiteralFromCache) \ 350 V(GetObjectLiteralFromCache) \ 351 V(GetStringFromCache) \ 352 V(OptLdSuperByValue) \ 353 V(OptStSuperByValue) \ 354 V(BigIntEqual) \ 355 V(StringEqual) \ 356 V(LdPatchVar) \ 357 V(StPatchVar) \ 358 V(DeoptHandler) \ 359 V(ContainerRBTreeForEach) \ 360 V(InsertStringToTable) \ 361 V(SlowFlattenString) \ 362 V(NotifyConcurrentResult) \ 363 V(DefineField) \ 364 V(CreatePrivateProperty) \ 365 V(DefinePrivateProperty) \ 366 V(LdPrivateProperty) \ 367 V(StPrivateProperty) \ 368 V(TestIn) \ 369 V(UpdateAOTHClass) \ 370 V(AotInlineTrace) \ 371 V(LocaleCompare) \ 372 V(ArraySort) \ 373 V(FastStringify) \ 374 V(ObjectSlowAssign) \ 375 V(GetLinkedHash) \ 376 V(LinkedHashMapComputeCapacity) \ 377 V(LinkedHashSetComputeCapacity) \ 378 V(JSObjectGrowElementsCapacity) \ 379 V(HClassCloneWithAddProto) \ 380 V(LocaleCompareWithGc) \ 381 V(ArrayForEachContinue) \ 382 V(NumberDictionaryPut) \ 383 V(ThrowRangeError) \ 384 V(InitializeGeneratorFunction) \ 385 V(FunctionDefineOwnProperty) \ 386 V(AOTEnableProtoChangeMarker) \ 387 V(HasProperty) \ 388 V(DumpObject) 389 390 #define RUNTIME_STUB_LIST(V) \ 391 RUNTIME_ASM_STUB_LIST(V) \ 392 RUNTIME_STUB_WITHOUT_GC_LIST(V) \ 393 RUNTIME_STUB_WITH_GC_LIST(V) \ 394 TEST_RUNTIME_STUB_GC_LIST(V) 395 396 class RuntimeStubs { 397 public: 398 static void Initialize(JSThread *thread); 399 400 #define DECLARE_RUNTIME_STUBS(name) \ 401 static JSTaggedType name(uintptr_t argGlue, uint32_t argc, uintptr_t argv); 402 RUNTIME_STUB_WITH_GC_LIST(DECLARE_RUNTIME_STUBS) TEST_RUNTIME_STUB_GC_LIST(DECLARE_RUNTIME_STUBS)403 TEST_RUNTIME_STUB_GC_LIST(DECLARE_RUNTIME_STUBS) 404 #undef DECLARE_RUNTIME_STUBS 405 406 inline static JSTaggedType GetTArg(uintptr_t argv, [[maybe_unused]] uint32_t argc, uint32_t index) 407 { 408 ASSERT(index < argc); 409 return *(reinterpret_cast<JSTaggedType *>(argv) + (index)); 410 } 411 GetArg(uintptr_t argv,uint32_t argc,uint32_t index)412 inline static JSTaggedValue GetArg(uintptr_t argv, [[maybe_unused]] uint32_t argc, uint32_t index) 413 { 414 ASSERT(index < argc); 415 return JSTaggedValue(*(reinterpret_cast<JSTaggedType *>(argv) + (index))); 416 } 417 418 template<typename T> GetHArg(uintptr_t argv,uint32_t argc,uint32_t index)419 inline static JSHandle<T> GetHArg(uintptr_t argv, [[maybe_unused]] uint32_t argc, uint32_t index) 420 { 421 ASSERT(index < argc); 422 return JSHandle<T>(&(reinterpret_cast<JSTaggedType *>(argv)[index])); 423 } 424 425 template<typename T> GetPtrArg(uintptr_t argv,uint32_t argc,uint32_t index)426 inline static T *GetPtrArg(uintptr_t argv, [[maybe_unused]] uint32_t argc, uint32_t index) 427 { 428 ASSERT(index < argc); 429 return reinterpret_cast<T*>(*(reinterpret_cast<JSTaggedType *>(argv) + (index))); 430 } 431 432 static void Dump(JSTaggedType value); 433 static void DebugDump(JSTaggedType value); 434 static void DumpWithHint(uintptr_t hintStrAddress, JSTaggedType value); 435 static void DebugDumpWithHint(uintptr_t hintStrAddress, JSTaggedType value); 436 static void DebugPrint(int fmtMessageId, ...); 437 static void DebugPrintCustom(uintptr_t fmt, ...); 438 static void DebugPrintInstruction([[maybe_unused]] uintptr_t argGlue, const uint8_t *pc); 439 static void Comment(uintptr_t argStr); 440 static void FatalPrint(int fmtMessageId, ...); 441 static void FatalPrintCustom(uintptr_t fmt, ...); 442 static void MarkingBarrier([[maybe_unused]] uintptr_t argGlue, 443 uintptr_t object, size_t offset, TaggedObject *value); 444 static void StoreBarrier([[maybe_unused]] uintptr_t argGlue, 445 uintptr_t object, size_t offset, TaggedObject *value); 446 static JSTaggedType TryToElementsIndexOrFindInStringTable(uintptr_t argGlue, JSTaggedType ecmaString); 447 static JSTaggedType TryGetInternString(uintptr_t argGlue, JSTaggedType ecmaString); 448 static JSTaggedType CreateArrayFromList([[maybe_unused]] uintptr_t argGlue, int32_t argc, JSTaggedValue *argvPtr); 449 static JSTaggedType GetActualArgvNoGC(uintptr_t argGlue); 450 static void InsertOldToNewRSet([[maybe_unused]] uintptr_t argGlue, uintptr_t object, size_t offset); 451 static int32_t DoubleToInt(double x, size_t bits); 452 static JSTaggedType DoubleToLength(double x); 453 static double FloatMod(double x, double y); 454 static JSTaggedType FloatSqrt(double x); 455 static JSTaggedType FloatCos(double x); 456 static JSTaggedType FloatSin(double x); 457 static JSTaggedType FloatACos(double x); 458 static JSTaggedType FloatATan(double x); 459 static JSTaggedType FloatFloor(double x); 460 static int32_t FindElementWithCache(uintptr_t argGlue, JSTaggedType hclass, 461 JSTaggedType key, int32_t num); 462 static bool StringsAreEquals(EcmaString *str1, EcmaString *str2); 463 static bool BigIntEquals(JSTaggedType left, JSTaggedType right); 464 static bool BigIntSameValueZero(JSTaggedType key, JSTaggedType other); 465 static JSTaggedValue JSHClassFindProtoTransitions(JSHClass *cls, JSTaggedValue key, JSTaggedValue proto); 466 static JSTaggedValue NumberHelperStringToDouble(EcmaString *str); 467 static JSTaggedValue GetStringToListCacheArray(uintptr_t argGlue); 468 static int FastArraySort(JSTaggedType x, JSTaggedType y); 469 static JSTaggedValue LocaleCompareNoGc(uintptr_t argGlue, JSTaggedType locales, EcmaString *thisHandle, 470 EcmaString *thatHandle); 471 static void ArrayTrim(uintptr_t argGlue, TaggedArray *array, int64_t newLength); 472 static double TimeClip(double time); 473 static double SetDateValues(double year, double month, double day); 474 static void StartCallTimer(uintptr_t argGlue, JSTaggedType func, bool isAot); 475 static void EndCallTimer(uintptr_t argGlue, JSTaggedType func); 476 static JSTaggedValue RuntimeArraySort(JSThread *thread, JSHandle<JSTaggedValue> thisHandle); 477 478 static JSTaggedValue CallBoundFunction(EcmaRuntimeCallInfo *info); 479 480 static int32_t StringGetStart(bool isUtf8, EcmaString *srcString, int32_t length, int32_t startIndex); 481 static int32_t StringGetEnd(bool isUtf8, EcmaString *srcString, int32_t start, int32_t length, int32_t startIndex); 482 private: 483 static void DumpToStreamWithHint(std::ostream &out, std::string_view prompt, JSTaggedValue value); 484 static void PrintHeapReginInfo(uintptr_t argGlue); 485 486 static inline JSTaggedValue RuntimeInc(JSThread *thread, const JSHandle<JSTaggedValue> &value); 487 static inline JSTaggedValue RuntimeDec(JSThread *thread, const JSHandle<JSTaggedValue> &value); 488 static inline JSTaggedValue RuntimeExp(JSThread *thread, JSTaggedValue base, JSTaggedValue exponent); 489 static inline JSTaggedValue RuntimeIsIn(JSThread *thread, const JSHandle<JSTaggedValue> &prop, 490 const JSHandle<JSTaggedValue> &obj); 491 static inline JSTaggedValue RuntimeInstanceof(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 492 const JSHandle<JSTaggedValue> &target); 493 static inline JSTaggedValue RuntimeInstanceofByHandler(JSThread *thread, JSHandle<JSTaggedValue> target, 494 JSHandle<JSTaggedValue> object, 495 JSHandle<JSTaggedValue> instOfHandler); 496 static inline JSTaggedValue RuntimeCreateGeneratorObj(JSThread *thread, const JSHandle<JSTaggedValue> &genFunc); 497 498 static inline JSTaggedValue RuntimeCreateAsyncGeneratorObj(JSThread *thread, 499 const JSHandle<JSTaggedValue> &genFunc); 500 501 static inline JSTaggedValue RuntimeAsyncGeneratorResolve(JSThread *thread, JSHandle<JSTaggedValue> asyncFuncObj, 502 JSHandle<JSTaggedValue> value, JSTaggedValue flag); 503 static inline JSTaggedValue RuntimeAsyncGeneratorReject(JSThread *thread, JSHandle<JSTaggedValue> asyncFuncObj, 504 JSHandle<JSTaggedValue> value); 505 static inline JSTaggedValue RuntimeGetTemplateObject(JSThread *thread, const JSHandle<JSTaggedValue> &literal); 506 static inline JSTaggedValue RuntimeGetNextPropName(JSThread *thread, const JSHandle<JSTaggedValue> &iter); 507 static inline JSTaggedValue RuntimeIterNext(JSThread *thread, const JSHandle<JSTaggedValue> &iter); 508 static inline JSTaggedValue RuntimeCloseIterator(JSThread *thread, const JSHandle<JSTaggedValue> &iter); 509 static inline JSTaggedValue RuntimeSuperCallSpread(JSThread *thread, const JSHandle<JSTaggedValue> &func, 510 const JSHandle<JSTaggedValue> &newTarget, 511 const JSHandle<JSTaggedValue> &array); 512 static inline JSTaggedValue RuntimeDelObjProp(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 513 const JSHandle<JSTaggedValue> &prop); 514 static inline JSTaggedValue RuntimeNewObjApply(JSThread *thread, const JSHandle<JSTaggedValue> &func, 515 const JSHandle<JSTaggedValue> &array); 516 static inline JSTaggedValue RuntimeCreateIterResultObj(JSThread *thread, const JSHandle<JSTaggedValue> &value, 517 JSTaggedValue flag); 518 static inline JSTaggedValue RuntimeAsyncFunctionAwaitUncaught(JSThread *thread, 519 const JSHandle<JSTaggedValue> &asyncFuncObj, 520 const JSHandle<JSTaggedValue> &value); 521 static inline JSTaggedValue RuntimeAsyncFunctionResolveOrReject(JSThread *thread, 522 const JSHandle<JSTaggedValue> &asyncFuncObj, 523 const JSHandle<JSTaggedValue> &value, 524 bool is_resolve); 525 static inline JSTaggedValue RuntimeCopyDataProperties(JSThread *thread, const JSHandle<JSTaggedValue> &dst, 526 const JSHandle<JSTaggedValue> &src); 527 static inline JSTaggedValue RuntimeStArraySpread(JSThread *thread, const JSHandle<JSTaggedValue> &dst, 528 JSTaggedValue index, const JSHandle<JSTaggedValue> &src); 529 static inline JSTaggedValue RuntimeSetObjectWithProto(JSThread *thread, const JSHandle<JSTaggedValue> &proto, 530 const JSHandle<JSObject> &obj); 531 static inline JSTaggedValue RuntimeGetIteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 532 const JSHandle<JSTaggedValue> &method); 533 static inline JSTaggedValue RuntimeLdObjByValue(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 534 const JSHandle<JSTaggedValue> &prop, bool callGetter, 535 JSTaggedValue receiver); 536 static inline JSTaggedValue RuntimeStObjByValue(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 537 const JSHandle<JSTaggedValue> &prop, 538 const JSHandle<JSTaggedValue> &value); 539 static inline JSTaggedValue RuntimeStOwnByValue(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 540 const JSHandle<JSTaggedValue> &key, 541 const JSHandle<JSTaggedValue> &value); 542 static inline JSTaggedValue RuntimeLdSuperByValue(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 543 const JSHandle<JSTaggedValue> &key, JSTaggedValue thisFunc); 544 static inline JSTaggedValue RuntimeStSuperByValue(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 545 const JSHandle<JSTaggedValue> &key, 546 const JSHandle<JSTaggedValue> &value, JSTaggedValue thisFunc); 547 static inline JSTaggedValue RuntimeLdObjByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &obj, uint32_t idx, 548 bool callGetter, JSTaggedValue receiver); 549 static inline JSTaggedValue RuntimeStObjByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &obj, uint32_t idx, 550 const JSHandle<JSTaggedValue> &value); 551 static inline JSTaggedValue RuntimeStOwnByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 552 const JSHandle<JSTaggedValue> &idx, 553 const JSHandle<JSTaggedValue> &value); 554 static inline JSTaggedValue RuntimeStGlobalRecord(JSThread *thread, const JSHandle<JSTaggedValue> &prop, 555 const JSHandle<JSTaggedValue> &value, bool isConst); 556 static inline JSTaggedValue RuntimeNeg(JSThread *thread, const JSHandle<JSTaggedValue> &value); 557 static inline JSTaggedValue RuntimeNot(JSThread *thread, const JSHandle<JSTaggedValue> &value); 558 static inline JSTaggedValue RuntimeResolveClass(JSThread *thread, const JSHandle<JSFunction> &ctor, 559 const JSHandle<TaggedArray> &literal, 560 const JSHandle<JSTaggedValue> &base, 561 const JSHandle<JSTaggedValue> &lexenv); 562 static inline JSTaggedValue RuntimeCloneClassFromTemplate(JSThread *thread, const JSHandle<JSFunction> &ctor, 563 const JSHandle<JSTaggedValue> &base, 564 const JSHandle<JSTaggedValue> &lexenv); 565 static inline JSTaggedValue RuntimeCreateClassWithBuffer(JSThread *thread, 566 const JSHandle<JSTaggedValue> &base, 567 const JSHandle<JSTaggedValue> &lexenv, 568 const JSHandle<JSTaggedValue> &constpool, 569 uint16_t methodId, uint16_t literalId, 570 const JSHandle<JSTaggedValue> &module, 571 const JSHandle<JSTaggedValue> &length); 572 static inline JSTaggedValue RuntimeCreateSharedClass(JSThread *thread, 573 const JSHandle<JSTaggedValue> &base, 574 const JSHandle<JSTaggedValue> &constpool, 575 uint16_t methodId, uint16_t literalId, uint16_t length, 576 const JSHandle<JSTaggedValue> &module); 577 static inline JSTaggedValue RuntimeLdSendableClass(const JSHandle<JSTaggedValue> &env, uint16_t level); 578 static inline JSTaggedValue RuntimeSetClassInheritanceRelationship(JSThread *thread, 579 const JSHandle<JSTaggedValue> &ctor, 580 const JSHandle<JSTaggedValue> &base, 581 ClassKind kind = ClassKind::NON_SENDABLE); 582 static inline JSTaggedValue RuntimeSetClassConstructorLength(JSThread *thread, JSTaggedValue ctor, 583 JSTaggedValue length); 584 static inline JSTaggedValue RuntimeNotifyInlineCache(JSThread *thread, const JSHandle<Method> &method, 585 uint32_t icSlotSize); 586 static inline JSTaggedValue RuntimeStOwnByValueWithNameSet(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 587 const JSHandle<JSTaggedValue> &key, 588 const JSHandle<JSTaggedValue> &value); 589 static inline JSTaggedValue RuntimeStOwnByName(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 590 const JSHandle<JSTaggedValue> &prop, 591 const JSHandle<JSTaggedValue> &value); 592 static inline JSTaggedValue RuntimeSuspendGenerator(JSThread *thread, const JSHandle<JSTaggedValue> &genObj, 593 const JSHandle<JSTaggedValue> &value); 594 static inline JSTaggedValue RuntimeGetModuleNamespace(JSThread *thread, int32_t index); 595 static inline JSTaggedValue RuntimeGetModuleNamespace(JSThread *thread, int32_t index, 596 JSTaggedValue jsFunc); 597 static inline JSTaggedValue RuntimeGetModuleNamespace(JSThread *thread, JSTaggedValue localName); 598 static inline JSTaggedValue RuntimeGetModuleNamespace(JSThread *thread, JSTaggedValue localName, 599 JSTaggedValue jsFunc); 600 static inline void RuntimeStModuleVar(JSThread *thread, int32_t index, JSTaggedValue value); 601 static inline void RuntimeStModuleVar(JSThread *thread, int32_t index, JSTaggedValue value, 602 JSTaggedValue jsFunc); 603 static inline void RuntimeStModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value); 604 static inline void RuntimeStModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value, 605 JSTaggedValue jsFunc); 606 static inline JSTaggedValue RuntimeLdLocalModuleVar(JSThread *thread, int32_t index); 607 static inline JSTaggedValue RuntimeLdLocalModuleVar(JSThread *thread, int32_t index, 608 JSTaggedValue jsFunc); 609 static inline JSTaggedValue RuntimeLdExternalModuleVar(JSThread *thread, int32_t index); 610 static inline JSTaggedValue RuntimeLdExternalModuleVar(JSThread *thread, int32_t index, 611 JSTaggedValue jsFunc); 612 static inline JSTaggedValue RuntimeLdModuleVar(JSThread *thread, JSTaggedValue key, bool inner); 613 static inline JSTaggedValue RuntimeLdModuleVar(JSThread *thread, JSTaggedValue key, bool inner, 614 JSTaggedValue jsFunc); 615 static inline JSTaggedValue RuntimeGetPropIterator(JSThread *thread, const JSHandle<JSTaggedValue> &value); 616 static inline JSTaggedValue RuntimeAsyncFunctionEnter(JSThread *thread); 617 static inline JSTaggedValue RuntimeGetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &obj); 618 static inline JSTaggedValue RuntimeGetAsyncIterator(JSThread *thread, const JSHandle<JSTaggedValue> &obj); 619 static inline void RuntimeSetGeneratorState(JSThread *thread, const JSHandle<JSTaggedValue> &genObj, 620 const int32_t index); 621 static inline void RuntimeThrow(JSThread *thread, JSTaggedValue value); 622 static inline void RuntimeThrowThrowNotExists(JSThread *thread); 623 static inline void RuntimeThrowPatternNonCoercible(JSThread *thread); 624 static inline void RuntimeThrowDeleteSuperProperty(JSThread *thread); 625 static inline void RuntimeThrowUndefinedIfHole(JSThread *thread, const JSHandle<EcmaString> &obj); 626 static inline void RuntimeThrowIfNotObject(JSThread *thread); 627 static inline void RuntimeThrowConstAssignment(JSThread *thread, const JSHandle<EcmaString> &value); 628 static inline JSTaggedValue RuntimeLdGlobalRecord(JSThread *thread, JSTaggedValue key); 629 static inline JSTaggedValue RuntimeTryLdGlobalByName(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 630 const JSHandle<JSTaggedValue> &prop); 631 static inline JSTaggedValue RuntimeTryUpdateGlobalRecord(JSThread *thread, JSTaggedValue prop, JSTaggedValue value); 632 static inline JSTaggedValue RuntimeThrowReferenceError(JSThread *thread, const JSHandle<JSTaggedValue> &prop, 633 const char *desc); 634 static inline JSTaggedValue RuntimeLdGlobalVarFromProto(JSThread *thread, const JSHandle<JSTaggedValue> &globalObj, 635 const JSHandle<JSTaggedValue> &prop); 636 static inline JSTaggedValue RuntimeStGlobalVar(JSThread *thread, const JSHandle<JSTaggedValue> &prop, 637 const JSHandle<JSTaggedValue> &value); 638 static inline JSTaggedValue RuntimeToNumber(JSThread *thread, const JSHandle<JSTaggedValue> &value); 639 static inline JSTaggedValue RuntimeDynamicImport(JSThread *thread, const JSHandle<JSTaggedValue> &specifier, 640 const JSHandle<JSTaggedValue> &func); 641 static inline JSTaggedValue RuntimeToNumeric(JSThread *thread, const JSHandle<JSTaggedValue> &value); 642 static inline JSTaggedValue RuntimeEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, 643 const JSHandle<JSTaggedValue> &right); 644 static inline JSTaggedValue RuntimeLdObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue prop, 645 bool callGetter, JSTaggedValue receiver); 646 static inline JSTaggedValue RuntimeNotEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, 647 const JSHandle<JSTaggedValue> &right); 648 static inline JSTaggedValue RuntimeLess(JSThread *thread, const JSHandle<JSTaggedValue> &left, 649 const JSHandle<JSTaggedValue> &right); 650 static inline JSTaggedValue RuntimeLessEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, 651 const JSHandle<JSTaggedValue> &right); 652 static inline JSTaggedValue RuntimeGreater(JSThread *thread, const JSHandle<JSTaggedValue> &left, 653 const JSHandle<JSTaggedValue> &right); 654 static inline JSTaggedValue RuntimeGreaterEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, 655 const JSHandle<JSTaggedValue> &right); 656 static inline JSTaggedValue RuntimeAdd2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 657 const JSHandle<JSTaggedValue> &right); 658 static inline JSTaggedValue RuntimeShl2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 659 const JSHandle<JSTaggedValue> &right); 660 static inline JSTaggedValue RuntimeShr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 661 const JSHandle<JSTaggedValue> &right); 662 static inline JSTaggedValue RuntimeSub2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 663 const JSHandle<JSTaggedValue> &right); 664 static inline JSTaggedValue RuntimeMul2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 665 const JSHandle<JSTaggedValue> &right); 666 static inline JSTaggedValue RuntimeDiv2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 667 const JSHandle<JSTaggedValue> &right); 668 static inline JSTaggedValue RuntimeMod2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 669 const JSHandle<JSTaggedValue> &right); 670 static inline JSTaggedValue RuntimeAshr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 671 const JSHandle<JSTaggedValue> &right); 672 static inline JSTaggedValue RuntimeAnd2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 673 const JSHandle<JSTaggedValue> &right); 674 static inline JSTaggedValue RuntimeOr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 675 const JSHandle<JSTaggedValue> &right); 676 static inline JSTaggedValue RuntimeXor2(JSThread *thread, const JSHandle<JSTaggedValue> &left, 677 const JSHandle<JSTaggedValue> &right); 678 static inline JSTaggedValue RuntimeStOwnByNameWithNameSet(JSThread *thread, 679 const JSHandle<JSTaggedValue> &obj, 680 const JSHandle<JSTaggedValue> &prop, 681 const JSHandle<JSTaggedValue> &value); 682 static inline JSTaggedValue RuntimeStObjByName(JSThread *thread, const JSHandle<JSTaggedValue> &obj, 683 const JSHandle<JSTaggedValue> &prop, 684 const JSHandle<JSTaggedValue> &value); 685 static inline JSTaggedValue RuntimeToJSTaggedValueWithInt32(JSThread *thread, 686 const JSHandle<JSTaggedValue> &value); 687 static inline JSTaggedValue RuntimeToJSTaggedValueWithUint32(JSThread *thread, 688 const JSHandle<JSTaggedValue> &value); 689 static inline JSTaggedValue RuntimeCreateEmptyObject(JSThread *thread, ObjectFactory *factory, 690 JSHandle<GlobalEnv> globalEnv); 691 static inline JSTaggedValue RuntimeCreateEmptyArray(JSThread *thread, ObjectFactory *factory, 692 JSHandle<GlobalEnv> globalEnv); 693 static inline JSTaggedValue RuntimeGetUnmapedArgs(JSThread *thread, JSTaggedType *sp, uint32_t actualNumArgs, 694 uint32_t startIdx); 695 static inline JSTaggedValue RuntimeCopyRestArgs(JSThread *thread, JSTaggedType *sp, uint32_t restNumArgs, 696 uint32_t startIdx); 697 static inline JSTaggedValue RuntimeCreateArrayWithBuffer(JSThread *thread, ObjectFactory *factory, 698 const JSHandle<JSTaggedValue> &literal); 699 static inline JSTaggedValue RuntimeCreateObjectWithBuffer(JSThread *thread, ObjectFactory *factory, 700 const JSHandle<JSObject> &literal); 701 static inline JSTaggedValue RuntimeNewLexicalEnv(JSThread *thread, uint16_t numVars); 702 static inline JSTaggedValue RuntimeNewObjRange(JSThread *thread, const JSHandle<JSTaggedValue> &func, 703 const JSHandle<JSTaggedValue> &newTarget, uint16_t firstArgIdx, 704 uint16_t length); 705 static inline JSTaggedValue RuntimeDefinefunc(JSThread *thread, const JSHandle<JSTaggedValue> &constpool, 706 uint16_t methodId, const JSHandle<JSTaggedValue> &module, 707 uint16_t length, const JSHandle<JSTaggedValue> &envHandle, 708 const JSHandle<JSTaggedValue> &homeObject); 709 static inline void DefineFuncTryUseAOTHClass(JSThread *thread, const JSHandle<JSFunction> &func, 710 const JSHandle<JSTaggedValue> &ihc); 711 static inline JSTaggedValue RuntimeCreateRegExpWithLiteral(JSThread *thread, const JSHandle<JSTaggedValue> &pattern, 712 uint8_t flags); 713 static inline JSTaggedValue RuntimeThrowIfSuperNotCorrectCall(JSThread *thread, uint16_t index, 714 JSTaggedValue thisValue); 715 static inline JSTaggedValue RuntimeCreateObjectHavingMethod(JSThread *thread, ObjectFactory *factory, 716 const JSHandle<JSObject> &literal, 717 const JSHandle<JSTaggedValue> &env); 718 static inline JSTaggedValue RuntimeCreateObjectWithExcludedKeys(JSThread *thread, uint16_t numKeys, 719 const JSHandle<JSTaggedValue> &objVal, 720 uint16_t firstArgRegIdx); 721 static inline JSTaggedValue RuntimeDefineMethod(JSThread *thread, const JSHandle<Method> &methodHandle, 722 const JSHandle<JSTaggedValue> &homeObject, uint16_t length, 723 const JSHandle<JSTaggedValue> &env); 724 static inline JSTaggedValue RuntimeCallSpread(JSThread *thread, const JSHandle<JSTaggedValue> &func, 725 const JSHandle<JSTaggedValue> &obj, 726 const JSHandle<JSTaggedValue> &array); 727 static inline JSTaggedValue RuntimeDefineGetterSetterByValue(JSThread *thread, const JSHandle<JSObject> &obj, 728 const JSHandle<JSTaggedValue> &prop, 729 const JSHandle<JSTaggedValue> &getter, 730 const JSHandle<JSTaggedValue> &setter, bool flag, 731 const JSHandle<JSTaggedValue> &func, 732 int32_t pcOffset); 733 static inline JSTaggedValue RuntimeSuperCall(JSThread *thread, const JSHandle<JSTaggedValue> &func, 734 const JSHandle<JSTaggedValue> &newTarget, uint16_t firstVRegIdx, 735 uint16_t length); 736 static inline JSTaggedValue RuntimeOptSuperCall(JSThread *thread, uintptr_t argv, uint32_t argc); 737 static inline JSTaggedValue RuntimeThrowTypeError(JSThread *thread, const char *message); 738 static inline JSTaggedValue RuntimeGetCallSpreadArgs(JSThread *thread, const JSHandle<JSTaggedValue> &array); 739 static inline JSTaggedValue RuntimeThrowReferenceError(JSThread *thread, JSTaggedValue prop, const char *desc); 740 static inline JSTaggedValue RuntimeThrowSyntaxError(JSThread *thread, const char *message); 741 static inline JSTaggedValue RuntimeLdBigInt(JSThread *thread, const JSHandle<JSTaggedValue> &numberBigInt); 742 static inline JSTaggedValue RuntimeNewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uint16_t scopeId); 743 static inline JSTaggedValue RuntimeOptGetUnmapedArgs(JSThread *thread, uint32_t actualNumArgs); 744 static inline JSTaggedValue RuntimeGetUnmapedJSArgumentObj(JSThread *thread, 745 const JSHandle<TaggedArray> &argumentsList); 746 static inline JSTaggedValue RuntimeOptNewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uint16_t scopeId, 747 JSHandle<JSTaggedValue> ¤tLexEnv, 748 JSHandle<JSTaggedValue> &func); 749 static inline JSTaggedValue RuntimeOptCopyRestArgs(JSThread *thread, uint32_t actualArgc, uint32_t restIndex); 750 static inline JSTaggedValue RuntimeOptSuspendGenerator(JSThread *thread, const JSHandle<JSTaggedValue> &genObj, 751 const JSHandle<JSTaggedValue> &value); 752 static inline JSTaggedValue RuntimeOptAsyncGeneratorResolve(JSThread *thread, JSHandle<JSTaggedValue> asyncFuncObj, 753 JSHandle<JSTaggedValue> value, JSTaggedValue flag); 754 static inline JSTaggedValue CommonCreateObjectWithExcludedKeys(JSThread *thread, 755 const JSHandle<JSTaggedValue> &objVal, 756 uint32_t numExcludedKeys, 757 JSHandle<TaggedArray> excludedKeys); 758 static inline JSTaggedValue RuntimeOptCreateObjectWithExcludedKeys(JSThread *thread, uintptr_t argv, uint32_t argc); 759 static inline JSTaggedValue RuntimeOptNewObjRange(JSThread *thread, uintptr_t argv, uint32_t argc); 760 static inline JSTaggedValue RuntimeOptConstruct(JSThread *thread, JSHandle<JSTaggedValue> ctor, 761 JSHandle<JSTaggedValue> newTarget, JSHandle<JSTaggedValue> preArgs, 762 JSHandle<TaggedArray> args); 763 static inline JSTaggedValue RuntimeOptConstructProxy(JSThread *thread, JSHandle<JSProxy> ctor, 764 JSHandle<JSTaggedValue> newTgt, 765 JSHandle<JSTaggedValue> preArgs, JSHandle<TaggedArray> args); 766 static inline JSTaggedValue RuntimeOptConstructBoundFunction(JSThread *thread, JSHandle<JSBoundFunction> ctor, 767 JSHandle<JSTaggedValue> newTgt, 768 JSHandle<JSTaggedValue> preArgs, 769 JSHandle<TaggedArray> args); 770 static inline JSTaggedValue RuntimeOptConstructGeneric(JSThread *thread, JSHandle<JSFunction> ctor, 771 JSHandle<JSTaggedValue> newTgt, 772 JSHandle<JSTaggedValue> preArgs, JSHandle<TaggedArray> args); 773 static inline JSTaggedValue GetResultValue(JSThread *thread, bool isAotMethod, JSHandle<JSFunction> ctor, 774 CVector<JSTaggedType> &values, JSHandle<JSTaggedValue> newTgt, uint32_t &size, JSHandle<JSTaggedValue> obj); 775 static inline JSTaggedValue RuntimeOptGenerateScopeInfo(JSThread *thread, uint16_t scopeId, JSTaggedValue func); 776 static inline JSTaggedType *GetActualArgv(JSThread *thread); 777 static inline JSTaggedType *GetActualArgvFromStub(JSThread *thread); 778 static inline OptimizedJSFunctionFrame *GetOptimizedJSFunctionFrame(JSThread *thread); 779 static inline OptimizedJSFunctionFrame *GetOptimizedJSFunctionFrameNoGC(JSThread *thread); 780 781 static JSTaggedValue NewObject(EcmaRuntimeCallInfo *info); 782 static void SaveFrameToContext(JSThread *thread, JSHandle<GeneratorContext> context); 783 784 static inline JSTaggedValue RuntimeLdPatchVar(JSThread *thread, uint32_t index); 785 static inline JSTaggedValue RuntimeStPatchVar(JSThread *thread, uint32_t index, 786 const JSHandle<JSTaggedValue> &value); 787 static inline JSTaggedValue RuntimeNotifyConcurrentResult(JSThread *thread, JSTaggedValue result, 788 JSTaggedValue hint); 789 static inline JSTaggedValue RuntimeDefineField(JSThread *thread, JSTaggedValue obj, 790 JSTaggedValue propKey, JSTaggedValue value); 791 static inline JSTaggedValue RuntimeCreatePrivateProperty(JSThread *thread, JSTaggedValue constpool, 792 uint32_t count, JSTaggedValue lexicalEnv, uint32_t literalId, JSTaggedValue module); 793 static inline JSTaggedValue RuntimeDefinePrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, 794 uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj, JSTaggedValue value); 795 static inline JSTaggedValue RuntimeLdPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, 796 uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj); 797 static inline JSTaggedValue RuntimeStPrivateProperty(JSThread *thread, JSTaggedValue lexicalEnv, 798 uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj, JSTaggedValue value); 799 static inline JSTaggedValue RuntimeTestIn(JSThread *thread, JSTaggedValue lexicalEnv, 800 uint32_t levelIndex, uint32_t slotIndex, JSTaggedValue obj); 801 static inline bool IsNeedNotifyHclassChangedForAotTransition(JSThread *thread, const JSHandle<JSHClass> &hclass, 802 JSTaggedValue key); 803 static inline JSTaggedValue RuntimeUpdateAOTHClass(JSThread *thread, const JSHandle<JSHClass> &oldhclass, 804 const JSHandle<JSHClass> &newhclass, JSTaggedValue key); 805 static inline JSTaggedValue RuntimeNotifyDebuggerStatement(JSThread *thread); 806 static inline bool CheckElementsNumber(JSHandle<TaggedArray> elements, uint32_t len); 807 static inline JSHandle<JSTaggedValue> GetOrCreateNumberString(JSThread *thread, 808 JSHandle<JSTaggedValue> presentValue, std::map<uint64_t, JSHandle<JSTaggedValue>> &cachedString); 809 static inline JSTaggedValue TryCopyCOWArray(JSThread *thread, JSHandle<JSArray> holderHandler, bool &isCOWArray); 810 static inline JSTaggedValue ArrayNumberSort(JSThread *thread, JSHandle<JSObject> thisObj, uint32_t len); 811 static inline bool ShouldUseAOTHClass(const JSHandle<JSTaggedValue> &ihc, 812 const JSHandle<JSTaggedValue> &chc, 813 const JSHandle<ClassLiteral> &classLiteral); 814 static inline JSTaggedType RuntimeTryGetInternString(uintptr_t argGlue, EcmaString *string); 815 friend class SlowRuntimeStub; 816 }; 817 } // namespace panda::ecmascript 818 #endif 819