Lines Matching refs:thread_

190     thread_ = thread;
194 [[maybe_unused]] EcmaHandleScope scope(thread_);
207 env->SetObjectFunctionClass(thread_, objFuncClass);
212 globalObjFuncClass->SetPrototype(thread_, objFuncPrototypeVal.GetTaggedValue());
221 env->SetJSGlobalObject(thread_, globalObject);
241 env->SetAsyncAwaitStatusFunctionClass(thread_, asyncAwaitStatusFuncClass);
249 env->SetAsyncGeneratorResNextRetProRstFtnClass(thread_, asyncGeneratorResNextRetProRstFtnClass);
255 env->SetProxyRevocFunctionClass(thread_, proxyRevocFuncClass);
261 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, JSHandle<JSFunction>(objectFunction),
264 env->SetObjectFunction(thread_, objectFunction);
265 env->SetObjectFunctionPrototype(thread_, objFuncPrototype);
266 thread_->SetInitialBuiltinHClass(
271 env->SetFunctionClassWithProto(thread_, functionClass);
274 env->SetFunctionClassWithoutProto(thread_, functionClass);
277 env->SetFunctionClassWithoutName(thread_, functionClass);
281 env->SetBoundFunctionClass(thread_, functionClass);
327 env->SetArgumentsClass(thread_, argumentsClass);
384 env->SetGeneratorFunctionClass(thread_, generatorFuncClass);
389 env->SetAsyncGeneratorFunctionClass(thread_, asyncGenetatorFuncClass);
390 env->SetObjectFunctionPrototypeClass(thread_, JSTaggedValue(objFuncPrototype->GetClass()));
394 env->SetAsyncFunctionClass(thread_, asyncFuncClass);
395 thread_->ResetGuardians();
400 thread_->InitializeBuiltinObject();
412 env->Set##name(thread_, name##detector);
420 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(accessor), true, false, true);
421 JSObject::DefineOwnProperty(thread_, object, key, descriptor);
426 thread_ = thread;
441 [[maybe_unused]] EcmaHandleScope scope(thread_);
517 layout->AddKey(thread_, index++, keyString.GetTaggedValue(), attributes);
542 layout->AddKey(thread_, index++, keyString.GetTaggedValue(), attributes);
561 ctor->SetPropertyInlinedProps(thread_, nameIndex, name.GetTaggedValue());
568 ctor->SetPropertyInlinedProps(thread_, lengthIndex, taggedLength);
574 ctor->SetPropertyInlinedProps(thread_, prototypeIndex, prototype);
590 obj->SetPropertyInlinedProps(thread_, index, function.GetTaggedValue());
600 obj->SetPropertyInlinedProps(thread_, index, function.GetTaggedValue());
608 accessor->SetGetter(thread_, getter);
609 accessor->SetSetter(thread_, setter);
610 obj->SetPropertyInlinedProps(thread_, index, accessor.GetTaggedValue());
629 SetFunctionName(funcFuncPrototype, thread_->GlobalConstants()->GetHandledEmptyString());
631 funcFuncPrototype->SetPropertyInlinedProps(thread_, fieldIndex++, funcFunc.GetTaggedValue()); // constructor
639 SetInlineFunction(env, funcFuncPrototypeObj, thread_->GlobalConstants()->GetHandledToStringString(),
645 env->SetHasInstanceFunction(thread_, function);
650 [[maybe_unused]] EcmaHandleScope scope(thread_);
675 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
676 PropertyDescriptor descriptor2(thread_, JSHandle<JSTaggedValue>::Cast(funcFunc), true, false, true);
677 JSObject::DefineOwnProperty(thread_, globalObject, nameString, descriptor2);
679 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, funcFunc, funcFuncIntanceHClass.GetTaggedValue());
680 env->SetFunctionFunction(thread_, funcFunc);
681 env->SetFunctionPrototype(thread_, funcFuncPrototype);
685 env->SetNormalFunctionClass(thread_, normalFuncClass);
690 env->SetJSIntlBoundFunctionClass(thread_, jSIntlBoundFunctionClass);
695 env->SetConstructorFunctionClass(thread_, constructorFunctionClass);
702 [[maybe_unused]] EcmaHandleScope scope(thread_);
720 GlobalEnvConstants *globalConst = const_cast<GlobalEnvConstants *>(thread_->GlobalConstants());
725 thread_->SetInitialBuiltinGlobalHClass(objFunc->GetJSHClass(), globalIndex);
730 [[maybe_unused]] EcmaHandleScope scope(thread_);
731 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
743 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
748 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(symbolFunction), true, false, true);
749 JSObject::DefineOwnProperty(thread_, symbolFuncPrototype, constructorKey, descriptor);
761 env->SetSymbolFunction(thread_, symbolFunction);
764 PropertyDescriptor descriptionDesc(thread_);
774 SetFunction(env, symbolFuncPrototype, thread_->GlobalConstants()->GetHandledToStringString(), Symbol::ToString,
776 SetFunction(env, symbolFuncPrototype, thread_->GlobalConstants()->GetHandledValueOfString(), Symbol::ValueOf,
783 env->SetHoleySymbol(thread_, holeySymbol.GetTaggedValue());
785 env->SetElementICSymbol(thread_, elementIcSymbol.GetTaggedValue());
791 [[maybe_unused]] EcmaHandleScope scope(thread_);
804 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
809 JSHandle<JSTaggedValue> constructorKey = thread_->GlobalConstants()->GetHandledConstructorString();
810 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(symbolFunction), true, false, true);
811 JSObject::DefineOwnProperty(thread_, symbolFuncPrototype, constructorKey, descriptor);
820 realm->Set##Name##Symbol(thread_, env->Get##Name##Symbol());
822 realm->SetSymbolFunction(thread_, symbolFunction);
827 PropertyDescriptor descriptionDesc(thread_);
845 realm->SetHoleySymbol(thread_, holeySymbol.GetTaggedValue());
847 realm->SetElementICSymbol(thread_, elementIcSymbol.GetTaggedValue());
854 [[maybe_unused]] EcmaHandleScope scope(thread_);
856 JSHandle<JSTaggedValue> toObject(thread_, JSTaggedValue(FunctionLength::ZERO));
869 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
892 env->SetNumberFunction(thread_, numFunction);
893 env->SetNumberPrototype(thread_, numFuncPrototype);
897 [[maybe_unused]] EcmaHandleScope scope(thread_);
899 realm->SetBigIntFunction(thread_, env->GetBigIntFunction());
902 JSHandle<JSObject> globalObject(thread_, realm->GetGlobalObject());
903 PropertyDescriptor descriptor(thread_, env->GetBigIntFunction(), true, false, true);
904 JSObject::DefineOwnProperty(thread_, globalObject, nameString, descriptor);
909 [[maybe_unused]] EcmaHandleScope scope(thread_);
921 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
939 env->SetBigIntFunction(thread_, bigIntFunction);
944 [[maybe_unused]] EcmaHandleScope scope(thread_);
959 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
979 env->SetDateFunction(thread_, dateFunction);
980 env->SetDatePrototype(thread_, dateFuncPrototype);
981 thread_->SetInitialBuiltinHClass(BuiltinTypeId::DATE,
989 [[maybe_unused]] EcmaHandleScope scope(thread_);
990 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
994 env->SetDateFunction(thread_, accessor);
995 env->SetDatePrototype(thread_, accessor);
1000 [[maybe_unused]] EcmaHandleScope scope(thread_);
1002 JSHandle<JSTaggedValue> toObject(thread_, JSTaggedValue::False());
1014 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, booleanFunction,
1018 SetFunction(env, booleanFuncPrototype, thread_->GlobalConstants()->GetHandledToStringString(),
1020 SetFunction(env, booleanFuncPrototype, thread_->GlobalConstants()->GetHandledValueOfString(),
1023 env->SetBooleanFunction(thread_, booleanFunction);
1024 env->SetBooleanPrototype(thread_, booleanFuncPrototype);
1034 env->SetProxyFunction(thread_, proxyFunction);
1044 JSFunction::SetFunctionLength(thread_, ctor, JSTaggedValue(length));
1046 JSFunction::SetFunctionName(thread_, JSHandle<JSFunctionBase>(ctor), nameString,
1047 JSHandle<JSTaggedValue>(thread_, JSTaggedValue::Undefined()));
1049 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1050 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>(ctor), true, false, true);
1051 JSObject::DefineOwnProperty(thread_, globalObject, nameString, descriptor);
1057 [[maybe_unused]] EcmaHandleScope scope(thread_);
1058 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1061 JSObject::SetPrototype(thread_, asyncFuncPrototype, env->GetFunctionPrototype());
1071 JSObject::SetPrototype(thread_, JSHandle<JSObject>::Cast(asyncFunction), env->GetFunctionFunction());
1073 PropertyDescriptor asyncDesc(thread_, JSHandle<JSTaggedValue>::Cast(asyncFunction), false, false, true);
1074 JSObject::DefineOwnProperty(thread_, asyncFuncPrototype, constructorKey, asyncDesc);
1075 asyncFunction->SetProtoOrHClass(thread_, asyncFuncInstanceHClass.GetTaggedValue());
1079 env->SetAsyncFunction(thread_, asyncFunction);
1080 env->SetAsyncFunctionPrototype(thread_, asyncFuncPrototype);
1094 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, errorFunction, errorFuncInstanceHClass.GetTaggedValue());
1097 SetFunction(env, errorFuncPrototype, thread_->GlobalConstants()->GetHandledToStringString(), Error::ToString,
1103 env->SetErrorFunction(thread_, errorFunction);
1108 env->SetNativeErrorFunctionClass(thread_, nativeErrorFuncClass);
1124 env->SetOOMErrorObject(thread_, oomError);
1131 realm->SetErrorFunction(thread_, env->GetErrorFunction());
1132 realm->SetNativeErrorFunctionClass(thread_, env->GetNativeErrorFunctionClass());
1148 JSHandle<JSObject> globalObject(thread_, realm->GetGlobalObject());
1154 nameString = JSHandle<JSTaggedValue>(thread_->GlobalConstants()->GetHandledRangeErrorString());
1155 realm->SetRangeErrorFunction(thread_, nativeErrorFunction);
1159 nameString = JSHandle<JSTaggedValue>(thread_->GlobalConstants()->GetHandledEvalErrorString());
1160 realm->SetEvalErrorFunction(thread_, nativeErrorFunction);
1164 nameString = JSHandle<JSTaggedValue>(thread_->GlobalConstants()->GetHandledReferenceErrorString());
1165 realm->SetReferenceErrorFunction(thread_, nativeErrorFunction);
1169 nameString = JSHandle<JSTaggedValue>(thread_->GlobalConstants()->GetHandledTypeErrorString());
1170 realm->SetTypeErrorFunction(thread_, nativeErrorFunction);
1171 realm->SetThrowTypeError(thread_, env->GetThrowTypeError());
1175 nameString = JSHandle<JSTaggedValue>(thread_->GlobalConstants()->GetHandledAggregateErrorString());
1176 realm->SetAggregateErrorFunction(thread_, nativeErrorFunction);
1180 nameString = JSHandle<JSTaggedValue>(thread_->GlobalConstants()->GetHandledURIErrorString());
1181 realm->SetURIErrorFunction(thread_, nativeErrorFunction);
1185 nameString = JSHandle<JSTaggedValue>(thread_->GlobalConstants()->GetHandledSyntaxErrorString());
1186 realm->SetSyntaxErrorFunction(thread_, nativeErrorFunction);
1190 nameString = JSHandle<JSTaggedValue>(thread_->GlobalConstants()->GetHandledOOMErrorString());
1191 realm->SetOOMErrorFunction(thread_, nativeErrorFunction);
1195 nameString = JSHandle<JSTaggedValue>(thread_->GlobalConstants()->GetHandledTerminationErrorString());
1196 realm->SetTerminationErrorFunction(thread_, nativeErrorFunction);
1201 PropertyDescriptor descriptor(thread_, nativeErrorFunction, true, false, true);
1202 JSObject::DefineOwnProperty(thread_, globalObject, nameString, descriptor);
1278 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, nativeErrorFunction,
1282 SetFunction(env, nativeErrorFuncPrototype, thread_->GlobalConstants()->GetHandledToStringString(),
1290 env->SetRangeErrorFunction(thread_, nativeErrorFunction);
1292 env->SetReferenceErrorFunction(thread_, nativeErrorFunction);
1294 env->SetTypeErrorFunction(thread_, nativeErrorFunction);
1297 JSFunction::SetFunctionLength(thread_, throwTypeErrorFunction, JSTaggedValue(1), false);
1298 JSObject::PreventExtensions(thread_, JSHandle<JSObject>::Cast(throwTypeErrorFunction));
1299 env->SetThrowTypeError(thread_, throwTypeErrorFunction);
1301 env->SetAggregateErrorFunction(thread_, nativeErrorFunction);
1303 env->SetURIErrorFunction(thread_, nativeErrorFunction);
1305 env->SetSyntaxErrorFunction(thread_, nativeErrorFunction);
1307 env->SetEvalErrorFunction(thread_, nativeErrorFunction);
1309 env->SetOOMErrorFunction(thread_, nativeErrorFunction);
1311 env->SetTerminationErrorFunction(thread_, nativeErrorFunction);
1318 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1319 JSFunction::SetFunctionLength(thread_, ctor, JSTaggedValue(length));
1321 JSFunction::SetFunctionName(thread_, JSHandle<JSFunctionBase>(ctor), nameString,
1322 JSHandle<JSTaggedValue>(thread_, JSTaggedValue::Undefined()));
1324 PropertyDescriptor descriptor1(thread_, JSHandle<JSTaggedValue>::Cast(ctor), true, false, true);
1325 JSObject::DefineOwnProperty(thread_, prototype, constructorKey, descriptor1);
1328 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, ctor, prototype.GetTaggedValue());
1330 if (!JSTaggedValue::SameValue(nameString, thread_->GlobalConstants()->GetHandledAsyncFunctionString())) {
1331 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1332 PropertyDescriptor descriptor2(thread_, JSHandle<JSTaggedValue>::Cast(ctor), true, false, true);
1333 JSObject::DefineOwnProperty(thread_, globalObject, nameString, descriptor2);
1339 [[maybe_unused]] EcmaHandleScope scope(thread_);
1340 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1353 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
1359 JSObject::SetProperty(thread_, JSHandle<JSTaggedValue>(setFuncPrototype), constructorKey, setFunction);
1360 RETURN_IF_ABRUPT_COMPLETION(thread_);
1370 JSObject::GetMethod(thread_, JSHandle<JSTaggedValue>::Cast(setFuncPrototype), values);
1371 RETURN_IF_ABRUPT_COMPLETION(thread_);
1372 PropertyDescriptor descriptor(thread_, valuesFunc, true, false, true);
1373 JSObject::DefineOwnProperty(thread_, setFuncPrototype, keys, descriptor);
1391 JSObject::DefineOwnProperty(thread_, setFuncPrototype, iteratorSymbol, descriptor);
1393 env->SetBuiltinsSetFunction(thread_, setFunction);
1394 env->SetSetPrototype(thread_, setFuncPrototype);
1395 env->SetSetProtoValuesFunction(thread_, valuesFunc);
1396 thread_->SetInitialBuiltinHClass(BuiltinTypeId::SET,
1404 [[maybe_unused]] EcmaHandleScope scope(thread_);
1405 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1409 env->SetBuiltinsSetFunction(thread_, accessor);
1410 env->SetSetPrototype(thread_, accessor);
1411 env->SetSetProtoValuesFunction(thread_, accessor);
1416 [[maybe_unused]] EcmaHandleScope scope(thread_);
1417 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1426 env->SetMapClass(thread_, mapFuncInstanceHClass);
1433 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
1439 JSObject::SetProperty(thread_, JSHandle<JSTaggedValue>(mapFuncPrototype), constructorKey, mapFunction);
1440 RETURN_IF_ABRUPT_COMPLETION(thread_);
1464 JSObject::GetMethod(thread_, JSHandle<JSTaggedValue>::Cast(mapFuncPrototype), entries);
1465 RETURN_IF_ABRUPT_COMPLETION(thread_);
1466 PropertyDescriptor descriptor(thread_, entriesFunc, true, false, true);
1467 JSObject::DefineOwnProperty(thread_, mapFuncPrototype, iteratorSymbol, descriptor);
1469 env->SetBuiltinsMapFunction(thread_, mapFunction);
1470 env->SetMapPrototype(thread_, mapFuncPrototype);
1471 env->SetMapProtoEntriesFunction(thread_, entriesFunc);
1472 thread_->SetInitialBuiltinHClass(BuiltinTypeId::MAP,
1480 [[maybe_unused]] EcmaHandleScope scope(thread_);
1481 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1485 env->SetBuiltinsMapFunction(thread_, accessor);
1486 env->SetMapPrototype(thread_, accessor);
1487 env->SetMapProtoEntriesFunction(thread_, accessor);
1488 env->SetMapClass(thread_, accessor);
1493 [[maybe_unused]] EcmaHandleScope scope(thread_);
1494 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1506 ->SetProtoOrHClass(thread_, weakMapFuncInstanceHClass.GetTaggedValue());
1510 JSObject::SetProperty(thread_, JSHandle<JSTaggedValue>(weakMapFuncPrototype), constructorKey, weakMapFunction);
1511 RETURN_IF_ABRUPT_COMPLETION(thread_);
1520 SetFunction(env, weakMapFuncPrototype, thread_->GlobalConstants()->GetHandledGetString(), BuiltinsWeakMap::Get,
1525 env->SetBuiltinsWeakMapFunction(thread_, weakMapFunction);
1530 [[maybe_unused]] EcmaHandleScope scope(thread_);
1531 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1535 env->SetBuiltinsWeakMapFunction(thread_, accessor);
1540 [[maybe_unused]] EcmaHandleScope scope(thread_);
1541 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1551 JSHandle<JSFunction>(weakSetFunction)->SetProtoOrHClass(thread_, weakSetFuncInstanceHClass.GetTaggedValue());
1555 JSObject::SetProperty(thread_, JSHandle<JSTaggedValue>(weakSetFuncPrototype), constructorKey, weakSetFunction);
1556 RETURN_IF_ABRUPT_COMPLETION(thread_);
1567 env->SetBuiltinsWeakSetFunction(thread_, weakSetFunction);
1572 [[maybe_unused]] EcmaHandleScope scope(thread_);
1573 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1577 env->SetBuiltinsWeakSetFunction(thread_, accessor);
1583 [[maybe_unused]] EcmaHandleScope scope(thread_);
1593 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1594 PropertyDescriptor atomicsDesc(thread_, JSHandle<JSTaggedValue>::Cast(atomicsObject), true, false, true);
1595 JSObject::DefineOwnProperty(thread_, globalObject, atomicsString, atomicsDesc);
1598 env->SetAtomicsFunction(thread_, atomicsObject);
1603 [[maybe_unused]] EcmaHandleScope scope(thread_);
1604 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1614 JSHandle<JSFunction>(weakRefFunction)->SetProtoOrHClass(thread_, weakRefFuncInstanceHClass.GetTaggedValue());
1618 JSObject::SetProperty(thread_, JSHandle<JSTaggedValue>(weakRefFuncPrototype), constructorKey, weakRefFunction);
1619 RETURN_IF_ABRUPT_COMPLETION(thread_);
1626 env->SetBuiltinsWeakRefFunction(thread_, weakRefFunction);
1631 [[maybe_unused]] EcmaHandleScope scope(thread_);
1632 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1636 env->SetBuiltinsWeakRefFunction(thread_, accessor);
1642 [[maybe_unused]] EcmaHandleScope scope(thread_);
1643 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1656 thread_, finalizationRegistryFuncInstanceHClass.GetTaggedValue());
1660 JSObject::SetProperty(thread_, JSHandle<JSTaggedValue>(finalizationRegistryFuncPrototype),
1662 RETURN_IF_ABRUPT_COMPLETION(thread_);
1671 env->SetBuiltinsFinalizationRegistryFunction(thread_, finalizationRegistryFunction);
1676 [[maybe_unused]] EcmaHandleScope scope(thread_);
1677 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1682 env->SetBuiltinsFinalizationRegistryFunction(thread_, accessor);
1687 [[maybe_unused]] EcmaHandleScope scope(thread_);
1690 RandomGenerator::InitRandom(thread_);
1700 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1701 PropertyDescriptor mathDesc(thread_, JSHandle<JSTaggedValue>::Cast(mathObject), true, false, true);
1702 JSObject::DefineOwnProperty(thread_, globalObject, mathString, mathDesc);
1705 env->SetMathFunction(thread_, mathObject);
1706 env->SetMathFunctionClass(thread_, JSHandle<JSHClass>(thread_, mathObject->GetJSHClass()));
1711 [[maybe_unused]] EcmaHandleScope scope(thread_);
1722 PropertyDescriptor jsonDesc(thread_, JSHandle<JSTaggedValue>::Cast(jsonObject), true, false, true);
1724 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
1725 JSObject::DefineOwnProperty(thread_, globalObject, jsonString, jsonDesc);
1728 env->SetJsonFunction(thread_, jsonObject);
1733 [[maybe_unused]] EcmaHandleScope scope(thread_);
1750 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
1774 env->SetStringFunction(thread_, stringFunction);
1775 env->SetStringPrototype(thread_, stringFuncPrototype);
1776 env->SetStringProtoIterFunction(thread_, stringIter);
1777 thread_->SetInitialBuiltinHClass(BuiltinTypeId::STRING, nullptr, nullptr, stringFuncPrototype->GetJSHClass());
1792 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, strIterFunction,
1799 env->SetStringIterator(thread_, strIterFunction);
1800 env->SetStringIteratorClass(thread_, strIterFuncInstanceHClass);
1801 env->SetStringIteratorPrototype(thread_, strIterPrototype);
1807 [[maybe_unused]] EcmaHandleScope scope(thread_);
1818 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, iterFunction, hclass.GetTaggedValue());
1819 env->SetAsyncFromSyncIterator(thread_, iterFunction);
1820 env->SetAsyncFromSyncIteratorPrototype(thread_, asyncItPrototype);
1828 env->SetAsyncFromSyncIterUnwarpClass(thread_, asyncFromSyncIterUnwarpClass);
1833 [[maybe_unused]] EcmaHandleScope scope(thread_);
1846 env->SetIteratorPrototype(thread_, iteratorPrototype);
1852 auto globalConst = const_cast<GlobalEnvConstants *>(thread_->GlobalConstants());
1864 thread_->SetInitialBuiltinHClass(BuiltinTypeId::ITERATOR, nullptr,
1868 JSHandle<JSHClass> iteratorPrototypeHClass(thread_, iteratorPrototype->GetJSHClass());
1886 [[maybe_unused]] EcmaHandleScope scope(thread_);
1898 env->SetAsyncIteratorPrototype(thread_, asyncIteratorPrototype);
1905 auto globalConst = const_cast<GlobalEnvConstants *>(thread_->GlobalConstants());
1912 [[maybe_unused]] EcmaHandleScope scope(thread_);
1920 env->SetForinIteratorPrototype(thread_, forinIteratorPrototype);
1921 env->SetForinIteratorClass(thread_, hclass);
1933 env->SetSetIteratorPrototype(thread_, setIteratorPrototype);
1935 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1937 hclassHandle->SetPrototype(thread_, protoValue);
1948 env->SetSharedSetIteratorPrototype(thread_, setIteratorPrototype);
1950 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1952 hclassHandle->SetPrototype(thread_, protoValue);
1965 env->SetMapIteratorPrototype(thread_, mapIteratorPrototype);
1967 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1969 hclassHandle->SetPrototype(thread_, protoValue);
1981 env->SetSharedMapIteratorPrototype(thread_, mapIteratorPrototype);
1983 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
1985 hclassHandle->SetPrototype(thread_, protoValue);
1996 auto globalConst = const_cast<GlobalEnvConstants *>(thread_->GlobalConstants());
2001 arrayIteratorInstanceHClass->SetPrototype(thread_, arrayIteratorPrototypeValue);
2003 thread_->SetInitialBuiltinHClass(BuiltinTypeId::ARRAY_ITERATOR, nullptr,
2005 env->SetArrayIteratorPrototype(thread_, arrayIteratorPrototype);
2016 env->SetSharedArrayIteratorPrototype(thread_, arrayIteratorPrototype);
2027 env->SetRegExpIteratorPrototype(thread_, regExpIteratorPrototype);
2032 [[maybe_unused]] EcmaHandleScope scope(thread_);
2048 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
2052 const GlobalEnvConstants *globalConstants = thread_->GlobalConstants();
2058 JSHandle<JSFunction>(execFunc)->SetLexicalEnv(thread_, env);
2064 JSHandle<JSFunction>(flagsGetter)->SetLexicalEnv(thread_, env);
2069 JSHandle<JSFunction>(sourceGetter)->SetLexicalEnv(thread_, env);
2074 JSHandle<JSFunction>(globalGetter)->SetLexicalEnv(thread_, env);
2080 JSHandle<JSFunction>(hasIndicesGetter)->SetLexicalEnv(thread_, env);
2086 JSHandle<JSFunction>(ignoreCaseGetter)->SetLexicalEnv(thread_, env);
2092 JSHandle<JSFunction>(multilineGetter)->SetLexicalEnv(thread_, env);
2097 JSHandle<JSFunction>(dotAllGetter)->SetLexicalEnv(thread_, env);
2102 JSHandle<JSFunction>(stickyGetter)->SetLexicalEnv(thread_, env);
2107 JSHandle<JSFunction>(unicodeGetter)->SetLexicalEnv(thread_, env);
2114 JSHandle<JSFunction>(speciesGetter)->SetLexicalEnv(thread_, env);
2132 env->SetRegExpFunction(thread_, regexpFunction);
2133 env->SetRegExpPrototype(thread_, regPrototype);
2134 env->SetRegExpExecFunction(thread_, execFunc);
2135 env->SetRegExpSplitFunction(thread_, splitFunc);
2136 env->SetRegExpSearchFunction(thread_, searchFunc);
2137 env->SetRegExpMatchFunction(thread_, matchFunc);
2138 env->SetRegExpMatchAllFunction(thread_, matchAllFunc);
2139 env->SetRegExpReplaceFunction(thread_, replaceFunc);
2141 JSHandle<JSHClass> regPrototypeClass(thread_, regPrototype->GetJSHClass());
2142 env->SetRegExpPrototypeClass(thread_, regPrototypeClass.GetTaggedValue());
2144 auto globalConst = const_cast<GlobalEnvConstants *>(thread_->GlobalConstants());
2150 [[maybe_unused]] EcmaHandleScope scope(thread_);
2158 auto accessor = thread_->GlobalConstants()->GetArrayLengthAccessor();
2159 JSArray::Cast(*arrFuncPrototype)->SetPropertyInlinedProps(thread_, JSArray::LENGTH_INLINE_PROPERTY_INDEX, accessor);
2163 JSMutableHandle<JSHClass> arrFuncInstanceHClass(thread_, JSTaggedValue::Undefined());
2165 auto globalConstant = const_cast<GlobalEnvConstants *>(thread_->GlobalConstants());
2166 globalConstant->InitElementKindHClass(thread_, arrFuncInstanceHClass);
2167 if (thread_->GetEcmaVM()->IsEnableElementsKind()) {
2187 lexicalEnv->SetParentEnv(thread_, env.GetTaggedValue());
2188 arrayFuncFunction->SetLexicalEnv(thread_, lexicalEnv.GetTaggedValue());
2190 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, arrayFuncFunction,
2203 JSObject::GetMethod(thread_, JSHandle<JSTaggedValue>::Cast(arrFuncPrototype), values);
2204 RETURN_IF_ABRUPT_COMPLETION(thread_);
2205 PropertyDescriptor iteartorDesc(thread_, valuesFunc, true, false, true);
2206 JSObject::DefineOwnProperty(thread_, arrFuncPrototype, iteratorSymbol, iteartorDesc);
2221 JSHandle<JSTaggedValue> keyString = thread_->GlobalConstants()->GetHandledLengthString();
2222 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>(thread_, JSTaggedValue(arrProtoLen)), true, false,
2224 JSObject::DefineOwnProperty(thread_, arrFuncPrototype, keyString, descriptor);
2227 PropertyDescriptor desc(thread_);
2228 JSObject::GetOwnProperty(thread_, arrFuncPrototype, valuesKey, desc);
2232 JSHandle<JSTaggedValue> unscopables = CreateArrayUnscopables(thread_);
2233 PropertyDescriptor unscopablesDesc(thread_, unscopables, false, false, true);
2234 JSObject::DefineOwnProperty(thread_, arrFuncPrototype, unscopablesSymbol, unscopablesDesc);
2236 env->SetArrayProtoValuesFunction(thread_, desc.GetValue());
2237 env->SetArrayFunction(thread_, arrayFunction);
2238 env->SetArrayPrototype(thread_, arrFuncPrototype);
2240 thread_->SetInitialBuiltinHClass(BuiltinTypeId::ARRAY, arrayFunction->GetJSHClass(),
2246 [[maybe_unused]] EcmaHandleScope scope(thread_);
2263 ->SetProtoOrHClass(thread_, typedArrFuncInstanceHClass.GetTaggedValue());
2281 JSObject::GetMethod(thread_, arrFuncPrototype, thread_->GlobalConstants()->GetHandledToStringString());
2282 RETURN_IF_ABRUPT_COMPLETION(thread_);
2283 PropertyDescriptor toStringDesc(thread_, toStringFunc, true, false, true);
2284 JSObject::DefineOwnProperty(thread_, typedArrFuncPrototype, thread_->GlobalConstants()->GetHandledToStringString(),
2291 JSObject::GetMethod(thread_, JSHandle<JSTaggedValue>::Cast(typedArrFuncPrototype), values);
2292 RETURN_IF_ABRUPT_COMPLETION(thread_);
2293 PropertyDescriptor iteartorDesc(thread_, valuesFunc, true, false, true);
2294 JSObject::DefineOwnProperty(thread_, typedArrFuncPrototype, iteratorSymbol, iteartorDesc);
2314 env->SetTypedArrayFunction(thread_, typedArrayFunction.GetTaggedValue());
2315 env->SetTypedArrayPrototype(thread_, typedArrFuncPrototype);
2316 env->SetTypedArrayProtoValuesFunction(thread_, valuesFunc);
2317 thread_->SetInitialBuiltinHClass(BuiltinTypeId::TYPED_ARRAY,
2325 env->SetSpecificTypedArrayFunctionClass(thread_, specificTypedArrayFuncClass);
2335 [[maybe_unused]] EcmaHandleScope scope(thread_);
2336 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
2341 env->SetTypedArrayFunction(thread_, accessor);
2342 env->SetTypedArrayPrototype(thread_, accessor);
2343 env->SetSpecificTypedArrayFunctionClass(thread_, accessor);
2354 [[maybe_unused]] EcmaHandleScope scope(thread_); \
2371 arrayFunction->SetProtoOrHClass(thread_, arrFuncInstanceHClass.GetTaggedValue()); \
2376 env->Set##Type##Function(thread_, arrayFunction); \
2377 env->Set##Type##FunctionPrototype(thread_, arrFuncPrototypeValue); \
2378 env->Set##Type##RootHclass(thread_, arrFuncInstanceHClass); \
2379 env->Set##Type##RootHclassOnHeap(thread_, arrFuncInstanceHClassOnHeap); \
2381 thread_->SetInitialBuiltinHClass(BuiltinTypeId::TYPE, \
2395 [[maybe_unused]] EcmaHandleScope scope(thread_); \
2396 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject()); \
2400 env->Set##Type##Function(thread_, accessor); \
2401 env->Set##Type##FunctionPrototype(thread_, accessor); \
2402 env->Set##Type##RootHclass(thread_, accessor); \
2403 env->Set##Type##RootHclassOnHeap(thread_, accessor); \
2411 [[maybe_unused]] EcmaHandleScope scope(thread_);
2424 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
2456 env->SetArrayBufferFunction(thread_, arrayBufferFunction.GetTaggedValue());
2461 [[maybe_unused]] EcmaHandleScope scope(thread_);
2462 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
2467 env->SetArrayBufferFunction(thread_, accessor);
2473 [[maybe_unused]] EcmaHandleScope scope(thread_);
2485 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
2486 PropertyDescriptor reflectDesc(thread_, JSHandle<JSTaggedValue>::Cast(reflectObject), true, false, true);
2487 JSObject::DefineOwnProperty(thread_, globalObject, reflectString, reflectDesc);
2492 env->SetReflectFunction(thread_, reflectObject.GetTaggedValue());
2498 [[maybe_unused]] EcmaHandleScope scope(thread_);
2512 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
2538 env->SetSharedArrayBufferFunction(thread_, SharedArrayBufferFunction.GetTaggedValue());
2543 [[maybe_unused]] EcmaHandleScope scope(thread_);
2544 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
2549 env->SetSharedArrayBufferFunction(thread_, accessor);
2554 [[maybe_unused]] EcmaHandleScope scope(thread_);
2564 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
2587 env->SetPromiseFunction(thread_, promiseFunction);
2594 vm_ = thread_->GetEcmaVM();
2601 env->SetPromiseReactionFunctionClass(thread_, promiseReactionFuncClass);
2607 env->SetPromiseExecutorFunctionClass(thread_, promiseExecutorFuncClass);
2613 env->SetAsyncModuleFulfilledFunctionClass(thread_, asyncModuleFulfilledFuncClass);
2619 env->SetAsyncModuleRejectedFunctionClass(thread_, asyncModuleRejectedFuncClass);
2626 env->SetPromiseAllResolveElementFunctionClass(thread_, promiseAllResolveElementFunctionClass);
2633 env->SetPromiseAnyRejectElementFunctionClass(thread_, promiseAnyRejectElementFunctionClass);
2640 env->SetPromiseAllSettledElementFunctionClass(thread_, promiseAllSettledElementFunctionClass);
2647 env->SetPromiseFinallyFunctionClass(thread_, promiseFinallyFunctionClass);
2654 env->SetPromiseValueThunkOrThrowerFunctionClass(thread_, promiseValueThunkOrThrowerFunctionClass);
2659 JSHandle<JSTaggedValue> keyString(thread_->GlobalConstants()->GetHandledEmptyString());
2661 env->SetPromiseReactionJob(thread_, func);
2663 env->SetPromiseResolveThenableJob(thread_, func);
2665 env->SetDynamicImportJob(thread_, func);
2670 [[maybe_unused]] EcmaHandleScope scope(thread_);
2685 JSHandle<JSFunction>(dataViewFunction)->SetProtoOrHClass(thread_, dataViewFuncInstanceHClass.GetTaggedValue());
2711 env->SetDataViewFunction(thread_, dataViewFunction.GetTaggedValue());
2712 env->SetDataViewPrototype(thread_, dataViewFuncPrototype.GetTaggedValue());
2713 thread_->SetInitialBuiltinHClass(BuiltinTypeId::DATA_VIEW,
2721 [[maybe_unused]] EcmaHandleScope scope(thread_);
2722 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
2726 env->SetDataViewFunction(thread_, accessor);
2727 env->SetDataViewPrototype(thread_, accessor);
2748 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
2749 JSFunction::SetFunctionLength(thread_, ctor, JSTaggedValue(length));
2751 JSFunction::SetFunctionName(thread_, JSHandle<JSFunctionBase>(ctor), nameString,
2752 JSHandle<JSTaggedValue>(thread_, JSTaggedValue::Undefined()));
2754 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(ctor), true, false, true);
2755 JSObject::DefineOwnProperty(thread_, prototype, constructorKey, descriptor);
2767 JSFunction::SetFunctionLength(thread_, function, JSTaggedValue(length));
2769 auto globalConst = const_cast<GlobalEnvConstants *>(thread_->GlobalConstants());
2770 JSFunction::SetFunctionName(thread_, baseFunction, key, globalConst->GetHandledUndefined());
2789 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>(function), true, false, true);
2790 JSObject::DefineOwnProperty(thread_, obj, key, descriptor);
2806 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>(function), true, false, true);
2807 JSObject::DefineOwnProperty(thread_, obj, key, descriptor);
2816 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>(function), false, false, false);
2817 JSObject::DefineOwnProperty(thread_, obj, keyString, descriptor);
2826 JSFunction::SetFunctionLength(thread_, function, JSTaggedValue(length));
2829 JSHandle<JSTaggedValue> handleUndefine(thread_, JSTaggedValue::Undefined());
2830 JSFunction::SetFunctionName(thread_, baseFunction, nameString, handleUndefine);
2833 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(function), false, false, true);
2834 JSObject::DefineOwnProperty(thread_, obj, symbol, descriptor);
2839 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(function), false, false, false);
2840 JSObject::DefineOwnProperty(thread_, obj, symbol, descriptor);
2841 env->SetHasInstanceFunction(thread_, function);
2844 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(function), true, false, true);
2845 JSObject::DefineOwnProperty(thread_, obj, symbol, descriptor);
2859 JSFunction::SetFunctionLength(thread_, function, JSTaggedValue(length));
2862 JSHandle<JSTaggedValue> handleUndefine(thread_, JSTaggedValue::Undefined());
2863 JSFunction::SetFunctionName(thread_, baseFunction, nameString, handleUndefine);
2866 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(function), false, false, true);
2867 JSObject::DefineOwnProperty(thread_, obj, symbol, descriptor);
2872 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(function), false, false, false);
2873 JSObject::DefineOwnProperty(thread_, obj, symbol, descriptor);
2874 env->SetHasInstanceFunction(thread_, function);
2877 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(function), true, false, true);
2878 JSObject::DefineOwnProperty(thread_, obj, symbol, descriptor);
2887 PropertyDescriptor desc(thread_, tag, false, false, true);
2888 JSObject::DefineOwnProperty(thread_, obj, symbol, desc);
2905 JSFunction::SetFunctionLength(thread_, function, JSTaggedValue(length));
2906 JSHandle<JSTaggedValue> prefix = thread_->GlobalConstants()->GetHandledGetString();
2907 JSFunction::SetFunctionName(thread_, JSHandle<JSFunctionBase>(function), key, prefix);
2922 JSFunction::SetFunctionLength(thread_, function, JSTaggedValue(length));
2923 JSHandle<JSTaggedValue> prefix = thread_->GlobalConstants()->GetHandledSetString();
2924 JSFunction::SetFunctionName(thread_, JSHandle<JSFunctionBase>(function), key, prefix);
2931 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>(thread_, value), false, false, false);
2932 JSObject::DefineOwnProperty(thread_, obj, keyString, descriptor);
2939 PropertyDescriptor descriptor(thread_, value, false, false, false);
2940 JSObject::DefineOwnProperty(thread_, obj, keyString, descriptor);
2947 PropertyDescriptor descriptor(thread_, value, true, true, true);
2948 JSObject::DefineOwnProperty(thread_, obj, keyString, descriptor);
2955 PropertyDescriptor descriptor(thread_, globalValue, true, false, true);
2956 JSObject::DefineOwnProperty(thread_, obj, keyString, descriptor);
2962 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>(factory_->NewFromUtf8ReadOnly(value)),
2964 JSObject::DefineOwnProperty(thread_, obj, keyString, descriptor);
2971 PropertyDescriptor des(thread_, value, false, false, false);
2972 JSObject::DefineOwnProperty(thread_, obj, keyString, des);
2981 JSFunction::SetFunctionLength(thread_, function, JSTaggedValue(length));
2984 JSHandle<JSTaggedValue> handleUndefine(thread_, JSTaggedValue::Undefined());
2985 JSFunction::SetFunctionName(thread_, baseFunction, keyString, handleUndefine);
2987 auto globalConst = const_cast<GlobalEnvConstants *>(thread_->GlobalConstants());
2990 PropertyDescriptor descriptor(thread_, JSHandle<JSTaggedValue>::Cast(function), true, false, true);
2991 JSObject::DefineOwnProperty(thread_, obj, keyString, descriptor);
2992 JSObject::DefineOwnProperty(thread_, globalObject, keyString, descriptor);
2998 [[maybe_unused]] EcmaHandleScope scope(thread_);
2999 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
3013 JSObject::SetPrototype(thread_, JSHandle<JSObject>::Cast(generatorFunction), env->GetFunctionFunction());
3015 PropertyDescriptor generatorDesc(thread_, JSHandle<JSTaggedValue>::Cast(generatorFunction), false, false, true);
3016 JSObject::DefineOwnProperty(thread_, generatorFuncPrototype, constructorKey, generatorDesc);
3017 generatorFunction->SetProtoOrHClass(thread_, generatorFuncInstanceHClass.GetTaggedValue());
3018 env->SetGeneratorFunctionFunction(thread_, generatorFunction);
3021 PropertyDescriptor descriptor(thread_, env->GetGeneratorPrototype(), false, false, true);
3022 JSObject::DefineOwnProperty(thread_, generatorFuncPrototype, globalConst->GetHandledPrototypeString(), descriptor);
3028 JSObject::SetPrototype(thread_, generatorFuncPrototype, env->GetFunctionPrototype());
3031 PropertyDescriptor generatorObjDesc(thread_, generatorFuncPrototypeValue, false, false, true);
3032 JSObject::DefineOwnProperty(thread_, JSHandle<JSObject>(env->GetGeneratorPrototype()),
3036 PropertyDescriptor generatorObjProtoDesc(thread_, generatorFuncPrototypeValue, true, false, false);
3037 JSObject::DefineOwnProperty(thread_, JSHandle<JSObject>(env->GetInitialGenerator()),
3040 env->SetGeneratorFunctionPrototype(thread_, generatorFuncPrototype);
3046 [[maybe_unused]] EcmaHandleScope scope(thread_);
3047 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
3060 JSObject::SetPrototype(thread_, JSHandle<JSObject>::Cast(asyncGeneratorFunction), env->GetFunctionFunction());
3062 PropertyDescriptor asyncGeneratorDesc(thread_, JSHandle<JSTaggedValue>::Cast(asyncGeneratorFunction),
3064 JSObject::DefineOwnProperty(thread_, asyncGeneratorFuncPrototype, constructorKey, asyncGeneratorDesc);
3065 asyncGeneratorFunction->SetProtoOrHClass(thread_, asyncGeneratorFuncInstanceHClass.GetTaggedValue());
3066 env->SetAsyncGeneratorFunctionFunction(thread_, asyncGeneratorFunction);
3069 PropertyDescriptor descriptor(thread_, env->GetAsyncGeneratorPrototype(), false, false, true);
3070 JSObject::DefineOwnProperty(thread_, asyncGeneratorFuncPrototype, globalConst->GetHandledPrototypeString(),
3076 JSObject::SetPrototype(thread_, asyncGeneratorFuncPrototype, env->GetFunctionPrototype());
3078 PropertyDescriptor asyncGeneratorObjDesc(thread_, asyncGeneratorFuncPrototypeValue, false, false, true);
3079 JSObject::DefineOwnProperty(thread_, JSHandle<JSObject>(env->GetInitialAsyncGenerator()),
3082 PropertyDescriptor asyncGeneratorObjProtoDesc(thread_, asyncGeneratorFuncPrototypeValue, true, false, false);
3083 JSObject::DefineOwnProperty(thread_, JSHandle<JSObject>(env->GetInitialAsyncGenerator()),
3086 env->SetAsyncGeneratorFunctionPrototype(thread_, asyncGeneratorFuncPrototype);
3091 [[maybe_unused]] EcmaHandleScope scope(thread_);
3108 env->SetGeneratorPrototype(thread_, generatorPrototype);
3109 JSObject::SetPrototype(thread_, generatorPrototype, env->GetIteratorPrototype());
3113 JSObject::SetPrototype(thread_, initialGeneratorFuncPrototype, JSHandle<JSTaggedValue>(generatorPrototype));
3114 env->SetInitialGenerator(thread_, initialGeneratorFuncPrototype);
3120 [[maybe_unused]] EcmaHandleScope scope(thread_);
3122 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
3139 PropertyDescriptor descriptor(thread_, env->GetAsyncIteratorPrototype(), true, false, false);
3140 JSObject::DefineOwnProperty(thread_, asyncGeneratorFuncPrototype,
3142 env->SetAsyncGeneratorPrototype(thread_, asyncGeneratorFuncPrototype);
3143 JSObject::SetPrototype(thread_, asyncGeneratorFuncPrototype, env->GetAsyncIteratorPrototype());
3146 JSObject::SetPrototype(thread_, initialAsyncGeneratorFuncPrototype,
3148 env->SetInitialAsyncGenerator(thread_, initialAsyncGeneratorFuncPrototype);
3156 accessor->SetGetter(thread_, throwFunction);
3157 accessor->SetSetter(thread_, throwFunction);
3158 env->SetArgumentsCallerAccessor(thread_, accessor);
3161 accessor->SetGetter(thread_, throwFunction);
3162 accessor->SetSetter(thread_, throwFunction);
3163 env->SetArgumentsCalleeAccessor(thread_, accessor);
3170 accessor->SetGetter(thread_, getter);
3171 accessor->SetSetter(thread_, setter);
3173 JSObject::AddAccessor(thread_, JSHandle<JSTaggedValue>::Cast(obj), key, accessor, attr);
3180 accessor->SetGetter(thread_, getter);
3182 JSObject::AddAccessor(thread_, JSHandle<JSTaggedValue>::Cast(obj), key, accessor, attr);
3198 [[maybe_unused]] EcmaHandleScope scope(thread_); \
3204 env->Set##type##Function(thread_, accessor); \
3213 const GlobalEnvConstants *globalConst = thread_->GlobalConstants();
3214 JSFunction::SetFunctionLength(thread_, ctor, JSTaggedValue(length));
3216 JSFunction::SetFunctionName(thread_, JSHandle<JSFunctionBase>(ctor), nameString,
3217 JSHandle<JSTaggedValue>(thread_, JSTaggedValue::Undefined()));
3219 PropertyDescriptor descriptor1(thread_, JSHandle<JSTaggedValue>::Cast(ctor), true, false, true);
3220 JSObject::DefineOwnProperty(thread_, prototype, constructorKey, descriptor1);
3223 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_, ctor, prototype.GetTaggedValue());
3225 if (!JSTaggedValue::SameValue(nameString, thread_->GlobalConstants()->GetHandledAsyncFunctionString())) {
3226 JSHandle<JSObject> intlObject(thread_, env->GetIntlFunction().GetTaggedValue());
3227 PropertyDescriptor descriptor2(thread_, JSHandle<JSTaggedValue>::Cast(ctor), true, false, true);
3228 JSObject::DefineOwnProperty(thread_, intlObject, nameString, descriptor2);
3234 [[maybe_unused]] EcmaHandleScope scope(thread_);
3245 JSHandle<JSObject> globalObject(thread_, env->GetGlobalObject());
3246 PropertyDescriptor intlDesc(thread_, JSHandle<JSTaggedValue>::Cast(intlObject), true, false, true);
3247 JSObject::DefineOwnProperty(thread_, globalObject, intlString, intlDesc);
3251 env->SetIntlFunction(thread_, intlObject);
3256 [[maybe_unused]] EcmaHandleScope scope(thread_);
3270 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3280 env->SetDateTimeFormatFunction(thread_, dtfFunction);
3284 JSHandle<JSTaggedValue> formatSetter(thread_, JSTaggedValue::Undefined());
3285 SetAccessor(dtfPrototype, thread_->GlobalConstants()->GetHandledFormatString(), formatGetter, formatSetter);
3300 [[maybe_unused]] EcmaHandleScope scope(thread_);
3315 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3325 env->SetRelativeTimeFormatFunction(thread_, rtfFunction);
3339 [[maybe_unused]] EcmaHandleScope scope(thread_);
3353 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3363 env->SetNumberFormatFunction(thread_, nfFunction);
3367 JSHandle<JSTaggedValue> formatSetter(thread_, JSTaggedValue::Undefined());
3368 SetAccessor(nfPrototype, thread_->GlobalConstants()->GetHandledFormatString(), formatGetter, formatSetter);
3379 [[maybe_unused]] EcmaHandleScope scope(thread_);
3392 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3402 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledBaseNameString(), baseNameGetter);
3405 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledCalendarString(), calendarGetter);
3409 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledCaseFirstString(), caseFirstGetter);
3413 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledCollationString(), collationGetter);
3417 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledHourCycleString(), hourCycleGetter);
3420 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledNumericString(), numericGetter);
3424 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledNumberingSystemString(), numberingSystemGetter);
3427 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledLanguageString(), languageGetter);
3430 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledScriptString(), scriptGetter);
3433 SetGetter(localePrototype, thread_->GlobalConstants()->GetHandledRegionString(), regionGetter);
3437 env->SetLocaleFunction(thread_, localeFunction);
3442 [[maybe_unused]] EcmaHandleScope scope(thread_);
3456 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3466 env->SetCollatorFunction(thread_, collatorFunction);
3470 JSHandle<JSTaggedValue> compareSetter(thread_, JSTaggedValue::Undefined());
3471 SetAccessor(collatorPrototype, thread_->GlobalConstants()->GetHandledCompareString(), compareGetter, compareSetter);
3480 [[maybe_unused]] EcmaHandleScope scope(thread_);
3494 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3504 env->SetPluralRulesFunction(thread_, prFunction);
3515 [[maybe_unused]] EcmaHandleScope scope(thread_);
3529 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3539 env->SetDisplayNamesFunction(thread_, dnFunction);
3550 [[maybe_unused]] EcmaHandleScope scope(thread_);
3564 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3574 env->SetListFormatFunction(thread_, lfFunction);
3588 [[maybe_unused]] EcmaHandleScope scope(thread_);
3602 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3612 env->SetSegmenterFunction(thread_, sgFunction);
3623 [[maybe_unused]] EcmaHandleScope scope(thread_);
3635 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3639 env->SetSegmentsFunction(thread_, segmentsFunction);
3659 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3666 env->SetSegmentIterator(thread_, segIterFunction);
3667 env->SetSegmentIteratorPrototype(thread_, segIterPrototype);
3698 PropertyDescriptor descriptor1(thread_, JSHandle<JSTaggedValue>::Cast(accessor1), true, false, true);
3699 JSHandle<JSTaggedValue> dollar1Key = thread_->GlobalConstants()->GetHandledDollarStringOne();
3700 JSObject::DefineOwnProperty(thread_, obj, dollar1Key, descriptor1);
3704 PropertyDescriptor descriptor2(thread_, JSHandle<JSTaggedValue>::Cast(accessor2), true, false, true);
3705 JSHandle<JSTaggedValue> dollar2Key = thread_->GlobalConstants()->GetHandledDollarStringTwo();
3706 JSObject::DefineOwnProperty(thread_, obj, dollar2Key, descriptor2);
3710 PropertyDescriptor descriptor3(thread_, JSHandle<JSTaggedValue>::Cast(accessor3), true, false, true);
3711 JSHandle<JSTaggedValue> dollar3Key = thread_->GlobalConstants()->GetHandledDollarStringThree();
3712 JSObject::DefineOwnProperty(thread_, obj, dollar3Key, descriptor3);
3716 PropertyDescriptor descriptor4(thread_, JSHandle<JSTaggedValue>::Cast(accessor4), true, false, true);
3717 JSHandle<JSTaggedValue> dollar4Key = thread_->GlobalConstants()->GetHandledDollarStringFour();
3718 JSObject::DefineOwnProperty(thread_, obj, dollar4Key, descriptor4);
3722 PropertyDescriptor descriptor5(thread_, JSHandle<JSTaggedValue>::Cast(accessor5), true, false, true);
3723 JSHandle<JSTaggedValue> dollar5Key = thread_->GlobalConstants()->GetHandledDollarStringFive();
3724 JSObject::DefineOwnProperty(thread_, obj, dollar5Key, descriptor5);
3728 PropertyDescriptor descriptor6(thread_, JSHandle<JSTaggedValue>::Cast(accessor6), true, false, true);
3729 JSHandle<JSTaggedValue> dollar6Key = thread_->GlobalConstants()->GetHandledDollarStringSix();
3730 JSObject::DefineOwnProperty(thread_, obj, dollar6Key, descriptor6);
3734 PropertyDescriptor descriptor7(thread_, JSHandle<JSTaggedValue>::Cast(accessor7), true, false, true);
3735 JSHandle<JSTaggedValue> dollar7Key = thread_->GlobalConstants()->GetHandledDollarStringSeven();
3736 JSObject::DefineOwnProperty(thread_, obj, dollar7Key, descriptor7);
3740 PropertyDescriptor descriptor8(thread_, JSHandle<JSTaggedValue>::Cast(accessor8), true, false, true);
3741 JSHandle<JSTaggedValue> dollar8Key = thread_->GlobalConstants()->GetHandledDollarStringEight();
3742 JSObject::DefineOwnProperty(thread_, obj, dollar8Key, descriptor8);
3746 PropertyDescriptor descriptor9(thread_, JSHandle<JSTaggedValue>::Cast(accessor9), true, false, true);
3747 JSHandle<JSTaggedValue> dollar9Key = thread_->GlobalConstants()->GetHandledDollarStringNine();
3748 JSObject::DefineOwnProperty(thread_, obj, dollar9Key, descriptor9);
3780 [[maybe_unused]] EcmaHandleScope scope(thread_);
3788 moduleNamespaceHClass->SetPrototype(thread_, JSTaggedValue::Null());
3789 env->SetModuleNamespaceClass(thread_, moduleNamespaceHClass.GetTaggedValue());
3798 [[maybe_unused]] EcmaHandleScope scope(thread_);
3807 nativeModuleFailureInfoHClass->SetPrototype(thread_, JSTaggedValue::Null());
3808 env->SetNativeModuleFailureInfoClass(thread_, nativeModuleFailureInfoHClass.GetTaggedValue());
3813 [[maybe_unused]] EcmaHandleScope scope(thread_);
3828 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3842 JSHandle<JSTaggedValue> id(thread_->GlobalConstants()->GetHandledEmptyString());
3843 JSHandle<JSTaggedValue> path(thread_->GlobalConstants()->GetHandledEmptyString());
3846 JSHandle<JSTaggedValue> filename(thread_->GlobalConstants()->GetHandledEmptyString());
3849 JSHandle<JSTaggedValue> cache = JSHandle<JSTaggedValue>::Cast(CjsModuleCache::Create(thread_,
3864 env->SetCjsModuleFunction(thread_, cjsModuleFunction);
3869 [[maybe_unused]] EcmaHandleScope scope(thread_);
3885 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3889 env->SetCjsExportsFunction(thread_, cjsExportsFunction);
3894 [[maybe_unused]] EcmaHandleScope scope(thread_);
3908 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread_,
3915 env->SetCjsRequireFunction(thread_, cjsRequireFunction);
3925 props->Set(thread_, 0, defaultKey);
3926 props->Set(thread_, 1, emptyObj);
3929 obj->SetPropertyInlinedProps(thread_, 0, props->Get(1));
3930 env->SetExportOfScript(thread_, obj);
3998 PropertyDescriptor desc(thread_, env->GetSBuiltininMapFunction(), true, false, true);
3999 JSObject::DefineOwnProperty(thread_, globalObject, nameString, desc);
4003 PropertyDescriptor desc(thread_, env->GetSBuiltininSetFunction(), true, false, true);
4004 JSObject::DefineOwnProperty(thread_, globalObject, nameString, desc);
4008 PropertyDescriptor desc(thread_, env->GetSharedArrayFunction(), true, false, true);
4009 JSObject::DefineOwnProperty(thread_, globalObject, nameString, desc);
4013 PropertyDescriptor desc(thread_, env->GetSBuiltininArrayBufferFunction(), true, false, true);
4014 JSObject::DefineOwnProperty(thread_, globalObject, nameString, desc);
4020 PropertyDescriptor desc(thread_, env->Get##ctorName##Function(), true, false, true); \
4021 JSObject::DefineOwnProperty(thread_, globalObject, nameString, desc); \