Lines Matching full:thread
61 JSThread *thread = msg->GetThread(); in Load() local
62 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Load()
68 … THROW_TYPE_ERROR_AND_RETURN(thread, "Incorrect input parameters", JSTaggedValue::Exception()); in Load()
72 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in Load()
74 …JSHandle<JSObject> undefinedIteratorResult = JSIterator::CreateIterResultObject(thread, undefinedH… in Load()
80 … res = InitializeContainer(thread, thisValue, InitializeArrayList, "ArrayListConstructor"); in Load()
84 res = InitializeContainer(thread, thisValue, InitializeDeque, "DequeConstructor"); in Load()
88 …res = InitializeContainer(thread, thisValue, InitializeLightWeightMap, "LightWeightMapConstructor"… in Load()
92 …res = InitializeContainer(thread, thisValue, InitializeLightWeightSet, "LightWeightSetConstructor"… in Load()
96 … res = InitializeContainer(thread, thisValue, InitializePlainArray, "PlainArrayConstructor"); in Load()
100 res = InitializeContainer(thread, thisValue, InitializeQueue, "QueueConstructor"); in Load()
104 res = InitializeContainer(thread, thisValue, InitializeStack, "StackConstructor"); in Load()
108 res = InitializeContainer(thread, thisValue, InitializeTreeMap, "TreeMapConstructor"); in Load()
112 res = InitializeContainer(thread, thisValue, InitializeTreeSet, "TreeSetConstructor"); in Load()
116 res = InitializeContainer(thread, thisValue, InitializeVector, "VectorConstructor"); in Load()
120 … res = InitializeContainer(thread, thisValue, InitializeBitVector, "BitVectorConstructor"); in Load()
124 res = InitializeContainer(thread, thisValue, InitializeList, "ListConstructor"); in Load()
128 … res = InitializeContainer(thread, thisValue, InitializeLinkedList, "LinkedListConstructor"); in Load()
132 res = InitializeContainer(thread, thisValue, InitializeHashMap, "HashMapConstructor"); in Load()
136 res = InitializeContainer(thread, thisValue, InitializeHashSet, "HashSetConstructor"); in Load()
149 JSTaggedValue ContainersPrivate::InitializeContainer(JSThread *thread, const JSHandle<JSObject> &ob… in InitializeContainer() argument
152 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeContainer()
155 (thread, obj.GetTaggedValue(), key.GetTaggedValue()); in InitializeContainer()
159 JSHandle<JSTaggedValue> map = func(thread); in InitializeContainer()
160 SetFrozenConstructor(thread, obj, name, map); in InitializeContainer()
164 JSHandle<JSFunction> ContainersPrivate::NewContainerConstructor(JSThread *thread, const JSHandle<JS… in NewContainerConstructor() argument
167 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in NewContainerConstructor()
168 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NewContainerConstructor()
172 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in NewContainerConstructor()
173 JSFunction::SetFunctionLength(thread, ctor, JSTaggedValue(length)); in NewContainerConstructor()
175 JSFunction::SetFunctionName(thread, JSHandle<JSFunctionBase>(ctor), nameString, in NewContainerConstructor()
178 PropertyDescriptor descriptor1(thread, JSHandle<JSTaggedValue>::Cast(ctor), true, false, true); in NewContainerConstructor()
179 JSObject::DefineOwnProperty(thread, prototype, constructorKey, descriptor1); in NewContainerConstructor()
182 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, ctor, prototype.GetTaggedValue()); in NewContainerConstructor()
187 void ContainersPrivate::SetFrozenFunction(JSThread *thread, const JSHandle<JSObject> &obj, const ch… in SetFrozenFunction() argument
190 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetFrozenFunction()
192 JSHandle<JSFunction> function = NewFunction(thread, keyString, func, length, builtinId); in SetFrozenFunction()
193 PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>(function), false, false, false); in SetFrozenFunction()
194 JSObject::DefineOwnProperty(thread, obj, keyString, descriptor); in SetFrozenFunction()
197 void ContainersPrivate::SetFrozenConstructor(JSThread *thread, const JSHandle<JSObject> &obj, const… in SetFrozenConstructor() argument
201 JSObject::PreventExtensions(thread, JSHandle<JSObject>::Cast(value)); in SetFrozenConstructor()
203 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetFrozenConstructor()
205 PropertyDescriptor descriptor(thread, value, false, false, false); in SetFrozenConstructor()
206 JSObject::DefineOwnProperty(thread, obj, key, descriptor); in SetFrozenConstructor()
209 JSHandle<JSFunction> ContainersPrivate::NewFunction(JSThread *thread, const JSHandle<JSTaggedValue>… in NewFunction() argument
213 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NewFunction()
215 factory->NewJSFunction(thread->GetEcmaVM()->GetGlobalEnv(), reinterpret_cast<void *>(func), in NewFunction()
217 JSFunction::SetFunctionLength(thread, function, JSTaggedValue(length)); in NewFunction()
219 …JSFunction::SetFunctionName(thread, baseFunction, key, thread->GlobalConstants()->GetHandledUndefi… in NewFunction()
223 JSHandle<JSTaggedValue> ContainersPrivate::CreateGetter(JSThread *thread, EcmaEntrypoint func, cons… in CreateGetter() argument
226 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in CreateGetter()
227 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateGetter()
229 JSFunction::SetFunctionLength(thread, function, JSTaggedValue(length)); in CreateGetter()
231 JSHandle<JSTaggedValue> prefix = thread->GlobalConstants()->GetHandledGetString(); in CreateGetter()
232 JSFunction::SetFunctionName(thread, JSHandle<JSFunctionBase>(function), funcName, prefix); in CreateGetter()
236 void ContainersPrivate::SetGetter(JSThread *thread, const JSHandle<JSObject> &obj, const JSHandle<J… in SetGetter() argument
239 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetGetter()
241 accessor->SetGetter(thread, getter); in SetGetter()
243 JSObject::AddAccessor(thread, JSHandle<JSTaggedValue>::Cast(obj), key, accessor, attr); in SetGetter()
246 void ContainersPrivate::SetFunctionAtSymbol(JSThread *thread, const JSHandle<GlobalEnv> &env, in SetFunctionAtSymbol() argument
250 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetFunctionAtSymbol()
252 JSFunction::SetFunctionLength(thread, function, JSTaggedValue(length)); in SetFunctionAtSymbol()
255 …JSFunction::SetFunctionName(thread, baseFunction, nameString, thread->GlobalConstants()->GetHandle… in SetFunctionAtSymbol()
256 …PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>::Cast(function), false, false, false… in SetFunctionAtSymbol()
257 JSObject::DefineOwnProperty(thread, obj, symbol, descriptor); in SetFunctionAtSymbol()
260 void ContainersPrivate::SetStringTagSymbol(JSThread *thread, const JSHandle<GlobalEnv> &env, in SetStringTagSymbol() argument
263 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetStringTagSymbol()
266 PropertyDescriptor desc(thread, tag, false, false, false); in SetStringTagSymbol()
267 JSObject::DefineOwnProperty(thread, obj, symbol, desc); in SetStringTagSymbol()
270 JSHandle<JSTaggedValue> ContainersPrivate::InitializeArrayList(JSThread *thread) in InitializeArrayList() argument
272 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeArrayList()
273 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeArrayList()
282 … thread, prototype, ContainersArrayList::ArrayListConstructor, "ArrayList", FuncLength::ZERO)); in InitializeArrayList()
283 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeArrayList()
288 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(prototype), constructorKey, arrayListFunctio… in InitializeArrayList()
289 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeArrayList()
292 SetFrozenFunction(thread, prototype, "add", ContainersArrayList::Add, FuncLength::ONE); in InitializeArrayList()
293 SetFrozenFunction(thread, prototype, "insert", ContainersArrayList::Insert, FuncLength::TWO); in InitializeArrayList()
294 SetFrozenFunction(thread, prototype, "clear", ContainersArrayList::Clear, FuncLength::ZERO); in InitializeArrayList()
295 SetFrozenFunction(thread, prototype, "clone", ContainersArrayList::Clone, FuncLength::ZERO); in InitializeArrayList()
296 SetFrozenFunction(thread, prototype, "has", ContainersArrayList::Has, FuncLength::ONE); in InitializeArrayList()
297 …SetFrozenFunction(thread, prototype, "getCapacity", ContainersArrayList::GetCapacity, FuncLength::… in InitializeArrayList()
298 SetFrozenFunction(thread, prototype, "increaseCapacityTo", in InitializeArrayList()
300 SetFrozenFunction(thread, prototype, "trimToCurrentLength", in InitializeArrayList()
302 …SetFrozenFunction(thread, prototype, "getIndexOf", ContainersArrayList::GetIndexOf, FuncLength::ON… in InitializeArrayList()
303 SetFrozenFunction(thread, prototype, "isEmpty", ContainersArrayList::IsEmpty, FuncLength::ZERO); in InitializeArrayList()
304 …SetFrozenFunction(thread, prototype, "getLastIndexOf", ContainersArrayList::GetLastIndexOf, FuncLe… in InitializeArrayList()
305 …SetFrozenFunction(thread, prototype, "removeByIndex", ContainersArrayList::RemoveByIndex, FuncLeng… in InitializeArrayList()
306 SetFrozenFunction(thread, prototype, "remove", ContainersArrayList::Remove, FuncLength::ONE); in InitializeArrayList()
307 …SetFrozenFunction(thread, prototype, "removeByRange", ContainersArrayList::RemoveByRange, FuncLeng… in InitializeArrayList()
308 …SetFrozenFunction(thread, prototype, "replaceAllElements", ContainersArrayList::ReplaceAllElements, in InitializeArrayList()
310 SetFrozenFunction(thread, prototype, "sort", ContainersArrayList::Sort, FuncLength::ONE); in InitializeArrayList()
311 …SetFrozenFunction(thread, prototype, "subArrayList", ContainersArrayList::SubArrayList, FuncLength… in InitializeArrayList()
312 …SetFrozenFunction(thread, prototype, "convertToArray", ContainersArrayList::ConvertToArray, FuncLe… in InitializeArrayList()
313 SetFrozenFunction(thread, prototype, "forEach", ContainersArrayList::ForEach, FuncLength::TWO, in InitializeArrayList()
316 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeArrayList()
317 SetStringTagSymbol(thread, env, prototype, "ArrayList"); in InitializeArrayList()
319 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersArrayList::GetSize, "length", in InitializeArrayList()
321 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeArrayList()
322 SetGetter(thread, prototype, lengthKey, lengthGetter); in InitializeArrayList()
324 SetFunctionAtSymbol(thread, env, prototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeArrayList()
326 ContainersPrivate::InitializeArrayListIterator(thread, env, globalConst); in InitializeArrayList()
331 void ContainersPrivate::InitializeArrayListIterator(JSThread *thread, const JSHandle<GlobalEnv> &en… in InitializeArrayListIterator() argument
334 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeArrayListIterator()
341 …SetFrozenFunction(thread, arrayListIteratorPrototype, "next", JSAPIArrayListIterator::Next, FuncLe… in InitializeArrayListIterator()
342 SetStringTagSymbol(thread, env, arrayListIteratorPrototype, "ArrayList Iterator"); in InitializeArrayListIterator()
347 JSHandle<JSTaggedValue> ContainersPrivate::InitializeLightWeightMap(JSThread *thread) in InitializeLightWeightMap() argument
349 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeLightWeightMap()
350 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLightWeightMap()
356 … thread, funcPrototype, ContainersLightWeightMap::LightWeightMapConstructor, "LightWeightMap", in InitializeLightWeightMap()
358 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeLightWeightMap()
363 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(funcPrototype), constructorKey, lightWeightM… in InitializeLightWeightMap()
364 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeLightWeightMap()
367 …SetFrozenFunction(thread, funcPrototype, "hasAll", ContainersLightWeightMap::HasAll, FuncLength::O… in InitializeLightWeightMap()
368 …SetFrozenFunction(thread, funcPrototype, "hasKey", ContainersLightWeightMap::HasKey, FuncLength::O… in InitializeLightWeightMap()
369 …SetFrozenFunction(thread, funcPrototype, "hasValue", ContainersLightWeightMap::HasValue, FuncLengt… in InitializeLightWeightMap()
370 …SetFrozenFunction(thread, funcPrototype, "increaseCapacityTo", ContainersLightWeightMap::IncreaseC… in InitializeLightWeightMap()
372 …SetFrozenFunction(thread, funcPrototype, "entries", ContainersLightWeightMap::Entries, FuncLength:… in InitializeLightWeightMap()
373 SetFrozenFunction(thread, funcPrototype, "get", ContainersLightWeightMap::Get, FuncLength::ONE); in InitializeLightWeightMap()
374 …SetFrozenFunction(thread, funcPrototype, "getIndexOfKey", ContainersLightWeightMap::GetIndexOfKey,… in InitializeLightWeightMap()
375 …SetFrozenFunction(thread, funcPrototype, "getIndexOfValue", ContainersLightWeightMap::GetIndexOfVa… in InitializeLightWeightMap()
377 …SetFrozenFunction(thread, funcPrototype, "isEmpty", ContainersLightWeightMap::IsEmpty, FuncLength:… in InitializeLightWeightMap()
378 …SetFrozenFunction(thread, funcPrototype, "getKeyAt", ContainersLightWeightMap::GetKeyAt, FuncLengt… in InitializeLightWeightMap()
379 … SetFrozenFunction(thread, funcPrototype, "keys", ContainersLightWeightMap::Keys, FuncLength::ONE); in InitializeLightWeightMap()
380 …SetFrozenFunction(thread, funcPrototype, "setAll", ContainersLightWeightMap::SetAll, FuncLength::O… in InitializeLightWeightMap()
381 SetFrozenFunction(thread, funcPrototype, "set", ContainersLightWeightMap::Set, FuncLength::ONE); in InitializeLightWeightMap()
382 …SetFrozenFunction(thread, funcPrototype, "remove", ContainersLightWeightMap::Remove, FuncLength::O… in InitializeLightWeightMap()
383 …SetFrozenFunction(thread, funcPrototype, "removeAt", ContainersLightWeightMap::RemoveAt, FuncLengt… in InitializeLightWeightMap()
384 …SetFrozenFunction(thread, funcPrototype, "clear", ContainersLightWeightMap::Clear, FuncLength::ONE… in InitializeLightWeightMap()
385 …SetFrozenFunction(thread, funcPrototype, "setValueAt", ContainersLightWeightMap::SetValueAt, FuncL… in InitializeLightWeightMap()
386 …SetFrozenFunction(thread, funcPrototype, "forEach", ContainersLightWeightMap::ForEach, FuncLength:… in InitializeLightWeightMap()
388 …SetFrozenFunction(thread, funcPrototype, "toString", ContainersLightWeightMap::ToString, FuncLengt… in InitializeLightWeightMap()
389 …SetFrozenFunction(thread, funcPrototype, "getValueAt", ContainersLightWeightMap::GetValueAt, FuncL… in InitializeLightWeightMap()
390 …SetFrozenFunction(thread, funcPrototype, "values", ContainersLightWeightMap::Values, FuncLength::O… in InitializeLightWeightMap()
392 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersLightWeightMap::Length, "len… in InitializeLightWeightMap()
395 SetGetter(thread, funcPrototype, lengthKey, lengthGetter); in InitializeLightWeightMap()
397 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeLightWeightMap()
398 SetFunctionAtSymbol(thread, env, funcPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeLightWeightMap()
401 ContainersPrivate::InitializeLightWeightMapIterator(thread); in InitializeLightWeightMap()
405 void ContainersPrivate::InitializeLightWeightMapIterator(JSThread *thread) in InitializeLightWeightMapIterator() argument
407 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeLightWeightMapIterator()
408 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLightWeightMapIterator()
412 …SetFrozenFunction(thread, lightWeightMapIteratorPrototype, "next", JSAPILightWeightMapIterator::Ne… in InitializeLightWeightMapIterator()
414 SetStringTagSymbol(thread, env, lightWeightMapIteratorPrototype, "LightWeightMap Iterator"); in InitializeLightWeightMapIterator()
415 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeLightWeightMapIterator()
420 JSHandle<JSTaggedValue> ContainersPrivate::InitializeLightWeightSet(JSThread *thread) in InitializeLightWeightSet() argument
422 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeLightWeightSet()
423 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLightWeightSet()
431 …NewContainerConstructor(thread, funcPrototype, ContainersLightWeightSet::LightWeightSetConstructor, in InitializeLightWeightSet()
433 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeLightWeightSet()
437 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(funcPrototype), constructorKey, lightweightS… in InitializeLightWeightSet()
438 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeLightWeightSet()
439 SetFrozenFunction(thread, funcPrototype, "add", ContainersLightWeightSet::Add, FuncLength::ONE); in InitializeLightWeightSet()
440 …SetFrozenFunction(thread, funcPrototype, "addAll", ContainersLightWeightSet::AddAll, FuncLength::O… in InitializeLightWeightSet()
441 …SetFrozenFunction(thread, funcPrototype, "isEmpty", ContainersLightWeightSet::IsEmpty, FuncLength:… in InitializeLightWeightSet()
442 …SetFrozenFunction(thread, funcPrototype, "getValueAt", ContainersLightWeightSet::GetValueAt, FuncL… in InitializeLightWeightSet()
443 …SetFrozenFunction(thread, funcPrototype, "hasAll", ContainersLightWeightSet::HasAll, FuncLength::O… in InitializeLightWeightSet()
444 SetFrozenFunction(thread, funcPrototype, "has", ContainersLightWeightSet::Has, FuncLength::ONE); in InitializeLightWeightSet()
445 …SetFrozenFunction(thread, funcPrototype, "equal", ContainersLightWeightSet::Equal, FuncLength::ONE… in InitializeLightWeightSet()
446 SetFrozenFunction(thread, funcPrototype, "increaseCapacityTo", in InitializeLightWeightSet()
448 …SetFrozenFunction(thread, funcPrototype, "forEach", ContainersLightWeightSet::ForEach, FuncLength:… in InitializeLightWeightSet()
450 …SetFrozenFunction(thread, funcPrototype, "getIndexOf", ContainersLightWeightSet::GetIndexOf, FuncL… in InitializeLightWeightSet()
451 …SetFrozenFunction(thread, funcPrototype, "remove", ContainersLightWeightSet::Remove, FuncLength::Z… in InitializeLightWeightSet()
452 …SetFrozenFunction(thread, funcPrototype, "removeAt", ContainersLightWeightSet::RemoveAt, FuncLengt… in InitializeLightWeightSet()
453 …SetFrozenFunction(thread, funcPrototype, "clear", ContainersLightWeightSet::Clear, FuncLength::ONE… in InitializeLightWeightSet()
454 …SetFrozenFunction(thread, funcPrototype, "toString", ContainersLightWeightSet::ToString, FuncLengt… in InitializeLightWeightSet()
455 …SetFrozenFunction(thread, funcPrototype, "toArray", ContainersLightWeightSet::ToArray, FuncLength:… in InitializeLightWeightSet()
456 …SetFrozenFunction(thread, funcPrototype, "values", ContainersLightWeightSet::Values, FuncLength::O… in InitializeLightWeightSet()
457 …SetFrozenFunction(thread, funcPrototype, "entries", ContainersLightWeightSet::Entries, FuncLength:… in InitializeLightWeightSet()
459 CreateGetter(thread, ContainersLightWeightSet::GetSize, "length", FuncLength::ZERO); in InitializeLightWeightSet()
462 SetGetter(thread, funcPrototype, lengthKey, lengthGetter); in InitializeLightWeightSet()
463 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeLightWeightSet()
464 SetFunctionAtSymbol(thread, env, funcPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeLightWeightSet()
467 InitializeLightWeightSetIterator(thread); in InitializeLightWeightSet()
471 void ContainersPrivate::InitializeLightWeightSetIterator(JSThread *thread) in InitializeLightWeightSetIterator() argument
473 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeLightWeightSetIterator()
474 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLightWeightSetIterator()
475 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeLightWeightSetIterator()
477 …JSHandle<JSHClass>(thread, globalConst->GetHandledJSAPIIteratorFuncHClass().GetObject<JSHClass>()); in InitializeLightWeightSetIterator()
480 …thread, lightWeightSetIteratorPrototype, "next", JSAPILightWeightSetIterator::Next, FuncLength::ON… in InitializeLightWeightSetIterator()
481 SetStringTagSymbol(thread, env, lightWeightSetIteratorPrototype, "LightWeightSet Iterator"); in InitializeLightWeightSetIterator()
486 JSHandle<JSTaggedValue> ContainersPrivate::InitializeTreeMap(JSThread *thread) in InitializeTreeMap() argument
488 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeTreeMap()
489 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeMap()
498 … thread, mapFuncPrototype, ContainersTreeMap::TreeMapConstructor, "TreeMap", FuncLength::ZERO)); in InitializeTreeMap()
499 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeTreeMap()
504 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(mapFuncPrototype), constructorKey, mapFuncti… in InitializeTreeMap()
505 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeTreeMap()
507 SetFrozenFunction(thread, mapFuncPrototype, "set", ContainersTreeMap::Set, FuncLength::TWO); in InitializeTreeMap()
508 SetFrozenFunction(thread, mapFuncPrototype, "get", ContainersTreeMap::Get, FuncLength::ONE); in InitializeTreeMap()
509 … SetFrozenFunction(thread, mapFuncPrototype, "remove", ContainersTreeMap::Remove, FuncLength::ONE); in InitializeTreeMap()
510 … SetFrozenFunction(thread, mapFuncPrototype, "hasKey", ContainersTreeMap::HasKey, FuncLength::ONE); in InitializeTreeMap()
511 …SetFrozenFunction(thread, mapFuncPrototype, "hasValue", ContainersTreeMap::HasValue, FuncLength::O… in InitializeTreeMap()
512 …SetFrozenFunction(thread, mapFuncPrototype, "getFirstKey", ContainersTreeMap::GetFirstKey, FuncLen… in InitializeTreeMap()
513 …SetFrozenFunction(thread, mapFuncPrototype, "getLastKey", ContainersTreeMap::GetLastKey, FuncLengt… in InitializeTreeMap()
514 … SetFrozenFunction(thread, mapFuncPrototype, "setAll", ContainersTreeMap::SetAll, FuncLength::ONE); in InitializeTreeMap()
515 … SetFrozenFunction(thread, mapFuncPrototype, "clear", ContainersTreeMap::Clear, FuncLength::ZERO); in InitializeTreeMap()
516 …SetFrozenFunction(thread, mapFuncPrototype, "getLowerKey", ContainersTreeMap::GetLowerKey, FuncLen… in InitializeTreeMap()
517 …SetFrozenFunction(thread, mapFuncPrototype, "getHigherKey", ContainersTreeMap::GetHigherKey, FuncL… in InitializeTreeMap()
518 SetFrozenFunction(thread, mapFuncPrototype, "keys", ContainersTreeMap::Keys, FuncLength::ZERO); in InitializeTreeMap()
519 …SetFrozenFunction(thread, mapFuncPrototype, "values", ContainersTreeMap::Values, FuncLength::ZERO); in InitializeTreeMap()
520 …SetFrozenFunction(thread, mapFuncPrototype, "replace", ContainersTreeMap::Replace, FuncLength::TWO… in InitializeTreeMap()
521 …SetFrozenFunction(thread, mapFuncPrototype, "forEach", ContainersTreeMap::ForEach, FuncLength::ONE… in InitializeTreeMap()
522 …SetFrozenFunction(thread, mapFuncPrototype, "entries", ContainersTreeMap::Entries, FuncLength::ZER… in InitializeTreeMap()
523 …SetFrozenFunction(thread, mapFuncPrototype, "isEmpty", ContainersTreeMap::IsEmpty, FuncLength::ZER… in InitializeTreeMap()
526 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeMap()
527 SetStringTagSymbol(thread, env, mapFuncPrototype, "TreeMap"); in InitializeTreeMap()
532 JSObject::GetMethod(thread, JSHandle<JSTaggedValue>::Cast(mapFuncPrototype), entries); in InitializeTreeMap()
533 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeTreeMap()
534 PropertyDescriptor descriptor(thread, entriesFunc, false, false, false); in InitializeTreeMap()
535 JSObject::DefineOwnProperty(thread, mapFuncPrototype, iteratorSymbol, descriptor); in InitializeTreeMap()
538 CreateGetter(thread, ContainersTreeMap::GetLength, "length", FuncLength::ZERO); in InitializeTreeMap()
539 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeTreeMap()
540 SetGetter(thread, mapFuncPrototype, lengthKey, lengthGetter); in InitializeTreeMap()
542 InitializeTreeMapIterator(thread); in InitializeTreeMap()
546 void ContainersPrivate::InitializeTreeMapIterator(JSThread *thread) in InitializeTreeMapIterator() argument
548 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeMapIterator()
549 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeMapIterator()
557 …SetFrozenFunction(thread, mapIteratorPrototype, "next", JSAPITreeMapIterator::Next, FuncLength::ZE… in InitializeTreeMapIterator()
558 SetStringTagSymbol(thread, env, mapIteratorPrototype, "TreeMap Iterator"); in InitializeTreeMapIterator()
559 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeTreeMapIterator()
563 JSHandle<JSTaggedValue> ContainersPrivate::InitializeTreeSet(JSThread *thread) in InitializeTreeSet() argument
565 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeTreeSet()
566 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeSet()
575 … thread, setFuncPrototype, ContainersTreeSet::TreeSetConstructor, "TreeSet", FuncLength::ZERO)); in InitializeTreeSet()
576 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeTreeSet()
581 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(setFuncPrototype), constructorKey, setFuncti… in InitializeTreeSet()
582 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeTreeSet()
584 SetFrozenFunction(thread, setFuncPrototype, "add", ContainersTreeSet::Add, FuncLength::TWO); in InitializeTreeSet()
585 … SetFrozenFunction(thread, setFuncPrototype, "remove", ContainersTreeSet::Remove, FuncLength::ONE); in InitializeTreeSet()
586 SetFrozenFunction(thread, setFuncPrototype, "has", ContainersTreeSet::Has, FuncLength::ONE); in InitializeTreeSet()
587 …SetFrozenFunction(thread, setFuncPrototype, "getFirstValue", ContainersTreeSet::GetFirstValue, Fun… in InitializeTreeSet()
588 …SetFrozenFunction(thread, setFuncPrototype, "getLastValue", ContainersTreeSet::GetLastValue, FuncL… in InitializeTreeSet()
589 … SetFrozenFunction(thread, setFuncPrototype, "clear", ContainersTreeSet::Clear, FuncLength::ZERO); in InitializeTreeSet()
590 …SetFrozenFunction(thread, setFuncPrototype, "getLowerValue", ContainersTreeSet::GetLowerValue, Fun… in InitializeTreeSet()
591 …SetFrozenFunction(thread, setFuncPrototype, "getHigherValue", ContainersTreeSet::GetHigherValue, F… in InitializeTreeSet()
592 …SetFrozenFunction(thread, setFuncPrototype, "popFirst", ContainersTreeSet::PopFirst, FuncLength::Z… in InitializeTreeSet()
593 …SetFrozenFunction(thread, setFuncPrototype, "popLast", ContainersTreeSet::PopLast, FuncLength::ZER… in InitializeTreeSet()
594 …SetFrozenFunction(thread, setFuncPrototype, "isEmpty", ContainersTreeSet::IsEmpty, FuncLength::TWO… in InitializeTreeSet()
595 …SetFrozenFunction(thread, setFuncPrototype, "values", ContainersTreeSet::Values, FuncLength::ZERO); in InitializeTreeSet()
596 …SetFrozenFunction(thread, setFuncPrototype, "forEach", ContainersTreeSet::ForEach, FuncLength::ONE… in InitializeTreeSet()
597 …SetFrozenFunction(thread, setFuncPrototype, "entries", ContainersTreeSet::Entries, FuncLength::ZER… in InitializeTreeSet()
600 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeSet()
601 SetStringTagSymbol(thread, env, setFuncPrototype, "TreeSet"); in InitializeTreeSet()
604 JSHandle<JSTaggedValue> values(thread, globalConst->GetValuesString()); in InitializeTreeSet()
606 JSObject::GetMethod(thread, JSHandle<JSTaggedValue>::Cast(setFuncPrototype), values); in InitializeTreeSet()
607 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeTreeSet()
608 PropertyDescriptor descriptor(thread, valuesFunc, false, false, false); in InitializeTreeSet()
609 JSObject::DefineOwnProperty(thread, setFuncPrototype, iteratorSymbol, descriptor); in InitializeTreeSet()
612 CreateGetter(thread, ContainersTreeSet::GetLength, "length", FuncLength::ZERO); in InitializeTreeSet()
613 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeTreeSet()
614 SetGetter(thread, setFuncPrototype, lengthKey, lengthGetter); in InitializeTreeSet()
616 InitializeTreeSetIterator(thread); in InitializeTreeSet()
620 void ContainersPrivate::InitializeTreeSetIterator(JSThread *thread) in InitializeTreeSetIterator() argument
622 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeSetIterator()
623 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeSetIterator()
631 …SetFrozenFunction(thread, setIteratorPrototype, "next", JSAPITreeSetIterator::Next, FuncLength::ZE… in InitializeTreeSetIterator()
632 SetStringTagSymbol(thread, env, setIteratorPrototype, "TreeSet Iterator"); in InitializeTreeSetIterator()
633 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeTreeSetIterator()
637 JSHandle<JSTaggedValue> ContainersPrivate::InitializePlainArray(JSThread *thread) in InitializePlainArray() argument
639 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializePlainArray()
640 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializePlainArray()
648 …NewContainerConstructor(thread, plainArrayFuncPrototype, ContainersPlainArray::PlainArrayConstruct… in InitializePlainArray()
650 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializePlainArray()
655 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(plainArrayFuncPrototype), constructorKey, in InitializePlainArray()
657 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializePlainArray()
659 …SetFrozenFunction(thread, plainArrayFuncPrototype, "add", ContainersPlainArray::Add, FuncLength::O… in InitializePlainArray()
660 …SetFrozenFunction(thread, plainArrayFuncPrototype, "clear", ContainersPlainArray::Clear, FuncLengt… in InitializePlainArray()
661 …SetFrozenFunction(thread, plainArrayFuncPrototype, "clone", ContainersPlainArray::Clone, FuncLengt… in InitializePlainArray()
662 …SetFrozenFunction(thread, plainArrayFuncPrototype, "has", ContainersPlainArray::Has, FuncLength::O… in InitializePlainArray()
663 …SetFrozenFunction(thread, plainArrayFuncPrototype, "get", ContainersPlainArray::Get, FuncLength::O… in InitializePlainArray()
664 …SetFrozenFunction(thread, plainArrayFuncPrototype, "forEach", ContainersPlainArray::ForEach, FuncL… in InitializePlainArray()
666 SetFrozenFunction(thread, plainArrayFuncPrototype, "toString", ContainersPlainArray::ToString, in InitializePlainArray()
668 …SetFrozenFunction(thread, plainArrayFuncPrototype, "getIndexOfKey", ContainersPlainArray::GetIndex… in InitializePlainArray()
670 …SetFrozenFunction(thread, plainArrayFuncPrototype, "getIndexOfValue", ContainersPlainArray::GetInd… in InitializePlainArray()
672 …SetFrozenFunction(thread, plainArrayFuncPrototype, "isEmpty", ContainersPlainArray::IsEmpty, FuncL… in InitializePlainArray()
673 SetFrozenFunction(thread, plainArrayFuncPrototype, "getKeyAt", in InitializePlainArray()
675 …SetFrozenFunction(thread, plainArrayFuncPrototype, "remove", ContainersPlainArray::Remove, FuncLen… in InitializePlainArray()
676 SetFrozenFunction(thread, plainArrayFuncPrototype, "removeAt", ContainersPlainArray::RemoveAt, in InitializePlainArray()
678 …SetFrozenFunction(thread, plainArrayFuncPrototype, "removeRangeFrom", ContainersPlainArray::Remove… in InitializePlainArray()
680 … SetFrozenFunction(thread, plainArrayFuncPrototype, "setValueAt", ContainersPlainArray::SetValueAt, in InitializePlainArray()
682 … SetFrozenFunction(thread, plainArrayFuncPrototype, "getValueAt", ContainersPlainArray::GetValueAt, in InitializePlainArray()
685 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersPlainArray::GetSize, "length… in InitializePlainArray()
688 SetGetter(thread, plainArrayFuncPrototype, lengthKey, lengthGetter); in InitializePlainArray()
690 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializePlainArray()
691 …SetFunctionAtSymbol(thread, env, plainArrayFuncPrototype, env->GetIteratorSymbol(), "[Symbol.itera… in InitializePlainArray()
693 InitializePlainArrayIterator(thread); in InitializePlainArray()
698 void ContainersPrivate::InitializePlainArrayIterator(JSThread *thread) in InitializePlainArrayIterator() argument
700 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializePlainArrayIterator()
701 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializePlainArrayIterator()
702 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializePlainArrayIterator()
704 …JSHandle<JSHClass>(thread, globalConst->GetHandledJSAPIIteratorFuncHClass().GetObject<JSHClass>()); in InitializePlainArrayIterator()
706 …SetFrozenFunction(thread, plainarrayIteratorPrototype, "next", JSAPIPlainArrayIterator::Next, Func… in InitializePlainArrayIterator()
707 SetStringTagSymbol(thread, env, plainarrayIteratorPrototype, "PlainArray Iterator"); in InitializePlainArrayIterator()
712 JSHandle<JSTaggedValue> ContainersPrivate::InitializeStack(JSThread *thread) in InitializeStack() argument
714 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeStack()
715 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeStack()
724 thread, stackFuncPrototype, ContainersStack::StackConstructor, "Stack", FuncLength::ZERO)); in InitializeStack()
725 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeStack()
730 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(stackFuncPrototype), constructorKey, stackFu… in InitializeStack()
731 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeStack()
733 SetFrozenFunction(thread, stackFuncPrototype, "push", ContainersStack::Push, FuncLength::ONE); in InitializeStack()
735 …SetFrozenFunction(thread, stackFuncPrototype, "isEmpty", ContainersStack::IsEmpty, FuncLength::ONE… in InitializeStack()
737 SetFrozenFunction(thread, stackFuncPrototype, "peek", ContainersStack::Peek, FuncLength::ONE); in InitializeStack()
739 SetFrozenFunction(thread, stackFuncPrototype, "pop", ContainersStack::Pop, FuncLength::ONE); in InitializeStack()
741 … SetFrozenFunction(thread, stackFuncPrototype, "locate", ContainersStack::Locate, FuncLength::ONE); in InitializeStack()
743 …SetFrozenFunction(thread, stackFuncPrototype, "forEach", ContainersStack::ForEach, FuncLength::ONE, in InitializeStack()
745 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeStack()
746 SetStringTagSymbol(thread, env, stackFuncPrototype, "Stack"); in InitializeStack()
748 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersStack::GetLength, "length", … in InitializeStack()
750 SetGetter(thread, stackFuncPrototype, lengthKey, lengthGetter); in InitializeStack()
752 …SetFunctionAtSymbol(thread, env, stackFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeStack()
755 ContainersPrivate::InitializeStackIterator(thread, globalConst); in InitializeStack()
759 void ContainersPrivate::InitializeStackIterator(JSThread *thread, GlobalEnvConstants *globalConst) in InitializeStackIterator() argument
761 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeStackIterator()
762 JSHandle<JSHClass> iteratorFuncHClass = JSHandle<JSHClass>(thread, globalConst-> in InitializeStackIterator()
767 …SetFrozenFunction(thread, stackIteratorPrototype, "next", JSAPIStackIterator::Next, FuncLength::ON… in InitializeStackIterator()
771 JSHandle<JSTaggedValue> ContainersPrivate::InitializeVector(JSThread *thread) in InitializeVector() argument
773 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeVector()
774 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeVector()
783 thread, prototype, ContainersVector::VectorConstructor, "Vector", FuncLength::ZERO)); in InitializeVector()
784 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeVector()
789 … JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(prototype), constructorKey, vectorFunction); in InitializeVector()
790 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeVector()
792 SetFrozenFunction(thread, prototype, "add", ContainersVector::Add, FuncLength::ONE); in InitializeVector()
793 SetFrozenFunction(thread, prototype, "insert", ContainersVector::Insert, FuncLength::TWO); in InitializeVector()
794 SetFrozenFunction(thread, prototype, "setLength", ContainersVector::SetLength, FuncLength::ONE); in InitializeVector()
795 …SetFrozenFunction(thread, prototype, "getCapacity", ContainersVector::GetCapacity, FuncLength::ZER… in InitializeVector()
796 …SetFrozenFunction(thread, prototype, "increaseCapacityTo", ContainersVector::IncreaseCapacityTo, F… in InitializeVector()
797 SetFrozenFunction(thread, prototype, "get", ContainersVector::Get, FuncLength::ONE); in InitializeVector()
798 … SetFrozenFunction(thread, prototype, "getIndexOf", ContainersVector::GetIndexOf, FuncLength::ONE); in InitializeVector()
799 …SetFrozenFunction(thread, prototype, "getIndexFrom", ContainersVector::GetIndexFrom, FuncLength::T… in InitializeVector()
800 SetFrozenFunction(thread, prototype, "isEmpty", ContainersVector::IsEmpty, FuncLength::ZERO); in InitializeVector()
801 …SetFrozenFunction(thread, prototype, "getLastElement", ContainersVector::GetLastElement, FuncLengt… in InitializeVector()
802 …SetFrozenFunction(thread, prototype, "getLastIndexOf", ContainersVector::GetLastIndexOf, FuncLengt… in InitializeVector()
803 …SetFrozenFunction(thread, prototype, "getLastIndexFrom", ContainersVector::GetLastIndexFrom, FuncL… in InitializeVector()
804 SetFrozenFunction(thread, prototype, "remove", ContainersVector::Remove, FuncLength::ONE); in InitializeVector()
805 …SetFrozenFunction(thread, prototype, "removeByIndex", ContainersVector::RemoveByIndex, FuncLength:… in InitializeVector()
806 …SetFrozenFunction(thread, prototype, "removeByRange", ContainersVector::RemoveByRange, FuncLength:… in InitializeVector()
807 SetFrozenFunction(thread, prototype, "set", ContainersVector::Set, FuncLength::TWO); in InitializeVector()
808 SetFrozenFunction(thread, prototype, "subVector", ContainersVector::SubVector, FuncLength::TWO); in InitializeVector()
809 SetFrozenFunction(thread, prototype, "toString", ContainersVector::ToString, FuncLength::ZERO); in InitializeVector()
810 SetFrozenFunction(thread, prototype, "forEach", ContainersVector::ForEach, FuncLength::TWO, in InitializeVector()
812 …SetFrozenFunction(thread, prototype, "replaceAllElements", ContainersVector::ReplaceAllElements, F… in InitializeVector()
814 SetFrozenFunction(thread, prototype, "has", ContainersVector::Has, FuncLength::ONE); in InitializeVector()
815 SetFrozenFunction(thread, prototype, "sort", ContainersVector::Sort, FuncLength::ZERO); in InitializeVector()
816 SetFrozenFunction(thread, prototype, "clear", ContainersVector::Clear, FuncLength::ZERO); in InitializeVector()
817 SetFrozenFunction(thread, prototype, "clone", ContainersVector::Clone, FuncLength::ZERO); in InitializeVector()
818 …SetFrozenFunction(thread, prototype, "copyToArray", ContainersVector::CopyToArray, FuncLength::ONE… in InitializeVector()
819 …SetFrozenFunction(thread, prototype, "convertToArray", ContainersVector::ConvertToArray, FuncLengt… in InitializeVector()
820 …SetFrozenFunction(thread, prototype, "getFirstElement", ContainersVector::GetFirstElement, FuncLen… in InitializeVector()
821 SetFrozenFunction(thread, prototype, "trimToCurrentLength", in InitializeVector()
824 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeVector()
825 SetStringTagSymbol(thread, env, prototype, "Vector"); in InitializeVector()
827 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersVector::GetSize, "length", F… in InitializeVector()
828 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeVector()
829 SetGetter(thread, prototype, lengthKey, lengthGetter); in InitializeVector()
831 SetFunctionAtSymbol(thread, env, prototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeVector()
834 ContainersPrivate::InitializeVectorIterator(thread, env, globalConst); in InitializeVector()
839 void ContainersPrivate::InitializeVectorIterator(JSThread *thread, const JSHandle<GlobalEnv> &env, in InitializeVectorIterator() argument
842 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeVectorIterator()
843 JSHandle<JSHClass> iteratorFuncHClass = JSHandle<JSHClass>(thread, globalConst-> in InitializeVectorIterator()
848 …SetFrozenFunction(thread, vectorIteratorPrototype, "next", JSAPIVectorIterator::Next, FuncLength::… in InitializeVectorIterator()
849 SetStringTagSymbol(thread, env, vectorIteratorPrototype, "Vector Iterator"); in InitializeVectorIterator()
853 JSHandle<JSTaggedValue> ContainersPrivate::InitializeBitVector(JSThread* thread) in InitializeBitVector() argument
855 auto globalConst = const_cast<GlobalEnvConstants*>(thread->GlobalConstants()); in InitializeBitVector()
856 auto vm = thread->GetEcmaVM(); in InitializeBitVector()
859 Builtins builtin(thread, factory, vm); in InitializeBitVector()
863 InitializeBitVectorIterator(thread, env, globalConst); in InitializeBitVector()
869 JSThread* thread, const JSHandle<GlobalEnv>& env, GlobalEnvConstants* globalConst) in InitializeBitVectorIterator() argument
871 ObjectFactory* factory = thread->GetEcmaVM()->GetFactory(); in InitializeBitVectorIterator()
872 JSHandle<JSHClass> iteratorFuncClass = JSHandle<JSHClass>(thread, in InitializeBitVectorIterator()
876 …SetFrozenFunction(thread, bitVectorIteratorPrototype, "next", JSAPIBitVectorIterator::Next, FuncLe… in InitializeBitVectorIterator()
877 SetStringTagSymbol(thread, env, bitVectorIteratorPrototype, "BitVector Iterator"); in InitializeBitVectorIterator()
878 env->SetBitVectorIteratorPrototype(thread, bitVectorIteratorPrototype); in InitializeBitVectorIterator()
881 JSHandle<JSTaggedValue> ContainersPrivate::InitializeQueue(JSThread *thread) in InitializeQueue() argument
883 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeQueue()
884 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeQueue()
893 thread, queueFuncPrototype, ContainersQueue::QueueConstructor, "Queue", FuncLength::ZERO)); in InitializeQueue()
894 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeQueue()
899 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(queueFuncPrototype), constructorKey, queueFu… in InitializeQueue()
900 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeQueue()
902 SetFrozenFunction(thread, queueFuncPrototype, "add", ContainersQueue::Add, FuncLength::ONE); in InitializeQueue()
903 …SetFrozenFunction(thread, queueFuncPrototype, "getFirst", ContainersQueue::GetFirst, FuncLength::Z… in InitializeQueue()
904 SetFrozenFunction(thread, queueFuncPrototype, "pop", ContainersQueue::Pop, FuncLength::ZERO); in InitializeQueue()
905 …SetFrozenFunction(thread, queueFuncPrototype, "forEach", ContainersQueue::ForEach, FuncLength::TWO, in InitializeQueue()
908 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeQueue()
909 SetStringTagSymbol(thread, env, queueFuncPrototype, "Queue"); in InitializeQueue()
911 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersQueue::GetSize, "length", Fu… in InitializeQueue()
912 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeQueue()
913 SetGetter(thread, queueFuncPrototype, lengthKey, lengthGetter); in InitializeQueue()
915 …SetFunctionAtSymbol(thread, env, queueFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeQueue()
918 ContainersPrivate::InitializeQueueIterator(thread, env, globalConst); in InitializeQueue()
922 void ContainersPrivate::InitializeQueueIterator(JSThread *thread, const JSHandle<GlobalEnv> &env, in InitializeQueueIterator() argument
925 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeQueueIterator()
931 …SetFrozenFunction(thread, queueIteratorPrototype, "next", JSAPIQueueIterator::Next, FuncLength::ON… in InitializeQueueIterator()
932 SetStringTagSymbol(thread, env, queueIteratorPrototype, "Queue Iterator"); in InitializeQueueIterator()
936 JSHandle<JSTaggedValue> ContainersPrivate::InitializeDeque(JSThread *thread) in InitializeDeque() argument
938 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeDeque()
939 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeDeque()
948 thread, dequeFuncPrototype, ContainersDeque::DequeConstructor, "Deque", FuncLength::ZERO)); in InitializeDeque()
949 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeDeque()
954 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(dequeFuncPrototype), constructorKey, dequeFu… in InitializeDeque()
955 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeDeque()
956 …SetFrozenFunction(thread, dequeFuncPrototype, "insertFront", ContainersDeque::InsertFront, FuncLen… in InitializeDeque()
957 …SetFrozenFunction(thread, dequeFuncPrototype, "insertEnd", ContainersDeque::InsertEnd, FuncLength:… in InitializeDeque()
958 …SetFrozenFunction(thread, dequeFuncPrototype, "getFirst", ContainersDeque::GetFirst, FuncLength::Z… in InitializeDeque()
959 …SetFrozenFunction(thread, dequeFuncPrototype, "getLast", ContainersDeque::GetLast, FuncLength::ZER… in InitializeDeque()
960 SetFrozenFunction(thread, dequeFuncPrototype, "has", ContainersDeque::Has, FuncLength::ONE); in InitializeDeque()
961 …SetFrozenFunction(thread, dequeFuncPrototype, "popFirst", ContainersDeque::PopFirst, FuncLength::Z… in InitializeDeque()
962 …SetFrozenFunction(thread, dequeFuncPrototype, "popLast", ContainersDeque::PopLast, FuncLength::ZER… in InitializeDeque()
963 …SetFrozenFunction(thread, dequeFuncPrototype, "forEach", ContainersDeque::ForEach, FuncLength::TWO, in InitializeDeque()
966 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeDeque()
967 SetStringTagSymbol(thread, env, dequeFuncPrototype, "Deque"); in InitializeDeque()
969 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersDeque::GetSize, "length", Fu… in InitializeDeque()
971 SetGetter(thread, dequeFuncPrototype, lengthKey, lengthGetter); in InitializeDeque()
973 …SetFunctionAtSymbol(thread, env, dequeFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeDeque()
976 ContainersPrivate::InitializeDequeIterator(thread, env, globalConst); in InitializeDeque()
981 void ContainersPrivate::InitializeDequeIterator(JSThread *thread, const JSHandle<GlobalEnv> &env, in InitializeDequeIterator() argument
984 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeDequeIterator()
985 JSHandle<JSHClass> iteratorFuncHClass = JSHandle<JSHClass>(thread, globalConst-> in InitializeDequeIterator()
988 …SetFrozenFunction(thread, dequeIteratorPrototype, "next", JSAPIDequeIterator::Next, FuncLength::ON… in InitializeDequeIterator()
989 SetStringTagSymbol(thread, env, dequeIteratorPrototype, "Deque Iterator"); in InitializeDequeIterator()
993 JSHandle<JSTaggedValue> ContainersPrivate::InitializeList(JSThread *thread) in InitializeList() argument
995 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeList()
996 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeList()
1002 thread, listFuncPrototype, ContainersList::ListConstructor, "List", FuncLength::ZERO)); in InitializeList()
1003 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeList()
1007 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(listFuncPrototype), constructorKey, listFunc… in InitializeList()
1008 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeList()
1009 SetFrozenFunction(thread, listFuncPrototype, "add", ContainersList::Add, FuncLength::ONE); in InitializeList()
1010 …SetFrozenFunction(thread, listFuncPrototype, "getFirst", ContainersList::GetFirst, FuncLength::ONE… in InitializeList()
1011 … SetFrozenFunction(thread, listFuncPrototype, "getLast", ContainersList::GetLast, FuncLength::ONE); in InitializeList()
1012 SetFrozenFunction(thread, listFuncPrototype, "insert", ContainersList::Insert, FuncLength::ONE); in InitializeList()
1013 SetFrozenFunction(thread, listFuncPrototype, "clear", ContainersList::Clear, FuncLength::ONE); in InitializeList()
1014 …SetFrozenFunction(thread, listFuncPrototype, "removeByIndex", ContainersList::RemoveByIndex, FuncL… in InitializeList()
1015 SetFrozenFunction(thread, listFuncPrototype, "remove", ContainersList::Remove, FuncLength::ONE); in InitializeList()
1016 SetFrozenFunction(thread, listFuncPrototype, "has", ContainersList::Has, FuncLength::ONE); in InitializeList()
1017 … SetFrozenFunction(thread, listFuncPrototype, "isEmpty", ContainersList::IsEmpty, FuncLength::ONE); in InitializeList()
1018 SetFrozenFunction(thread, listFuncPrototype, "get", ContainersList::Get, FuncLength::ONE); in InitializeList()
1019 …SetFrozenFunction(thread, listFuncPrototype, "getIndexOf", ContainersList::GetIndexOf, FuncLength:… in InitializeList()
1020 …SetFrozenFunction(thread, listFuncPrototype, "getLastIndexOf", ContainersList::GetLastIndexOf, Fun… in InitializeList()
1021 SetFrozenFunction(thread, listFuncPrototype, "set", ContainersList::Set, FuncLength::ONE); in InitializeList()
1022 … SetFrozenFunction(thread, listFuncPrototype, "forEach", ContainersList::ForEach, FuncLength::ONE, in InitializeList()
1024 …SetFrozenFunction(thread, listFuncPrototype, "replaceAllElements", ContainersList::ReplaceAllEleme… in InitializeList()
1026 SetFrozenFunction(thread, listFuncPrototype, "equal", ContainersList::Equal, FuncLength::ONE); in InitializeList()
1027 SetFrozenFunction(thread, listFuncPrototype, "sort", ContainersList::Sort, FuncLength::ONE); in InitializeList()
1028 …SetFrozenFunction(thread, listFuncPrototype, "convertToArray", ContainersList::ConvertToArray, Fun… in InitializeList()
1029 …SetFrozenFunction(thread, listFuncPrototype, "getSubList", ContainersList::GetSubList, FuncLength:… in InitializeList()
1031 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersList::Length, "length", Func… in InitializeList()
1033 SetGetter(thread, listFuncPrototype, lengthKey, lengthGetter); in InitializeList()
1035 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeList()
1036 … SetFunctionAtSymbol(thread, env, listFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeList()
1039 InitializeListIterator(thread, env); in InitializeList()
1044 JSHandle<JSTaggedValue> ContainersPrivate::InitializeLinkedList(JSThread *thread) in InitializeLinkedList() argument
1046 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeLinkedList()
1047 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLinkedList()
1053 …thread, linkedListFuncPrototype, ContainersLinkedList::LinkedListConstructor, "LinkedList", FuncLe… in InitializeLinkedList()
1054 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeLinkedList()
1058 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(linkedListFuncPrototype), constructorKey, li… in InitializeLinkedList()
1059 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeLinkedList()
1060 …SetFrozenFunction(thread, linkedListFuncPrototype, "add", ContainersLinkedList::Add, FuncLength::O… in InitializeLinkedList()
1061 …SetFrozenFunction(thread, linkedListFuncPrototype, "insert", ContainersLinkedList::Insert, FuncLen… in InitializeLinkedList()
1062 …SetFrozenFunction(thread, linkedListFuncPrototype, "clear", ContainersLinkedList::Clear, FuncLengt… in InitializeLinkedList()
1063 …SetFrozenFunction(thread, linkedListFuncPrototype, "clone", ContainersLinkedList::Clone, FuncLengt… in InitializeLinkedList()
1064 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeFirst", ContainersLinkedList::RemoveFirs… in InitializeLinkedList()
1066 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeLast", ContainersLinkedList::RemoveLast,… in InitializeLinkedList()
1067 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeFirstFound", ContainersLinkedList::Remov… in InitializeLinkedList()
1069 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeByIndex", ContainersLinkedList::RemoveBy… in InitializeLinkedList()
1071 …SetFrozenFunction(thread, linkedListFuncPrototype, "remove", ContainersLinkedList::Remove, FuncLen… in InitializeLinkedList()
1072 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeLastFound", ContainersLinkedList::Remove… in InitializeLinkedList()
1074 …SetFrozenFunction(thread, linkedListFuncPrototype, "has", ContainersLinkedList::Has, FuncLength::O… in InitializeLinkedList()
1075 …SetFrozenFunction(thread, linkedListFuncPrototype, "get", ContainersLinkedList::Get, FuncLength::O… in InitializeLinkedList()
1076 …SetFrozenFunction(thread, linkedListFuncPrototype, "addFirst", ContainersLinkedList::AddFirst, Fun… in InitializeLinkedList()
1077 …SetFrozenFunction(thread, linkedListFuncPrototype, "getFirst", ContainersLinkedList::GetFirst, Fun… in InitializeLinkedList()
1078 …SetFrozenFunction(thread, linkedListFuncPrototype, "getLast", ContainersLinkedList::GetLast, FuncL… in InitializeLinkedList()
1079 …SetFrozenFunction(thread, linkedListFuncPrototype, "getIndexOf", ContainersLinkedList::GetIndexOf,… in InitializeLinkedList()
1080 …SetFrozenFunction(thread, linkedListFuncPrototype, "getLastIndexOf", ContainersLinkedList::GetLast… in InitializeLinkedList()
1082 …SetFrozenFunction(thread, linkedListFuncPrototype, "convertToArray", ContainersLinkedList::Convert… in InitializeLinkedList()
1084 …SetFrozenFunction(thread, linkedListFuncPrototype, "set", ContainersLinkedList::Set, FuncLength::O… in InitializeLinkedList()
1085 …SetFrozenFunction(thread, linkedListFuncPrototype, "forEach", ContainersLinkedList::ForEach, FuncL… in InitializeLinkedList()
1088 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersLinkedList::Length, "length", in InitializeLinkedList()
1091 SetGetter(thread, linkedListFuncPrototype, lengthKey, lengthGetter); in InitializeLinkedList()
1093 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeLinkedList()
1094 …SetFunctionAtSymbol(thread, env, linkedListFuncPrototype, env->GetIteratorSymbol(), "[Symbol.itera… in InitializeLinkedList()
1097 InitializeLinkedListIterator(thread, env); in InitializeLinkedList()
1102 void ContainersPrivate::InitializeLinkedListIterator(JSThread *thread, const JSHandle<GlobalEnv> &e… in InitializeLinkedListIterator() argument
1104 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeLinkedListIterator()
1105 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLinkedListIterator()
1107 …JSHandle<JSHClass>(thread, globalConst->GetHandledJSAPIIteratorFuncHClass().GetObject<JSHClass>()); in InitializeLinkedListIterator()
1109 …SetFrozenFunction(thread, setIteratorPrototype, "next", JSAPILinkedListIterator::Next, FuncLength:… in InitializeLinkedListIterator()
1110 SetStringTagSymbol(thread, env, setIteratorPrototype, "linkedlist Iterator"); in InitializeLinkedListIterator()
1115 void ContainersPrivate::InitializeListIterator(JSThread *thread, const JSHandle<GlobalEnv> &env) in InitializeListIterator() argument
1117 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeListIterator()
1118 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeListIterator()
1120 …JSHandle<JSHClass>(thread, globalConst->GetHandledJSAPIIteratorFuncHClass().GetObject<JSHClass>()); in InitializeListIterator()
1122 … SetFrozenFunction(thread, setIteratorPrototype, "next", JSAPIListIterator::Next, FuncLength::ONE); in InitializeListIterator()
1123 SetStringTagSymbol(thread, env, setIteratorPrototype, "list Iterator"); in InitializeListIterator()
1127 JSHandle<JSTaggedValue> ContainersPrivate::InitializeHashMap(JSThread *thread) in InitializeHashMap() argument
1129 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeHashMap()
1130 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeHashMap()
1139 …thread, hashMapFuncPrototype, ContainersHashMap::HashMapConstructor, "HashMap", FuncLength::ZERO)); in InitializeHashMap()
1140 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeHashMap()
1145 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(hashMapFuncPrototype), constructorKey, hashM… in InitializeHashMap()
1146 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeHashMap()
1148 SetFrozenFunction(thread, hashMapFuncPrototype, "set", ContainersHashMap::Set, FuncLength::TWO); in InitializeHashMap()
1150 …SetFrozenFunction(thread, hashMapFuncPrototype, "setAll", ContainersHashMap::SetAll, FuncLength::O… in InitializeHashMap()
1152 …SetFrozenFunction(thread, hashMapFuncPrototype, "isEmpty", ContainersHashMap::IsEmpty, FuncLength:… in InitializeHashMap()
1154 …SetFrozenFunction(thread, hashMapFuncPrototype, "remove", ContainersHashMap::Remove, FuncLength::O… in InitializeHashMap()
1156 …SetFrozenFunction(thread, hashMapFuncPrototype, "clear", ContainersHashMap::Clear, FuncLength::ZER… in InitializeHashMap()
1158 SetFrozenFunction(thread, hashMapFuncPrototype, "get", ContainersHashMap::Get, FuncLength::ONE); in InitializeHashMap()
1160 …SetFrozenFunction(thread, hashMapFuncPrototype, "forEach", ContainersHashMap::ForEach, FuncLength:… in InitializeHashMap()
1163 …SetFrozenFunction(thread, hashMapFuncPrototype, "hasKey", ContainersHashMap::HasKey, FuncLength::O… in InitializeHashMap()
1165 …SetFrozenFunction(thread, hashMapFuncPrototype, "hasValue", ContainersHashMap::HasValue, FuncLengt… in InitializeHashMap()
1167 …SetFrozenFunction(thread, hashMapFuncPrototype, "replace", ContainersHashMap::Replace, FuncLength:… in InitializeHashMap()
1169 …SetFrozenFunction(thread, hashMapFuncPrototype, "keys", ContainersHashMap::Keys, FuncLength::ZERO); in InitializeHashMap()
1171 …SetFrozenFunction(thread, hashMapFuncPrototype, "values", ContainersHashMap::Values, FuncLength::Z… in InitializeHashMap()
1173 …SetFrozenFunction(thread, hashMapFuncPrototype, "entries", ContainersHashMap::Entries, FuncLength:… in InitializeHashMap()
1174 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeHashMap()
1176 SetStringTagSymbol(thread, env, hashMapFuncPrototype, "HashMap"); in InitializeHashMap()
1178 …SetFunctionAtSymbol(thread, env, hashMapFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator… in InitializeHashMap()
1182 CreateGetter(thread, ContainersHashMap::GetLength, "length", FuncLength::ZERO); in InitializeHashMap()
1183 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeHashMap()
1184 SetGetter(thread, hashMapFuncPrototype, lengthKey, lengthGetter); in InitializeHashMap()
1185 InitializeHashMapIterator(thread); in InitializeHashMap()
1189 void ContainersPrivate::InitializeHashMapIterator(JSThread *thread) in InitializeHashMapIterator() argument
1191 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeHashMapIterator()
1192 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeHashMapIterator()
1193 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeHashMapIterator()
1199 …SetFrozenFunction(thread, hashMapIteratorPrototype, "next", JSAPIHashMapIterator::Next, FuncLength… in InitializeHashMapIterator()
1200 SetStringTagSymbol(thread, env, hashMapIteratorPrototype, "HashMap Iterator"); in InitializeHashMapIterator()
1206 JSHandle<JSTaggedValue> ContainersPrivate::InitializeHashSet(JSThread *thread) in InitializeHashSet() argument
1208 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeHashSet()
1209 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeHashSet()
1218 …thread, hashSetFuncPrototype, ContainersHashSet::HashSetConstructor, "HashSet", FuncLength::ZERO)); in InitializeHashSet()
1219 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, in InitializeHashSet()
1224 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(hashSetFuncPrototype), constructorKey, hashS… in InitializeHashSet()
1225 RETURN_HANDLE_IF_ABRUPT_COMPLETION(JSTaggedValue, thread); in InitializeHashSet()
1226 …SetFrozenFunction(thread, hashSetFuncPrototype, "isEmpty", ContainersHashSet::IsEmpty, FuncLength:… in InitializeHashSet()
1227 SetFrozenFunction(thread, hashSetFuncPrototype, "has", ContainersHashSet::Has, FuncLength::ONE); in InitializeHashSet()
1228 SetFrozenFunction(thread, hashSetFuncPrototype, "add", ContainersHashSet::Add, FuncLength::ONE); in InitializeHashSet()
1229 SetFrozenFunction(thread, hashSetFuncPrototype, "has", ContainersHashSet::Has, FuncLength::ONE); in InitializeHashSet()
1230 …SetFrozenFunction(thread, hashSetFuncPrototype, "remove", ContainersHashSet::Remove, FuncLength::O… in InitializeHashSet()
1231 …SetFrozenFunction(thread, hashSetFuncPrototype, "clear", ContainersHashSet::Clear, FuncLength::ZER… in InitializeHashSet()
1232 …SetFrozenFunction(thread, hashSetFuncPrototype, "values", ContainersHashSet::Values, FuncLength::Z… in InitializeHashSet()
1233 …SetFrozenFunction(thread, hashSetFuncPrototype, "entries", ContainersHashSet::Entries, FuncLength:… in InitializeHashSet()
1234 …SetFrozenFunction(thread, hashSetFuncPrototype, "forEach", ContainersHashSet::ForEach, FuncLength:… in InitializeHashSet()
1237 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeHashSet()
1239 SetStringTagSymbol(thread, env, hashSetFuncPrototype, "HashSet"); in InitializeHashSet()
1241 …SetFunctionAtSymbol(thread, env, hashSetFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator… in InitializeHashSet()
1245 CreateGetter(thread, ContainersHashSet::GetLength, "length", FuncLength::ZERO); in InitializeHashSet()
1246 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeHashSet()
1247 SetGetter(thread, hashSetFuncPrototype, lengthKey, lengthGetter); in InitializeHashSet()
1248 InitializeHashSetIterator(thread); in InitializeHashSet()
1252 void ContainersPrivate::InitializeHashSetIterator(JSThread *thread) in InitializeHashSetIterator() argument
1254 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeHashSetIterator()
1255 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeHashSetIterator()
1256 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeHashSetIterator()
1263 …SetFrozenFunction(thread, hashSetIteratorPrototype, "next", JSAPIHashSetIterator::Next, FuncLength… in InitializeHashSetIterator()
1264 SetStringTagSymbol(thread, env, hashSetIteratorPrototype, "HashSet Iterator"); in InitializeHashSetIterator()