Lines Matching full:thread
47 JSTaggedValue RuntimeStubs::RuntimeInc(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeInc() argument
49 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeInc()
50 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeInc()
53 return BigInt::BigintAddOne(thread, bigValue).GetTaggedValue(); in RuntimeInc()
59 JSTaggedValue RuntimeStubs::RuntimeDec(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeDec() argument
61 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeDec()
62 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDec()
65 return BigInt::BigintSubOne(thread, bigValue).GetTaggedValue(); in RuntimeDec()
71 JSTaggedValue RuntimeStubs::RuntimeExp(JSThread *thread, JSTaggedValue base, JSTaggedValue exponent) in RuntimeExp() argument
73 JSHandle<JSTaggedValue> baseTag(thread, base); in RuntimeExp()
74 JSHandle<JSTaggedValue> exponentTag(thread, exponent); in RuntimeExp()
75 JSHandle<JSTaggedValue> valBase = JSTaggedValue::ToNumeric(thread, baseTag); in RuntimeExp()
76 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeExp()
77 JSHandle<JSTaggedValue> valExponent = JSTaggedValue::ToNumeric(thread, exponentTag); in RuntimeExp()
78 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeExp()
83 return BigInt::Exponentiate(thread, bigBaseVale, bigExponentValue).GetTaggedValue(); in RuntimeExp()
85 … THROW_TYPE_ERROR_AND_RETURN(thread, "Cannot mix BigInt and other types, use explicit conversions", in RuntimeExp()
106 JSTaggedValue RuntimeStubs::RuntimeIsIn(JSThread *thread, const JSHandle<JSTaggedValue> &prop, in RuntimeIsIn() argument
110 return RuntimeThrowTypeError(thread, "Cannot use 'in' operator in Non-Object"); in RuntimeIsIn()
112 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeIsIn()
113 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeIsIn()
114 bool ret = JSTaggedValue::HasProperty(thread, obj, propKey); in RuntimeIsIn()
115 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeIsIn()
119 JSTaggedValue RuntimeStubs::RuntimeInstanceof(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeInstanceof() argument
122 bool ret = JSObject::InstanceOf(thread, obj, target); in RuntimeInstanceof()
123 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeInstanceof()
127 JSTaggedValue RuntimeStubs::RuntimeCreateGeneratorObj(JSThread *thread, const JSHandle<JSTaggedValu… in RuntimeCreateGeneratorObj() argument
129 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateGeneratorObj()
132 context->SetGeneratorObject(thread, obj.GetTaggedValue()); in RuntimeCreateGeneratorObj()
136 obj->SetGeneratorContext(thread, context); in RuntimeCreateGeneratorObj()
138 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateGeneratorObj()
142 JSTaggedValue RuntimeStubs::RuntimeCreateAsyncGeneratorObj(JSThread *thread, const JSHandle<JSTagge… in RuntimeCreateAsyncGeneratorObj() argument
144 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateAsyncGeneratorObj()
147 context->SetGeneratorObject(thread, obj.GetTaggedValue()); in RuntimeCreateAsyncGeneratorObj()
151 obj->SetGeneratorContext(thread, context); in RuntimeCreateAsyncGeneratorObj()
153 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateAsyncGeneratorObj()
157 JSTaggedValue RuntimeStubs::RuntimeGetTemplateObject(JSThread *thread, const JSHandle<JSTaggedValue… in RuntimeGetTemplateObject() argument
159 JSHandle<JSTaggedValue> templateObj = TemplateString::GetTemplateObject(thread, literal); in RuntimeGetTemplateObject()
160 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetTemplateObject()
164 JSTaggedValue RuntimeStubs::RuntimeGetNextPropName(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeGetNextPropName() argument
168 JSForInIterator::NextInternal(thread, JSHandle<JSForInIterator>::Cast(iter)); in RuntimeGetNextPropName()
169 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetNextPropName()
173 JSTaggedValue RuntimeStubs::RuntimeIterNext(JSThread *thread, const JSHandle<JSTaggedValue> &iter) in RuntimeIterNext() argument
175 JSHandle<JSTaggedValue> resultObj = JSIterator::IteratorNext(thread, iter); in RuntimeIterNext()
176 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeIterNext()
180 JSTaggedValue RuntimeStubs::RuntimeCloseIterator(JSThread *thread, const JSHandle<JSTaggedValue> &i… in RuntimeCloseIterator() argument
182 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCloseIterator()
183 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeCloseIterator()
186 if (thread->HasPendingException()) { in RuntimeCloseIterator()
188 CompletionRecordType::THROW, JSHandle<JSTaggedValue>(thread, thread->GetException()))); in RuntimeCloseIterator()
193 JSHandle<JSTaggedValue> result = JSIterator::IteratorClose(thread, iter, record); in RuntimeCloseIterator()
200 JSTaggedValue RuntimeStubs::RuntimeSuperCallSpread(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeSuperCallSpread() argument
204 JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func)); in RuntimeSuperCallSpread()
207 JSHandle<TaggedArray> argv(thread, RuntimeGetCallSpreadArgs(thread, array)); in RuntimeSuperCallSpread()
209 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeSuperCallSpread()
211 EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newTarget, argsLength); in RuntimeSuperCallSpread()
212 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCallSpread()
215 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCallSpread()
220 JSTaggedValue RuntimeStubs::RuntimeDelObjProp(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeDelObjProp() argument
223 JSHandle<JSTaggedValue> jsObj(JSTaggedValue::ToObject(thread, obj)); in RuntimeDelObjProp()
224 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDelObjProp()
225 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeDelObjProp()
226 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDelObjProp()
227 bool ret = JSTaggedValue::DeletePropertyOrThrow(thread, jsObj, propKey); in RuntimeDelObjProp()
228 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDelObjProp()
232 JSTaggedValue RuntimeStubs::RuntimeNewObjApply(JSThread *thread, const JSHandle<JSTaggedValue> &fun… in RuntimeNewObjApply() argument
235 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewObjApply()
237 return RuntimeThrowTypeError(thread, "Cannot Newobjspread"); in RuntimeNewObjApply()
243 auto prop = JSTaggedValue::GetProperty(thread, array, i).GetValue(); in RuntimeNewObjApply()
244 argsArray->Set(thread, i, prop); in RuntimeNewObjApply()
245 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjApply()
247 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeNewObjApply()
248 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, func, undefined, func, len… in RuntimeNewObjApply()
249 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjApply()
254 JSTaggedValue RuntimeStubs::RuntimeCreateIterResultObj(JSThread *thread, const JSHandle<JSTaggedVal… in RuntimeCreateIterResultObj() argument
259 JSHandle<JSObject> iter = JSIterator::CreateIterResultObject(thread, value, done); in RuntimeCreateIterResultObj()
260 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateIterResultObj()
264 JSTaggedValue RuntimeStubs::RuntimeAsyncFunctionAwaitUncaught(JSThread *thread, in RuntimeAsyncFunctionAwaitUncaught() argument
268 JSAsyncFunction::AsyncFunctionAwait(thread, asyncFuncObj, value); in RuntimeAsyncFunctionAwaitUncaught()
270 JSHandle<JSObject> obj = JSTaggedValue::ToObject(thread, asyncFuncObj); in RuntimeAsyncFunctionAwaitUncaught()
271 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionAwaitUncaught()
273 JSHandle<TaggedQueue> queue(thread, generator->GetAsyncGeneratorQueue()); in RuntimeAsyncFunctionAwaitUncaught()
277 JSHandle<AsyncGeneratorRequest> next(thread, queue->Front()); in RuntimeAsyncFunctionAwaitUncaught()
278 JSHandle<PromiseCapability> completion(thread, next->GetCapability()); in RuntimeAsyncFunctionAwaitUncaught()
279 JSHandle<JSPromise> promise(thread, completion->GetPromise()); in RuntimeAsyncFunctionAwaitUncaught()
283 JSHandle<JSPromise> promise(thread, asyncFuncObjHandle->GetPromise()); in RuntimeAsyncFunctionAwaitUncaught()
285 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionAwaitUncaught()
289 JSTaggedValue RuntimeStubs::RuntimeAsyncFunctionResolveOrReject(JSThread *thread, in RuntimeAsyncFunctionResolveOrReject() argument
293 JSHandle<JSPromise> promise(thread, asyncFuncObjHandle->GetPromise()); in RuntimeAsyncFunctionResolveOrReject()
296 …JSHandle<ResolvingFunctionsRecord> reactions = JSPromise::CreateResolvingFunctions(thread, promise… in RuntimeAsyncFunctionResolveOrReject()
297 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeAsyncFunctionResolveOrReject()
301 activeFunc = JSHandle<JSTaggedValue>(thread, reactions->GetResolveFunction()); in RuntimeAsyncFunctionResolveOrReject()
303 activeFunc = JSHandle<JSTaggedValue>(thread, reactions->GetRejectFunction()); in RuntimeAsyncFunctionResolveOrReject()
305 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeAsyncFunctionResolveOrReject()
306 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, activeFunc, thisArg, undef… in RuntimeAsyncFunctionResolveOrReject()
307 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionResolveOrReject()
311 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionResolveOrReject()
315 JSTaggedValue RuntimeStubs::RuntimeAsyncGeneratorResolve(JSThread *thread, JSHandle<JSTaggedValue> … in RuntimeAsyncGeneratorResolve() argument
318 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeAsyncGeneratorResolve()
322 …JSHandle<GeneratorContext> genContextHandle(thread, asyncGeneratorObjHandle->GetGeneratorContext()… in RuntimeAsyncGeneratorResolve()
324 SaveFrameToContext(thread, genContextHandle); in RuntimeAsyncGeneratorResolve()
328 …return JSAsyncGeneratorObject::AsyncGeneratorResolve(thread, asyncGeneratorObjHandle, valueHandle,… in RuntimeAsyncGeneratorResolve()
331 JSTaggedValue RuntimeStubs::RuntimeAsyncGeneratorReject(JSThread *thread, JSHandle<JSTaggedValue> a… in RuntimeAsyncGeneratorReject() argument
334 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeAsyncGeneratorReject()
339 … return JSAsyncGeneratorObject::AsyncGeneratorReject(thread, asyncGeneratorObjHandle, valueHandle); in RuntimeAsyncGeneratorReject()
342 JSTaggedValue RuntimeStubs::RuntimeCopyDataProperties(JSThread *thread, const JSHandle<JSTaggedValu… in RuntimeCopyDataProperties() argument
347 JSHandle<JSTaggedValue> from(JSTaggedValue::ToObject(thread, src)); in RuntimeCopyDataProperties()
348 JSHandle<TaggedArray> keys = JSTaggedValue::GetOwnPropertyKeys(thread, from); in RuntimeCopyDataProperties()
349 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
351 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in RuntimeCopyDataProperties()
354 PropertyDescriptor desc(thread); in RuntimeCopyDataProperties()
356 bool success = JSTaggedValue::GetOwnProperty(thread, from, key, desc); in RuntimeCopyDataProperties()
357 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
360 JSTaggedValue::DefineOwnProperty(thread, dst, key, desc); in RuntimeCopyDataProperties()
361 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyDataProperties()
368 JSTaggedValue RuntimeStubs::RuntimeStArraySpread(JSThread *thread, const JSHandle<JSTaggedValue> &d… in RuntimeStArraySpread() argument
371 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeStArraySpread()
374 JSHandle<EcmaString> srcString = JSTaggedValue::ToString(thread, src); in RuntimeStArraySpread()
375 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
381 JSTaggedValue::SetProperty(thread, dst, dstLen + i, strValue, true); in RuntimeStArraySpread()
382 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
388 auto globalConst = thread->GlobalConstants(); in RuntimeStArraySpread()
394 JSHandle<JSTaggedValue> valuesMethod = JSObject::GetMethod(thread, src, valuesStr); in RuntimeStArraySpread()
395 iter = JSIterator::GetIterator(thread, src, valuesMethod); in RuntimeStArraySpread()
396 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
398 iter = JSIterator::GetIterator(thread, src); in RuntimeStArraySpread()
399 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
402 JSMutableHandle<JSTaggedValue> indexHandle(thread, index); in RuntimeStArraySpread()
404 PropertyDescriptor desc(thread); in RuntimeStArraySpread()
407 iterResult = JSIterator::IteratorStep(thread, iter); in RuntimeStArraySpread()
408 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStArraySpread()
412 bool success = JSTaggedValue::GetOwnProperty(thread, iterResult, valueStr, desc); in RuntimeStArraySpread()
414 JSTaggedValue::DefineOwnProperty(thread, dst, indexHandle, desc); in RuntimeStArraySpread()
423 JSTaggedValue RuntimeStubs::RuntimeGetIteratorNext(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeGetIteratorNext() argument
427 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeGetIteratorNext()
428 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, obj, undefined, 0); in RuntimeGetIteratorNext()
429 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetIteratorNext()
431 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetIteratorNext()
433 return RuntimeThrowTypeError(thread, "the Iterator is not an ecmaobject."); in RuntimeGetIteratorNext()
438 JSTaggedValue RuntimeStubs::RuntimeSetObjectWithProto(JSThread *thread, const JSHandle<JSTaggedValu… in RuntimeSetObjectWithProto() argument
444 JSObject::SetPrototype(thread, obj, proto); in RuntimeSetObjectWithProto()
445 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSetObjectWithProto()
449 JSTaggedValue RuntimeStubs::RuntimeLdObjByValue(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeLdObjByValue() argument
457 … JSTaggedValue::RequireObjectCoercible(thread, obj, "Cannot load property of null or undefined"); in RuntimeLdObjByValue()
458 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
462 res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), object); in RuntimeLdObjByValue()
464 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeLdObjByValue()
465 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
466 res = JSTaggedValue::GetProperty(thread, object, propKey).GetValue().GetTaggedValue(); in RuntimeLdObjByValue()
468 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByValue()
472 JSTaggedValue RuntimeStubs::RuntimeStObjByValue(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStObjByValue() argument
480 … JSTaggedValue::RequireObjectCoercible(thread, obj, "Cannot store property of null or undefined"); in RuntimeStObjByValue()
481 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByValue()
483 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, prop)); in RuntimeStObjByValue()
486 JSTaggedValue::SetProperty(thread, object, propKey, value, true); in RuntimeStObjByValue()
487 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByValue()
491 JSTaggedValue RuntimeStubs::RuntimeStOwnByValue(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStOwnByValue() argument
495 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeStOwnByValue()
499 …return RuntimeThrowTypeError(thread, "In a class, static property named 'prototype' throw a TypeEr… in RuntimeStOwnByValue()
505 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByValue()
506 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key); in RuntimeStOwnByValue()
507 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc); in RuntimeStOwnByValue()
509 return RuntimeThrowTypeError(thread, "StOwnByValue failed"); in RuntimeStOwnByValue()
514 JSTaggedValue RuntimeStubs::RuntimeLdSuperByValue(JSThread *thread, const JSHandle<JSTaggedValue> &… in RuntimeLdSuperByValue() argument
519 …JSHandle<JSTaggedValue> homeObject(thread, JSFunction::Cast(thisFunc.GetTaggedObject())->GetHomeOb… in RuntimeLdSuperByValue()
522 return RuntimeThrowReferenceError(thread, obj, "this is uninitialized."); in RuntimeLdSuperByValue()
525 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, key)); in RuntimeLdSuperByValue()
526 JSHandle<JSTaggedValue> superBase(thread, JSTaggedValue::GetSuperBase(thread, homeObject)); in RuntimeLdSuperByValue()
527 JSTaggedValue::RequireObjectCoercible(thread, superBase); in RuntimeLdSuperByValue()
528 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
530 …JSTaggedValue res = JSTaggedValue::GetProperty(thread, superBase, propKey, obj).GetValue().GetTagg… in RuntimeLdSuperByValue()
531 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdSuperByValue()
535 JSTaggedValue RuntimeStubs::RuntimeStSuperByValue(JSThread *thread, const JSHandle<JSTaggedValue> &… in RuntimeStSuperByValue() argument
541 …JSHandle<JSTaggedValue> homeObject(thread, JSFunction::Cast(thisFunc.GetTaggedObject())->GetHomeOb… in RuntimeStSuperByValue()
544 return RuntimeThrowReferenceError(thread, obj, "this is uninitialized."); in RuntimeStSuperByValue()
547 JSHandle<JSTaggedValue> propKey(JSTaggedValue::ToPropertyKey(thread, key)); in RuntimeStSuperByValue()
548 JSHandle<JSTaggedValue> superBase(thread, JSTaggedValue::GetSuperBase(thread, homeObject)); in RuntimeStSuperByValue()
549 JSTaggedValue::RequireObjectCoercible(thread, superBase); in RuntimeStSuperByValue()
550 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
553 JSTaggedValue::SetProperty(thread, superBase, propKey, value, obj, true); in RuntimeStSuperByValue()
554 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStSuperByValue()
558 JSTaggedValue RuntimeStubs::RuntimeLdObjByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeLdObjByIndex() argument
563 res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), obj); in RuntimeLdObjByIndex()
565 res = JSTaggedValue::GetProperty(thread, obj, idx).GetValue().GetTaggedValue(); in RuntimeLdObjByIndex()
567 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByIndex()
571 JSTaggedValue RuntimeStubs::RuntimeLdObjByName(JSThread *thread, JSTaggedValue obj, JSTaggedValue p… in RuntimeLdObjByName() argument
574 JSHandle<JSTaggedValue> objHandle(thread, obj); in RuntimeLdObjByName()
577 … res = JSObject::CallGetter(thread, AccessorData::Cast(receiver.GetTaggedObject()), objHandle); in RuntimeLdObjByName()
579 JSHandle<JSTaggedValue> propHandle(thread, prop); in RuntimeLdObjByName()
580 res = JSTaggedValue::GetProperty(thread, objHandle, propHandle).GetValue().GetTaggedValue(); in RuntimeLdObjByName()
582 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdObjByName()
586 JSTaggedValue RuntimeStubs::RuntimeStObjByName(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeStObjByName() argument
590 JSTaggedValue::SetProperty(thread, obj, prop, value, true); in RuntimeStObjByName()
591 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByName()
595 JSTaggedValue RuntimeStubs::RuntimeStObjByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStObjByIndex() argument
598 JSTaggedValue::SetProperty(thread, obj, idx, value, true); in RuntimeStObjByIndex()
599 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStObjByIndex()
603 JSTaggedValue RuntimeStubs::RuntimeStOwnByIndex(JSThread *thread, const JSHandle<JSTaggedValue> &ob… in RuntimeStOwnByIndex() argument
610 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByIndex()
611 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, idx, desc); in RuntimeStOwnByIndex()
613 return RuntimeThrowTypeError(thread, "SetOwnByIndex failed"); in RuntimeStOwnByIndex()
618 JSTaggedValue RuntimeStubs::RuntimeStGlobalRecord(JSThread *thread, const JSHandle<JSTaggedValue> &… in RuntimeStGlobalRecord() argument
621 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeStGlobalRecord()
628 return RuntimeThrowSyntaxError(thread, "Duplicate identifier"); in RuntimeStGlobalRecord()
635 JSHandle<GlobalDictionary> dictHandle(thread, dict); in RuntimeStGlobalRecord()
637 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeStGlobalRecord()
642 …dict = *GlobalDictionary::PutIfAbsent(thread, dictHandle, prop, JSHandle<JSTaggedValue>(box), attr… in RuntimeStGlobalRecord()
643 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStGlobalRecord()
644 env->SetGlobalRecord(thread, JSTaggedValue(dict)); in RuntimeStGlobalRecord()
648 JSTaggedValue RuntimeStubs::RuntimeNeg(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeNeg() argument
650 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeNeg()
651 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNeg()
654 return BigInt::UnaryMinus(thread, bigValue).GetTaggedValue(); in RuntimeNeg()
673 JSTaggedValue RuntimeStubs::RuntimeNot(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeNot() argument
675 JSHandle<JSTaggedValue> inputVal = JSTaggedValue::ToNumeric(thread, value); in RuntimeNot()
676 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNot()
679 return BigInt::BitwiseNOT(thread, bigValue).GetTaggedValue(); in RuntimeNot()
681 int32_t number = JSTaggedValue::ToInt32(thread, inputVal); in RuntimeNot()
685 JSTaggedValue RuntimeStubs::RuntimeResolveClass(JSThread *thread, const JSHandle<JSFunction> &ctor, in RuntimeResolveClass() argument
692 FrameHandler frameHandler(thread); in RuntimeResolveClass()
694 …JSHandle<JSTaggedValue> ecmaModule(thread, JSFunction::Cast(currentFunc.GetTaggedObject())->GetMod… in RuntimeResolveClass()
696 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(ctor), base); in RuntimeResolveClass()
697 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeResolveClass()
706 func->SetLexicalEnv(thread, lexenv.GetTaggedValue()); in RuntimeResolveClass()
707 func->SetModule(thread, ecmaModule); in RuntimeResolveClass()
714 JSTaggedValue RuntimeStubs::RuntimeCloneClassFromTemplate(JSThread *thread, const JSHandle<JSFuncti… in RuntimeCloneClassFromTemplate() argument
718 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCloneClassFromTemplate()
719 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeCloneClassFromTemplate()
722 JSHandle<JSObject> clsPrototype(thread, ctor->GetFunctionPrototype()); in RuntimeCloneClassFromTemplate()
726 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
729 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
732 cloneClass->SetFunctionPrototype(thread, cloneClassPrototype.GetTaggedValue()); in RuntimeCloneClassFromTemplate()
733 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
735 PropertyDescriptor ctorDesc(thread, JSHandle<JSTaggedValue>(cloneClass), true, false, true); in RuntimeCloneClassFromTemplate()
736 JSTaggedValue::DefinePropertyOrThrow(thread, JSHandle<JSTaggedValue>(cloneClassPrototype), in RuntimeCloneClassFromTemplate()
738 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
740 cloneClass->SetHomeObject(thread, cloneClassPrototype); in RuntimeCloneClassFromTemplate()
743 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cloneClass), base); in RuntimeCloneClassFromTemplate()
744 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCloneClassFromTemplate()
751 JSTaggedValue RuntimeStubs::RuntimeCreateClassWithBuffer(JSThread *thread, in RuntimeCreateClassWithBuffer() argument
758 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeCreateClassWithBuffer()
759 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateClassWithBuffer()
763 auto methodObj = ConstantPool::GetClassMethodFromCache(thread, constantPool, methodId); in RuntimeCreateClassWithBuffer()
764 JSHandle<JSTaggedValue> method(thread, methodObj); in RuntimeCreateClassWithBuffer()
765 … auto literalObj = ConstantPool::GetClassLiteralFromCache(thread, constantPool, literalId, entry); in RuntimeCreateClassWithBuffer()
766 JSHandle<ClassLiteral> classLiteral(thread, literalObj); in RuntimeCreateClassWithBuffer()
767 JSHandle<TaggedArray> arrayHandle(thread, classLiteral->GetArray()); in RuntimeCreateClassWithBuffer()
770 ClassInfoExtractor::BuildClassInfoExtractorFromLiteral(thread, extractor, arrayHandle); in RuntimeCreateClassWithBuffer()
771 … JSHandle<JSFunction> cls = ClassHelper::DefineClassFromExtractor(thread, base, extractor, lexenv); in RuntimeCreateClassWithBuffer()
773 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cls), base); in RuntimeCreateClassWithBuffer()
774 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateClassWithBuffer()
778 JSTaggedValue RuntimeStubs::RuntimeCreateClassWithIHClass(JSThread *thread, in RuntimeCreateClassWithIHClass() argument
786 [[maybe_unused]] EcmaHandleScope handleScope(thread); in RuntimeCreateClassWithIHClass()
787 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateClassWithIHClass()
791 auto methodObj = ConstantPool::GetClassMethodFromCache(thread, constantPool, methodId); in RuntimeCreateClassWithIHClass()
792 JSHandle<JSTaggedValue> method(thread, methodObj); in RuntimeCreateClassWithIHClass()
793 … auto literalObj = ConstantPool::GetClassLiteralFromCache(thread, constantPool, literalId, entry); in RuntimeCreateClassWithIHClass()
794 JSHandle<ClassLiteral> classLiteral(thread, literalObj); in RuntimeCreateClassWithIHClass()
797 … return RuntimeCreateClassWithBuffer(thread, base, lexenv, constpool, methodId, literalId, module); in RuntimeCreateClassWithIHClass()
801 JSHandle<TaggedArray> arrayHandle(thread, classLiteral->GetArray()); in RuntimeCreateClassWithIHClass()
804 ClassInfoExtractor::BuildClassInfoExtractorFromLiteral(thread, extractor, arrayHandle); in RuntimeCreateClassWithIHClass()
805 …JSHandle<JSFunction> cls = ClassHelper::DefineClassWithIHClass(thread, base, extractor, lexenv, ih… in RuntimeCreateClassWithIHClass()
807 RuntimeSetClassInheritanceRelationship(thread, JSHandle<JSTaggedValue>(cls), base); in RuntimeCreateClassWithIHClass()
808 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateClassWithIHClass()
813 JSTaggedValue RuntimeStubs::RuntimeSetClassInheritanceRelationship(JSThread *thread, in RuntimeSetClassInheritanceRelationship() argument
817 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeSetClassInheritanceRelationship()
818 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeSetClassInheritanceRelationship()
845 parentPrototype = JSHandle<JSTaggedValue>(thread, JSTaggedValue::Null()); in RuntimeSetClassInheritanceRelationship()
848 return RuntimeThrowTypeError(thread, "parent class is not constructor"); in RuntimeSetClassInheritanceRelationship()
851 parentPrototype = JSTaggedValue::GetProperty(thread, parent, in RuntimeSetClassInheritanceRelationship()
854 return RuntimeThrowTypeError(thread, "parent class have no valid prototype"); in RuntimeSetClassInheritanceRelationship()
858 ctor->GetTaggedObject()->GetClass()->SetPrototype(thread, parent); in RuntimeSetClassInheritanceRelationship()
860 JSHandle<JSObject> clsPrototype(thread, JSHandle<JSFunction>(ctor)->GetFunctionPrototype()); in RuntimeSetClassInheritanceRelationship()
861 clsPrototype->GetClass()->SetPrototype(thread, parentPrototype); in RuntimeSetClassInheritanceRelationship()
866 JSTaggedValue RuntimeStubs::RuntimeSetClassConstructorLength(JSThread *thread, JSTaggedValue ctor, in RuntimeSetClassConstructorLength() argument
873 cls->SetPropertyInlinedProps(thread, JSFunction::LENGTH_INLINE_PROPERTY_INDEX, length); in RuntimeSetClassConstructorLength()
875 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeSetClassConstructorLength()
876 cls->UpdatePropertyInDictionary(thread, globalConst->GetLengthString(), length); in RuntimeSetClassConstructorLength()
881 JSTaggedValue RuntimeStubs::RuntimeNotifyInlineCache(JSThread *thread, const JSHandle<Method> &meth… in RuntimeNotifyInlineCache() argument
887 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNotifyInlineCache()
892 profileTypeInfo->Set(thread, ProfileTypeInfo::INVALID_SLOT_INDEX, JSTaggedValue::Hole()); in RuntimeNotifyInlineCache()
895 method->SetProfileTypeInfo(thread, profileTypeInfo.GetTaggedValue()); in RuntimeNotifyInlineCache()
899 JSTaggedValue RuntimeStubs::RuntimeStOwnByValueWithNameSet(JSThread *thread, const JSHandle<JSTagge… in RuntimeStOwnByValueWithNameSet() argument
903 const GlobalEnvConstants *globalConst = thread->GlobalConstants(); in RuntimeStOwnByValueWithNameSet()
907 …return RuntimeThrowTypeError(thread, "In a class, static property named 'prototype' throw a TypeEr… in RuntimeStOwnByValueWithNameSet()
913 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByValueWithNameSet()
914 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, key); in RuntimeStOwnByValueWithNameSet()
915 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, propKey, desc); in RuntimeStOwnByValueWithNameSet()
917 return RuntimeThrowTypeError(thread, "StOwnByValueWithNameSet failed"); in RuntimeStOwnByValueWithNameSet()
921 …propKey = JSHandle<JSTaggedValue>(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValu… in RuntimeStOwnByValueWithNameSet()
923 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(value), propKey, in RuntimeStOwnByValueWithNameSet()
924 … JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in RuntimeStOwnByValueWithNameSet()
929 JSTaggedValue RuntimeStubs::RuntimeStOwnByName(JSThread *thread, const JSHandle<JSTaggedValue> &obj, in RuntimeStOwnByName() argument
938 PropertyDescriptor desc(thread, value, true, enumerable, true); in RuntimeStOwnByName()
939 bool ret = JSTaggedValue::DefineOwnProperty(thread, obj, prop, desc); in RuntimeStOwnByName()
941 return RuntimeThrowTypeError(thread, "SetOwnByName failed"); in RuntimeStOwnByName()
946 JSTaggedValue RuntimeStubs::RuntimeStOwnByNameWithNameSet(JSThread *thread, in RuntimeStOwnByNameWithNameSet() argument
952 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, propHandle); in RuntimeStOwnByNameWithNameSet()
957 PropertyDescriptor desc(thread, valueHandle, true, enumerable, true); in RuntimeStOwnByNameWithNameSet()
958 bool ret = JSTaggedValue::DefineOwnProperty(thread, objHandle, propHandle, desc); in RuntimeStOwnByNameWithNameSet()
960 return RuntimeThrowTypeError(thread, "SetOwnByNameWithNameSet failed"); in RuntimeStOwnByNameWithNameSet()
962 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(valueHandle), propKey, in RuntimeStOwnByNameWithNameSet()
963 JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined())); in RuntimeStOwnByNameWithNameSet()
967 JSTaggedValue RuntimeStubs::RuntimeSuspendGenerator(JSThread *thread, const JSHandle<JSTaggedValue>… in RuntimeSuspendGenerator() argument
972 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in RuntimeSuspendGenerator()
974 SaveFrameToContext(thread, genContextHandle); in RuntimeSuspendGenerator()
980 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuspendGenerator()
984 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in RuntimeSuspendGenerator()
986 SaveFrameToContext(thread, genContextHandle); in RuntimeSuspendGenerator()
991 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuspendGenerator()
994 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuspendGenerator()
997 return RuntimeThrowTypeError(thread, "RuntimeSuspendGenerator failed"); in RuntimeSuspendGenerator()
1001 void RuntimeStubs::RuntimeSetGeneratorState(JSThread *thread, const JSHandle<JSTaggedValue> &genObj, in RuntimeSetGeneratorState() argument
1005 … JSHandle<GeneratorContext> genContextHandle(thread, generatorObjectHandle->GetGeneratorContext()); in RuntimeSetGeneratorState()
1030 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, int32_t index) in RuntimeGetModuleNamespace() argument
1032 return thread->GetEcmaVM()->GetModuleManager()->GetModuleNamespace(index); in RuntimeGetModuleNamespace()
1035 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, int32_t index, in RuntimeGetModuleNamespace() argument
1038 return thread->GetEcmaVM()->GetModuleManager()->GetModuleNamespace(index, jsFunc); in RuntimeGetModuleNamespace()
1041 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, JSTaggedValue localName) in RuntimeGetModuleNamespace() argument
1043 return thread->GetEcmaVM()->GetModuleManager()->GetModuleNamespace(localName); in RuntimeGetModuleNamespace()
1046 JSTaggedValue RuntimeStubs::RuntimeGetModuleNamespace(JSThread *thread, JSTaggedValue localName, in RuntimeGetModuleNamespace() argument
1049 return thread->GetEcmaVM()->GetModuleManager()->GetModuleNamespace(localName, jsFunc); in RuntimeGetModuleNamespace()
1052 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, int32_t index, JSTaggedValue value) in RuntimeStModuleVar() argument
1054 thread->GetEcmaVM()->GetModuleManager()->StoreModuleValue(index, value); in RuntimeStModuleVar()
1057 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, int32_t index, JSTaggedValue value, in RuntimeStModuleVar() argument
1060 thread->GetEcmaVM()->GetModuleManager()->StoreModuleValue(index, value, jsFunc); in RuntimeStModuleVar()
1063 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value) in RuntimeStModuleVar() argument
1065 thread->GetEcmaVM()->GetModuleManager()->StoreModuleValue(key, value); in RuntimeStModuleVar()
1068 void RuntimeStubs::RuntimeStModuleVar(JSThread *thread, JSTaggedValue key, JSTaggedValue value, in RuntimeStModuleVar() argument
1071 thread->GetEcmaVM()->GetModuleManager()->StoreModuleValue(key, value, jsFunc); in RuntimeStModuleVar()
1074 JSTaggedValue RuntimeStubs::RuntimeLdLocalModuleVar(JSThread *thread, int32_t index) in RuntimeLdLocalModuleVar() argument
1076 return thread->GetEcmaVM()->GetModuleManager()->GetModuleValueInner(index); in RuntimeLdLocalModuleVar()
1079 JSTaggedValue RuntimeStubs::RuntimeLdLocalModuleVar(JSThread *thread, int32_t index, JSTaggedValue … in RuntimeLdLocalModuleVar() argument
1081 return thread->GetEcmaVM()->GetModuleManager()->GetModuleValueInner(index, jsFunc); in RuntimeLdLocalModuleVar()
1084 JSTaggedValue RuntimeStubs::RuntimeLdExternalModuleVar(JSThread *thread, int32_t index) in RuntimeLdExternalModuleVar() argument
1086 return thread->GetEcmaVM()->GetModuleManager()->GetModuleValueOutter(index); in RuntimeLdExternalModuleVar()
1089 JSTaggedValue RuntimeStubs::RuntimeLdExternalModuleVar(JSThread *thread, int32_t index, JSTaggedVal… in RuntimeLdExternalModuleVar() argument
1091 return thread->GetEcmaVM()->GetModuleManager()->GetModuleValueOutter(index, jsFunc); in RuntimeLdExternalModuleVar()
1094 JSTaggedValue RuntimeStubs::RuntimeLdModuleVar(JSThread *thread, JSTaggedValue key, bool inner) in RuntimeLdModuleVar() argument
1097 … JSTaggedValue moduleValue = thread->GetEcmaVM()->GetModuleManager()->GetModuleValueInner(key); in RuntimeLdModuleVar()
1101 return thread->GetEcmaVM()->GetModuleManager()->GetModuleValueOutter(key); in RuntimeLdModuleVar()
1104 JSTaggedValue RuntimeStubs::RuntimeLdModuleVar(JSThread *thread, JSTaggedValue key, bool inner, in RuntimeLdModuleVar() argument
1108 …JSTaggedValue moduleValue = thread->GetEcmaVM()->GetModuleManager()->GetModuleValueInner(key, jsFu… in RuntimeLdModuleVar()
1112 return thread->GetEcmaVM()->GetModuleManager()->GetModuleValueOutter(key, jsFunc); in RuntimeLdModuleVar()
1115 JSTaggedValue RuntimeStubs::RuntimeGetPropIterator(JSThread *thread, const JSHandle<JSTaggedValue> … in RuntimeGetPropIterator() argument
1117 JSHandle<JSForInIterator> iteratorHandle = JSObject::EnumerateObjectProperties(thread, value); in RuntimeGetPropIterator()
1118 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetPropIterator()
1122 JSTaggedValue RuntimeStubs::RuntimeAsyncFunctionEnter(JSThread *thread) in RuntimeAsyncFunctionEnter() argument
1124 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeAsyncFunctionEnter()
1126 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeAsyncFunctionEnter()
1133 asyncFuncObj->SetPromise(thread, promiseObject); in RuntimeAsyncFunctionEnter()
1136 context->SetGeneratorObject(thread, asyncFuncObj); in RuntimeAsyncFunctionEnter()
1140 asyncFuncObj->SetGeneratorContext(thread, context); in RuntimeAsyncFunctionEnter()
1143 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAsyncFunctionEnter()
1147 JSTaggedValue RuntimeStubs::RuntimeGetIterator(JSThread *thread, const JSHandle<JSTaggedValue> &obj) in RuntimeGetIterator() argument
1149 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeGetIterator()
1152 JSTaggedValue::GetProperty(thread, obj, env->GetIteratorSymbol()).GetValue(); in RuntimeGetIterator()
1153 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetIterator()
1158 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeGetIterator()
1159 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, valuesFunc, obj, undefined… in RuntimeGetIterator()
1163 JSTaggedValue RuntimeStubs::RuntimeGetAsyncIterator(JSThread *thread, const JSHandle<JSTaggedValue>… in RuntimeGetAsyncIterator() argument
1165 JSHandle<JSTaggedValue> asyncit = JSIterator::GetAsyncIterator(thread, obj); in RuntimeGetAsyncIterator()
1169 void RuntimeStubs::RuntimeThrow(JSThread *thread, JSTaggedValue value) in RuntimeThrow() argument
1171 thread->SetException(value); in RuntimeThrow()
1174 void RuntimeStubs::RuntimeThrowThrowNotExists(JSThread *thread) in RuntimeThrowThrowNotExists() argument
1176 THROW_TYPE_ERROR(thread, "Throw method is not defined"); in RuntimeThrowThrowNotExists()
1179 void RuntimeStubs::RuntimeThrowPatternNonCoercible(JSThread *thread) in RuntimeThrowPatternNonCoercible() argument
1181 JSHandle<EcmaString> msg(thread->GlobalConstants()->GetHandledObjNotCoercibleString()); in RuntimeThrowPatternNonCoercible()
1182 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowPatternNonCoercible()
1183 …THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::TYPE_ERROR, msg).GetTagged… in RuntimeThrowPatternNonCoercible()
1186 void RuntimeStubs::RuntimeThrowDeleteSuperProperty(JSThread *thread) in RuntimeThrowDeleteSuperProperty() argument
1188 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowDeleteSuperProperty()
1191 THROW_NEW_ERROR_AND_RETURN(thread, errorObj.GetTaggedValue()); in RuntimeThrowDeleteSuperProperty()
1194 void RuntimeStubs::RuntimeThrowUndefinedIfHole(JSThread *thread, const JSHandle<EcmaString> &obj) in RuntimeThrowUndefinedIfHole() argument
1196 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowUndefinedIfHole()
1200 …THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::REFERENCE_ERROR, msg).GetT… in RuntimeThrowUndefinedIfHole()
1203 void RuntimeStubs::RuntimeThrowIfNotObject(JSThread *thread) in RuntimeThrowIfNotObject() argument
1205 THROW_TYPE_ERROR(thread, "Inner return result is not object"); in RuntimeThrowIfNotObject()
1208 void RuntimeStubs::RuntimeThrowConstAssignment(JSThread *thread, const JSHandle<EcmaString> &value) in RuntimeThrowConstAssignment() argument
1210 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowConstAssignment()
1215 …THROW_NEW_ERROR_AND_RETURN(thread, factory->NewJSError(base::ErrorType::TYPE_ERROR, msg).GetTagged… in RuntimeThrowConstAssignment()
1218 JSTaggedValue RuntimeStubs::RuntimeLdGlobalRecord(JSThread *thread, JSTaggedValue key) in RuntimeLdGlobalRecord() argument
1220 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeLdGlobalRecord()
1230 JSTaggedValue RuntimeStubs::RuntimeTryLdGlobalByName(JSThread *thread, const JSHandle<JSTaggedValue… in RuntimeTryLdGlobalByName() argument
1233 OperationResult res = JSTaggedValue::GetProperty(thread, obj, prop); in RuntimeTryLdGlobalByName()
1235 return RuntimeThrowReferenceError(thread, prop, " is not defined"); in RuntimeTryLdGlobalByName()
1241 JSTaggedValue RuntimeStubs::RuntimeTryUpdateGlobalRecord(JSThread *thread, JSTaggedValue prop, in RuntimeTryUpdateGlobalRecord() argument
1244 EcmaVM *vm = thread->GetEcmaVM(); in RuntimeTryUpdateGlobalRecord()
1251 return RuntimeThrowTypeError(thread, "const variable can not be modified"); in RuntimeTryUpdateGlobalRecord()
1255 box->SetValue(thread, value); in RuntimeTryUpdateGlobalRecord()
1256 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeTryUpdateGlobalRecord()
1260 JSTaggedValue RuntimeStubs::RuntimeThrowReferenceError(JSThread *thread, const JSHandle<JSTaggedVal… in RuntimeThrowReferenceError() argument
1263 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeThrowReferenceError()
1264 JSHandle<EcmaString> propName = JSTaggedValue::ToString(thread, prop); in RuntimeThrowReferenceError()
1265 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeThrowReferenceError()
1268 THROW_NEW_ERROR_AND_RETURN_VALUE(thread, in RuntimeThrowReferenceError()
1273 JSTaggedValue RuntimeStubs::RuntimeLdGlobalVarFromProto(JSThread *thread, const JSHandle<JSTaggedVa… in RuntimeLdGlobalVarFromProto() argument
1278 JSHandle<JSTaggedValue> obj(thread, JSObject::GetPrototype(global)); in RuntimeLdGlobalVarFromProto()
1279 OperationResult res = JSTaggedValue::GetProperty(thread, obj, prop); in RuntimeLdGlobalVarFromProto()
1280 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLdGlobalVarFromProto()
1284 JSTaggedValue RuntimeStubs::RuntimeStGlobalVar(JSThread *thread, const JSHandle<JSTaggedValue> &pro… in RuntimeStGlobalVar() argument
1287 JSHandle<JSTaggedValue> global(thread, thread->GetEcmaVM()->GetGlobalEnv()->GetGlobalObject()); in RuntimeStGlobalVar()
1289 JSObject::GlobalSetProperty(thread, prop, value, true); in RuntimeStGlobalVar()
1290 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeStGlobalVar()
1294 JSTaggedValue RuntimeStubs::RuntimeToNumber(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeToNumber() argument
1296 return JSTaggedValue::ToNumber(thread, value); in RuntimeToNumber()
1299 JSTaggedValue RuntimeStubs::RuntimeToNumeric(JSThread *thread, const JSHandle<JSTaggedValue> &value) in RuntimeToNumeric() argument
1301 return JSTaggedValue::ToNumeric(thread, value).GetTaggedValue(); in RuntimeToNumeric()
1304 JSTaggedValue RuntimeStubs::RuntimeDynamicImport(JSThread *thread, const JSHandle<JSTaggedValue> &s… in RuntimeDynamicImport() argument
1307 EcmaVM *ecmaVm = thread->GetEcmaVM(); in RuntimeDynamicImport()
1318 JSMutableHandle<JSTaggedValue> recordName(thread, thread->GlobalConstants()->GetUndefined()); in RuntimeDynamicImport()
1322 RETURN_VALUE_IF_ABRUPT_COMPLETION(thread, JSTaggedValue::Hole()); in RuntimeDynamicImport()
1327 …JSHandle<JSTaggedValue> module(thread, JSFunction::Cast(func.GetTaggedValue().GetTaggedObject())->… in RuntimeDynamicImport()
1341 …JSHandle<PromiseCapability> promiseCapability = JSPromise::NewPromiseCapability(thread, promiseFun… in RuntimeDynamicImport()
1346 argv->Set(thread, 0, promiseCapability->GetResolve()); in RuntimeDynamicImport()
1347 argv->Set(thread, 1, promiseCapability->GetReject()); // 1 : first argument in RuntimeDynamicImport()
1348 argv->Set(thread, 2, dirPath); // 2: second argument in RuntimeDynamicImport()
1349 argv->Set(thread, 3, specifier); // 3 : third argument in RuntimeDynamicImport()
1350 argv->Set(thread, 4, recordName); // 4 : fourth argument in RuntimeDynamicImport()
1353 …job::MicroJobQueue::EnqueueJob(thread, job, job::QueueType::QUEUE_PROMISE, dynamicImportJob, argv); in RuntimeDynamicImport()
1358 JSTaggedValue RuntimeStubs::RuntimeEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeEq() argument
1361 bool ret = JSTaggedValue::Equal(thread, left, right); in RuntimeEq()
1362 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeEq()
1366 JSTaggedValue RuntimeStubs::RuntimeNotEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeNotEq() argument
1369 bool ret = JSTaggedValue::Equal(thread, left, right); in RuntimeNotEq()
1370 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNotEq()
1374 JSTaggedValue RuntimeStubs::RuntimeLess(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeLess() argument
1377 bool ret = JSTaggedValue::Compare(thread, left, right) == ComparisonResult::LESS; in RuntimeLess()
1378 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLess()
1382 JSTaggedValue RuntimeStubs::RuntimeLessEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeLessEq() argument
1385 bool ret = JSTaggedValue::Compare(thread, left, right) <= ComparisonResult::EQUAL; in RuntimeLessEq()
1386 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeLessEq()
1390 JSTaggedValue RuntimeStubs::RuntimeGreater(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeGreater() argument
1393 bool ret = JSTaggedValue::Compare(thread, left, right) == ComparisonResult::GREAT; in RuntimeGreater()
1394 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGreater()
1398 JSTaggedValue RuntimeStubs::RuntimeGreaterEq(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeGreaterEq() argument
1401 ComparisonResult comparison = JSTaggedValue::Compare(thread, left, right); in RuntimeGreaterEq()
1403 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGreaterEq()
1407 JSTaggedValue RuntimeStubs::RuntimeAdd2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeAdd2() argument
1411 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeAdd2()
1416 JSHandle<JSTaggedValue> primitiveA0(thread, JSTaggedValue::ToPrimitive(thread, left)); in RuntimeAdd2()
1417 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1418 JSHandle<JSTaggedValue> primitiveA1(thread, JSTaggedValue::ToPrimitive(thread, right)); in RuntimeAdd2()
1419 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1422 JSHandle<EcmaString> stringA0 = JSTaggedValue::ToString(thread, primitiveA0); in RuntimeAdd2()
1423 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1424 JSHandle<EcmaString> stringA1 = JSTaggedValue::ToString(thread, primitiveA1); in RuntimeAdd2()
1425 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1426 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeAdd2()
1430 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, primitiveA0); in RuntimeAdd2()
1431 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1432 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, primitiveA1); in RuntimeAdd2()
1433 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAdd2()
1438 return BigInt::Add(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeAdd2()
1440 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeAdd2()
1447 JSTaggedValue RuntimeStubs::RuntimeShl2(JSThread *thread, in RuntimeShl2() argument
1451 JSHandle<JSTaggedValue> leftValue = JSTaggedValue::ToNumeric(thread, left); in RuntimeShl2()
1452 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1453 JSHandle<JSTaggedValue> rightValue = JSTaggedValue::ToNumeric(thread, right); in RuntimeShl2()
1454 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1459 return BigInt::LeftShift(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeShl2()
1461 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeShl2()
1463 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, leftValue); in RuntimeShl2()
1464 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1465 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, rightValue); in RuntimeShl2()
1466 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShl2()
1477 JSTaggedValue RuntimeStubs::RuntimeShr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeShr2() argument
1480 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeShr2()
1481 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1482 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeShr2()
1483 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1486 return BigInt::UnsignedRightShift(thread); in RuntimeShr2()
1488 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeShr2()
1490 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeShr2()
1491 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1492 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeShr2()
1493 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeShr2()
1503 JSTaggedValue RuntimeStubs::RuntimeSub2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeSub2() argument
1506 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeSub2()
1507 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSub2()
1508 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeSub2()
1509 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSub2()
1514 return BigInt::Subtract(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeSub2()
1516 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeSub2()
1523 JSTaggedValue RuntimeStubs::RuntimeMul2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeMul2() argument
1526 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeMul2()
1527 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMul2()
1528 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeMul2()
1529 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMul2()
1535 return BigInt::Multiply(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeMul2()
1537 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeMul2()
1545 JSTaggedValue RuntimeStubs::RuntimeDiv2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeDiv2() argument
1548 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeDiv2()
1549 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDiv2()
1550 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeDiv2()
1551 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeDiv2()
1556 return BigInt::Divide(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeDiv2()
1558 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeDiv2()
1573 JSTaggedValue RuntimeStubs::RuntimeMod2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeMod2() argument
1576 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeMod2()
1577 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMod2()
1578 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeMod2()
1579 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeMod2()
1586 return BigInt::Remainder(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeMod2()
1588 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeMod2()
1602 JSTaggedValue RuntimeStubs::RuntimeAshr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeAshr2() argument
1605 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeAshr2()
1606 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
1607 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeAshr2()
1608 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
1613 return BigInt::SignedRightShift(thread, bigLeft, bigRight).GetTaggedValue(); in RuntimeAshr2()
1615 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeAshr2()
1617 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeAshr2()
1618 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
1619 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeAshr2()
1620 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAshr2()
1628 JSTaggedValue RuntimeStubs::RuntimeAnd2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeAnd2() argument
1631 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeAnd2()
1632 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
1633 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeAnd2()
1634 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
1639 return BigInt::BitwiseAND(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeAnd2()
1641 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeAnd2()
1643 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeAnd2()
1644 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
1645 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeAnd2()
1646 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeAnd2()
1654 JSTaggedValue RuntimeStubs::RuntimeOr2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeOr2() argument
1657 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeOr2()
1658 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
1659 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeOr2()
1660 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
1665 return BigInt::BitwiseOR(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeOr2()
1667 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeOr2()
1669 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeOr2()
1670 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
1671 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeOr2()
1672 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOr2()
1680 JSTaggedValue RuntimeStubs::RuntimeXor2(JSThread *thread, const JSHandle<JSTaggedValue> &left, in RuntimeXor2() argument
1683 JSHandle<JSTaggedValue> valLeft = JSTaggedValue::ToNumeric(thread, left); in RuntimeXor2()
1684 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
1685 JSHandle<JSTaggedValue> valRight = JSTaggedValue::ToNumeric(thread, right); in RuntimeXor2()
1686 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
1691 return BigInt::BitwiseXOR(thread, leftBigint, rightBigint).GetTaggedValue(); in RuntimeXor2()
1693 …return RuntimeThrowTypeError(thread, "Cannot mix BigInt and other types, use explicit conversions"… in RuntimeXor2()
1695 JSTaggedValue taggedNumber0 = RuntimeToJSTaggedValueWithInt32(thread, valLeft); in RuntimeXor2()
1696 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
1697 JSTaggedValue taggedNumber1 = RuntimeToJSTaggedValueWithInt32(thread, valRight); in RuntimeXor2()
1698 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeXor2()
1706 JSTaggedValue RuntimeStubs::RuntimeToJSTaggedValueWithInt32(JSThread *thread, in RuntimeToJSTaggedValueWithInt32() argument
1709 int32_t res = JSTaggedValue::ToInt32(thread, value); in RuntimeToJSTaggedValueWithInt32()
1710 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeToJSTaggedValueWithInt32()
1714 JSTaggedValue RuntimeStubs::RuntimeToJSTaggedValueWithUint32(JSThread *thread, const JSHandle<JSTag… in RuntimeToJSTaggedValueWithUint32() argument
1716 uint32_t res = JSTaggedValue::ToUint32(thread, value); in RuntimeToJSTaggedValueWithUint32()
1717 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeToJSTaggedValueWithUint32()
1721 JSTaggedValue RuntimeStubs::RuntimeCreateEmptyObject([[maybe_unused]] JSThread *thread, ObjectFacto… in RuntimeCreateEmptyObject() argument
1729 JSTaggedValue RuntimeStubs::RuntimeCreateEmptyArray([[maybe_unused]] JSThread *thread, ObjectFactor… in RuntimeCreateEmptyArray() argument
1737 JSTaggedValue RuntimeStubs::RuntimeGetUnmapedArgs(JSThread *thread, JSTaggedType *sp, uint32_t actu… in RuntimeGetUnmapedArgs() argument
1740 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeGetUnmapedArgs()
1743 argumentsList->Set(thread, i, in RuntimeGetUnmapedArgs()
1746 return RuntimeGetUnmapedJSArgumentObj(thread, argumentsList); in RuntimeGetUnmapedArgs()
1749 JSTaggedValue RuntimeStubs::RuntimeCopyRestArgs(JSThread *thread, JSTaggedType *sp, uint32_t restNu… in RuntimeCopyRestArgs() argument
1752 JSHandle<JSTaggedValue> restArray = JSArray::ArrayCreate(thread, JSTaggedNumber(restNumArgs)); in RuntimeCopyRestArgs()
1754 JSMutableHandle<JSTaggedValue> element(thread, JSTaggedValue::Undefined()); in RuntimeCopyRestArgs()
1758 JSObject::SetProperty(thread, restArray, i, element, true); in RuntimeCopyRestArgs()
1760 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCopyRestArgs()
1764 JSTaggedValue RuntimeStubs::RuntimeCreateArrayWithBuffer(JSThread *thread, ObjectFactory *factory, in RuntimeCreateArrayWithBuffer() argument
1769 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateArrayWithBuffer()
1774 JSTaggedValue RuntimeStubs::RuntimeCreateObjectWithBuffer(JSThread *thread, ObjectFactory *factory, in RuntimeCreateObjectWithBuffer() argument
1778 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateObjectWithBuffer()
1783 JSTaggedValue RuntimeStubs::RuntimeNewLexicalEnv(JSThread *thread, uint16_t numVars) in RuntimeNewLexicalEnv() argument
1785 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewLexicalEnv()
1788 JSTaggedValue currentLexenv = thread->GetCurrentLexenv(); in RuntimeNewLexicalEnv()
1789 newEnv->SetParentEnv(thread, currentLexenv); in RuntimeNewLexicalEnv()
1790 newEnv->SetScopeInfo(thread, JSTaggedValue::Hole()); in RuntimeNewLexicalEnv()
1791 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewLexicalEnv()
1795 JSTaggedValue RuntimeStubs::RuntimeNewObjRange(JSThread *thread, const JSHandle<JSTaggedValue> &fun… in RuntimeNewObjRange() argument
1798 JSHandle<JSTaggedValue> preArgs(thread, JSTaggedValue::Undefined()); in RuntimeNewObjRange()
1799 JSHandle<TaggedArray> args = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(length); in RuntimeNewObjRange()
1800 FrameHandler frameHandler(thread); in RuntimeNewObjRange()
1803 args->Set(thread, i, value); in RuntimeNewObjRange()
1805 auto tagged = RuntimeOptConstruct(thread, func, newTarget, preArgs, args); in RuntimeNewObjRange()
1806 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewObjRange()
1810 JSTaggedValue RuntimeStubs::RuntimeDefinefunc(JSThread *thread, const JSHandle<Method> &methodHandl… in RuntimeDefinefunc() argument
1812 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeDefinefunc()
1813 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeDefinefunc()
1855 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeDefinefunc()
1859 JSTaggedValue RuntimeStubs::RuntimeCreateRegExpWithLiteral(JSThread *thread, in RuntimeCreateRegExpWithLiteral() argument
1862 JSHandle<JSTaggedValue> flagsHandle(thread, JSTaggedValue(flags)); in RuntimeCreateRegExpWithLiteral()
1863 return builtins::BuiltinsRegExp::RegExpCreate(thread, pattern, flagsHandle); in RuntimeCreateRegExpWithLiteral()
1866 JSTaggedValue RuntimeStubs::RuntimeThrowIfSuperNotCorrectCall(JSThread *thread, uint16_t index, in RuntimeThrowIfSuperNotCorrectCall() argument
1870 …return RuntimeThrowReferenceError(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined… in RuntimeThrowIfSuperNotCorrectCall()
1874 …return RuntimeThrowReferenceError(thread, JSHandle<JSTaggedValue>(thread, JSTaggedValue::Undefined… in RuntimeThrowIfSuperNotCorrectCall()
1880 JSTaggedValue RuntimeStubs::RuntimeCreateObjectHavingMethod(JSThread *thread, ObjectFactory *factor… in RuntimeCreateObjectHavingMethod() argument
1885 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateObjectHavingMethod()
1890 JSTaggedValue RuntimeStubs::RuntimeCreateObjectWithExcludedKeys(JSThread *thread, uint16_t numKeys, in RuntimeCreateObjectWithExcludedKeys() argument
1894 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeCreateObjectWithExcludedKeys()
1899 JSHandle<JSObject> obj(JSTaggedValue::ToObject(thread, objVal)); in RuntimeCreateObjectWithExcludedKeys()
1903 FrameHandler frameHandler(thread); in RuntimeCreateObjectWithExcludedKeys()
1907 excludedKeys->Set(thread, 0, excludedKey); in RuntimeCreateObjectWithExcludedKeys()
1910 excludedKeys->Set(thread, i, excludedKey); in RuntimeCreateObjectWithExcludedKeys()
1914 JSHandle<TaggedArray> allKeys = JSObject::GetOwnPropertyKeys(thread, obj); in RuntimeCreateObjectWithExcludedKeys()
1916 JSMutableHandle<JSTaggedValue> key(thread, JSTaggedValue::Undefined()); in RuntimeCreateObjectWithExcludedKeys()
1921 … if (JSTaggedValue::Equal(thread, key, JSHandle<JSTaggedValue>(thread, excludedKeys->Get(j)))) { in RuntimeCreateObjectWithExcludedKeys()
1927 PropertyDescriptor desc(thread); in RuntimeCreateObjectWithExcludedKeys()
1928 bool success = JSObject::GetOwnProperty(thread, obj, key, desc); in RuntimeCreateObjectWithExcludedKeys()
1929 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateObjectWithExcludedKeys()
1931 JSHandle<JSTaggedValue> value = JSObject::GetProperty(thread, obj, key).GetValue(); in RuntimeCreateObjectWithExcludedKeys()
1932 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateObjectWithExcludedKeys()
1933 JSObject::SetProperty(thread, restObj, key, value, true); in RuntimeCreateObjectWithExcludedKeys()
1934 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeCreateObjectWithExcludedKeys()
1941 JSTaggedValue RuntimeStubs::RuntimeDefineMethod(JSThread *thread, const JSHandle<Method> &methodHan… in RuntimeDefineMethod() argument
1946 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeDefineMethod()
1947 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeDefineMethod()
1950 jsFunc->SetHomeObject(thread, homeObject); in RuntimeDefineMethod()
1951 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeDefineMethod()
1955 JSTaggedValue RuntimeStubs::RuntimeCallSpread(JSThread *thread, in RuntimeCallSpread() argument
1961 THROW_TYPE_ERROR_AND_RETURN(thread, "cannot Callspread", JSTaggedValue::Exception()); in RuntimeCallSpread()
1964 JSHandle<TaggedArray> coretypesArray(thread, RuntimeGetCallSpreadArgs(thread, array)); in RuntimeCallSpread()
1966 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeCallSpread()
1967 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, func, obj, undefined, leng… in RuntimeCallSpread()
1972 JSTaggedValue RuntimeStubs::RuntimeDefineGetterSetterByValue(JSThread *thread, const JSHandle<JSObj… in RuntimeDefineGetterSetterByValue() argument
1977 JSHandle<JSTaggedValue> propKey = JSTaggedValue::ToPropertyKey(thread, prop); in RuntimeDefineGetterSetterByValue()
1979 auto globalConst = thread->GlobalConstants(); in RuntimeDefineGetterSetterByValue()
1983 thread, in RuntimeDefineGetterSetterByValue()
1991 …JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue())… in RuntimeDefineGetterSetterByValue()
1993 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(getter), propKey, in RuntimeDefineGetterSetterByValue()
1994 … JSHandle<JSTaggedValue>(thread, globalConst->GetGetString())); in RuntimeDefineGetterSetterByValue()
2000 …JSHandle<JSTaggedValue>::Cast(base::NumberHelper::NumberToString(thread, propKey.GetTaggedValue())… in RuntimeDefineGetterSetterByValue()
2002 JSFunctionBase::SetFunctionName(thread, JSHandle<JSFunctionBase>::Cast(setter), propKey, in RuntimeDefineGetterSetterByValue()
2003 … JSHandle<JSTaggedValue>(thread, globalConst->GetSetString())); in RuntimeDefineGetterSetterByValue()
2010 PropertyDescriptor desc(thread, true, enumerable, true); in RuntimeDefineGetterSetterByValue()
2021 JSObject::DefineOwnProperty(thread, obj, propKey, desc); in RuntimeDefineGetterSetterByValue()
2026 JSTaggedValue RuntimeStubs::RuntimeSuperCall(JSThread *thread, const JSHandle<JSTaggedValue> &func, in RuntimeSuperCall() argument
2030 JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func)); in RuntimeSuperCall()
2033 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeSuperCall()
2035 FrameHandler frameHandler(thread); in RuntimeSuperCall()
2037 argv->Set(thread, i, frameHandler.GetVRegValue(firstVRegIdx + i)); in RuntimeSuperCall()
2040 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeSuperCall()
2041 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newT… in RuntimeSuperCall()
2042 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCall()
2045 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeSuperCall()
2050 JSTaggedValue RuntimeStubs::RuntimeOptSuperCall(JSThread *thread, uintptr_t argv, uint32_t argc) in RuntimeOptSuperCall() argument
2055 JSHandle<JSTaggedValue> superFunc(thread, JSTaggedValue::GetPrototype(thread, func)); in RuntimeOptSuperCall()
2058 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptSuperCall()
2059 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, superFunc, undefined, newT… in RuntimeOptSuperCall()
2060 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCall()
2066 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuperCall()
2071 JSTaggedValue RuntimeStubs::RuntimeThrowTypeError(JSThread *thread, const char *message) in RuntimeThrowTypeError() argument
2073 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeThrowTypeError()
2074 THROW_TYPE_ERROR_AND_RETURN(thread, message, JSTaggedValue::Exception()); in RuntimeThrowTypeError()
2077 JSTaggedValue RuntimeStubs::RuntimeGetCallSpreadArgs(JSThread *thread, const JSHandle<JSTaggedValue… in RuntimeGetCallSpreadArgs() argument
2081 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeGetCallSpreadArgs()
2083 JSHandle<JSTaggedValue> itor = JSIterator::GetIterator(thread, jsArray); in RuntimeGetCallSpreadArgs()
2084 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2085 JSMutableHandle<JSTaggedValue> next(thread, JSTaggedValue::Undefined()); in RuntimeGetCallSpreadArgs()
2086 JSMutableHandle<JSTaggedValue> nextArg(thread, JSTaggedValue::Undefined()); in RuntimeGetCallSpreadArgs()
2089 next.Update(JSIterator::IteratorStep(thread, itor).GetTaggedValue()); in RuntimeGetCallSpreadArgs()
2090 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2094 nextArg.Update(JSIterator::IteratorValue(thread, next).GetTaggedValue()); in RuntimeGetCallSpreadArgs()
2095 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetCallSpreadArgs()
2098 argv = argv->SetCapacity(thread, argv, argvMayMaxLength); in RuntimeGetCallSpreadArgs()
2100 argv->Set(thread, argvIndex++, nextArg); in RuntimeGetCallSpreadArgs()
2106 JSTaggedValue RuntimeStubs::RuntimeThrowSyntaxError(JSThread *thread, const char *message) in RuntimeThrowSyntaxError() argument
2108 ASSERT_NO_ABRUPT_COMPLETION(thread); in RuntimeThrowSyntaxError()
2109 THROW_SYNTAX_ERROR_AND_RETURN(thread, message, JSTaggedValue::Exception()); in RuntimeThrowSyntaxError()
2112 JSTaggedValue RuntimeStubs::RuntimeLdBigInt(JSThread *thread, const JSHandle<JSTaggedValue> &number… in RuntimeLdBigInt() argument
2114 return JSTaggedValue::ToBigInt(thread, numberBigInt); in RuntimeLdBigInt()
2117 JSTaggedValue RuntimeStubs::RuntimeNewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uint16… in RuntimeNewLexicalEnvWithName() argument
2119 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeNewLexicalEnvWithName()
2122 JSTaggedValue currentLexenv = thread->GetCurrentLexenv(); in RuntimeNewLexicalEnvWithName()
2123 newEnv->SetParentEnv(thread, currentLexenv); in RuntimeNewLexicalEnvWithName()
2124 JSTaggedValue scopeInfo = ScopeInfoExtractor::GenerateScopeInfo(thread, scopeId); in RuntimeNewLexicalEnvWithName()
2125 newEnv->SetScopeInfo(thread, scopeInfo); in RuntimeNewLexicalEnvWithName()
2126 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeNewLexicalEnvWithName()
2130 JSTaggedValue RuntimeStubs::RuntimeOptGetUnmapedArgs(JSThread *thread, uint32_t actualNumArgs) in RuntimeOptGetUnmapedArgs() argument
2132 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptGetUnmapedArgs()
2135 auto argv = GetActualArgvFromStub(thread); in RuntimeOptGetUnmapedArgs()
2141 argumentsList->Set(thread, idx++, args); in RuntimeOptGetUnmapedArgs()
2143 return RuntimeGetUnmapedJSArgumentObj(thread, argumentsList); in RuntimeOptGetUnmapedArgs()
2146 JSTaggedValue RuntimeStubs::RuntimeGetUnmapedJSArgumentObj(JSThread *thread, const JSHandle<TaggedA… in RuntimeGetUnmapedJSArgumentObj() argument
2148 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeGetUnmapedJSArgumentObj()
2149 JSHandle<GlobalEnv> globalEnv = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeGetUnmapedJSArgumentObj()
2158 …obj->SetPropertyInlinedProps(thread, JSArguments::LENGTH_INLINE_PROPERTY_INDEX, JSTaggedValue(len)… in RuntimeGetUnmapedJSArgumentObj()
2164 obj->SetElements(thread, argumentsList.GetTaggedValue()); in RuntimeGetUnmapedJSArgumentObj()
2168 obj->SetPropertyInlinedProps(thread, JSArguments::ITERATOR_INLINE_PROPERTY_INDEX, in RuntimeGetUnmapedJSArgumentObj()
2173 …obj->SetPropertyInlinedProps(thread, JSArguments::CALLER_INLINE_PROPERTY_INDEX, accessorCaller.Get… in RuntimeGetUnmapedJSArgumentObj()
2177 …obj->SetPropertyInlinedProps(thread, JSArguments::CALLEE_INLINE_PROPERTY_INDEX, accessorCallee.Get… in RuntimeGetUnmapedJSArgumentObj()
2178 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeGetUnmapedJSArgumentObj()
2183 JSTaggedValue RuntimeStubs::RuntimeOptNewLexicalEnvWithName(JSThread *thread, uint16_t numVars, uin… in RuntimeOptNewLexicalEnvWithName() argument
2187 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptNewLexicalEnvWithName()
2190 newEnv->SetParentEnv(thread, currentLexEnv.GetTaggedValue()); in RuntimeOptNewLexicalEnvWithName()
2191 JSTaggedValue scopeInfo = RuntimeOptGenerateScopeInfo(thread, scopeId, func.GetTaggedValue()); in RuntimeOptNewLexicalEnvWithName()
2192 newEnv->SetScopeInfo(thread, scopeInfo); in RuntimeOptNewLexicalEnvWithName()
2193 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptNewLexicalEnvWithName()
2198 JSTaggedValue RuntimeStubs::RuntimeOptCopyRestArgs(JSThread *thread, uint32_t actualArgc, uint32_t … in RuntimeOptCopyRestArgs() argument
2205 JSHandle<JSTaggedValue> restArray = JSArray::ArrayCreate(thread, JSTaggedNumber(actualRestNum)); in RuntimeOptCopyRestArgs()
2207 auto argv = GetActualArgv(thread); in RuntimeOptCopyRestArgs()
2209 JSMutableHandle<JSTaggedValue> element(thread, JSTaggedValue::Undefined()); in RuntimeOptCopyRestArgs()
2215 JSObject::SetProperty(thread, restArray, idx++, element, true); in RuntimeOptCopyRestArgs()
2217 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptCopyRestArgs()
2221 JSTaggedValue RuntimeStubs::RuntimeOptSuspendGenerator(JSThread *thread, const JSHandle<JSTaggedVal… in RuntimeOptSuspendGenerator() argument
2229 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2232 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2239 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2242 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptSuspendGenerator()
2245 return RuntimeThrowTypeError(thread, "RuntimeSuspendGenerator failed"); in RuntimeOptSuspendGenerator()
2249 JSTaggedValue RuntimeStubs::RuntimeOptConstruct(JSThread *thread, JSHandle<JSTaggedValue> ctor, in RuntimeOptConstruct() argument
2258 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception()); in RuntimeOptConstruct()
2262 …return RuntimeOptConstructGeneric(thread, JSHandle<JSFunction>::Cast(ctor), newTarget, preArgs, ar… in RuntimeOptConstruct()
2266 thread, JSHandle<JSBoundFunction>::Cast(ctor), newTarget, preArgs, args); in RuntimeOptConstruct()
2269 … return RuntimeOptConstructProxy(thread, JSHandle<JSProxy>::Cast(ctor), newTarget, preArgs, args); in RuntimeOptConstruct()
2271 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor NonConstructor", JSTaggedValue::Exception()); in RuntimeOptConstruct()
2274 JSTaggedValue RuntimeStubs::RuntimeOptConstructProxy(JSThread *thread, JSHandle<JSProxy> ctor, in RuntimeOptConstructProxy() argument
2279 JSHandle<JSTaggedValue> handler(thread, ctor->GetHandler()); in RuntimeOptConstructProxy()
2281 … THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor: handler is null", JSTaggedValue::Exception()); in RuntimeOptConstructProxy()
2284 JSHandle<JSTaggedValue> target(thread, ctor->GetTarget()); in RuntimeOptConstructProxy()
2287 JSHandle<JSTaggedValue> key(thread->GlobalConstants()->GetHandledProxyConstructString()); in RuntimeOptConstructProxy()
2288 JSHandle<JSTaggedValue> method = JSObject::GetMethod(thread, handler, key); in RuntimeOptConstructProxy()
2291 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructProxy()
2297 return RuntimeOptConstruct(thread, target, newTgt, preArgs, args); in RuntimeOptConstructProxy()
2304 JSHandle<TaggedArray> arr = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(size); in RuntimeOptConstructProxy()
2309 arr->Set(thread, i, value); in RuntimeOptConstructProxy()
2315 arr->Set(thread, i + preArgsSize, value); in RuntimeOptConstructProxy()
2320 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptConstructProxy()
2321 …EcmaRuntimeCallInfo *info = EcmaInterpreter::NewRuntimeCallInfo(thread, method, handler, undefined… in RuntimeOptConstructProxy()
2322 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructProxy()
2326 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructProxy()
2329 THROW_TYPE_ERROR_AND_RETURN(thread, "new object is not object", JSTaggedValue::Exception()); in RuntimeOptConstructProxy()
2335 JSTaggedValue RuntimeStubs::RuntimeOptConstructBoundFunction(JSThread *thread, JSHandle<JSBoundFunc… in RuntimeOptConstructBoundFunction() argument
2340 JSHandle<JSTaggedValue> target(thread, ctor->GetBoundTarget()); in RuntimeOptConstructBoundFunction()
2343 JSHandle<TaggedArray> boundArgs(thread, ctor->GetBoundArguments()); in RuntimeOptConstructBoundFunction()
2344 JSMutableHandle<JSTaggedValue> newPreArgs(thread, preArgs.GetTaggedValue()); in RuntimeOptConstructBoundFunction()
2349 … TaggedArray::Append(thread, boundArgs, JSHandle<TaggedArray>::Cast(preArgs)).GetTaggedValue()); in RuntimeOptConstructBoundFunction()
2351 JSMutableHandle<JSTaggedValue> newTargetMutable(thread, newTgt.GetTaggedValue()); in RuntimeOptConstructBoundFunction()
2355 return RuntimeOptConstruct(thread, target, newTargetMutable, newPreArgs, args); in RuntimeOptConstructBoundFunction()
2358 JSTaggedValue RuntimeStubs::RuntimeOptConstructGeneric(JSThread *thread, JSHandle<JSFunction> ctor, in RuntimeOptConstructGeneric() argument
2363 THROW_TYPE_ERROR_AND_RETURN(thread, "Constructor is false", JSTaggedValue::Exception()); in RuntimeOptConstructGeneric()
2366 JSHandle<JSTaggedValue> obj(thread, JSTaggedValue::Undefined()); in RuntimeOptConstructGeneric()
2368 ObjectFactory *factory = thread->GetEcmaVM()->GetFactory(); in RuntimeOptConstructGeneric()
2403 const JSTaggedType *prevFp = thread->GetLastLeaveFrame(); in RuntimeOptConstructGeneric()
2405 …thread->GetEcmaVM()->ExecuteAot(size, values.data(), prevFp, OptimizedEntryFrame::CallType::CALL_N… in RuntimeOptConstructGeneric()
2408 … EcmaInterpreter::NewRuntimeCallInfo(thread, JSHandle<JSTaggedValue>(ctor), obj, newTgt, size); in RuntimeOptConstructGeneric()
2409 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructGeneric()
2413 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptConstructGeneric()
2423 … THROW_TYPE_ERROR_AND_RETURN(thread, "function is non-constructor", JSTaggedValue::Exception()); in RuntimeOptConstructGeneric()
2428 JSTaggedValue RuntimeStubs::RuntimeOptNewObjRange(JSThread *thread, uintptr_t argv, uint32_t argc) in RuntimeOptNewObjRange() argument
2431 JSHandle<JSTaggedValue> undefined = thread->GlobalConstants()->GetHandledUndefined(); in RuntimeOptNewObjRange()
2434 JSHandle<TaggedArray> args = thread->GetEcmaVM()->GetFactory()->NewTaggedArray(arrLength); in RuntimeOptNewObjRange()
2436 args->Set(thread, i, GetArg(argv, argc, i + firstArgOffset)); in RuntimeOptNewObjRange()
2438 JSTaggedValue object = RuntimeOptConstruct(thread, ctor, ctor, undefined, args); in RuntimeOptNewObjRange()
2439 RETURN_EXCEPTION_IF_ABRUPT_COMPLETION(thread); in RuntimeOptNewObjRange()
2441 THROW_TYPE_ERROR_AND_RETURN(thread, "Derived constructor must return object or undefined", in RuntimeOptNewObjRange()
2447 JSTaggedValue RuntimeStubs::RuntimeOptGenerateScopeInfo(JSThread *thread, uint16_t scopeId, JSTagge… in RuntimeOptGenerateScopeInfo() argument
2449 EcmaVM *ecmaVm = thread->GetEcmaVM(); in RuntimeOptGenerateScopeInfo()
2453 JSHandle<ConstantPool> constpool(thread, method->GetConstantPool()); in RuntimeOptGenerateScopeInfo()
2460 LiteralDataExtractor::GetDatasIgnoreType(thread, jsPandaFile, id, constpool); in RuntimeOptGenerateScopeInfo()
2484 JSTaggedType *RuntimeStubs::GetActualArgv(JSThread *thread) in GetActualArgv() argument
2486 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetActualArgv()
2487 FrameIterator it(current, thread); in GetActualArgv()
2495 JSTaggedType *RuntimeStubs::GetActualArgvFromStub(JSThread *thread) in GetActualArgvFromStub() argument
2497 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetActualArgvFromStub()
2498 FrameIterator it(current, thread); in GetActualArgvFromStub()
2508 OptimizedJSFunctionFrame *RuntimeStubs::GetOptimizedJSFunctionFrame(JSThread *thread) in GetOptimizedJSFunctionFrame() argument
2510 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetOptimizedJSFunctionFrame()
2511 FrameIterator it(current, thread); in GetOptimizedJSFunctionFrame()
2518 OptimizedJSFunctionFrame *RuntimeStubs::GetOptimizedJSFunctionFrameNoGC(JSThread *thread) in GetOptimizedJSFunctionFrameNoGC() argument
2520 JSTaggedType *current = const_cast<JSTaggedType *>(thread->GetLastLeaveFrame()); in GetOptimizedJSFunctionFrameNoGC()
2521 FrameIterator it(current, thread); in GetOptimizedJSFunctionFrameNoGC()
2528 JSTaggedValue RuntimeStubs::RuntimeLdPatchVar(JSThread *thread, uint32_t index) in RuntimeLdPatchVar() argument
2531 JSHandle<TaggedArray>::Cast(thread->GetEcmaVM()->GetGlobalEnv()->GetGlobalPatch()); in RuntimeLdPatchVar()
2533 return globalPatch->Get(thread, index); in RuntimeLdPatchVar()
2536 JSTaggedValue RuntimeStubs::RuntimeStPatchVar(JSThread *thread, uint32_t index, const JSHandle<JSTa… in RuntimeStPatchVar() argument
2538 JSHandle<GlobalEnv> env = thread->GetEcmaVM()->GetGlobalEnv(); in RuntimeStPatchVar()
2542 globalPatch = TaggedArray::SetCapacity(thread, globalPatch, index + 1); in RuntimeStPatchVar()
2544 globalPatch->Set(thread, index, value); in RuntimeStPatchVar()
2545 env->SetGlobalPatch(thread, globalPatch.GetTaggedValue()); in RuntimeStPatchVar()
2549 JSTaggedValue RuntimeStubs::RuntimeNotifyConcurrentResult(JSThread *thread, JSTaggedValue result, J… in RuntimeNotifyConcurrentResult() argument
2551 thread->GetEcmaVM()->TriggerConcurrentCallback(result, hint); in RuntimeNotifyConcurrentResult()