• Home
  • Raw
  • Download

Lines Matching full:thread

48     JSThread *thread = argv->GetThread();  in ArrayConstructor()  local
49 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ArrayConstructor()
50 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in ArrayConstructor()
69 …return JSTaggedValue(JSArray::ArrayCreate(thread, JSTaggedNumber(0), newTarget).GetObject<JSArray>… in ArrayConstructor()
76 …JSHandle<JSObject> newArrayHandle(JSArray::ArrayCreate(thread, JSTaggedNumber(newLen), newTarget)); in ArrayConstructor()
89 JSObject::CreateDataProperty(thread, newArrayHandle, key0, len); in ArrayConstructor()
92 newLen = JSTaggedValue::ToUint32(thread, len); in ArrayConstructor()
93 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ArrayConstructor()
95 … THROW_RANGE_ERROR_AND_RETURN(thread, "The length is out of range.", JSTaggedValue::Exception()); in ArrayConstructor()
98 JSArray::Cast(*newArrayHandle)->SetArrayLength(thread, newLen); in ArrayConstructor()
105 …JSTaggedValue newArray = JSArray::ArrayCreate(thread, JSTaggedNumber(argc), newTarget).GetTaggedVa… in ArrayConstructor()
106 if (!newArray.IsArray(thread)) { in ArrayConstructor()
107 THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to create array.", JSTaggedValue::Exception()); in ArrayConstructor()
109 JSHandle<JSObject> newArrayHandle(thread, newArray); in ArrayConstructor()
119 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in ArrayConstructor()
123 JSObject::CreateDataProperty(thread, newArrayHandle, key, itemK); in ArrayConstructor()
128 JSArray::Cast(*newArrayHandle)->SetArrayLength(thread, argc); in ArrayConstructor()
138 JSThread *thread = argv->GetThread(); in From() local
139 [[maybe_unused]] EcmaHandleScope handleScope(thread); in From()
140 InternalCallParams *arguments = thread->GetInternalCallParams(); in From()
141 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in From()
154 … THROW_TYPE_ERROR_AND_RETURN(thread, "the mapfn is not callable.", JSTaggedValue::Exception()); in From()
161 THROW_TYPE_ERROR_AND_RETURN(thread, "The items is null.", JSTaggedValue::Exception()); in From()
163 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in From()
165 JSHandle<JSTaggedValue> usingIterator = JSObject::GetMethod(thread, items, iteratorSymbol); in From()
167 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
177 newArray = JSFunction::Construct(thread, thisHandle, 0, nullptr, in From()
178 … JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in From()
179 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
181 newArray = JSArray::ArrayCreate(thread, JSTaggedNumber(0)).GetTaggedValue(); in From()
182 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
185 … THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to construct the array.", JSTaggedValue::Exception()); in From()
187 JSHandle<JSObject> newArrayHandle(thread, newArray); in From()
189 JSHandle<JSTaggedValue> iterator = JSIterator::GetIterator(thread, items, usingIterator); in From()
191 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
195 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in From()
196 JSMutableHandle<JSTaggedValue> mapValue(thread, JSTaggedValue::Undefined()); in From()
201 JSHandle<JSTaggedValue> next = JSIterator::IteratorStep(thread, iterator); in From()
203 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
209 …JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(newArrayHandle), lengthKey, key, … in From()
210 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
214 JSHandle<JSTaggedValue> nextValue = JSIterator::IteratorValue(thread, next); in From()
216 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
225 … JSFunction::Call(thread, mapfn, thisArgHandle, 2, arguments->GetArgv()); // 2: two args in From()
227 … JSTaggedValue mapResult = JSIterator::IteratorClose(thread, iterator, mapValue).GetTaggedValue(); in From()
228 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue(mapResult)); in From()
236thread, JSTaggedValue(JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, key, mapValue))); in From()
237 …JSTaggedValue defineResult = JSIterator::IteratorClose(thread, iterator, defineStatus).GetTaggedVa… in From()
238 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue(defineResult)); in From()
244 JSHandle<JSObject> arrayLikeObj = JSTaggedValue::ToObject(thread, items); in From()
246 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
249 double len = ArrayHelper::GetArrayLength(thread, arrayLike); in From()
251 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
260 newArray = JSFunction::Construct(thread, thisHandle, 1, arguments->GetArgv(), in From()
261 … JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in From()
262 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
264 newArray = JSArray::ArrayCreate(thread, JSTaggedNumber(len)).GetTaggedValue(); in From()
265 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
268 … THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to construct the array.", JSTaggedValue::Exception()); in From()
270 JSHandle<JSObject> newArrayHandle(thread, newArray); in From()
279 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in From()
280 JSMutableHandle<JSTaggedValue> mapValue(thread, JSTaggedValue::Undefined()); in From()
283 JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, arrayLike, k); in From()
284 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
289 … JSFunction::Call(thread, mapfn, thisArgHandle, 2, arguments->GetArgv()); // 2: two args in From()
290 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
292 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
296 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, k, mapValue); in From()
297 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
301 JSHandle<JSTaggedValue> lenHandle(thread, JSTaggedValue(len)); in From()
302 …JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(newArrayHandle), lengthKey, lenHa… in From()
304 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in From()
326 JSThread *thread = argv->GetThread(); in Of() local
327 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Of()
328 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in Of()
344 InternalCallParams *arguments = thread->GetInternalCallParams(); in Of()
346 …JSTaggedValue taggedArray = JSFunction::Construct(thread, thisHandle, 1, arguments->GetArgv(), und… in Of()
347 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Of()
348 newArray = JSHandle<JSTaggedValue>(thread, taggedArray); in Of()
350 newArray = JSArray::ArrayCreate(thread, JSTaggedNumber(argc)); in Of()
351 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Of()
354 THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to create Object.", JSTaggedValue::Exception()); in Of()
365 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Of()
369 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, key, kValue); in Of()
370 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Of()
373 JSHandle<JSTaggedValue> lenHandle(thread, JSTaggedValue(argc)); in Of()
374 …JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(newArrayHandle), lengthKey, lenHa… in Of()
375 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Of()
393 JSThread *thread = argv->GetThread(); in Concat() local
394 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Concat()
399 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Concat()
401 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
406 …JSTaggedValue newArray = JSArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(arrayLe… in Concat()
408 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
409 JSHandle<JSObject> newArrayHandle(thread, newArray); in Concat()
413 JSMutableHandle<JSTaggedValue> fromKey(thread, JSTaggedValue::Undefined()); in Concat()
414 JSMutableHandle<JSTaggedValue> toKey(thread, JSTaggedValue::Undefined()); in Concat()
415 bool isSpreadable = ArrayHelper::IsConcatSpreadable(thread, thisHandle); in Concat()
416 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
418 double thisLen = ArrayHelper::GetArrayLength(thread, thisObjVal); in Concat()
419 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
421 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Concat()
427 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, fromKey); in Concat()
428 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
430 …JSHandle<JSTaggedValue> fromValHandle = JSArray::FastGetPropertyByValue(thread, thisObjVal, fromKe… in Concat()
431 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
432 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toKey, fromValHandle); in Concat()
433 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
440 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Concat()
442 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, n, thisObjVal); in Concat()
443 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
450 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
454 isSpreadable = ArrayHelper::IsConcatSpreadable(thread, addHandle); in Concat()
456 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
460 … double len = ArrayHelper::GetArrayLength(thread, JSHandle<JSTaggedValue>::Cast(addObjHandle)); in Concat()
462 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
465 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Concat()
475 …bool exists = JSTaggedValue::HasProperty(thread, JSHandle<JSTaggedValue>::Cast(addObjHandle), from… in Concat()
476 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
479 …JSHandle<JSTaggedValue> fromValHandle = JSArray::FastGetPropertyByValue(thread, addHandle, fromKey… in Concat()
481 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
482 … JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toKey, fromValHandle); in Concat()
484 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
494 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Concat()
497 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, n, addHandle); in Concat()
499 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
506 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in Concat()
507 JSHandle<JSTaggedValue> lenHandle(thread, JSTaggedValue(n)); in Concat()
508 …JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(newArrayHandle), lengthKey, lenHa… in Concat()
510 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Concat()
521 JSThread *thread = argv->GetThread(); in CopyWithin() local
522 [[maybe_unused]] EcmaHandleScope handleScope(thread); in CopyWithin()
525 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, GetThis(argv)); in CopyWithin()
527 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyWithin()
531 double len = ArrayHelper::GetLength(thread, thisObjVal); in CopyWithin()
533 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyWithin()
540 JSTaggedNumber targetTemp = JSTaggedValue::ToInteger(thread, GetCallArg(argv, 0)); in CopyWithin()
542 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyWithin()
552 JSTaggedNumber start_t = JSTaggedValue::ToInteger(thread, GetCallArg(argv, 1)); in CopyWithin()
554 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyWithin()
567 JSTaggedNumber temp = JSTaggedValue::ToInteger(thread, msg3); in CopyWithin()
569 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyWithin()
612 JSMutableHandle<JSTaggedValue> fromKey(thread, JSTaggedValue::Undefined()); in CopyWithin()
613 JSMutableHandle<JSTaggedValue> toKey(thread, JSTaggedValue::Undefined()); in CopyWithin()
617 …bool exists = (thisObjVal->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, fromKe… in CopyWithin()
618 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyWithin()
620 …JSHandle<JSTaggedValue> fromValHandle = JSArray::FastGetPropertyByValue(thread, thisObjVal, fromKe… in CopyWithin()
621 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyWithin()
622 JSArray::FastSetPropertyByValue(thread, thisObjVal, toKey, fromValHandle); in CopyWithin()
623 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyWithin()
626 toKey.Update(JSTaggedValue::ToString(thread, toKey).GetTaggedValue()); in CopyWithin()
628 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey); in CopyWithin()
629 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in CopyWithin()
645 JSThread *thread = argv->GetThread(); in Entries() local
646 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Entries()
647 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Entries()
650 JSHandle<JSObject> self = JSTaggedValue::ToObject(thread, GetThis(argv)); in Entries()
651 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Entries()
661 JSThread *thread = argv->GetThread(); in Every() local
662 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Every()
666 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Every()
668 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Every()
672 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Every()
674 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Every()
679 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in Every()
697 InternalCallParams *arguments = thread->GetInternalCallParams(); in Every()
698 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Every()
701 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, k); in Every()
702 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Every()
704 JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in Every()
705 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Every()
709 …JSFunction::Call(thread, callbackFnHandle, thisArgHandle, 3, arguments->GetArgv()); // 3: three a… in Every()
710 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Every()
728 JSThread *thread = argv->GetThread(); in Fill() local
729 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Fill()
733 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Fill()
735 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
740 JSTaggedNumber number = JSTaggedValue::ToNumber(thread, value); in Fill()
741 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
742 value = JSHandle<JSTaggedValue>(thread, JSTaggedValue(number.GetNumber())); in Fill()
746 double len = ArrayHelper::GetLength(thread, thisObjVal); in Fill()
748 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
753 JSTaggedNumber argStartTemp = JSTaggedValue::ToInteger(thread, msg1); in Fill()
755 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
768 JSTaggedNumber argEndTemp = JSTaggedValue::ToInteger(thread, msg2); in Fill()
770 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
787 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Fill()
791 JSArray::FastSetPropertyByValue(thread, thisObjVal, key, value); in Fill()
792 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Fill()
804 JSThread *thread = argv->GetThread(); in Filter() local
805 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Filter()
809 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Filter()
811 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
815 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Filter()
817 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
822 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in Filter()
830 …JSTaggedValue newArray = JSArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(arrayLe… in Filter()
832 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
833 JSHandle<JSObject> newArrayHandle(thread, newArray); in Filter()
852 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Filter()
853 JSMutableHandle<JSTaggedValue> toIndexHandle(thread, JSTaggedValue::Undefined()); in Filter()
854 InternalCallParams *arguments = thread->GetInternalCallParams(); in Filter()
857 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, k); in Filter()
858 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
860 JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in Filter()
861 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
865 …JSFunction::Call(thread, callbackFnHandle, thisArgHandle, 3, arguments->GetArgv()); // 3: three a… in Filter()
867 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
870 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toIndexHandle, kValue); in Filter()
871 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Filter()
887 JSThread *thread = argv->GetThread(); in Find() local
888 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Find()
892 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Find()
894 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Find()
898 double len = ArrayHelper::GetLength(thread, thisObjVal); in Find()
900 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Find()
905 … THROW_TYPE_ERROR_AND_RETURN(thread, "the predicate is not callable.", JSTaggedValue::Exception()); in Find()
920 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Find()
921 InternalCallParams *arguments = thread->GetInternalCallParams(); in Find()
924 JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in Find()
925 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Find()
929 …JSFunction::Call(thread, callbackFnHandle, thisArgHandle, 3, arguments->GetArgv()); // 3: three a… in Find()
931 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Find()
947 JSThread *thread = argv->GetThread(); in FindIndex() local
948 [[maybe_unused]] EcmaHandleScope handleScope(thread); in FindIndex()
952 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in FindIndex()
954 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
958 double len = ArrayHelper::GetLength(thread, thisObjVal); in FindIndex()
960 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
965 … THROW_TYPE_ERROR_AND_RETURN(thread, "the predicate is not callable.", JSTaggedValue::Exception()); in FindIndex()
980 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in FindIndex()
981 InternalCallParams *arguments = thread->GetInternalCallParams(); in FindIndex()
984 JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in FindIndex()
985 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
989 …JSFunction::Call(thread, callbackFnHandle, thisArgHandle, 3, arguments->GetArgv()); // 3: three a… in FindIndex()
991 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in FindIndex()
1006 JSThread *thread = argv->GetThread(); in ForEach() local
1007 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ForEach()
1011 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in ForEach()
1013 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
1017 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in ForEach()
1019 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
1024 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in ForEach()
1041 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in ForEach()
1042 InternalCallParams *arguments = thread->GetInternalCallParams(); in ForEach()
1045 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, k); in ForEach()
1046 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
1048 JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in ForEach()
1049 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ForEach()
1053 …JSFunction::Call(thread, callbackFnHandle, thisArgHandle, 3, arguments->GetArgv()); // 3: three a… in ForEach()
1054 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, funcResult); in ForEach()
1068 JSThread *thread = argv->GetThread(); in IndexOf() local
1069 [[maybe_unused]] EcmaHandleScope handleScope(thread); in IndexOf()
1075 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in IndexOf()
1077 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOf()
1083 double len = ArrayHelper::GetLength(thread, thisObjVal); in IndexOf()
1085 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOf()
1096 JSTaggedNumber fromIndexTemp = JSTaggedValue::ToNumber(thread, msg1); in IndexOf()
1098 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOf()
1123 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in IndexOf()
1126 … bool exists = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, key)); in IndexOf()
1127 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOf()
1129 … JSHandle<JSTaggedValue> kValueHandle = JSArray::FastGetPropertyByValue(thread, thisObjVal, key); in IndexOf()
1130 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in IndexOf()
1131 if (JSTaggedValue::StrictEqual(thread, searchElement, kValueHandle)) { in IndexOf()
1147 JSThread *thread = argv->GetThread(); in Join() local
1148 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Join()
1150 if (thisHandle->IsStableJSArray(thread)) { in Join()
1153 auto factory = thread->GetEcmaVM()->GetFactory(); in Join()
1156 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Join()
1158 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Join()
1162 double len = ArrayHelper::GetLength(thread, thisObjVal); in Join()
1164 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Join()
1175 JSHandle<EcmaString> sepStringHandle = JSTaggedValue::ToString(thread, sepHandle); in Join()
1177 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Join()
1188 return GetTaggedString(thread, ""); in Join()
1206 JSHandle<JSTaggedValue> element = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in Join()
1207 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Join()
1209 JSHandle<EcmaString> nextStringHandle = JSTaggedValue::ToString(thread, element); in Join()
1210 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Join()
1239 JSThread *thread = argv->GetThread(); in Keys() local
1240 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Keys()
1241 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Keys()
1244 JSHandle<JSObject> self = JSTaggedValue::ToObject(thread, GetThis(argv)); in Keys()
1245 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Keys()
1256 JSThread *thread = argv->GetThread(); in LastIndexOf() local
1257 [[maybe_unused]] EcmaHandleScope handleScope(thread); in LastIndexOf()
1263 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in LastIndexOf()
1265 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOf()
1271 double len = ArrayHelper::GetLength(thread, thisObjVal); in LastIndexOf()
1273 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOf()
1284 JSTaggedNumber fromIndexTemp = JSTaggedValue::ToNumber(thread, msg1); in LastIndexOf()
1286 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOf()
1304 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in LastIndexOf()
1307 … bool exists = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, key)); in LastIndexOf()
1308 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOf()
1310 … JSHandle<JSTaggedValue> kValueHandle = JSArray::FastGetPropertyByValue(thread, thisObjVal, key); in LastIndexOf()
1311 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in LastIndexOf()
1312 if (JSTaggedValue::StrictEqual(thread, searchElement, kValueHandle)) { in LastIndexOf()
1328 JSThread *thread = argv->GetThread(); in Map() local
1329 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Map()
1333 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Map()
1335 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1339 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Map()
1341 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1346 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in Map()
1353 … JSTaggedValue newArray = JSArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(len)); in Map()
1355 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1357 THROW_TYPE_ERROR_AND_RETURN(thread, "Failed to create Object.", JSTaggedValue::Exception()); in Map()
1359 JSHandle<JSObject> newArrayHandle(thread, newArray); in Map()
1374 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Map()
1375 JSMutableHandle<JSTaggedValue> mapResultHandle(thread, JSTaggedValue::Undefined()); in Map()
1376 InternalCallParams *arguments = thread->GetInternalCallParams(); in Map()
1379 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, k); in Map()
1380 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1382 JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in Map()
1383 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1387 …JSFunction::Call(thread, callbackFnHandle, thisArgHandle, 3, arguments->GetArgv()); // 3: three a… in Map()
1388 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1390 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, k, mapResultHandle); in Map()
1391 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Map()
1405 JSThread *thread = argv->GetThread(); in Pop() local
1406 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Pop()
1410 if (thisHandle->IsStableJSArray(thread)) { in Pop()
1413 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Pop()
1415 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Pop()
1419 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Pop()
1421 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Pop()
1426 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in Pop()
1428 JSHandle<JSTaggedValue> lengthValue(thread, JSTaggedValue(0)); in Pop()
1429 JSTaggedValue::SetProperty(thread, thisObjVal, lengthKey, lengthValue, true); in Pop()
1430 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Pop()
1445 JSHandle<JSTaggedValue> indexHandle(thread, JSTaggedValue(newLen)); in Pop()
1446 …JSHandle<JSTaggedValue> element = JSTaggedValue::GetProperty(thread, thisObjVal, indexHandle).GetV… in Pop()
1447 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Pop()
1448 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, indexHandle); in Pop()
1449 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Pop()
1450 JSTaggedValue::SetProperty(thread, thisObjVal, lengthKey, indexHandle, true); in Pop()
1451 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Pop()
1461 JSThread *thread = argv->GetThread(); in Push() local
1462 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Push()
1464 if (thisHandle->IsStableJSArray(thread)) { in Push()
1471 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Push()
1473 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Push()
1477 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Push()
1479 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Push()
1482 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Push()
1491 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Push()
1495 JSArray::FastSetPropertyByValue(thread, thisObjVal, key, kValue); in Push()
1496 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Push()
1502 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in Push()
1504 JSTaggedValue::SetProperty(thread, thisObjVal, lengthKey, key, true); in Push()
1506 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Push()
1517 JSThread *thread = argv->GetThread(); in Reduce() local
1518 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Reduce()
1519 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in Reduce()
1524 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Reduce()
1526 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1530 double len = ArrayHelper::GetLength(thread, thisObjVal); in Reduce()
1532 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1537 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in Reduce()
1542 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Reduce()
1560 JSMutableHandle<JSTaggedValue> accumulator(thread, JSTaggedValue::Undefined()); in Reduce()
1566 … kPresent = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, k)); in Reduce()
1567 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1569 … accumulator.Update(JSArray::FastGetPropertyByValue(thread, thisObjVal, k).GetTaggedValue()); in Reduce()
1570 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1575 …THROW_TYPE_ERROR_AND_RETURN(thread, "accumulator can't be initialized.", JSTaggedValue::Exception(… in Reduce()
1590 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Reduce()
1591 InternalCallParams *arguments = thread->GetInternalCallParams(); in Reduce()
1593 … bool exists = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, k)); in Reduce()
1594 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1596 JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in Reduce()
1597 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1602 …JSFunction::Call(thread, callbackFnHandle, thisArgHandle, 4, arguments->GetArgv()); // 4: four ar… in Reduce()
1603 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reduce()
1618 JSThread *thread = argv->GetThread(); in ReduceRight() local
1619 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ReduceRight()
1620 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in ReduceRight()
1626 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in ReduceRight()
1628 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceRight()
1632 double len = ArrayHelper::GetLength(thread, thisObjVal); in ReduceRight()
1634 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceRight()
1639 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in ReduceRight()
1644 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in ReduceRight()
1662 JSMutableHandle<JSTaggedValue> accumulator(thread, JSTaggedValue::Undefined()); in ReduceRight()
1668 … kPresent = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, k)); in ReduceRight()
1669 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceRight()
1671 … accumulator.Update(JSArray::FastGetPropertyByValue(thread, thisObjVal, k).GetTaggedValue()); in ReduceRight()
1672 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceRight()
1677 …THROW_TYPE_ERROR_AND_RETURN(thread, "accumulator can't be initialized.", JSTaggedValue::Exception(… in ReduceRight()
1691 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in ReduceRight()
1693 InternalCallParams *arguments = thread->GetInternalCallParams(); in ReduceRight()
1696 … bool exists = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, key)); in ReduceRight()
1697 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceRight()
1699 … JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, key); in ReduceRight()
1700 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceRight()
1704 …JSFunction::Call(thread, callbackFnHandle, thisArgHandle, 4, arguments->GetArgv()); // 4: four ar… in ReduceRight()
1705 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ReduceRight()
1720 JSThread *thread = argv->GetThread(); in Reverse() local
1721 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Reverse()
1725 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Reverse()
1727 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1731 double len = ArrayHelper::GetLength(thread, thisObjVal); in Reverse()
1733 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1773 JSMutableHandle<JSTaggedValue> lowerP(thread, JSTaggedValue::Undefined()); in Reverse()
1774 JSMutableHandle<JSTaggedValue> upperP(thread, JSTaggedValue::Undefined()); in Reverse()
1775 JSHandle<JSTaggedValue> lowerValueHandle(thread, JSTaggedValue::Undefined()); in Reverse()
1776 JSHandle<JSTaggedValue> upperValueHandle(thread, JSTaggedValue::Undefined()); in Reverse()
1781 …bool lowerExists = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, l… in Reverse()
1782 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1784 lowerValueHandle = JSArray::FastGetPropertyByValue(thread, thisObjVal, lowerP); in Reverse()
1785 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1787 …bool upperExists = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, u… in Reverse()
1788 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1790 upperValueHandle = JSArray::FastGetPropertyByValue(thread, thisObjVal, upperP); in Reverse()
1791 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1794 JSArray::FastSetPropertyByValue(thread, thisObjVal, lowerP, upperValueHandle); in Reverse()
1795 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1796 JSArray::FastSetPropertyByValue(thread, thisObjVal, upperP, lowerValueHandle); in Reverse()
1797 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1799 JSArray::FastSetPropertyByValue(thread, thisObjVal, lowerP, upperValueHandle); in Reverse()
1800 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1801 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, upperP); in Reverse()
1802 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1804 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, lowerP); in Reverse()
1805 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1806 JSArray::FastSetPropertyByValue(thread, thisObjVal, upperP, lowerValueHandle); in Reverse()
1807 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Reverse()
1822 JSThread *thread = argv->GetThread(); in Shift() local
1823 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Shift()
1827 if (thisHandle->IsStableJSArray(thread)) { in Shift()
1830 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Shift()
1832 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1836 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Shift()
1838 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1843 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in Shift()
1845 JSHandle<JSTaggedValue> zeroLenHandle(thread, JSTaggedValue(len)); in Shift()
1846 JSTaggedValue::SetProperty(thread, thisObjVal, lengthKey, zeroLenHandle, true); in Shift()
1847 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1852 JSHandle<JSTaggedValue> firstKey(thread, JSTaggedValue(0)); in Shift()
1853 …JSHandle<JSTaggedValue> firstValue = JSTaggedValue::GetProperty(thread, thisObjVal, firstKey).GetV… in Shift()
1855 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1872 JSMutableHandle<JSTaggedValue> toKey(thread, JSTaggedValue::Undefined()); in Shift()
1875 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, k); in Shift()
1876 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1878 … JSHandle<JSTaggedValue> fromValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in Shift()
1879 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1880 JSArray::FastSetPropertyByValue(thread, thisObjVal, k - 1, fromValue); in Shift()
1881 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1884 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey); in Shift()
1885 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1890 JSHandle<JSTaggedValue> deleteKey(thread, JSTaggedValue(len - 1)); in Shift()
1891 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, deleteKey); in Shift()
1893 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1896 JSHandle<JSTaggedValue> newLenHandle(thread, JSTaggedValue(len - 1)); in Shift()
1897 JSTaggedValue::SetProperty(thread, thisObjVal, lengthKey, newLenHandle, true); in Shift()
1899 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Shift()
1910 JSThread *thread = argv->GetThread(); in Slice() local
1911 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Slice()
1915 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Slice()
1917 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1921 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Slice()
1923 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1927 JSTaggedNumber argStartTemp = JSTaggedValue::ToInteger(thread, msg0); in Slice()
1929 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1945 JSTaggedNumber argEndTemp = JSTaggedValue::ToInteger(thread, msg1); in Slice()
1946 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1955 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1961 …JSTaggedValue newArray = JSArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(count)); in Slice()
1963 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
1967 JSHandle<JSObject> newArrayHandle(thread, newArray); in Slice()
1969 if (thisHandle->IsStableJSArray(thread) && newArray.IsStableJSArray(thread)) { in Slice()
1970 TaggedArray *destElements = *JSObject::GrowElementsCapacity(thread, newArrayHandle, count); in Slice()
1974 destElements->Set(thread, idx, srcElements->Get(k + idx)); in Slice()
1977 JSHandle<JSArray>::Cast(newArrayHandle)->SetArrayLength(thread, count); in Slice()
1994 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Slice()
1995 JSMutableHandle<JSTaggedValue> nKey(thread, JSTaggedValue::Undefined()); in Slice()
1998 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, key); in Slice()
1999 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
2002 … JSHandle<JSTaggedValue> kValueHandle = JSArray::FastGetPropertyByValue(thread, thisObjVal, key); in Slice()
2003 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
2004 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, nKey, kValueHandle); in Slice()
2005 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
2012 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in Slice()
2013 JSHandle<JSTaggedValue> newLenHandle(thread, JSTaggedValue(n)); in Slice()
2014 …JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(newArrayHandle), lengthKey, newLe… in Slice()
2016 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Slice()
2027 JSThread *thread = argv->GetThread(); in Some() local
2028 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Some()
2032 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Some()
2034 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Some()
2038 double len = ArrayHelper::GetLength(thread, thisObjVal); in Some()
2040 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Some()
2045 …THROW_TYPE_ERROR_AND_RETURN(thread, "the callbackfun is not callable.", JSTaggedValue::Exception()… in Some()
2063 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Some()
2064 InternalCallParams *arguments = thread->GetInternalCallParams(); in Some()
2067 … bool exists = (thisHandle->IsTypedArray() || JSTaggedValue::HasProperty(thread, thisObjVal, k)); in Some()
2068 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Some()
2071 … JSHandle<JSTaggedValue> kValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, key); in Some()
2072 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Some()
2075 …JSFunction::Call(thread, callbackFnHandle, thisArgHandle, 3, arguments->GetArgv()); // 3: three a… in Some()
2077 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Some()
2094 JSThread *thread = argv->GetThread(); in Sort() local
2095 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Sort()
2099 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Sort()
2100 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
2104 THROW_TYPE_ERROR_AND_RETURN(thread, "Callable is false", JSTaggedValue::Exception()); in Sort()
2108 double len = ArrayHelper::GetArrayLength(thread, JSHandle<JSTaggedValue>(thisObjHandle)); in Sort()
2110 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
2112 JSMutableHandle<JSTaggedValue> presentValue(thread, JSTaggedValue::Undefined()); in Sort()
2113 JSMutableHandle<JSTaggedValue> middleValue(thread, JSTaggedValue::Undefined()); in Sort()
2114 JSMutableHandle<JSTaggedValue> previousValue(thread, JSTaggedValue::Undefined()); in Sort()
2118 …presentValue.Update(FastRuntimeStub::FastGetPropertyByIndex<true>(thread, thisObjHandle.GetTaggedV… in Sort()
2119 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
2123 …FastRuntimeStub::FastGetPropertyByIndex<true>(thread, thisObjHandle.GetTaggedValue(), middleIndex)… in Sort()
2124 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
2125 …int32_t compareResult = ArrayHelper::SortCompare(thread, callbackFnHandle, middleValue, presentVal… in Sort()
2126 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
2137 … FastRuntimeStub::FastGetPropertyByIndex<true>(thread, thisObjHandle.GetTaggedValue(), j - 1)); in Sort()
2138 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
2139 FastRuntimeStub::FastSetPropertyByIndex(thread, thisObjHandle.GetTaggedValue(), j, in Sort()
2141 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
2143 … FastRuntimeStub::FastSetPropertyByIndex(thread, thisObjHandle.GetTaggedValue(), endIndex, in Sort()
2145 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Sort()
2158 JSThread *thread = argv->GetThread(); in Splice() local
2159 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Splice()
2163 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Splice()
2165 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2168 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Splice()
2170 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2179 JSTaggedNumber argStartTemp = JSTaggedValue::ToInteger(thread, msg0); in Splice()
2181 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2206 JSTaggedNumber argDeleteCount = JSTaggedValue::ToInteger(thread, msg1); in Splice()
2207 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2214 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Splice()
2217 if (thisHandle->IsStableJSArray(thread)) { in Splice()
2221 …JSTaggedValue newArray = JSArray::ArraySpeciesCreate(thread, thisObjHandle, JSTaggedNumber(actualD… in Splice()
2222 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2223 JSHandle<JSObject> newArrayHandle(thread, newArray); in Splice()
2232 JSMutableHandle<JSTaggedValue> fromKey(thread, JSTaggedValue::Undefined()); in Splice()
2233 JSMutableHandle<JSTaggedValue> toKey(thread, JSTaggedValue::Undefined()); in Splice()
2238 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, fromKey); in Splice()
2239 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2241 … JSHandle<JSTaggedValue> fromValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, fromKey); in Splice()
2242 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2245 toKey.Update(JSTaggedValue::ToString(thread, toKey).GetTaggedValue()); in Splice()
2247 JSObject::CreateDataPropertyOrThrow(thread, newArrayHandle, toKey, fromValue); in Splice()
2248 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2253 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in Splice()
2254 JSHandle<JSTaggedValue> deleteCountHandle(thread, JSTaggedValue(actualDeleteCount)); in Splice()
2255 …JSTaggedValue::SetProperty(thread, JSHandle<JSTaggedValue>::Cast(newArrayHandle), lengthKey, delet… in Splice()
2257 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2280 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, fromKey); in Splice()
2281 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2283 … JSHandle<JSTaggedValue> fromValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, fromKey); in Splice()
2284 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2285 JSArray::FastSetPropertyByValue(thread, thisObjVal, toKey, fromValue); in Splice()
2286 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2288 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey); in Splice()
2289 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2294 JSMutableHandle<JSTaggedValue> deleteKey(thread, JSTaggedValue::Undefined()); in Splice()
2297 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, deleteKey); in Splice()
2298 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2322 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, fromKey); in Splice()
2323 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2325 … JSHandle<JSTaggedValue> fromValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, fromKey); in Splice()
2326 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2327 JSArray::FastSetPropertyByValue(thread, thisObjVal, toKey, fromValue); in Splice()
2328 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2330 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey); in Splice()
2331 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2339 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in Splice()
2343 JSArray::FastSetPropertyByValue(thread, thisObjVal, key, itemValue); in Splice()
2344 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2349 JSHandle<JSTaggedValue> newLenHandle(thread, JSTaggedValue(newLen)); in Splice()
2350 JSTaggedValue::SetProperty(thread, thisObjVal, lengthKey, newLenHandle, true); in Splice()
2352 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Splice()
2362 JSThread *thread = argv->GetThread(); in ToLocaleString() local
2363 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ToLocaleString()
2364 auto ecmaVm = thread->GetEcmaVM(); in ToLocaleString()
2369 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in ToLocaleString()
2371 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToLocaleString()
2375 double len = ArrayHelper::GetLength(thread, thisObjVal); in ToLocaleString()
2377 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToLocaleString()
2387 JSHandle<EcmaString> sepStringHandle = JSTaggedValue::ToString(thread, sepHandle); in ToLocaleString()
2388 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToLocaleString()
2392 return GetTaggedString(thread, ""); in ToLocaleString()
2419 auto globalConst = thread->GlobalConstants(); in ToLocaleString()
2420 InternalCallParams *arguments = thread->GetInternalCallParams(); in ToLocaleString()
2423 … JSHandle<JSTaggedValue> nextElement = JSArray::FastGetPropertyByValue(thread, thisObjVal, k); in ToLocaleString()
2424 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToLocaleString()
2429 JSFunction::Invoke(thread, nextValueHandle, in ToLocaleString()
2431 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToLocaleString()
2434 JSHandle<JSTaggedValue> nextHandle(thread, next); in ToLocaleString()
2435 JSHandle<EcmaString> nextStringHandle = JSTaggedValue::ToString(thread, nextHandle); in ToLocaleString()
2436 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToLocaleString()
2455 JSThread *thread = argv->GetThread(); in ToString() local
2456 [[maybe_unused]] EcmaHandleScope handleScope(thread); in ToString()
2457 auto ecmaVm = thread->GetEcmaVM(); in ToString()
2462 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in ToString()
2464 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToString()
2469 …JSHandle<JSTaggedValue> callbackFnHandle = JSTaggedValue::GetProperty(thread, thisObjVal, joinKey)… in ToString()
2472 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToString()
2478 JSHandle<JSTaggedValue> toStringKey = thread->GlobalConstants()->GetHandledToStringString(); in ToString()
2479 … callbackFnHandle = JSTaggedValue::GetProperty(thread, objectPrototype, toStringKey).GetValue(); in ToString()
2480 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in ToString()
2483 InternalCallParams *arguments = thread->GetInternalCallParams(); in ToString()
2485 …return JSFunction::Call(thread, callbackFnHandle, thisObjVal, argsList->GetLength(), arguments->Ge… in ToString()
2493 JSThread *thread = argv->GetThread(); in Unshift() local
2494 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Unshift()
2501 JSHandle<JSObject> thisObjHandle = JSTaggedValue::ToObject(thread, thisHandle); in Unshift()
2503 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2507 double len = ArrayHelper::GetArrayLength(thread, thisObjVal); in Unshift()
2509 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2530 THROW_TYPE_ERROR_AND_RETURN(thread, "out of range.", JSTaggedValue::Exception()); in Unshift()
2532 JSMutableHandle<JSTaggedValue> fromKey(thread, JSTaggedValue::Undefined()); in Unshift()
2533 JSMutableHandle<JSTaggedValue> toKey(thread, JSTaggedValue::Undefined()); in Unshift()
2538 bool exists = JSTaggedValue::HasProperty(thread, thisObjVal, fromKey); in Unshift()
2539 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2541 … JSHandle<JSTaggedValue> fromValue = JSArray::FastGetPropertyByValue(thread, thisObjVal, fromKey); in Unshift()
2542 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2543 JSArray::FastSetPropertyByValue(thread, thisObjVal, toKey, fromValue); in Unshift()
2544 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2546 JSTaggedValue::DeletePropertyOrThrow(thread, thisObjVal, toKey); in Unshift()
2547 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2563 JSArray::FastSetPropertyByValue(thread, thisObjVal, toKey, toValue); in Unshift()
2564 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2570 JSHandle<JSTaggedValue> lengthKey = thread->GlobalConstants()->GetHandledLengthString(); in Unshift()
2572 JSHandle<JSTaggedValue> newLenHandle(thread, JSTaggedValue(newLen)); in Unshift()
2573 JSTaggedValue::SetProperty(thread, thisObjVal, lengthKey, newLenHandle, true); in Unshift()
2575 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Unshift()
2586 JSThread *thread = argv->GetThread(); in Values() local
2587 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Values()
2588 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Values()
2591 JSHandle<JSObject> self = JSTaggedValue::ToObject(thread, GetThis(argv)); in Values()
2592 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in Values()
2600 JSThread *thread = argv->GetThread(); in Unscopables() local
2601 [[maybe_unused]] EcmaHandleScope handleScope(thread); in Unscopables()
2602 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in Unscopables()
2604 JSHandle<JSTaggedValue> nullHandle(thread, JSTaggedValue::Null()); in Unscopables()
2607 JSHandle<JSTaggedValue> trueVal(thread, JSTaggedValue::True()); in Unscopables()
2609 JSObject::CreateDataProperty(thread, unscopableList, copyWithKey, trueVal); in Unscopables()
2612 JSObject::CreateDataProperty(thread, unscopableList, entriesKey, trueVal); in Unscopables()
2615 JSObject::CreateDataProperty(thread, unscopableList, fillKey, trueVal); in Unscopables()
2618 JSObject::CreateDataProperty(thread, unscopableList, findKey, trueVal); in Unscopables()
2621 JSObject::CreateDataProperty(thread, unscopableList, findIndexKey, trueVal); in Unscopables()
2624 JSObject::CreateDataProperty(thread, unscopableList, flatKey, trueVal); in Unscopables()
2627 JSObject::CreateDataProperty(thread, unscopableList, flatMapKey, trueVal); in Unscopables()
2630 JSObject::CreateDataProperty(thread, unscopableList, includesKey, trueVal); in Unscopables()
2633 JSObject::CreateDataProperty(thread, unscopableList, keysKey, trueVal); in Unscopables()
2636 JSObject::CreateDataProperty(thread, unscopableList, valuesKey, trueVal); in Unscopables()