• Home
  • Raw
  • Download

Lines Matching full:thread

36     JSThread *thread = msg->GetThread();  in Load()  local
37 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Load()
43 … THROW_TYPE_ERROR_AND_RETURN(thread, "Incorrect input parameters", JSTaggedValue::Exception()); in Load()
49 … res = InitializeContainer(thread, thisValue, InitializeArrayList, "ArrayListConstructor"); in Load()
53 res = InitializeContainer(thread, thisValue, InitializeTreeMap, "TreeMapConstructor"); in Load()
57 res = InitializeContainer(thread, thisValue, InitializeTreeSet, "TreeSetConstructor"); in Load()
80 JSTaggedValue ContainersPrivate::InitializeContainer(JSThread *thread, const JSHandle<JSObject> &ob… in InitializeContainer() argument
83 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeContainer()
86 … FastRuntimeStub::GetPropertyByName<true>(thread, obj.GetTaggedValue(), key.GetTaggedValue()); in InitializeContainer()
90 JSHandle<JSTaggedValue> map = func(thread); in InitializeContainer()
91 SetFrozenConstructor(thread, obj, name, map); in InitializeContainer()
95 JSHandle<JSFunction> ContainersPrivate::NewContainerConstructor(JSThread *thread, const JSHandle<JS… in NewContainerConstructor() argument
98 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in NewContainerConstructor()
99 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NewContainerConstructor()
103 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in NewContainerConstructor()
104 JSFunction::SetFunctionLength(thread, ctor, JSTaggedValue(length)); in NewContainerConstructor()
106 JSFunction::SetFunctionName(thread, JSHandle<JSFunctionBase>(ctor), nameString, in NewContainerConstructor()
109 PropertyDescriptor descriptor1(thread, JSHandle<JSTaggedValue>::Cast(ctor), true, false, true); in NewContainerConstructor()
110 JSObject::DefineOwnProperty(thread, prototype, constructorKey, descriptor1); in NewContainerConstructor()
113 ctor->SetFunctionPrototype(thread, prototype.GetTaggedValue()); in NewContainerConstructor()
118 void ContainersPrivate::SetFrozenFunction(JSThread *thread, const JSHandle<JSObject> &obj, const ch… in SetFrozenFunction() argument
121 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetFrozenFunction()
123 JSHandle<JSFunction> function = NewFunction(thread, keyString, func, length); in SetFrozenFunction()
124 PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>(function), false, false, false); in SetFrozenFunction()
125 JSObject::DefineOwnProperty(thread, obj, keyString, descriptor); in SetFrozenFunction()
128 void ContainersPrivate::SetFrozenConstructor(JSThread *thread, const JSHandle<JSObject> &obj, const… in SetFrozenConstructor() argument
131 JSObject::PreventExtensions(thread, JSHandle<JSObject>::Cast(value)); in SetFrozenConstructor()
132 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetFrozenConstructor()
134 PropertyDescriptor descriptor(thread, value, false, false, false); in SetFrozenConstructor()
135 JSObject::DefineOwnProperty(thread, obj, key, descriptor); in SetFrozenConstructor()
138 JSHandle<JSFunction> ContainersPrivate::NewFunction(JSThread *thread, const JSHandle<JSTaggedValue>… in NewFunction() argument
141 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in NewFunction()
143 factory->NewJSFunction(thread->GetEcmaVM()->GetGlobalEnv(), reinterpret_cast<void *>(func)); in NewFunction()
144 JSFunction::SetFunctionLength(thread, function, JSTaggedValue(length)); in NewFunction()
146 …JSFunction::SetFunctionName(thread, baseFunction, key, thread->GlobalConstants()->GetHandledUndefi… in NewFunction()
150 JSHandle<JSTaggedValue> ContainersPrivate::CreateGetter(JSThread *thread, EcmaEntrypoint func, cons… in CreateGetter() argument
153 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in CreateGetter()
154 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in CreateGetter()
156 JSFunction::SetFunctionLength(thread, function, JSTaggedValue(length)); in CreateGetter()
158 JSHandle<JSTaggedValue> prefix = thread->GlobalConstants()->GetHandledGetString(); in CreateGetter()
159 JSFunction::SetFunctionName(thread, JSHandle<JSFunctionBase>(function), funcName, prefix); in CreateGetter()
163 void ContainersPrivate::SetGetter(JSThread *thread, const JSHandle<JSObject> &obj, const JSHandle<J… in SetGetter() argument
166 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetGetter()
168 accessor->SetGetter(thread, getter); in SetGetter()
170 JSObject::AddAccessor(thread, JSHandle<JSTaggedValue>::Cast(obj), key, accessor, attr); in SetGetter()
173 void ContainersPrivate::SetFunctionAtSymbol(JSThread *thread, const JSHandle<GlobalEnv> &env, in SetFunctionAtSymbol() argument
177 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetFunctionAtSymbol()
179 JSFunction::SetFunctionLength(thread, function, JSTaggedValue(length)); in SetFunctionAtSymbol()
182 …JSFunction::SetFunctionName(thread, baseFunction, nameString, thread->GlobalConstants()->GetHandle… in SetFunctionAtSymbol()
184 …PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>::Cast(function), false, false, false… in SetFunctionAtSymbol()
185 JSObject::DefineOwnProperty(thread, obj, symbol, descriptor); in SetFunctionAtSymbol()
188 void ContainersPrivate::SetStringTagSymbol(JSThread *thread, const JSHandle<GlobalEnv> &env, in SetStringTagSymbol() argument
191 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in SetStringTagSymbol()
194 PropertyDescriptor desc(thread, tag, false, false, false); in SetStringTagSymbol()
195 JSObject::DefineOwnProperty(thread, obj, symbol, desc); in SetStringTagSymbol()
198 JSHandle<JSTaggedValue> ContainersPrivate::InitializeArrayList(JSThread *thread) in InitializeArrayList() argument
200 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeArrayList()
201 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeArrayList()
210thread, prototype, ContainersArrayList::ArrayListConstructor, "ArrayList", FuncLength::ZERO)); in InitializeArrayList()
211 …JSHandle<JSFunction>(arrayListFunction)->SetFunctionPrototype(thread, arrayListInstanceDynclass.Ge… in InitializeArrayList()
215 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(prototype), constructorKey, arrayListFunctio… in InitializeArrayList()
218 SetFrozenFunction(thread, prototype, "add", ContainersArrayList::Add, FuncLength::ONE); in InitializeArrayList()
219 SetFrozenFunction(thread, prototype, "insert", ContainersArrayList::Insert, FuncLength::TWO); in InitializeArrayList()
220 SetFrozenFunction(thread, prototype, "clear", ContainersArrayList::Clear, FuncLength::ZERO); in InitializeArrayList()
221 SetFrozenFunction(thread, prototype, "clone", ContainersArrayList::Clone, FuncLength::ZERO); in InitializeArrayList()
222 SetFrozenFunction(thread, prototype, "has", ContainersArrayList::Has, FuncLength::ONE); in InitializeArrayList()
223 …SetFrozenFunction(thread, prototype, "getCapacity", ContainersArrayList::GetCapacity, FuncLength::… in InitializeArrayList()
224 SetFrozenFunction(thread, prototype, "increaseCapacityTo", in InitializeArrayList()
226 SetFrozenFunction(thread, prototype, "trimToCurrentLength", in InitializeArrayList()
228 …SetFrozenFunction(thread, prototype, "getIndexOf", ContainersArrayList::GetIndexOf, FuncLength::ON… in InitializeArrayList()
229 SetFrozenFunction(thread, prototype, "isEmpty", ContainersArrayList::IsEmpty, FuncLength::ZERO); in InitializeArrayList()
230 …SetFrozenFunction(thread, prototype, "getLastIndexOf", ContainersArrayList::GetLastIndexOf, FuncLe… in InitializeArrayList()
231 …SetFrozenFunction(thread, prototype, "removeByIndex", ContainersArrayList::RemoveByIndex, FuncLeng… in InitializeArrayList()
232 SetFrozenFunction(thread, prototype, "remove", ContainersArrayList::Remove, FuncLength::ONE); in InitializeArrayList()
233 …SetFrozenFunction(thread, prototype, "removeByRange", ContainersArrayList::RemoveByRange, FuncLeng… in InitializeArrayList()
234 SetFrozenFunction(thread, prototype, "replaceAllElements", in InitializeArrayList()
236 SetFrozenFunction(thread, prototype, "sort", ContainersArrayList::Sort, FuncLength::ONE); in InitializeArrayList()
237 …SetFrozenFunction(thread, prototype, "subArrayList", ContainersArrayList::SubArrayList, FuncLength… in InitializeArrayList()
238 …SetFrozenFunction(thread, prototype, "convertToArray", ContainersArrayList::ConvertToArray, FuncLe… in InitializeArrayList()
239 SetFrozenFunction(thread, prototype, "forEach", ContainersArrayList::ForEach, FuncLength::TWO); in InitializeArrayList()
241 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeArrayList()
242 SetStringTagSymbol(thread, env, prototype, "ArrayList"); in InitializeArrayList()
244 …JSHandle<JSTaggedValue> lengthGetter = CreateGetter(thread, ContainersArrayList::GetSize, "length", in InitializeArrayList()
247 SetGetter(thread, prototype, lengthKey, lengthGetter); in InitializeArrayList()
249 SetFunctionAtSymbol(thread, env, prototype, env->GetIteratorSymbol(), "[Symbol.iterator]", in InitializeArrayList()
251 ContainersPrivate::InitializeArrayListIterator(thread, env, globalConst); in InitializeArrayList()
256 void ContainersPrivate::InitializeArrayListIterator(JSThread *thread, const JSHandle<GlobalEnv> &en… in InitializeArrayListIterator() argument
259 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeArrayListIterator()
266 …SetFrozenFunction(thread, arrayListIteratorPrototype, "next", JSAPIArrayListIterator::Next, FuncLe… in InitializeArrayListIterator()
267 SetStringTagSymbol(thread, env, arrayListIteratorPrototype, "ArrayList Iterator"); in InitializeArrayListIterator()
272 JSHandle<JSTaggedValue> ContainersPrivate::InitializeTreeMap(JSThread *thread) in InitializeTreeMap() argument
274 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeTreeMap()
275 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeMap()
284thread, mapFuncPrototype, ContainersTreeMap::TreeMapConstructor, "TreeMap", FuncLength::ZERO)); in InitializeTreeMap()
285 …JSHandle<JSFunction>(mapFunction)->SetFunctionPrototype(thread, mapInstanceDynclass.GetTaggedValue… in InitializeTreeMap()
289 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(mapFuncPrototype), constructorKey, mapFuncti… in InitializeTreeMap()
292 SetFrozenFunction(thread, mapFuncPrototype, "set", ContainersTreeMap::Set, FuncLength::TWO); in InitializeTreeMap()
293 SetFrozenFunction(thread, mapFuncPrototype, "get", ContainersTreeMap::Get, FuncLength::ONE); in InitializeTreeMap()
294 … SetFrozenFunction(thread, mapFuncPrototype, "remove", ContainersTreeMap::Remove, FuncLength::ONE); in InitializeTreeMap()
295 … SetFrozenFunction(thread, mapFuncPrototype, "hasKey", ContainersTreeMap::HasKey, FuncLength::ONE); in InitializeTreeMap()
296 …SetFrozenFunction(thread, mapFuncPrototype, "hasValue", ContainersTreeMap::HasValue, FuncLength::O… in InitializeTreeMap()
297 …SetFrozenFunction(thread, mapFuncPrototype, "getFirstKey", ContainersTreeMap::GetFirstKey, FuncLen… in InitializeTreeMap()
298 …SetFrozenFunction(thread, mapFuncPrototype, "getLastKey", ContainersTreeMap::GetLastKey, FuncLengt… in InitializeTreeMap()
299 … SetFrozenFunction(thread, mapFuncPrototype, "setAll", ContainersTreeMap::SetAll, FuncLength::ONE); in InitializeTreeMap()
300 … SetFrozenFunction(thread, mapFuncPrototype, "clear", ContainersTreeMap::Clear, FuncLength::ZERO); in InitializeTreeMap()
301 …SetFrozenFunction(thread, mapFuncPrototype, "getLowerKey", ContainersTreeMap::GetLowerKey, FuncLen… in InitializeTreeMap()
302 …SetFrozenFunction(thread, mapFuncPrototype, "getHigherKey", ContainersTreeMap::GetHigherKey, FuncL… in InitializeTreeMap()
303 SetFrozenFunction(thread, mapFuncPrototype, "keys", ContainersTreeMap::Keys, FuncLength::ZERO); in InitializeTreeMap()
304 …SetFrozenFunction(thread, mapFuncPrototype, "values", ContainersTreeMap::Values, FuncLength::ZERO); in InitializeTreeMap()
305 …SetFrozenFunction(thread, mapFuncPrototype, "replace", ContainersTreeMap::Replace, FuncLength::TWO… in InitializeTreeMap()
306 …SetFrozenFunction(thread, mapFuncPrototype, "forEach", ContainersTreeMap::ForEach, FuncLength::ONE… in InitializeTreeMap()
307 …SetFrozenFunction(thread, mapFuncPrototype, "entries", ContainersTreeMap::Entries, FuncLength::ZER… in InitializeTreeMap()
308 …SetFrozenFunction(thread, mapFuncPrototype, "isEmpty", ContainersTreeMap::IsEmpty, FuncLength::ZER… in InitializeTreeMap()
311 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeMap()
312 SetStringTagSymbol(thread, env, mapFuncPrototype, "TreeMap"); in InitializeTreeMap()
317 JSObject::GetMethod(thread, JSHandle<JSTaggedValue>::Cast(mapFuncPrototype), entries); in InitializeTreeMap()
318 PropertyDescriptor descriptor(thread, entriesFunc, false, false, false); in InitializeTreeMap()
319 JSObject::DefineOwnProperty(thread, mapFuncPrototype, iteratorSymbol, descriptor); in InitializeTreeMap()
322 CreateGetter(thread, ContainersTreeMap::GetLength, "length", FuncLength::ZERO); in InitializeTreeMap()
323 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeTreeMap()
324 SetGetter(thread, mapFuncPrototype, lengthKey, lengthGetter); in InitializeTreeMap()
326 InitializeTreeMapIterator(thread); in InitializeTreeMap()
330 void ContainersPrivate::InitializeTreeMapIterator(JSThread *thread) in InitializeTreeMapIterator() argument
332 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeMapIterator()
333 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeMapIterator()
341 …SetFrozenFunction(thread, mapIteratorPrototype, "next", JSAPITreeMapIterator::Next, FuncLength::ZE… in InitializeTreeMapIterator()
342 SetStringTagSymbol(thread, env, mapIteratorPrototype, "TreeMap Iterator"); in InitializeTreeMapIterator()
343 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeTreeMapIterator()
347 JSHandle<JSTaggedValue> ContainersPrivate::InitializeTreeSet(JSThread *thread) in InitializeTreeSet() argument
349 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in InitializeTreeSet()
350 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeSet()
359thread, setFuncPrototype, ContainersTreeSet::TreeSetConstructor, "TreeSet", FuncLength::ZERO)); in InitializeTreeSet()
360 …JSHandle<JSFunction>(setFunction)->SetFunctionPrototype(thread, setInstanceDynclass.GetTaggedValue… in InitializeTreeSet()
364 …JSObject::SetProperty(thread, JSHandle<JSTaggedValue>(setFuncPrototype), constructorKey, setFuncti… in InitializeTreeSet()
367 SetFrozenFunction(thread, setFuncPrototype, "add", ContainersTreeSet::Add, FuncLength::TWO); in InitializeTreeSet()
368 … SetFrozenFunction(thread, setFuncPrototype, "remove", ContainersTreeSet::Remove, FuncLength::ONE); in InitializeTreeSet()
369 SetFrozenFunction(thread, setFuncPrototype, "has", ContainersTreeSet::Has, FuncLength::ONE); in InitializeTreeSet()
370 …SetFrozenFunction(thread, setFuncPrototype, "getFirstValue", ContainersTreeSet::GetFirstValue, Fun… in InitializeTreeSet()
371 …SetFrozenFunction(thread, setFuncPrototype, "getLastValue", ContainersTreeSet::GetLastValue, FuncL… in InitializeTreeSet()
372 … SetFrozenFunction(thread, setFuncPrototype, "clear", ContainersTreeSet::Clear, FuncLength::ZERO); in InitializeTreeSet()
373 …SetFrozenFunction(thread, setFuncPrototype, "getLowerValue", ContainersTreeSet::GetLowerValue, Fun… in InitializeTreeSet()
374 …SetFrozenFunction(thread, setFuncPrototype, "getHigherValue", ContainersTreeSet::GetHigherValue, F… in InitializeTreeSet()
375 …SetFrozenFunction(thread, setFuncPrototype, "popFirst", ContainersTreeSet::PopFirst, FuncLength::Z… in InitializeTreeSet()
376 …SetFrozenFunction(thread, setFuncPrototype, "popLast", ContainersTreeSet::PopLast, FuncLength::ZER… in InitializeTreeSet()
377 …SetFrozenFunction(thread, setFuncPrototype, "isEmpty", ContainersTreeSet::IsEmpty, FuncLength::TWO… in InitializeTreeSet()
378 …SetFrozenFunction(thread, setFuncPrototype, "values", ContainersTreeSet::Values, FuncLength::ZERO); in InitializeTreeSet()
379 …SetFrozenFunction(thread, setFuncPrototype, "forEach", ContainersTreeSet::ForEach, FuncLength::ONE… in InitializeTreeSet()
380 …SetFrozenFunction(thread, setFuncPrototype, "entries", ContainersTreeSet::Entries, FuncLength::ZER… in InitializeTreeSet()
383 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeSet()
384 SetStringTagSymbol(thread, env, setFuncPrototype, "TreeSet"); in InitializeTreeSet()
387 JSHandle<JSTaggedValue> values(thread, globalConst->GetValuesString()); in InitializeTreeSet()
389 JSObject::GetMethod(thread, JSHandle<JSTaggedValue>::Cast(setFuncPrototype), values); in InitializeTreeSet()
390 PropertyDescriptor descriptor(thread, valuesFunc, false, false, false); in InitializeTreeSet()
391 JSObject::DefineOwnProperty(thread, setFuncPrototype, iteratorSymbol, descriptor); in InitializeTreeSet()
394 CreateGetter(thread, ContainersTreeSet::GetLength, "length", FuncLength::ZERO); in InitializeTreeSet()
395 JSHandle<JSTaggedValue> lengthKey(thread, globalConst->GetLengthString()); in InitializeTreeSet()
396 SetGetter(thread, setFuncPrototype, lengthKey, lengthGetter); in InitializeTreeSet()
398 InitializeTreeSetIterator(thread); in InitializeTreeSet()
402 void ContainersPrivate::InitializeTreeSetIterator(JSThread *thread) in InitializeTreeSetIterator() argument
404 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in InitializeTreeSetIterator()
405 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in InitializeTreeSetIterator()
413 …SetFrozenFunction(thread, setIteratorPrototype, "next", JSAPITreeSetIterator::Next, FuncLength::ZE… in InitializeTreeSetIterator()
414 SetStringTagSymbol(thread, env, setIteratorPrototype, "TreeSet Iterator"); in InitializeTreeSetIterator()
415 auto globalConst = const_cast<GlobalEnvConstants *>(thread->GlobalConstants()); in InitializeTreeSetIterator()