Lines Matching refs:factory
209 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory();
210 JSHandle<JSTaggedValue> obj(factory->NewJSObjectByConstructor(JSHandle<JSFunction>(objFun), objFun));
221 static JSHandle<JSMap> NewJSMap(JSThread *thread, ObjectFactory *factory, JSHandle<JSTaggedValue> proto)
223 JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSMap::SIZE, JSType::JS_MAP, proto);
224 JSHandle<JSMap> jsMap = JSHandle<JSMap>::Cast(factory->NewJSObjectWithInit(mapClass));
230 static JSHandle<JSSharedMap> NewJSSharedMap(JSThread *thread, ObjectFactory *factory)
235 JSHandle<JSHClass> mapClass = factory->NewSEcmaHClass(JSSharedMap::SIZE, 0,
237 JSHandle<JSSharedMap> jsMap = JSHandle<JSSharedMap>::Cast(factory->NewJSObjectWithInit(mapClass));
245 static JSHandle<JSSet> NewJSSet(JSThread *thread, ObjectFactory *factory, JSHandle<JSTaggedValue> proto)
247 JSHandle<JSHClass> setClass = factory->NewEcmaHClass(JSSet::SIZE, JSType::JS_SET, proto);
248 JSHandle<JSSet> jsSet = JSHandle<JSSet>::Cast(factory->NewJSObjectWithInit(setClass));
254 static JSHandle<JSSharedSet> NewJSSharedSet(JSThread *thread, ObjectFactory *factory)
259 JSHandle<JSHClass> setClass = factory->NewSEcmaHClass(JSSharedSet::SIZE, 0,
261 JSHandle<JSSharedSet> jsSet = JSHandle<JSSharedSet>::Cast(factory->NewJSObjectWithInit(setClass));
269 static JSHandle<JSAPIHashMap> NewJSAPIHashMap(JSThread *thread, ObjectFactory *factory)
273 JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSAPIHashMap::SIZE, JSType::JS_API_HASH_MAP, proto);
274 JSHandle<JSAPIHashMap> jsHashMap = JSHandle<JSAPIHashMap>::Cast(factory->NewJSObjectWithInit(mapClass));
280 static JSHandle<JSAPIHashSet> NewJSAPIHashSet(JSThread *thread, ObjectFactory *factory)
284 JSHandle<JSHClass> setClass = factory->NewEcmaHClass(JSAPIHashSet::SIZE, JSType::JS_API_HASH_SET, proto);
285 JSHandle<JSAPIHashSet> jsHashSet = JSHandle<JSAPIHashSet>::Cast(factory->NewJSObjectWithInit(setClass));
291 static JSHandle<JSAPITreeMap> NewJSAPITreeMap(JSThread *thread, ObjectFactory *factory)
295 JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSAPITreeMap::SIZE, JSType::JS_API_TREE_MAP, proto);
296 JSHandle<JSAPITreeMap> jsTreeMap = JSHandle<JSAPITreeMap>::Cast(factory->NewJSObjectWithInit(mapClass));
302 static JSHandle<JSAPITreeSet> NewJSAPITreeSet(JSThread *thread, ObjectFactory *factory)
306 JSHandle<JSHClass> setClass = factory->NewEcmaHClass(JSAPITreeSet::SIZE, JSType::JS_API_TREE_SET, proto);
307 JSHandle<JSAPITreeSet> jsTreeSet = JSHandle<JSAPITreeSet>::Cast(factory->NewJSObjectWithInit(setClass));
313 static JSHandle<JSAPIPlainArray> NewJSAPIPlainArray(JSThread *thread, ObjectFactory *factory)
317 JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSAPIPlainArray::SIZE, JSType::JS_API_PLAIN_ARRAY, proto);
318 JSHandle<JSAPIPlainArray> jSAPIPlainArray = JSHandle<JSAPIPlainArray>::Cast(factory->NewJSObjectWithInit(mapClass));
329 static JSHandle<JSAPIList> NewJSAPIList(JSThread *thread, ObjectFactory *factory)
333 JSHandle<JSHClass> listClass = factory->NewEcmaHClass(JSAPIList::SIZE, JSType::JS_API_LIST, proto);
334 JSHandle<JSAPIList> jsAPIList = JSHandle<JSAPIList>::Cast(factory->NewJSObjectWithInit(listClass));
340 static JSHandle<JSAPILinkedList> NewJSAPILinkedList(JSThread *thread, ObjectFactory *factory)
344 JSHandle<JSHClass> mapClass = factory->NewEcmaHClass(JSAPILinkedList::SIZE, JSType::JS_API_LINKED_LIST, proto);
345 JSHandle<JSAPILinkedList> jsAPILinkedList = JSHandle<JSAPILinkedList>::Cast(factory->NewJSObjectWithInit(mapClass));
351 static JSHandle<JSObject> NewJSObject(JSThread *thread, ObjectFactory *factory, JSHandle<GlobalEnv> globalEnv)
355 JSHandle<JSObject> jsObj = factory->NewJSObjectByConstructor(JSHandle<JSFunction>(jsFunc1), jsFunc1);
359 static JSHandle<JSAPIArrayList> NewJSAPIArrayList(JSThread *thread, ObjectFactory *factory,
363 factory->NewEcmaHClass(JSAPIArrayList::SIZE, JSType::JS_API_ARRAY_LIST, proto);
364 JSHandle<JSAPIArrayList> jsArrayList = JSHandle<JSAPIArrayList>::Cast(factory->NewJSObjectWithInit(arrayListClass));
369 static JSHandle<JSAPIStack> NewJSAPIStack(ObjectFactory *factory, JSHandle<JSTaggedValue> proto)
371 JSHandle<JSHClass> stackClass = factory->NewEcmaHClass(JSAPIStack::SIZE, JSType::JS_API_STACK, proto);
372 JSHandle<JSAPIStack> jsStack = JSHandle<JSAPIStack>::Cast(factory->NewJSObjectWithInit(stackClass));
377 static JSHandle<JSRegExp> NewJSRegExp(JSThread *thread, ObjectFactory *factory, JSHandle<JSTaggedValue> proto)
380 factory->NewEcmaHClass(JSRegExp::SIZE, JSType::JS_REG_EXP, proto);
381 JSHandle<JSRegExp> jSRegExp = JSHandle<JSRegExp>::Cast(factory->NewJSObject(jSRegExpClass));
390 static JSHandle<JSAPILightWeightMap> NewJSAPILightWeightMap(JSThread *thread, ObjectFactory *factory)
395 factory->NewEcmaHClass(JSAPILightWeightMap::SIZE, JSType::JS_API_LIGHT_WEIGHT_MAP, proto);
397 JSHandle<JSAPILightWeightMap>::Cast(factory->NewJSObjectWithInit(lwmapClass));
399 JSHandle<JSTaggedValue>(factory->NewTaggedArray(JSAPILightWeightMap::DEFAULT_CAPACITY_LENGTH));
401 JSHandle<JSTaggedValue>(factory->NewTaggedArray(JSAPILightWeightMap::DEFAULT_CAPACITY_LENGTH));
403 JSHandle<JSTaggedValue>(factory->NewTaggedArray(JSAPILightWeightMap::DEFAULT_CAPACITY_LENGTH));
411 static JSHandle<JSAPILightWeightSet> NewJSAPILightWeightSet(JSThread *thread, ObjectFactory *factory)
416 factory->NewEcmaHClass(JSAPILightWeightSet::SIZE, JSType::JS_API_LIGHT_WEIGHT_SET, proto);
418 JSHandle<JSAPILightWeightSet>::Cast(factory->NewJSObjectWithInit(setClass));
429 static JSHandle<JSAPIQueue> NewJSAPIQueue(JSThread *thread, ObjectFactory *factory, JSHandle<JSTaggedValue> proto)
431 JSHandle<JSHClass> queueClass = factory->NewEcmaHClass(JSAPIQueue::SIZE, JSType::JS_API_QUEUE, proto);
432 JSHandle<JSAPIQueue> jsQueue = JSHandle<JSAPIQueue>::Cast(factory->NewJSObjectWithInit(queueClass));
433 JSHandle<TaggedArray> newElements = factory->NewTaggedArray(JSAPIQueue::DEFAULT_CAPACITY_LENGTH);
441 static JSHandle<JSAPIDeque> NewJSAPIDeque(JSThread *thread, ObjectFactory *factory, JSHandle<JSTaggedValue> proto)
443 JSHandle<JSHClass> dequeClass = factory->NewEcmaHClass(JSAPIDeque::SIZE, JSType::JS_API_DEQUE, proto);
444 JSHandle<JSAPIDeque> jsDeque = JSHandle<JSAPIDeque>::Cast(factory->NewJSObjectWithInit(dequeClass));
445 JSHandle<TaggedArray> newElements = factory->NewTaggedArray(JSAPIDeque::DEFAULT_CAPACITY_LENGTH);
452 static JSHandle<JSAPIVector> NewJSAPIVector(ObjectFactory *factory, JSHandle<JSTaggedValue> proto)
454 JSHandle<JSHClass> vectorClass = factory->NewEcmaHClass(JSAPIVector::SIZE, JSType::JS_API_VECTOR, proto);
455 JSHandle<JSAPIVector> jsVector = JSHandle<JSAPIVector>::Cast(factory->NewJSObjectWithInit(vectorClass));
463 auto factory = thread->GetEcmaVM()->GetFactory();
493 factory->NewEcmaHClass(ClassName::SIZE, JSType::TypeName, proto); \
494 JSHandle<JSObject> object##ClassName = factory->NewJSObjectWithInit(class##ClassName); \
514 JSHandle<JSObject> jsObj = NewJSObject(thread, factory, globalEnv);
520 JSHandle<JSRealm> jsRealm = factory->NewJSRealm();
547 JSHandle<JSObject> proxyRevocFunc = factory->NewJSObjectWithInit(proxyRevocClass);
555 JSHandle<JSObject> promiseReactFunc = factory->NewJSObjectWithInit(promiseReactClass);
563 JSHandle<JSObject> promiseExeFunc = factory->NewJSObjectWithInit(promiseExeClass);
571 JSHandle<JSObject> moduleFulfilledFunc = factory->NewJSObjectWithInit(moduleFulfilledClass);
579 JSHandle<JSObject> moduleRejectedFunc = factory->NewJSObjectWithInit(moduleRejectedClass);
587 JSHandle<JSObject> promiseAllFunc = factory->NewJSObjectWithInit(promiseAllClass);
595 JSHandle<JSObject> promiseAnyFunc = factory->NewJSObjectWithInit(promiseAnyClass);
603 JSHandle<JSObject> promiseAllSettledFunc = factory->NewJSObjectWithInit(promiseAllSettledClass);
611 JSHandle<JSObject> promiseFinallyFunc = factory->NewJSObjectWithInit(promiseFinallyClass);
619 JSHandle<JSObject> promiseValueFunc = factory->NewJSObjectWithInit(promiseValueClass);
638 JSHandle<JSIntlBoundFunction> intlBoundFunc = factory->NewJSIntlBoundFunction(
645 JSHandle<JSAsyncAwaitStatusFunction> asyncAwaitFunc = factory->NewJSAsyncAwaitStatusFunction(
662 JSHandle<JSSet> jsSet = NewJSSet(thread, factory, proto);
668 JSHandle<JSSharedSet> jsSet = NewJSSharedSet(thread, factory);
674 JSHandle<JSMap> jsMap = NewJSMap(thread, factory, proto);
680 JSHandle<JSSharedMap> jsMap = NewJSSharedMap(thread, factory);
686 JSHandle<JSHClass> weakMapClass = factory->NewEcmaHClass(JSWeakMap::SIZE, JSType::JS_WEAK_MAP, proto);
687 JSHandle<JSWeakMap> jsWeakMap = JSHandle<JSWeakMap>::Cast(factory->NewJSObjectWithInit(weakMapClass));
695 JSHandle<JSHClass> weakSetClass = factory->NewEcmaHClass(JSWeakSet::SIZE, JSType::JS_WEAK_SET, proto);
696 JSHandle<JSWeakSet> jsWeakSet = JSHandle<JSWeakSet>::Cast(factory->NewJSObjectWithInit(weakSetClass));
704 JSHandle<JSHClass> weakRefClass = factory->NewEcmaHClass(JSWeakRef::SIZE, JSType::JS_WEAK_REF, proto);
705 JSHandle<JSWeakRef> jsWeakRef = JSHandle<JSWeakRef>::Cast(factory->NewJSObjectWithInit(weakRefClass));
713 factory->NewEcmaHClass(JSFinalizationRegistry::SIZE, JSType::JS_FINALIZATION_REGISTRY, proto);
715 JSHandle<JSFinalizationRegistry>::Cast(factory->NewJSObjectWithInit(finalizationRegistryClass));
723 JSHandle<CellRecord> cellRecord = factory->NewCellRecord();
729 JSHandle<JSHClass> dateClass = factory->NewEcmaHClass(JSDate::SIZE, JSType::JS_DATE, proto);
730 JSHandle<JSDate> date = JSHandle<JSDate>::Cast(factory->NewJSObjectWithInit(dateClass));
738 JSHandle<JSTaggedValue> array(thread, factory->NewJSArray().GetTaggedValue());
739 JSHandle<JSTaggedValue> keys(thread, factory->EmptyArray().GetTaggedValue());
741 JSHandle<JSForInIterator> forInIter = factory->NewJSForinIterator(array, keys, hclass);
748 factory->NewJSMapIterator(NewJSMap(thread, factory, proto), IterationKind::KEY);
755 factory->NewJSMapIterator(NewJSSharedMap(thread, factory), IterationKind::KEY);
762 factory->NewJSSetIterator(NewJSSet(thread, factory, proto), IterationKind::KEY);
769 factory->NewJSSetIterator(NewJSSharedSet(thread, factory), IterationKind::KEY);
776 JSHandle<JSTaggedValue> jsRegExp(NewJSRegExp(thread, factory, proto));
778 factory->NewJSRegExpIterator(jsRegExp, emptyString, false, false);
785 factory->NewJSArrayIterator(JSHandle<JSObject>::Cast(factory->NewJSArray()), IterationKind::KEY);
791 JSHandle<JSSharedArrayIterator> arrayIter = factory->NewJSSharedArrayIterator(
792 JSHandle<JSObject>::Cast(factory->NewJSSArray()), IterationKind::KEY);
895 JSHandle<JSAsyncFuncObject> asyncFuncObject = factory->NewJSAsyncFuncObject();
901 JSHandle<JSArray> jsArray = factory->NewJSArray();
907 JSHandle<JSSharedArray> jsArray = factory->NewJSSArray();
955 JSHandle<JSTaggedValue> emptyObj(thread, NewJSObject(thread, factory, globalEnv).GetTaggedValue());
956 JSHandle<JSProxy> proxy = factory->NewJSProxy(emptyObj, emptyObj);
962 JSHandle<JSHClass> hclass = factory->NewEcmaHClass(JSHClass::SIZE, JSType::HCLASS, proto);
981 JSHandle<ProfileTypeInfoCell> profileTypeInfoCell = factory->NewProfileTypeInfoCell(handleUndefined);
989 JSHandle<FunctionTemplate> funcTemp = factory->NewFunctionTemplate(methodHandle, handleUndefined, 0);
998 JSHandle<TaggedArray> taggedArray = factory->NewTaggedArray(4);
1003 JSHandle<ConstantPool> constantPool = factory->NewConstantPool(4);
1008 JSHandle<ProfileTypeInfo> info = factory->NewProfileTypeInfo(4);
1013 JSHandle<ExtraProfileTypeInfo> info = factory->NewExtraProfileTypeInfo();
1018 JSHandle<TaggedArray> dict = factory->NewDictionaryArray(4);
1023 JSHandle<ByteArray> byteArray = factory->NewByteArray(4, 8);
1028 JSHandle<COWTaggedArray> dict = factory->NewCOWTaggedArray(4);
1033 JSHandle<MutantTaggedArray> array = factory->NewMutantTaggedArray(4);
1038 JSHandle<COWMutantTaggedArray> array = factory->NewCOWMutantTaggedArray(4);
1049 JSHandle<AccessorData> accessor = factory->NewAccessorData();
1055 JSHandle<JSSymbol> symbol = factory->NewJSSymbol();
1061 JSHandle<GeneratorContext> genContext = factory->NewGeneratorContext();
1067 JSHandle<PrototypeHandler> protoHandler = factory->NewPrototypeHandler();
1073 JSHandle<TransitionHandler> transitionHandler = factory->NewTransitionHandler();
1079 JSHandle<TransWithProtoHandler> transWithProtoHandler = factory->NewTransWithProtoHandler();
1085 JSHandle<StoreTSHandler> storeTSHandler = factory->NewStoreTSHandler();
1091 JSHandle<PropertyBox> PropertyBox = factory->NewPropertyBox(globalConst->GetHandledEmptyArray());
1097 JSHandle<ProtoChangeMarker> protoMaker = factory->NewProtoChangeMarker();
1103 JSHandle<MarkerCell> markerCell = factory->NewMarkerCell();
1113 JSHandle<ProtoChangeDetails> protoDetails = factory->NewProtoChangeDetails();
1124 JSHandle<Program> program = factory->NewProgram();
1130 JSHandle<PromiseCapability> promiseCapa = factory->NewPromiseCapability();
1136 JSHandle<PromiseRecord> promiseRecord = factory->NewPromiseRecord();
1142 JSHandle<ResolvingFunctionsRecord> ResolvingFunc = factory->NewResolvingFunctionsRecord();
1148 JSHandle<AsyncGeneratorRequest> asyncGeneratorRequest = factory->NewAsyncGeneratorRequest();
1154 JSHandle<JSTaggedValue> emptyObj(thread, NewJSObject(thread, factory, globalEnv).GetTaggedValue());
1155 JSHandle<JSTaggedValue> emptyMethod(thread, NewJSObject(thread, factory, globalEnv).GetTaggedValue());
1157 factory->NewAsyncIteratorRecord(emptyObj, emptyMethod, false);
1172 JSHandle<PromiseReaction> promiseReact = factory->NewPromiseReaction();
1178 JSHandle<JSTaggedValue> emptyObj(thread, NewJSObject(thread, factory, globalEnv).GetTaggedValue());
1179 JSHandle<PromiseIteratorRecord> promiseIter = factory->NewPromiseIteratorRecord(emptyObj, false);
1185 JSHandle<ecmascript::job::MicroJobQueue> microJob = factory->NewMicroJobQueue();
1197 JSHandle<TaggedObject> pendingJob(thread, factory->NewObject(pendingClass));
1206 factory->NewCompletionRecord(CompletionRecordType::NORMAL, globalConst->GetHandledEmptyArray());
1217 JSHandle<ClassInfoExtractor> classInfoExtractor = factory->NewClassInfoExtractor(
1225 JSHandle<JSAPIArrayList> jsArrayList = NewJSAPIArrayList(thread, factory, proto);
1232 JSHandle<JSAPIArrayList> jsArrayList = NewJSAPIArrayList(thread, factory, proto);
1233 JSHandle<JSAPIArrayListIterator> jsArrayListIter = factory->NewJSAPIArrayListIterator(jsArrayList);
1253 JSHandle<JSAPIHashMap> jsHashMap = NewJSAPIHashMap(thread, factory);
1259 JSHandle<JSAPIHashSet> jsHashSet = NewJSAPIHashSet(thread, factory);
1265 JSHandle<JSAPIHashMap> jsHashMap = NewJSAPIHashMap(thread, factory);
1267 factory->NewJSAPIHashMapIterator(jsHashMap, IterationKind::KEY);
1273 JSHandle<JSAPIHashSet> jsHashSet = NewJSAPIHashSet(thread, factory);
1275 factory->NewJSAPIHashSetIterator(jsHashSet, IterationKind::KEY);
1281 JSHandle<JSAPILightWeightMap> jSAPILightWeightMap = NewJSAPILightWeightMap(thread, factory);
1287 JSHandle<JSAPILightWeightMap> jSAPILightWeightMap = NewJSAPILightWeightMap(thread, factory);
1289 factory->NewJSAPILightWeightMapIterator(jSAPILightWeightMap, IterationKind::KEY);
1295 JSHandle<JSAPILightWeightSet> jSAPILightWeightSet = NewJSAPILightWeightSet(thread, factory);
1302 factory->NewJSAPILightWeightSetIterator(NewJSAPILightWeightSet(thread, factory),
1310 JSHandle<JSAPIQueue> jsQueue = NewJSAPIQueue(thread, factory, proto);
1317 JSHandle<JSAPIQueue> jsQueue = NewJSAPIQueue(thread, factory, proto);
1319 factory->NewJSAPIQueueIterator(jsQueue);
1325 JSHandle<JSAPIPlainArray> jSAPIPlainArray = NewJSAPIPlainArray(thread, factory);
1331 JSHandle<JSAPIPlainArray> jSAPIPlainArray = NewJSAPIPlainArray(thread, factory);
1333 factory->NewJSAPIPlainArrayIterator(jSAPIPlainArray, IterationKind::KEY);
1340 JSHandle<JSAPITreeMap> jsTreeMap = NewJSAPITreeMap(thread, factory);
1347 JSHandle<JSAPITreeSet> jsTreeSet = NewJSAPITreeSet(thread, factory);
1354 JSHandle<JSAPITreeMap> jsTreeMap = NewJSAPITreeMap(thread, factory);
1356 factory->NewJSAPITreeMapIterator(jsTreeMap, IterationKind::KEY);
1363 JSHandle<JSAPITreeSet> jsTreeSet = NewJSAPITreeSet(thread, factory);
1365 factory->NewJSAPITreeSetIterator(jsTreeSet, IterationKind::KEY);
1371 JSHandle<JSAPIDeque> jsDeque = NewJSAPIDeque(thread, factory, proto);
1378 factory->NewJSAPIDequeIterator(NewJSAPIDeque(thread, factory, proto));
1384 JSHandle<JSAPIStack> jsStack = NewJSAPIStack(factory, proto);
1391 factory->NewJSAPIStackIterator(NewJSAPIStack(factory, proto));
1397 JSHandle<JSAPIVector> jsVector = NewJSAPIVector(factory, proto);
1404 factory->NewJSAPIVectorIterator(NewJSAPIVector(factory, proto));
1411 JSHandle<JSAPIList> jsAPIList = NewJSAPIList(thread, factory);
1418 JSHandle<JSAPILinkedList> jsAPILinkedList = NewJSAPILinkedList(thread, factory);
1425 JSHandle<JSAPIList> jsAPIList = NewJSAPIList(thread, factory);
1426 JSHandle<JSAPIListIterator> jsAPIListIter = factory->NewJSAPIListIterator(jsAPIList);
1433 JSHandle<JSAPILinkedList> jsAPILinkedList = NewJSAPILinkedList(thread, factory);
1435 factory->NewJSAPILinkedListIterator(jsAPILinkedList);
1445 JSHandle<SourceTextModule> moduleSourceRecord = factory->NewSourceTextModule();
1451 JSHandle<ImportEntry> importEntry = factory->NewImportEntry();
1457 JSHandle<LocalExportEntry> localExportEntry = factory->NewLocalExportEntry();
1463 JSHandle<IndirectExportEntry> indirectExportEntry = factory->NewIndirectExportEntry();
1469 JSHandle<StarExportEntry> starExportEntry = factory->NewStarExportEntry();
1475 JSHandle<ResolvedBinding> resolvedBinding = factory->NewResolvedBindingRecord();
1481 JSHandle<ResolvedIndexBinding> resolvedBinding = factory->NewResolvedIndexBindingRecord();
1487 JSHandle<ResolvedRecordIndexBinding> recordBinding = factory->NewSResolvedRecordIndexBindingRecord();
1493 JSHandle<ResolvedRecordBinding> recordBinding = factory->NewSResolvedRecordBindingRecord();
1499 JSHandle<ModuleNamespace> moduleNamespace = factory->NewModuleNamespace();
1505 JSHandle<NativeModuleFailureInfo> nativeFailureInfo = factory->NewNativeModuleFailureInfo();
1511 JSHandle<CjsExports> cjsExports = factory->NewCjsExports();
1517 JSHandle<CjsModule> cjsModule = factory->NewCjsModule();
1523 JSHandle<CjsRequire> cjsRequire = factory->NewCjsRequire();
1541 JSHandle<ClassLiteral> classLiteral = factory->NewClassLiteral();