• Home
  • Raw
  • Download

Lines Matching full:thread

70     JSThread *thread = msg->GetThread();  in Load()  local
71 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Load()
77 … THROW_TYPE_ERROR_AND_RETURN(thread, "Incorrect input parameters", JSTaggedValue::Exception()); in Load()
81 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in Load()
83 …JSHandle<JSObject> undefinedIteratorResult = JSIterator::CreateIterResultObject(thread, undefinedH… in Load()
89 … res = InitializeContainer(thread, thisValue, InitializeArrayList, "ArrayListConstructor"); in Load()
93 res = InitializeContainer(thread, thisValue, InitializeDeque, "DequeConstructor"); in Load()
97 …res = InitializeContainer(thread, thisValue, InitializeLightWeightMap, "LightWeightMapConstructor"… in Load()
101 …res = InitializeContainer(thread, thisValue, InitializeLightWeightSet, "LightWeightSetConstructor"… in Load()
105 … res = InitializeContainer(thread, thisValue, InitializePlainArray, "PlainArrayConstructor"); in Load()
109 res = InitializeContainer(thread, thisValue, InitializeQueue, "QueueConstructor"); in Load()
113 res = InitializeContainer(thread, thisValue, InitializeStack, "StackConstructor"); in Load()
117 res = InitializeContainer(thread, thisValue, InitializeTreeMap, "TreeMapConstructor"); in Load()
121 res = InitializeContainer(thread, thisValue, InitializeTreeSet, "TreeSetConstructor"); in Load()
125 res = InitializeContainer(thread, thisValue, InitializeVector, "VectorConstructor"); in Load()
129 res = InitializeContainer(thread, thisValue, InitializeList, "ListConstructor"); in Load()
133 … res = InitializeContainer(thread, thisValue, InitializeLinkedList, "LinkedListConstructor"); in Load()
137 res = InitializeContainer(thread, thisValue, InitializeHashMap, "HashMapConstructor"); in Load()
141 res = InitializeContainer(thread, thisValue, InitializeHashSet, "HashSetConstructor"); in Load()
153 JSTaggedValue ContainersPrivate::InitializeContainer(JSThread *thread, const JSHandle<JSObject> &ob… in InitializeContainer() argument
156 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeContainer()
159 … ObjectFastOperator::GetPropertyByName<true>(thread, obj.GetTaggedValue(), key.GetTaggedValue()); in InitializeContainer()
163 JSHandle<JSTaggedValue> map = func(thread); in InitializeContainer()
164 SetFrozenConstructor(thread, obj, name, map); in InitializeContainer()
168 JSHandle<JSFunction> ContainersPrivate::NewContainerConstructor(JSThread *thread, const JSHandle<JS… in NewContainerConstructor() argument
171 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in NewContainerConstructor()
172 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NewContainerConstructor()
176 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in NewContainerConstructor()
177 JSFunction::SetFunctionLength(thread, ctor, JSTaggedValue(length)); in NewContainerConstructor()
179 JSFunction::SetFunctionName(thread, JSHandle<JSFunctionBase>(ctor), nameString, in NewContainerConstructor()
182 PropertyDescriptor descriptor1(thread, JSHandle<JSTaggedValue>::Cast(ctor), true, false, true); in NewContainerConstructor()
183 JSObject::DefineOwnProperty(thread, prototype, constructorKey, descriptor1); in NewContainerConstructor()
186 ctor->SetFunctionPrototype(thread, prototype.GetTaggedValue()); in NewContainerConstructor()
191 void ContainersPrivate::SetFrozenFunction(JSThread *thread, const JSHandle<JSObject> &obj, const ch… in SetFrozenFunction() argument
194 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetFrozenFunction()
196 JSHandle<JSFunction> function = NewFunction(thread, keyString, func, length, builtinId); in SetFrozenFunction()
197 PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>(function), false, false, false); in SetFrozenFunction()
198 JSObject::DefineOwnProperty(thread, obj, keyString, descriptor); in SetFrozenFunction()
201 void ContainersPrivate::SetFrozenConstructor(JSThread *thread, const JSHandle<JSObject> &obj, const… in SetFrozenConstructor() argument
204 JSObject::PreventExtensions(thread, JSHandle<JSObject>::Cast(value)); in SetFrozenConstructor()
205 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetFrozenConstructor()
207 PropertyDescriptor descriptor(thread, value, false, false, false); in SetFrozenConstructor()
208 JSObject::DefineOwnProperty(thread, obj, key, descriptor); in SetFrozenConstructor()
211 JSHandle<JSFunction> ContainersPrivate::NewFunction(JSThread *thread, const JSHandle<JSTaggedValue>… in NewFunction() argument
215 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NewFunction()
217 factory->NewJSFunction(thread->GetEcmaVM()->GetGlobalEnv(), reinterpret_cast<void *>(func), in NewFunction()
219 JSFunction::SetFunctionLength(thread, function, JSTaggedValue(length)); in NewFunction()
221 …JSFunction::SetFunctionName(thread, baseFunction, key, thread->GlobalConstants()->GetHandledUndefi… in NewFunction()
225 JSHandle<JSTaggedValue> ContainersPrivate::CreateGetter(JSThread *thread, EcmaEntrypoint func, cons… in CreateGetter() argument
228 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in CreateGetter()
229 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateGetter()
231 JSFunction::SetFunctionLength(thread, function, JSTaggedValue(length)); in CreateGetter()
233 JSHandle<JSTaggedValue> prefix = thread->GlobalConstants()->GetHandledGetString(); in CreateGetter()
234 JSFunction::SetFunctionName(thread, JSHandle<JSFunctionBase>(function), funcName, prefix); in CreateGetter()
238 void ContainersPrivate::SetGetter(JSThread *thread, const JSHandle<JSObject> &obj, const JSHandle<J… in SetGetter() argument
241 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetGetter()
243 accessor->SetGetter(thread, getter); in SetGetter()
245 JSObject::AddAccessor(thread, JSHandle<JSTaggedValue>::Cast(obj), key, accessor, attr); in SetGetter()
248 void ContainersPrivate::SetFunctionAtSymbol(JSThread *thread, const JSHandle<GlobalEnv> &env, in SetFunctionAtSymbol() argument
252 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetFunctionAtSymbol()
254 JSFunction::SetFunctionLength(thread, function, JSTaggedValue(length)); in SetFunctionAtSymbol()
257 …JSFunction::SetFunctionName(thread, baseFunction, nameString, thread->GlobalConstants()->GetHandle… in SetFunctionAtSymbol()
258 …PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>::Cast(function), false, false, false… in SetFunctionAtSymbol()
259 JSObject::DefineOwnProperty(thread, obj, symbol, descriptor); in SetFunctionAtSymbol()
262 void ContainersPrivate::SetStringTagSymbol(JSThread *thread, const JSHandle<GlobalEnv> &env, in SetStringTagSymbol() argument
265 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetStringTagSymbol()
268 PropertyDescriptor desc(thread, tag, false, false, false); in SetStringTagSymbol()
269 JSObject::DefineOwnProperty(thread, obj, symbol, desc); in SetStringTagSymbol()
272 JSHandle<JSTaggedValue> ContainersPrivate::InitializeArrayList(JSThread *thread) in InitializeArrayList() argument
274 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeArrayList()
275 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeArrayList()
284thread, prototype, ContainersArrayList::ArrayListConstructor, "ArrayList", FuncLength::ZERO)); in InitializeArrayList()
285 JSHandle<JSFunction>::Cast(arrayListFunction)->SetFunctionPrototype(thread, in InitializeArrayList()
290 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(prototype), constructorKey, arrayListFunctio… in InitializeArrayList()
293 SetFrozenFunction(thread, prototype, "add", ContainersArrayList::Add, FuncLength::ONE); in InitializeArrayList()
294 SetFrozenFunction(thread, prototype, "insert", ContainersArrayList::Insert, FuncLength::TWO); in InitializeArrayList()
295 SetFrozenFunction(thread, prototype, "clear", ContainersArrayList::Clear, FuncLength::ZERO); in InitializeArrayList()
296 SetFrozenFunction(thread, prototype, "clone", ContainersArrayList::Clone, FuncLength::ZERO); in InitializeArrayList()
297 SetFrozenFunction(thread, prototype, "has", ContainersArrayList::Has, FuncLength::ONE); in InitializeArrayList()
298 …SetFrozenFunction(thread, prototype, "getCapacity", ContainersArrayList::GetCapacity, FuncLength::… in InitializeArrayList()
299 SetFrozenFunction(thread, prototype, "increaseCapacityTo", in InitializeArrayList()
301 SetFrozenFunction(thread, prototype, "trimToCurrentLength", in InitializeArrayList()
303 …SetFrozenFunction(thread, prototype, "getIndexOf", ContainersArrayList::GetIndexOf, FuncLength::ON… in InitializeArrayList()
304 SetFrozenFunction(thread, prototype, "isEmpty", ContainersArrayList::IsEmpty, FuncLength::ZERO); in InitializeArrayList()
305 …SetFrozenFunction(thread, prototype, "getLastIndexOf", ContainersArrayList::GetLastIndexOf, FuncLe… in InitializeArrayList()
306 …SetFrozenFunction(thread, prototype, "removeByIndex", ContainersArrayList::RemoveByIndex, FuncLeng… in InitializeArrayList()
307 SetFrozenFunction(thread, prototype, "remove", ContainersArrayList::Remove, FuncLength::ONE); in InitializeArrayList()
308 …SetFrozenFunction(thread, prototype, "removeByRange", ContainersArrayList::RemoveByRange, FuncLeng… in InitializeArrayList()
309 …SetFrozenFunction(thread, prototype, "replaceAllElements", ContainersArrayList::ReplaceAllElements, in InitializeArrayList()
311 SetFrozenFunction(thread, prototype, "sort", ContainersArrayList::Sort, FuncLength::ONE); in InitializeArrayList()
312 …SetFrozenFunction(thread, prototype, "subArrayList", ContainersArrayList::SubArrayList, FuncLength… in InitializeArrayList()
313 …SetFrozenFunction(thread, prototype, "convertToArray", ContainersArrayList::ConvertToArray, FuncLe… in InitializeArrayList()
314 SetFrozenFunction(thread, prototype, "forEach", ContainersArrayList::ForEach, FuncLength::TWO, in InitializeArrayList()
317 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeArrayList()
318 SetStringTagSymbol(thread, env, prototype, "ArrayList"); in InitializeArrayList()
320 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersArrayList::GetSize, "length", in InitializeArrayList()
322 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeArrayList()
323 SetGetter(thread, prototype, lengthKey, lengthGetter); in InitializeArrayList()
325 SetFunctionAtSymbol(thread, env, prototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeArrayList()
327 ContainersPrivate::InitializeArrayListIterator(thread, env, globalConst); in InitializeArrayList()
332 void ContainersPrivate::InitializeArrayListIterator(JSThread *thread, const JSHandle<GlobalEnv> &en… in InitializeArrayListIterator() argument
335 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeArrayListIterator()
342 …SetFrozenFunction(thread, arrayListIteratorPrototype, "next", JSAPIArrayListIterator::Next, FuncLe… in InitializeArrayListIterator()
343 SetStringTagSymbol(thread, env, arrayListIteratorPrototype, "ArrayList Iterator"); in InitializeArrayListIterator()
348 JSHandle<JSTaggedValue> ContainersPrivate::InitializeLightWeightMap(JSThread *thread) in InitializeLightWeightMap() argument
350 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeLightWeightMap()
351 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLightWeightMap()
357thread, funcPrototype, ContainersLightWeightMap::LightWeightMapConstructor, "LightWeightMap", in InitializeLightWeightMap()
360 … SetFunctionPrototype(thread, lightWeightMapInstanceClass.GetTaggedValue()); in InitializeLightWeightMap()
364 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(funcPrototype), constructorKey, lightWeightM… 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 …JSHandle<JSFunction>::Cast(lightweightSetFunction)->SetFunctionPrototype(thread, lightweightSetIns… in InitializeLightWeightSet()
437 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(funcPrototype), constructorKey, lightweightS… in InitializeLightWeightSet()
438 SetFrozenFunction(thread, funcPrototype, "add", ContainersLightWeightSet::Add, FuncLength::ONE); in InitializeLightWeightSet()
439 …SetFrozenFunction(thread, funcPrototype, "addAll", ContainersLightWeightSet::AddAll, FuncLength::O… in InitializeLightWeightSet()
440 …SetFrozenFunction(thread, funcPrototype, "isEmpty", ContainersLightWeightSet::IsEmpty, FuncLength:… in InitializeLightWeightSet()
441 …SetFrozenFunction(thread, funcPrototype, "getValueAt", ContainersLightWeightSet::GetValueAt, FuncL… in InitializeLightWeightSet()
442 …SetFrozenFunction(thread, funcPrototype, "hasAll", ContainersLightWeightSet::HasAll, FuncLength::O… in InitializeLightWeightSet()
443 SetFrozenFunction(thread, funcPrototype, "has", ContainersLightWeightSet::Has, FuncLength::ONE); in InitializeLightWeightSet()
444 …SetFrozenFunction(thread, funcPrototype, "equal", ContainersLightWeightSet::Equal, FuncLength::ONE… in InitializeLightWeightSet()
445 SetFrozenFunction(thread, funcPrototype, "increaseCapacityTo", in InitializeLightWeightSet()
447 …SetFrozenFunction(thread, funcPrototype, "forEach", ContainersLightWeightSet::ForEach, FuncLength:… in InitializeLightWeightSet()
449 …SetFrozenFunction(thread, funcPrototype, "getIndexOf", ContainersLightWeightSet::GetIndexOf, FuncL… in InitializeLightWeightSet()
450 …SetFrozenFunction(thread, funcPrototype, "remove", ContainersLightWeightSet::Remove, FuncLength::Z… in InitializeLightWeightSet()
451 …SetFrozenFunction(thread, funcPrototype, "removeAt", ContainersLightWeightSet::RemoveAt, FuncLengt… in InitializeLightWeightSet()
452 …SetFrozenFunction(thread, funcPrototype, "clear", ContainersLightWeightSet::Clear, FuncLength::ONE… in InitializeLightWeightSet()
453 …SetFrozenFunction(thread, funcPrototype, "toString", ContainersLightWeightSet::ToString, FuncLengt… in InitializeLightWeightSet()
454 …SetFrozenFunction(thread, funcPrototype, "toArray", ContainersLightWeightSet::ToArray, FuncLength:… in InitializeLightWeightSet()
455 …SetFrozenFunction(thread, funcPrototype, "values", ContainersLightWeightSet::Values, FuncLength::O… in InitializeLightWeightSet()
456 …SetFrozenFunction(thread, funcPrototype, "entries", ContainersLightWeightSet::Entries, FuncLength:… in InitializeLightWeightSet()
458 CreateGetter(thread, ContainersLightWeightSet::GetSize, "length", FuncLength::ZERO); in InitializeLightWeightSet()
461 SetGetter(thread, funcPrototype, lengthKey, lengthGetter); in InitializeLightWeightSet()
462 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeLightWeightSet()
463 SetFunctionAtSymbol(thread, env, funcPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeLightWeightSet()
466 InitializeLightWeightSetIterator(thread); in InitializeLightWeightSet()
470 void ContainersPrivate::InitializeLightWeightSetIterator(JSThread *thread) in InitializeLightWeightSetIterator() argument
472 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeLightWeightSetIterator()
473 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLightWeightSetIterator()
474 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeLightWeightSetIterator()
475 …JSHandle<JSHClass> iteratorClass = JSHandle<JSHClass>(thread, globalConst->GetHandledJSAPIIterator… in InitializeLightWeightSetIterator()
479thread, lightWeightSetIteratorPrototype, "next", JSAPILightWeightSetIterator::Next, FuncLength::ON… in InitializeLightWeightSetIterator()
480 SetStringTagSymbol(thread, env, lightWeightSetIteratorPrototype, "LightWeightSet Iterator"); in InitializeLightWeightSetIterator()
485 JSHandle<JSTaggedValue> ContainersPrivate::InitializeTreeMap(JSThread *thread) in InitializeTreeMap() argument
487 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeTreeMap()
488 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeMap()
497thread, mapFuncPrototype, ContainersTreeMap::TreeMapConstructor, "TreeMap", FuncLength::ZERO)); in InitializeTreeMap()
498 …JSHandle<JSFunction>::Cast(mapFunction)->SetFunctionPrototype(thread, mapInstanceClass.GetTaggedVa… in InitializeTreeMap()
502 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(mapFuncPrototype), constructorKey, mapFuncti… in InitializeTreeMap()
505 SetFrozenFunction(thread, mapFuncPrototype, "set", ContainersTreeMap::Set, FuncLength::TWO); in InitializeTreeMap()
506 SetFrozenFunction(thread, mapFuncPrototype, "get", ContainersTreeMap::Get, FuncLength::ONE); in InitializeTreeMap()
507 … SetFrozenFunction(thread, mapFuncPrototype, "remove", ContainersTreeMap::Remove, FuncLength::ONE); in InitializeTreeMap()
508 … SetFrozenFunction(thread, mapFuncPrototype, "hasKey", ContainersTreeMap::HasKey, FuncLength::ONE); in InitializeTreeMap()
509 …SetFrozenFunction(thread, mapFuncPrototype, "hasValue", ContainersTreeMap::HasValue, FuncLength::O… in InitializeTreeMap()
510 …SetFrozenFunction(thread, mapFuncPrototype, "getFirstKey", ContainersTreeMap::GetFirstKey, FuncLen… in InitializeTreeMap()
511 …SetFrozenFunction(thread, mapFuncPrototype, "getLastKey", ContainersTreeMap::GetLastKey, FuncLengt… in InitializeTreeMap()
512 … SetFrozenFunction(thread, mapFuncPrototype, "setAll", ContainersTreeMap::SetAll, FuncLength::ONE); in InitializeTreeMap()
513 … SetFrozenFunction(thread, mapFuncPrototype, "clear", ContainersTreeMap::Clear, FuncLength::ZERO); in InitializeTreeMap()
514 …SetFrozenFunction(thread, mapFuncPrototype, "getLowerKey", ContainersTreeMap::GetLowerKey, FuncLen… in InitializeTreeMap()
515 …SetFrozenFunction(thread, mapFuncPrototype, "getHigherKey", ContainersTreeMap::GetHigherKey, FuncL… in InitializeTreeMap()
516 SetFrozenFunction(thread, mapFuncPrototype, "keys", ContainersTreeMap::Keys, FuncLength::ZERO); in InitializeTreeMap()
517 …SetFrozenFunction(thread, mapFuncPrototype, "values", ContainersTreeMap::Values, FuncLength::ZERO); in InitializeTreeMap()
518 …SetFrozenFunction(thread, mapFuncPrototype, "replace", ContainersTreeMap::Replace, FuncLength::TWO… in InitializeTreeMap()
519 …SetFrozenFunction(thread, mapFuncPrototype, "forEach", ContainersTreeMap::ForEach, FuncLength::ONE… in InitializeTreeMap()
520 …SetFrozenFunction(thread, mapFuncPrototype, "entries", ContainersTreeMap::Entries, FuncLength::ZER… in InitializeTreeMap()
521 …SetFrozenFunction(thread, mapFuncPrototype, "isEmpty", ContainersTreeMap::IsEmpty, FuncLength::ZER… in InitializeTreeMap()
524 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeMap()
525 SetStringTagSymbol(thread, env, mapFuncPrototype, "TreeMap"); in InitializeTreeMap()
530 JSObject::GetMethod(thread, JSHandle<JSTaggedValue>::Cast(mapFuncPrototype), entries); in InitializeTreeMap()
531 PropertyDescriptor descriptor(thread, entriesFunc, false, false, false); in InitializeTreeMap()
532 JSObject::DefineOwnProperty(thread, mapFuncPrototype, iteratorSymbol, descriptor); in InitializeTreeMap()
535 CreateGetter(thread, ContainersTreeMap::GetLength, "length", FuncLength::ZERO); in InitializeTreeMap()
536 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeTreeMap()
537 SetGetter(thread, mapFuncPrototype, lengthKey, lengthGetter); in InitializeTreeMap()
539 InitializeTreeMapIterator(thread); in InitializeTreeMap()
543 void ContainersPrivate::InitializeTreeMapIterator(JSThread *thread) in InitializeTreeMapIterator() argument
545 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeMapIterator()
546 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeMapIterator()
554 …SetFrozenFunction(thread, mapIteratorPrototype, "next", JSAPITreeMapIterator::Next, FuncLength::ZE… in InitializeTreeMapIterator()
555 SetStringTagSymbol(thread, env, mapIteratorPrototype, "TreeMap Iterator"); in InitializeTreeMapIterator()
556 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeTreeMapIterator()
560 JSHandle<JSTaggedValue> ContainersPrivate::InitializeTreeSet(JSThread *thread) in InitializeTreeSet() argument
562 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeTreeSet()
563 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeSet()
572thread, setFuncPrototype, ContainersTreeSet::TreeSetConstructor, "TreeSet", FuncLength::ZERO)); in InitializeTreeSet()
573 …JSHandle<JSFunction>::Cast(setFunction)->SetFunctionPrototype(thread, setInstanceClass.GetTaggedVa… in InitializeTreeSet()
577 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(setFuncPrototype), constructorKey, setFuncti… in InitializeTreeSet()
580 SetFrozenFunction(thread, setFuncPrototype, "add", ContainersTreeSet::Add, FuncLength::TWO); in InitializeTreeSet()
581 … SetFrozenFunction(thread, setFuncPrototype, "remove", ContainersTreeSet::Remove, FuncLength::ONE); in InitializeTreeSet()
582 SetFrozenFunction(thread, setFuncPrototype, "has", ContainersTreeSet::Has, FuncLength::ONE); in InitializeTreeSet()
583 …SetFrozenFunction(thread, setFuncPrototype, "getFirstValue", ContainersTreeSet::GetFirstValue, Fun… in InitializeTreeSet()
584 …SetFrozenFunction(thread, setFuncPrototype, "getLastValue", ContainersTreeSet::GetLastValue, FuncL… in InitializeTreeSet()
585 … SetFrozenFunction(thread, setFuncPrototype, "clear", ContainersTreeSet::Clear, FuncLength::ZERO); in InitializeTreeSet()
586 …SetFrozenFunction(thread, setFuncPrototype, "getLowerValue", ContainersTreeSet::GetLowerValue, Fun… in InitializeTreeSet()
587 …SetFrozenFunction(thread, setFuncPrototype, "getHigherValue", ContainersTreeSet::GetHigherValue, F… in InitializeTreeSet()
588 …SetFrozenFunction(thread, setFuncPrototype, "popFirst", ContainersTreeSet::PopFirst, FuncLength::Z… in InitializeTreeSet()
589 …SetFrozenFunction(thread, setFuncPrototype, "popLast", ContainersTreeSet::PopLast, FuncLength::ZER… in InitializeTreeSet()
590 …SetFrozenFunction(thread, setFuncPrototype, "isEmpty", ContainersTreeSet::IsEmpty, FuncLength::TWO… in InitializeTreeSet()
591 …SetFrozenFunction(thread, setFuncPrototype, "values", ContainersTreeSet::Values, FuncLength::ZERO); in InitializeTreeSet()
592 …SetFrozenFunction(thread, setFuncPrototype, "forEach", ContainersTreeSet::ForEach, FuncLength::ONE… in InitializeTreeSet()
593 …SetFrozenFunction(thread, setFuncPrototype, "entries", ContainersTreeSet::Entries, FuncLength::ZER… in InitializeTreeSet()
596 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeSet()
597 SetStringTagSymbol(thread, env, setFuncPrototype, "TreeSet"); in InitializeTreeSet()
600 JSHandle<JSTaggedValue> values(thread, globalConst->GetValuesString()); in InitializeTreeSet()
602 JSObject::GetMethod(thread, JSHandle<JSTaggedValue>::Cast(setFuncPrototype), values); in InitializeTreeSet()
603 PropertyDescriptor descriptor(thread, valuesFunc, false, false, false); in InitializeTreeSet()
604 JSObject::DefineOwnProperty(thread, setFuncPrototype, iteratorSymbol, descriptor); in InitializeTreeSet()
607 CreateGetter(thread, ContainersTreeSet::GetLength, "length", FuncLength::ZERO); in InitializeTreeSet()
608 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeTreeSet()
609 SetGetter(thread, setFuncPrototype, lengthKey, lengthGetter); in InitializeTreeSet()
611 InitializeTreeSetIterator(thread); in InitializeTreeSet()
615 void ContainersPrivate::InitializeTreeSetIterator(JSThread *thread) in InitializeTreeSetIterator() argument
617 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeSetIterator()
618 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeSetIterator()
626 …SetFrozenFunction(thread, setIteratorPrototype, "next", JSAPITreeSetIterator::Next, FuncLength::ZE… in InitializeTreeSetIterator()
627 SetStringTagSymbol(thread, env, setIteratorPrototype, "TreeSet Iterator"); in InitializeTreeSetIterator()
628 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeTreeSetIterator()
632 JSHandle<JSTaggedValue> ContainersPrivate::InitializePlainArray(JSThread *thread) in InitializePlainArray() argument
634 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializePlainArray()
635 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializePlainArray()
643 …NewContainerConstructor(thread, plainArrayFuncPrototype, ContainersPlainArray::PlainArrayConstruct… in InitializePlainArray()
645 JSHandle<JSFunction>::Cast(plainArrayFunction)->SetFunctionPrototype(thread, in InitializePlainArray()
650 JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(plainArrayFuncPrototype), constructorKey, in InitializePlainArray()
653 …SetFrozenFunction(thread, plainArrayFuncPrototype, "add", ContainersPlainArray::Add, FuncLength::O… in InitializePlainArray()
654 …SetFrozenFunction(thread, plainArrayFuncPrototype, "clear", ContainersPlainArray::Clear, FuncLengt… in InitializePlainArray()
655 …SetFrozenFunction(thread, plainArrayFuncPrototype, "clone", ContainersPlainArray::Clone, FuncLengt… in InitializePlainArray()
656 …SetFrozenFunction(thread, plainArrayFuncPrototype, "has", ContainersPlainArray::Has, FuncLength::O… in InitializePlainArray()
657 …SetFrozenFunction(thread, plainArrayFuncPrototype, "get", ContainersPlainArray::Get, FuncLength::O… in InitializePlainArray()
658 …SetFrozenFunction(thread, plainArrayFuncPrototype, "forEach", ContainersPlainArray::ForEach, FuncL… in InitializePlainArray()
660 SetFrozenFunction(thread, plainArrayFuncPrototype, "toString", ContainersPlainArray::ToString, in InitializePlainArray()
662 …SetFrozenFunction(thread, plainArrayFuncPrototype, "getIndexOfKey", ContainersPlainArray::GetIndex… in InitializePlainArray()
664 …SetFrozenFunction(thread, plainArrayFuncPrototype, "getIndexOfValue", ContainersPlainArray::GetInd… in InitializePlainArray()
666 …SetFrozenFunction(thread, plainArrayFuncPrototype, "isEmpty", ContainersPlainArray::IsEmpty, FuncL… in InitializePlainArray()
667 SetFrozenFunction(thread, plainArrayFuncPrototype, "getKeyAt", in InitializePlainArray()
669 …SetFrozenFunction(thread, plainArrayFuncPrototype, "remove", ContainersPlainArray::Remove, FuncLen… in InitializePlainArray()
670 SetFrozenFunction(thread, plainArrayFuncPrototype, "removeAt", ContainersPlainArray::RemoveAt, in InitializePlainArray()
672 …SetFrozenFunction(thread, plainArrayFuncPrototype, "removeRangeFrom", ContainersPlainArray::Remove… in InitializePlainArray()
674 … SetFrozenFunction(thread, plainArrayFuncPrototype, "setValueAt", ContainersPlainArray::SetValueAt, in InitializePlainArray()
676 … SetFrozenFunction(thread, plainArrayFuncPrototype, "getValueAt", ContainersPlainArray::GetValueAt, in InitializePlainArray()
679 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersPlainArray::GetSize, "length… in InitializePlainArray()
682 SetGetter(thread, plainArrayFuncPrototype, lengthKey, lengthGetter); in InitializePlainArray()
684 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializePlainArray()
685 …SetFunctionAtSymbol(thread, env, plainArrayFuncPrototype, env->GetIteratorSymbol(), "[Symbol.itera… in InitializePlainArray()
687 InitializePlainArrayIterator(thread); in InitializePlainArray()
692 void ContainersPrivate::InitializePlainArrayIterator(JSThread *thread) in InitializePlainArrayIterator() argument
694 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializePlainArrayIterator()
695 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializePlainArrayIterator()
696 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializePlainArrayIterator()
697 JSHandle<JSHClass> iteratorClass = JSHandle<JSHClass>(thread, globalConst-> in InitializePlainArrayIterator()
701 …SetFrozenFunction(thread, plainarrayIteratorPrototype, "next", JSAPIPlainArrayIterator::Next, Func… in InitializePlainArrayIterator()
702 SetStringTagSymbol(thread, env, plainarrayIteratorPrototype, "PlainArray Iterator"); in InitializePlainArrayIterator()
707 JSHandle<JSTaggedValue> ContainersPrivate::InitializeStack(JSThread *thread) in InitializeStack() argument
709 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeStack()
710 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeStack()
719 thread, stackFuncPrototype, ContainersStack::StackConstructor, "Stack", FuncLength::ZERO)); in InitializeStack()
720 …JSHandle<JSFunction>::Cast(stackFunction)->SetFunctionPrototype(thread, stackInstanceClass.GetTagg… in InitializeStack()
724 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(stackFuncPrototype), constructorKey, stackFu… in InitializeStack()
727 SetFrozenFunction(thread, stackFuncPrototype, "push", ContainersStack::Push, FuncLength::ONE); in InitializeStack()
729 …SetFrozenFunction(thread, stackFuncPrototype, "isEmpty", ContainersStack::IsEmpty, FuncLength::ONE… in InitializeStack()
731 SetFrozenFunction(thread, stackFuncPrototype, "peek", ContainersStack::Peek, FuncLength::ONE); in InitializeStack()
733 SetFrozenFunction(thread, stackFuncPrototype, "pop", ContainersStack::Pop, FuncLength::ONE); in InitializeStack()
735 … SetFrozenFunction(thread, stackFuncPrototype, "locate", ContainersStack::Locate, FuncLength::ONE); in InitializeStack()
737 …SetFrozenFunction(thread, stackFuncPrototype, "forEach", ContainersStack::ForEach, FuncLength::ONE, in InitializeStack()
739 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeStack()
740 SetStringTagSymbol(thread, env, stackFuncPrototype, "Stack"); in InitializeStack()
742 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersStack::GetLength, "length", … in InitializeStack()
744 SetGetter(thread, stackFuncPrototype, lengthKey, lengthGetter); in InitializeStack()
746 …SetFunctionAtSymbol(thread, env, stackFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeStack()
749 ContainersPrivate::InitializeStackIterator(thread, globalConst); in InitializeStack()
753 void ContainersPrivate::InitializeStackIterator(JSThread *thread, GlobalEnvConstants *globalConst) in InitializeStackIterator() argument
755 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeStackIterator()
756 JSHandle<JSHClass> iteratorFuncHClass = JSHandle<JSHClass>(thread, globalConst-> in InitializeStackIterator()
761 …SetFrozenFunction(thread, stackIteratorPrototype, "next", JSAPIStackIterator::Next, FuncLength::ON… in InitializeStackIterator()
765 JSHandle<JSTaggedValue> ContainersPrivate::InitializeVector(JSThread *thread) in InitializeVector() argument
767 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeVector()
768 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeVector()
777 thread, prototype, ContainersVector::VectorConstructor, "Vector", FuncLength::ZERO)); in InitializeVector()
778 …JSHandle<JSFunction>::Cast(vectorFunction)->SetFunctionPrototype(thread, vectorInstanceClass.GetTa… in InitializeVector()
782 … JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(prototype), constructorKey, vectorFunction); in InitializeVector()
785 SetFrozenFunction(thread, prototype, "add", ContainersVector::Add, FuncLength::ONE); in InitializeVector()
786 SetFrozenFunction(thread, prototype, "insert", ContainersVector::Insert, FuncLength::TWO); in InitializeVector()
787 SetFrozenFunction(thread, prototype, "setLength", ContainersVector::SetLength, FuncLength::ONE); in InitializeVector()
788 …SetFrozenFunction(thread, prototype, "getCapacity", ContainersVector::GetCapacity, FuncLength::ZER… in InitializeVector()
789 …SetFrozenFunction(thread, prototype, "increaseCapacityTo", ContainersVector::IncreaseCapacityTo, F… in InitializeVector()
790 SetFrozenFunction(thread, prototype, "get", ContainersVector::Get, FuncLength::ONE); in InitializeVector()
791 … SetFrozenFunction(thread, prototype, "getIndexOf", ContainersVector::GetIndexOf, FuncLength::ONE); in InitializeVector()
792 …SetFrozenFunction(thread, prototype, "getIndexFrom", ContainersVector::GetIndexFrom, FuncLength::T… in InitializeVector()
793 SetFrozenFunction(thread, prototype, "isEmpty", ContainersVector::IsEmpty, FuncLength::ZERO); in InitializeVector()
794 …SetFrozenFunction(thread, prototype, "getLastElement", ContainersVector::GetLastElement, FuncLengt… in InitializeVector()
795 …SetFrozenFunction(thread, prototype, "getLastIndexOf", ContainersVector::GetLastIndexOf, FuncLengt… in InitializeVector()
796 …SetFrozenFunction(thread, prototype, "getLastIndexFrom", ContainersVector::GetLastIndexFrom, FuncL… in InitializeVector()
797 SetFrozenFunction(thread, prototype, "remove", ContainersVector::Remove, FuncLength::ONE); in InitializeVector()
798 …SetFrozenFunction(thread, prototype, "removeByIndex", ContainersVector::RemoveByIndex, FuncLength:… in InitializeVector()
799 …SetFrozenFunction(thread, prototype, "removeByRange", ContainersVector::RemoveByRange, FuncLength:… in InitializeVector()
800 SetFrozenFunction(thread, prototype, "set", ContainersVector::Set, FuncLength::TWO); in InitializeVector()
801 SetFrozenFunction(thread, prototype, "subVector", ContainersVector::SubVector, FuncLength::TWO); in InitializeVector()
802 SetFrozenFunction(thread, prototype, "toString", ContainersVector::ToString, FuncLength::ZERO); in InitializeVector()
803 SetFrozenFunction(thread, prototype, "forEach", ContainersVector::ForEach, FuncLength::TWO, in InitializeVector()
805 …SetFrozenFunction(thread, prototype, "replaceAllElements", ContainersVector::ReplaceAllElements, F… in InitializeVector()
807 SetFrozenFunction(thread, prototype, "has", ContainersVector::Has, FuncLength::ONE); in InitializeVector()
808 SetFrozenFunction(thread, prototype, "sort", ContainersVector::Sort, FuncLength::ZERO); in InitializeVector()
809 SetFrozenFunction(thread, prototype, "clear", ContainersVector::Clear, FuncLength::ZERO); in InitializeVector()
810 SetFrozenFunction(thread, prototype, "clone", ContainersVector::Clone, FuncLength::ZERO); in InitializeVector()
811 …SetFrozenFunction(thread, prototype, "copyToArray", ContainersVector::CopyToArray, FuncLength::ONE… in InitializeVector()
812 …SetFrozenFunction(thread, prototype, "convertToArray", ContainersVector::ConvertToArray, FuncLengt… in InitializeVector()
813 …SetFrozenFunction(thread, prototype, "getFirstElement", ContainersVector::GetFirstElement, FuncLen… in InitializeVector()
814 SetFrozenFunction(thread, prototype, "trimToCurrentLength", in InitializeVector()
817 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeVector()
818 SetStringTagSymbol(thread, env, prototype, "Vector"); in InitializeVector()
820 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersVector::GetSize, "length", F… in InitializeVector()
821 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeVector()
822 SetGetter(thread, prototype, lengthKey, lengthGetter); in InitializeVector()
824 SetFunctionAtSymbol(thread, env, prototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeVector()
827 ContainersPrivate::InitializeVectorIterator(thread, env, globalConst); in InitializeVector()
832 void ContainersPrivate::InitializeVectorIterator(JSThread *thread, const JSHandle<GlobalEnv> &env, in InitializeVectorIterator() argument
835 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeVectorIterator()
836 JSHandle<JSHClass> iteratorFuncHClass = JSHandle<JSHClass>(thread, globalConst-> in InitializeVectorIterator()
841 …SetFrozenFunction(thread, vectorIteratorPrototype, "next", JSAPIVectorIterator::Next, FuncLength::… in InitializeVectorIterator()
842 SetStringTagSymbol(thread, env, vectorIteratorPrototype, "Vector Iterator"); in InitializeVectorIterator()
846 JSHandle<JSTaggedValue> ContainersPrivate::InitializeQueue(JSThread *thread) in InitializeQueue() argument
848 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeQueue()
849 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeQueue()
858 thread, queueFuncPrototype, ContainersQueue::QueueConstructor, "Queue", FuncLength::ZERO)); in InitializeQueue()
859 …JSHandle<JSFunction>::Cast(queueFunction)->SetFunctionPrototype(thread, queueInstanceClass.GetTagg… in InitializeQueue()
863 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(queueFuncPrototype), constructorKey, queueFu… in InitializeQueue()
866 SetFrozenFunction(thread, queueFuncPrototype, "add", ContainersQueue::Add, FuncLength::ONE); in InitializeQueue()
867 …SetFrozenFunction(thread, queueFuncPrototype, "getFirst", ContainersQueue::GetFirst, FuncLength::Z… in InitializeQueue()
868 SetFrozenFunction(thread, queueFuncPrototype, "pop", ContainersQueue::Pop, FuncLength::ZERO); in InitializeQueue()
869 …SetFrozenFunction(thread, queueFuncPrototype, "forEach", ContainersQueue::ForEach, FuncLength::TWO, in InitializeQueue()
872 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeQueue()
873 SetStringTagSymbol(thread, env, queueFuncPrototype, "Queue"); in InitializeQueue()
875 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersQueue::GetSize, "length", Fu… in InitializeQueue()
876 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeQueue()
877 SetGetter(thread, queueFuncPrototype, lengthKey, lengthGetter); in InitializeQueue()
879 …SetFunctionAtSymbol(thread, env, queueFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeQueue()
882 ContainersPrivate::InitializeQueueIterator(thread, env, globalConst); in InitializeQueue()
886 void ContainersPrivate::InitializeQueueIterator(JSThread *thread, const JSHandle<GlobalEnv> &env, in InitializeQueueIterator() argument
889 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeQueueIterator()
895 …SetFrozenFunction(thread, queueIteratorPrototype, "next", JSAPIQueueIterator::Next, FuncLength::ON… in InitializeQueueIterator()
896 SetStringTagSymbol(thread, env, queueIteratorPrototype, "Queue Iterator"); in InitializeQueueIterator()
900 JSHandle<JSTaggedValue> ContainersPrivate::InitializeDeque(JSThread *thread) in InitializeDeque() argument
902 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeDeque()
903 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeDeque()
912 thread, dequeFuncPrototype, ContainersDeque::DequeConstructor, "Deque", FuncLength::ZERO)); in InitializeDeque()
913 …JSHandle<JSFunction>::Cast(dequeFunction)->SetFunctionPrototype(thread, dequeInstanceClass.GetTagg… in InitializeDeque()
917 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(dequeFuncPrototype), constructorKey, dequeFu… in InitializeDeque()
919 …SetFrozenFunction(thread, dequeFuncPrototype, "insertFront", ContainersDeque::InsertFront, FuncLen… in InitializeDeque()
920 …SetFrozenFunction(thread, dequeFuncPrototype, "insertEnd", ContainersDeque::InsertEnd, FuncLength:… in InitializeDeque()
921 …SetFrozenFunction(thread, dequeFuncPrototype, "getFirst", ContainersDeque::GetFirst, FuncLength::Z… in InitializeDeque()
922 …SetFrozenFunction(thread, dequeFuncPrototype, "getLast", ContainersDeque::GetLast, FuncLength::ZER… in InitializeDeque()
923 SetFrozenFunction(thread, dequeFuncPrototype, "has", ContainersDeque::Has, FuncLength::ONE); in InitializeDeque()
924 …SetFrozenFunction(thread, dequeFuncPrototype, "popFirst", ContainersDeque::PopFirst, FuncLength::Z… in InitializeDeque()
925 …SetFrozenFunction(thread, dequeFuncPrototype, "popLast", ContainersDeque::PopLast, FuncLength::ZER… in InitializeDeque()
926 …SetFrozenFunction(thread, dequeFuncPrototype, "forEach", ContainersDeque::ForEach, FuncLength::TWO, in InitializeDeque()
929 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeDeque()
930 SetStringTagSymbol(thread, env, dequeFuncPrototype, "Deque"); in InitializeDeque()
932 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersDeque::GetSize, "length", Fu… in InitializeDeque()
934 SetGetter(thread, dequeFuncPrototype, lengthKey, lengthGetter); in InitializeDeque()
936 …SetFunctionAtSymbol(thread, env, dequeFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeDeque()
939 ContainersPrivate::InitializeDequeIterator(thread, env, globalConst); in InitializeDeque()
944 void ContainersPrivate::InitializeDequeIterator(JSThread *thread, const JSHandle<GlobalEnv> &env, in InitializeDequeIterator() argument
947 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeDequeIterator()
948 JSHandle<JSHClass> iteratorFuncHClass = JSHandle<JSHClass>(thread, globalConst-> in InitializeDequeIterator()
951 …SetFrozenFunction(thread, dequeIteratorPrototype, "next", JSAPIDequeIterator::Next, FuncLength::ON… in InitializeDequeIterator()
952 SetStringTagSymbol(thread, env, dequeIteratorPrototype, "Deque Iterator"); in InitializeDequeIterator()
956 JSHandle<JSTaggedValue> ContainersPrivate::InitializeList(JSThread *thread) in InitializeList() argument
958 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeList()
959 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeList()
965 thread, listFuncPrototype, ContainersList::ListConstructor, "List", FuncLength::ZERO)); in InitializeList()
966 …JSHandle<JSFunction>::Cast(listFunction)->SetFunctionPrototype(thread, listInstanceClass.GetTagged… in InitializeList()
969 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(listFuncPrototype), constructorKey, listFunc… in InitializeList()
971 SetFrozenFunction(thread, listFuncPrototype, "add", ContainersList::Add, FuncLength::ONE); in InitializeList()
972 …SetFrozenFunction(thread, listFuncPrototype, "getFirst", ContainersList::GetFirst, FuncLength::ONE… in InitializeList()
973 … SetFrozenFunction(thread, listFuncPrototype, "getLast", ContainersList::GetLast, FuncLength::ONE); in InitializeList()
974 SetFrozenFunction(thread, listFuncPrototype, "insert", ContainersList::Insert, FuncLength::ONE); in InitializeList()
975 SetFrozenFunction(thread, listFuncPrototype, "clear", ContainersList::Clear, FuncLength::ONE); in InitializeList()
976 …SetFrozenFunction(thread, listFuncPrototype, "removeByIndex", ContainersList::RemoveByIndex, FuncL… in InitializeList()
977 SetFrozenFunction(thread, listFuncPrototype, "remove", ContainersList::Remove, FuncLength::ONE); in InitializeList()
978 SetFrozenFunction(thread, listFuncPrototype, "has", ContainersList::Has, FuncLength::ONE); in InitializeList()
979 … SetFrozenFunction(thread, listFuncPrototype, "isEmpty", ContainersList::IsEmpty, FuncLength::ONE); in InitializeList()
980 SetFrozenFunction(thread, listFuncPrototype, "get", ContainersList::Get, FuncLength::ONE); in InitializeList()
981 …SetFrozenFunction(thread, listFuncPrototype, "getIndexOf", ContainersList::GetIndexOf, FuncLength:… in InitializeList()
982 …SetFrozenFunction(thread, listFuncPrototype, "getLastIndexOf", ContainersList::GetLastIndexOf, Fun… in InitializeList()
983 SetFrozenFunction(thread, listFuncPrototype, "set", ContainersList::Set, FuncLength::ONE); in InitializeList()
984 … SetFrozenFunction(thread, listFuncPrototype, "forEach", ContainersList::ForEach, FuncLength::ONE, in InitializeList()
986 …SetFrozenFunction(thread, listFuncPrototype, "replaceAllElements", ContainersList::ReplaceAllEleme… in InitializeList()
988 SetFrozenFunction(thread, listFuncPrototype, "equal", ContainersList::Equal, FuncLength::ONE); in InitializeList()
989 SetFrozenFunction(thread, listFuncPrototype, "sort", ContainersList::Sort, FuncLength::ONE); in InitializeList()
990 …SetFrozenFunction(thread, listFuncPrototype, "convertToArray", ContainersList::ConvertToArray, Fun… in InitializeList()
991 …SetFrozenFunction(thread, listFuncPrototype, "getSubList", ContainersList::GetSubList, FuncLength:… in InitializeList()
993 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersList::Length, "length", Func… in InitializeList()
995 SetGetter(thread, listFuncPrototype, lengthKey, lengthGetter); in InitializeList()
997 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeList()
998 … SetFunctionAtSymbol(thread, env, listFuncPrototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeList()
1001 InitializeListIterator(thread, env); in InitializeList()
1006 JSHandle<JSTaggedValue> ContainersPrivate::InitializeLinkedList(JSThread *thread) in InitializeLinkedList() argument
1008 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeLinkedList()
1009 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLinkedList()
1015thread, linkedListFuncPrototype, ContainersLinkedList::LinkedListConstructor, "LinkedList", FuncLe… in InitializeLinkedList()
1016 JSHandle<JSFunction>::Cast(linkedListFunction)->SetFunctionPrototype(thread, in InitializeLinkedList()
1020 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(linkedListFuncPrototype), constructorKey, li… in InitializeLinkedList()
1022 …SetFrozenFunction(thread, linkedListFuncPrototype, "add", ContainersLinkedList::Add, FuncLength::O… in InitializeLinkedList()
1023 …SetFrozenFunction(thread, linkedListFuncPrototype, "insert", ContainersLinkedList::Insert, FuncLen… in InitializeLinkedList()
1024 …SetFrozenFunction(thread, linkedListFuncPrototype, "clear", ContainersLinkedList::Clear, FuncLengt… in InitializeLinkedList()
1025 …SetFrozenFunction(thread, linkedListFuncPrototype, "clone", ContainersLinkedList::Clone, FuncLengt… in InitializeLinkedList()
1026 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeFirst", ContainersLinkedList::RemoveFirs… in InitializeLinkedList()
1028 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeLast", ContainersLinkedList::RemoveLast,… in InitializeLinkedList()
1029 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeFirstFound", ContainersLinkedList::Remov… in InitializeLinkedList()
1031 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeByIndex", ContainersLinkedList::RemoveBy… in InitializeLinkedList()
1033 …SetFrozenFunction(thread, linkedListFuncPrototype, "remove", ContainersLinkedList::Remove, FuncLen… in InitializeLinkedList()
1034 …SetFrozenFunction(thread, linkedListFuncPrototype, "removeLastFound", ContainersLinkedList::Remove… in InitializeLinkedList()
1036 …SetFrozenFunction(thread, linkedListFuncPrototype, "has", ContainersLinkedList::Has, FuncLength::O… in InitializeLinkedList()
1037 …SetFrozenFunction(thread, linkedListFuncPrototype, "get", ContainersLinkedList::Get, FuncLength::O… in InitializeLinkedList()
1038 …SetFrozenFunction(thread, linkedListFuncPrototype, "addFirst", ContainersLinkedList::AddFirst, Fun… in InitializeLinkedList()
1039 …SetFrozenFunction(thread, linkedListFuncPrototype, "getFirst", ContainersLinkedList::GetFirst, Fun… in InitializeLinkedList()
1040 …SetFrozenFunction(thread, linkedListFuncPrototype, "getLast", ContainersLinkedList::GetLast, FuncL… in InitializeLinkedList()
1041 …SetFrozenFunction(thread, linkedListFuncPrototype, "getIndexOf", ContainersLinkedList::GetIndexOf,… in InitializeLinkedList()
1042 …SetFrozenFunction(thread, linkedListFuncPrototype, "getLastIndexOf", ContainersLinkedList::GetLast… in InitializeLinkedList()
1044 …SetFrozenFunction(thread, linkedListFuncPrototype, "convertToArray", ContainersLinkedList::Convert… in InitializeLinkedList()
1046 …SetFrozenFunction(thread, linkedListFuncPrototype, "set", ContainersLinkedList::Set, FuncLength::O… in InitializeLinkedList()
1047 …SetFrozenFunction(thread, linkedListFuncPrototype, "forEach", ContainersLinkedList::ForEach, FuncL… in InitializeLinkedList()
1050 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersLinkedList::Length, "length", in InitializeLinkedList()
1053 SetGetter(thread, linkedListFuncPrototype, lengthKey, lengthGetter); in InitializeLinkedList()
1055 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeLinkedList()
1056 …SetFunctionAtSymbol(thread, env, linkedListFuncPrototype, env->GetIteratorSymbol(), "[Symbol.itera… in InitializeLinkedList()
1059 InitializeLinkedListIterator(thread, env); in InitializeLinkedList()
1064 void ContainersPrivate::InitializeLinkedListIterator(JSThread *thread, const JSHandle<GlobalEnv> &e… in InitializeLinkedListIterator() argument
1066 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeLinkedListIterator()
1067 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeLinkedListIterator()
1069 …JSHandle<JSHClass>(thread, globalConst->GetHandledJSAPIIteratorFuncHClass().GetObject<JSHClass>()); in InitializeLinkedListIterator()
1071 …SetFrozenFunction(thread, setIteratorPrototype, "next", JSAPILinkedListIterator::Next, FuncLength:… in InitializeLinkedListIterator()
1072 SetStringTagSymbol(thread, env, setIteratorPrototype, "linkedlist Iterator"); in InitializeLinkedListIterator()
1077 void ContainersPrivate::InitializeListIterator(JSThread *thread, const JSHandle<GlobalEnv> &env) in InitializeListIterator() argument
1079 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeListIterator()
1080 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeListIterator()
1082 …JSHandle<JSHClass>(thread, globalConst->GetHandledJSAPIIteratorFuncHClass().GetObject<JSHClass>()); in InitializeListIterator()
1084 … SetFrozenFunction(thread, setIteratorPrototype, "next", JSAPIListIterator::Next, FuncLength::ONE); in InitializeListIterator()
1085 SetStringTagSymbol(thread, env, setIteratorPrototype, "list Iterator"); in InitializeListIterator()
1089 JSHandle<JSTaggedValue> ContainersPrivate::InitializeHashMap(JSThread *thread) in InitializeHashMap() argument
1091 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeHashMap()
1092 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeHashMap()
1101thread, hashMapFuncPrototype, ContainersHashMap::HashMapConstructor, "HashMap", FuncLength::ZERO)); in InitializeHashMap()
1102 …JSHandle<JSFunction>::Cast(hashMapFunction)->SetFunctionPrototype(thread, hashMapInstanceClass.Get… in InitializeHashMap()
1106 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(hashMapFuncPrototype), constructorKey, hashM… in InitializeHashMap()
1108 SetFrozenFunction(thread, hashMapFuncPrototype, "set", ContainersHashMap::Set, FuncLength::TWO); in InitializeHashMap()
1110 …SetFrozenFunction(thread, hashMapFuncPrototype, "setAll", ContainersHashMap::SetAll, FuncLength::O… in InitializeHashMap()
1112 …SetFrozenFunction(thread, hashMapFuncPrototype, "isEmpty", ContainersHashMap::IsEmpty, FuncLength:… in InitializeHashMap()
1114 …SetFrozenFunction(thread, hashMapFuncPrototype, "remove", ContainersHashMap::Remove, FuncLength::O… in InitializeHashMap()
1116 …SetFrozenFunction(thread, hashMapFuncPrototype, "clear", ContainersHashMap::Clear, FuncLength::ZER… in InitializeHashMap()
1118 SetFrozenFunction(thread, hashMapFuncPrototype, "get", ContainersHashMap::Get, FuncLength::ONE); in InitializeHashMap()
1120 …SetFrozenFunction(thread, hashMapFuncPrototype, "forEach", ContainersHashMap::ForEach, FuncLength:… in InitializeHashMap()
1123 …SetFrozenFunction(thread, hashMapFuncPrototype, "hasKey", ContainersHashMap::HasKey, FuncLength::O… in InitializeHashMap()
1125 …SetFrozenFunction(thread, hashMapFuncPrototype, "hasValue", ContainersHashMap::HasValue, FuncLengt… in InitializeHashMap()
1127 …SetFrozenFunction(thread, hashMapFuncPrototype, "replace", ContainersHashMap::Replace, FuncLength:… in InitializeHashMap()
1129 …SetFrozenFunction(thread, hashMapFuncPrototype, "keys", ContainersHashMap::Keys, FuncLength::ZERO); in InitializeHashMap()
1131 …SetFrozenFunction(thread, hashMapFuncPrototype, "values", ContainersHashMap::Values, FuncLength::Z… in InitializeHashMap()
1133 …SetFrozenFunction(thread, hashMapFuncPrototype, "entries", ContainersHashMap::Entries, FuncLength:… in InitializeHashMap()
1134 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeHashMap()
1136 SetStringTagSymbol(thread, env, hashMapFuncPrototype, "HashMap"); in InitializeHashMap()
1141 JSObject::GetMethod(thread, JSHandle<JSTaggedValue>::Cast(hashMapFuncPrototype), entries); in InitializeHashMap()
1142 PropertyDescriptor descriptor(thread, entriesFunc, false, false, false); in InitializeHashMap()
1143 JSObject::DefineOwnProperty(thread, hashMapFuncPrototype, iteratorSymbol, descriptor); in InitializeHashMap()
1146 CreateGetter(thread, ContainersHashMap::GetLength, "length", FuncLength::ZERO); in InitializeHashMap()
1147 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeHashMap()
1148 SetGetter(thread, hashMapFuncPrototype, lengthKey, lengthGetter); in InitializeHashMap()
1149 InitializeHashMapIterator(thread); in InitializeHashMap()
1153 void ContainersPrivate::InitializeHashMapIterator(JSThread *thread) in InitializeHashMapIterator() argument
1155 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeHashMapIterator()
1156 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeHashMapIterator()
1157 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeHashMapIterator()
1163 …SetFrozenFunction(thread, hashMapIteratorPrototype, "next", JSAPIHashMapIterator::Next, FuncLength… in InitializeHashMapIterator()
1164 SetStringTagSymbol(thread, env, hashMapIteratorPrototype, "HashMap Iterator"); in InitializeHashMapIterator()
1170 JSHandle<JSTaggedValue> ContainersPrivate::InitializeHashSet(JSThread *thread) in InitializeHashSet() argument
1172 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeHashSet()
1173 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeHashSet()
1182thread, hashSetFuncPrototype, ContainersHashSet::HashSetConstructor, "HashSet", FuncLength::ZERO)); in InitializeHashSet()
1183 …JSHandle<JSFunction>::Cast(hashSetFunction)->SetFunctionPrototype(thread, hashSetInstanceClass.Get… in InitializeHashSet()
1187 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(hashSetFuncPrototype), constructorKey, hashS… in InitializeHashSet()
1189 …SetFrozenFunction(thread, hashSetFuncPrototype, "isEmpty", ContainersHashSet::IsEmpty, FuncLength:… in InitializeHashSet()
1190 SetFrozenFunction(thread, hashSetFuncPrototype, "has", ContainersHashSet::Has, FuncLength::ONE); in InitializeHashSet()
1191 SetFrozenFunction(thread, hashSetFuncPrototype, "add", ContainersHashSet::Add, FuncLength::ONE); in InitializeHashSet()
1192 SetFrozenFunction(thread, hashSetFuncPrototype, "has", ContainersHashSet::Has, FuncLength::ONE); in InitializeHashSet()
1193 …SetFrozenFunction(thread, hashSetFuncPrototype, "remove", ContainersHashSet::Remove, FuncLength::O… in InitializeHashSet()
1194 …SetFrozenFunction(thread, hashSetFuncPrototype, "clear", ContainersHashSet::Clear, FuncLength::ZER… in InitializeHashSet()
1195 …SetFrozenFunction(thread, hashSetFuncPrototype, "values", ContainersHashSet::Values, FuncLength::Z… in InitializeHashSet()
1196 …SetFrozenFunction(thread, hashSetFuncPrototype, "entries", ContainersHashSet::Entries, FuncLength:… in InitializeHashSet()
1197 …SetFrozenFunction(thread, hashSetFuncPrototype, "forEach", ContainersHashSet::ForEach, FuncLength:… in InitializeHashSet()
1200 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeHashSet()
1202 SetStringTagSymbol(thread, env, hashSetFuncPrototype, "HashSet"); in InitializeHashSet()
1205 JSHandle<JSTaggedValue> values(thread, globalConst->GetValuesString()); in InitializeHashSet()
1207 JSObject::GetMethod(thread, JSHandle<JSTaggedValue>::Cast(hashSetFuncPrototype), values); in InitializeHashSet()
1208 PropertyDescriptor descriptor(thread, valuesFunc, false, false, false); in InitializeHashSet()
1209 JSObject::DefineOwnProperty(thread, hashSetFuncPrototype, iteratorSymbol, descriptor); in InitializeHashSet()
1212 CreateGetter(thread, ContainersHashSet::GetLength, "length", FuncLength::ZERO); in InitializeHashSet()
1213 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeHashSet()
1214 SetGetter(thread, hashSetFuncPrototype, lengthKey, lengthGetter); in InitializeHashSet()
1215 InitializeHashSetIterator(thread); in InitializeHashSet()
1219 void ContainersPrivate::InitializeHashSetIterator(JSThread *thread) in InitializeHashSetIterator() argument
1221 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeHashSetIterator()
1222 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeHashSetIterator()
1223 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeHashSetIterator()
1230 …SetFrozenFunction(thread, hashSetIteratorPrototype, "next", JSAPIHashSetIterator::Next, FuncLength… in InitializeHashSetIterator()
1231 SetStringTagSymbol(thread, env, hashSetIteratorPrototype, "HashSet Iterator"); in InitializeHashSetIterator()