Lines Matching full:vm
152 Local<PrimitiveRef> JSValueRef::Undefined(const EcmaVM *vm) in Undefined() argument
155 vm->GetJSThread()->GlobalConstants()->GetHandledUndefined()); in Undefined()
158 Local<PrimitiveRef> JSValueRef::Null(const EcmaVM *vm) in Null() argument
161 vm->GetJSThread()->GlobalConstants()->GetHandledNull()); in Null()
164 Local<PrimitiveRef> JSValueRef::Hole(const EcmaVM *vm) in Hole() argument
167 vm->GetJSThread()->GlobalConstants()->GetHandledHole()); in Hole()
170 Local<PrimitiveRef> JSValueRef::True(const EcmaVM *vm) in True() argument
173 vm->GetJSThread()->GlobalConstants()->GetHandledTrue()); in True()
176 Local<PrimitiveRef> JSValueRef::False(const EcmaVM *vm) in False() argument
179 vm->GetJSThread()->GlobalConstants()->GetHandledFalse()); in False()
182 Local<ObjectRef> JSValueRef::ToObject(const EcmaVM *vm) in ToObject() argument
184 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in ToObject()
186 return Undefined(vm); in ToObject()
188 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ToObject()
191 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in ToObject()
195 Local<ObjectRef> JSValueRef::ToEcmaObject(const EcmaVM *vm) in ToEcmaObject() argument
197 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in ToEcmaObject()
198 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ToEcmaObject()
202 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in ToEcmaObject()
206 return Undefined(vm); in ToEcmaObject()
209 Local<StringRef> JSValueRef::ToString(const EcmaVM *vm) in ToString() argument
211 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in ToString()
212 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ToString()
217 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in ToString()
222 Local<NativePointerRef> JSValueRef::ToNativePointer(const EcmaVM *vm) in ToNativePointer() argument
224 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in ToNativePointer()
225 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ToNativePointer()
232 bool JSValueRef::BooleaValue(const EcmaVM *vm) in BooleaValue() argument
234 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in BooleaValue()
238 int64_t JSValueRef::IntegerValue(const EcmaVM *vm) in IntegerValue() argument
240 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in IntegerValue()
241 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IntegerValue()
256 uint32_t JSValueRef::Uint32Value(const EcmaVM *vm) in Uint32Value() argument
258 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in Uint32Value()
259 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Uint32Value()
272 int32_t JSValueRef::Int32Value(const EcmaVM *vm) in Int32Value() argument
274 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in Int32Value()
275 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Int32Value()
358 Local<BooleanRef> JSValueRef::ToBoolean(const EcmaVM *vm) in ToBoolean() argument
360 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in ToBoolean()
361 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ToBoolean()
368 Local<BigIntRef> JSValueRef::ToBigInt(const EcmaVM *vm) in ToBigInt() argument
370 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in ToBigInt()
371 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ToBigInt()
375 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in ToBigInt()
379 Local<NumberRef> JSValueRef::ToNumber(const EcmaVM *vm) in ToNumber() argument
381 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in ToNumber()
382 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ToNumber()
386 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in ToNumber()
390 bool JSValueRef::IsStrictEquals(const EcmaVM *vm, Local<JSValueRef> value) in IsStrictEquals() argument
392 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in IsStrictEquals()
393 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsStrictEquals()
400 Local<StringRef> JSValueRef::Typeof(const EcmaVM *vm) in Typeof() argument
402 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Typeof()
403 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Typeof()
408 bool JSValueRef::InstanceOf(const EcmaVM *vm, Local<JSValueRef> value) in InstanceOf() argument
410 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in InstanceOf()
411 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in InstanceOf()
450 bool JSValueRef::IsBigInt(const EcmaVM *vm) in IsBigInt() argument
452 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsBigInt()
471 bool JSValueRef::IsString(const EcmaVM *vm) in IsString() argument
473 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsString()
477 bool JSValueRef::IsSymbol(const EcmaVM *vm) in IsSymbol() argument
479 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSymbol()
483 bool JSValueRef::IsObject(const EcmaVM *vm) in IsObject() argument
485 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsObject()
489 bool JSValueRef::IsArray(const EcmaVM *vm) in IsArray() argument
491 CROSS_THREAD_CHECK(vm); in IsArray()
492 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsArray()
496 bool JSValueRef::IsJSArray(const EcmaVM *vm) in IsJSArray() argument
498 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSArray()
502 bool JSValueRef::IsConstructor(const EcmaVM *vm) in IsConstructor() argument
504 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsConstructor()
509 bool JSValueRef::IsFunction(const EcmaVM *vm) in IsFunction() argument
511 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsFunction()
516 bool JSValueRef::IsJSFunction(const EcmaVM *vm) in IsJSFunction() argument
518 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSFunction()
523 bool JSValueRef::IsProxy(const EcmaVM *vm) in IsProxy() argument
525 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsProxy()
529 bool JSValueRef::IsPromise(const EcmaVM *vm) in IsPromise() argument
531 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsPromise()
535 bool JSValueRef::IsDataView(const EcmaVM *vm) in IsDataView() argument
537 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsDataView()
541 bool JSValueRef::IsTypedArray(const EcmaVM *vm) in IsTypedArray() argument
543 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsTypedArray()
547 bool JSValueRef::IsNativePointer(const EcmaVM *vm) in IsNativePointer() argument
549 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsNativePointer()
553 bool JSValueRef::IsDate(const EcmaVM *vm) in IsDate() argument
555 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsDate()
559 bool JSValueRef::IsError(const EcmaVM *vm) in IsError() argument
561 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsError()
565 bool JSValueRef::IsMap(const EcmaVM *vm) in IsMap() argument
567 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsMap()
571 bool JSValueRef::IsSet(const EcmaVM *vm) in IsSet() argument
573 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSet()
577 bool JSValueRef::IsWeakRef(const EcmaVM *vm) in IsWeakRef() argument
579 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsWeakRef()
583 bool JSValueRef::IsWeakMap(const EcmaVM *vm) in IsWeakMap() argument
585 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsWeakMap()
589 bool JSValueRef::IsWeakSet(const EcmaVM *vm) in IsWeakSet() argument
591 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsWeakSet()
595 bool JSValueRef::IsRegExp(const EcmaVM *vm) in IsRegExp() argument
597 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsRegExp()
601 bool JSValueRef::IsArrayIterator(const EcmaVM *vm) in IsArrayIterator() argument
603 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsArrayIterator()
607 bool JSValueRef::IsStringIterator(const EcmaVM *vm) in IsStringIterator() argument
609 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsStringIterator()
613 bool JSValueRef::IsSetIterator(const EcmaVM *vm) in IsSetIterator() argument
615 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSetIterator()
619 bool JSValueRef::IsMapIterator(const EcmaVM *vm) in IsMapIterator() argument
621 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsMapIterator()
625 bool JSValueRef::IsArrayBuffer(const EcmaVM *vm) in IsArrayBuffer() argument
627 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsArrayBuffer()
631 bool JSValueRef::IsBuffer(const EcmaVM *vm) in IsBuffer() argument
633 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsBuffer()
637 bool JSValueRef::IsUint8Array(const EcmaVM *vm) in IsUint8Array() argument
639 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsUint8Array()
643 bool JSValueRef::IsInt8Array(const EcmaVM *vm) in IsInt8Array() argument
645 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsInt8Array()
649 bool JSValueRef::IsUint8ClampedArray(const EcmaVM *vm) in IsUint8ClampedArray() argument
651 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsUint8ClampedArray()
655 bool JSValueRef::IsInt16Array(const EcmaVM *vm) in IsInt16Array() argument
657 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsInt16Array()
661 bool JSValueRef::IsUint16Array(const EcmaVM *vm) in IsUint16Array() argument
663 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsUint16Array()
667 bool JSValueRef::IsInt32Array(const EcmaVM *vm) in IsInt32Array() argument
669 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsInt32Array()
673 bool JSValueRef::IsUint32Array(const EcmaVM *vm) in IsUint32Array() argument
675 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsUint32Array()
679 bool JSValueRef::IsFloat32Array(const EcmaVM *vm) in IsFloat32Array() argument
681 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsFloat32Array()
685 bool JSValueRef::IsFloat64Array(const EcmaVM *vm) in IsFloat64Array() argument
687 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsFloat64Array()
691 bool JSValueRef::IsBigInt64Array(const EcmaVM *vm) in IsBigInt64Array() argument
693 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsBigInt64Array()
697 bool JSValueRef::IsBigUint64Array(const EcmaVM *vm) in IsBigUint64Array() argument
699 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsBigUint64Array()
703 bool JSValueRef::IsJSSharedInt8Array(const EcmaVM *vm) in IsJSSharedInt8Array() argument
705 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSSharedInt8Array()
709 bool JSValueRef::IsJSSharedUint8Array([[maybe_unused]]const EcmaVM *vm) in IsJSSharedUint8Array() argument
711 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSSharedUint8Array()
715 bool JSValueRef::IsJSSharedUint8ClampedArray([[maybe_unused]]const EcmaVM *vm) in IsJSSharedUint8ClampedArray() argument
717 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSSharedUint8ClampedArray()
721 bool JSValueRef::IsJSSharedInt16Array(const EcmaVM *vm) in IsJSSharedInt16Array() argument
723 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSSharedInt16Array()
727 bool JSValueRef::IsJSSharedUint16Array(const EcmaVM *vm) in IsJSSharedUint16Array() argument
729 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSSharedUint16Array()
733 bool JSValueRef::IsJSSharedInt32Array(const EcmaVM *vm) in IsJSSharedInt32Array() argument
735 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSSharedInt32Array()
739 bool JSValueRef::IsJSSharedFloat32Array(const EcmaVM *vm) in IsJSSharedFloat32Array() argument
741 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSSharedFloat32Array()
745 bool JSValueRef::IsJSSharedUint32Array(const EcmaVM *vm) in IsJSSharedUint32Array() argument
747 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSSharedUint32Array()
751 bool JSValueRef::IsJSPrimitiveRef(const EcmaVM *vm) in IsJSPrimitiveRef() argument
753 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSPrimitiveRef()
757 bool JSValueRef::IsJSPrimitiveNumber(const EcmaVM *vm) in IsJSPrimitiveNumber() argument
759 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSPrimitiveNumber()
765 bool JSValueRef::IsJSPrimitiveInt(const EcmaVM *vm) in IsJSPrimitiveInt() argument
767 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSPrimitiveInt()
773 bool JSValueRef::IsJSPrimitiveBoolean(const EcmaVM *vm) in IsJSPrimitiveBoolean() argument
775 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSPrimitiveBoolean()
781 bool JSValueRef::IsJSPrimitiveString(const EcmaVM *vm) in IsJSPrimitiveString() argument
783 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSPrimitiveString()
789 bool JSValueRef::IsJSPrimitiveSymbol(const EcmaVM *vm) in IsJSPrimitiveSymbol() argument
791 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSPrimitiveSymbol()
797 bool JSValueRef::IsGeneratorObject(const EcmaVM *vm) in IsGeneratorObject() argument
799 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsGeneratorObject()
803 bool JSValueRef::IsModuleNamespaceObject(const EcmaVM *vm) in IsModuleNamespaceObject() argument
805 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsModuleNamespaceObject()
809 bool JSValueRef::IsNativeModuleFailureInfoObject(const EcmaVM *vm) in IsNativeModuleFailureInfoObject() argument
811 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsNativeModuleFailureInfoObject()
815 bool JSValueRef::IsSharedArrayBuffer(const EcmaVM *vm) in IsSharedArrayBuffer() argument
817 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSharedArrayBuffer()
821 bool JSValueRef::IsSendableArrayBuffer(const EcmaVM *vm) in IsSendableArrayBuffer() argument
823 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSendableArrayBuffer()
827 bool JSValueRef::IsJSLocale(const EcmaVM *vm) in IsJSLocale() argument
829 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSLocale()
833 bool JSValueRef::IsJSDateTimeFormat(const EcmaVM *vm) in IsJSDateTimeFormat() argument
835 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSDateTimeFormat()
839 bool JSValueRef::IsJSRelativeTimeFormat(const EcmaVM *vm) in IsJSRelativeTimeFormat() argument
841 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSRelativeTimeFormat()
845 bool JSValueRef::IsJSIntl(const EcmaVM *vm) in IsJSIntl() argument
847 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSIntl()
851 bool JSValueRef::IsJSNumberFormat(const EcmaVM *vm) in IsJSNumberFormat() argument
853 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSNumberFormat()
857 bool JSValueRef::IsJSCollator(const EcmaVM *vm) in IsJSCollator() argument
859 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSCollator()
863 bool JSValueRef::IsJSPluralRules(const EcmaVM *vm) in IsJSPluralRules() argument
865 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSPluralRules()
869 bool JSValueRef::IsJSListFormat(const EcmaVM *vm) in IsJSListFormat() argument
871 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSListFormat()
875 bool JSValueRef::IsAsyncGeneratorObject(const EcmaVM *vm) in IsAsyncGeneratorObject() argument
877 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsAsyncGeneratorObject()
881 bool JSValueRef::IsAsyncFunction(const EcmaVM *vm) in IsAsyncFunction() argument
883 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsAsyncFunction()
887 bool JSValueRef::IsConcurrentFunction(const EcmaVM *vm) in IsConcurrentFunction() argument
889 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsConcurrentFunction()
895 bool JSValueRef::IsArgumentsObject(const EcmaVM *vm) in IsArgumentsObject() argument
897 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsArgumentsObject()
901 bool JSValueRef::IsGeneratorFunction(const EcmaVM *vm) in IsGeneratorFunction() argument
903 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsGeneratorFunction()
907 bool JSValueRef::IsAsyncGeneratorFunction(const EcmaVM *vm) in IsAsyncGeneratorFunction() argument
909 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsAsyncGeneratorFunction()
913 bool JSValueRef::IsArrayList(const EcmaVM *vm) in IsArrayList() argument
915 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsArrayList()
919 bool JSValueRef::IsDeque(const EcmaVM *vm) in IsDeque() argument
921 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsDeque()
925 bool JSValueRef::IsHashMap(const EcmaVM *vm) in IsHashMap() argument
927 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsHashMap()
931 bool JSValueRef::IsHashSet(const EcmaVM *vm) in IsHashSet() argument
933 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsHashSet()
937 bool JSValueRef::IsLightWeightMap(const EcmaVM *vm) in IsLightWeightMap() argument
939 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsLightWeightMap()
943 bool JSValueRef::IsLightWeightSet(const EcmaVM *vm) in IsLightWeightSet() argument
945 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsLightWeightSet()
949 bool JSValueRef::IsLinkedList(const EcmaVM *vm) in IsLinkedList() argument
951 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsLinkedList()
955 bool JSValueRef::IsLinkedListIterator(const EcmaVM *vm) in IsLinkedListIterator() argument
957 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsLinkedListIterator()
961 bool JSValueRef::IsList(const EcmaVM *vm) in IsList() argument
963 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsList()
967 bool JSValueRef::IsPlainArray(const EcmaVM *vm) in IsPlainArray() argument
969 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsPlainArray()
973 bool JSValueRef::IsQueue(const EcmaVM *vm) in IsQueue() argument
975 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsQueue()
979 bool JSValueRef::IsStack(const EcmaVM *vm) in IsStack() argument
981 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsStack()
985 bool JSValueRef::IsTreeMap(const EcmaVM *vm) in IsTreeMap() argument
987 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsTreeMap()
991 bool JSValueRef::IsTreeSet(const EcmaVM *vm) in IsTreeSet() argument
993 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsTreeSet()
997 bool JSValueRef::IsVector(const EcmaVM *vm) in IsVector() argument
999 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsVector()
1003 bool JSValueRef::IsBitVector(const EcmaVM *vm) in IsBitVector() argument
1005 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsBitVector()
1009 bool JSValueRef::IsSendableObject(const EcmaVM *vm) in IsSendableObject() argument
1011 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSendableObject()
1012 return IsJSShared(vm) && IsObject(vm); in IsSendableObject()
1015 bool JSValueRef::IsJSShared(const EcmaVM *vm) in IsJSShared() argument
1017 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsJSShared()
1021 bool JSValueRef::IsSharedArray(const EcmaVM *vm) in IsSharedArray() argument
1023 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSharedArray()
1027 bool JSValueRef::IsSharedTypedArray(const EcmaVM *vm) in IsSharedTypedArray() argument
1029 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSharedTypedArray()
1033 bool JSValueRef::IsSharedSet(const EcmaVM *vm) in IsSharedSet() argument
1035 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSharedSet()
1039 bool JSValueRef::IsSharedMap(const EcmaVM *vm) in IsSharedMap() argument
1041 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSharedMap()
1045 bool JSValueRef::IsSharedMapIterator(const EcmaVM *vm) in IsSharedMapIterator() argument
1047 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsSharedMapIterator()
1056 void *JSValueRef::GetNativePointerValue(const EcmaVM* vm, bool &isNativePointer) in GetNativePointerValue() argument
1058 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetNativePointerValue()
1059 if (IsJSShared(vm)) { in GetNativePointerValue()
1060 return GetNativePointerValueImpl(vm, isNativePointer); in GetNativePointerValue()
1062 return GetNativePointerValueImpl(vm, isNativePointer); in GetNativePointerValue()
1067 void *JSValueRef::GetNativePointerValueImpl(const EcmaVM* vm, bool &isNativePointer) in GetNativePointerValueImpl() argument
1069 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetNativePointerValueImpl()
1070 if (!IsNativePointer(vm)) { in GetNativePointerValueImpl()
1075 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, nullptr); in GetNativePointerValueImpl()
1080 bool JSValueRef::IsDetachedArraybuffer(const EcmaVM *vm, bool &isArrayBuffer) in IsDetachedArraybuffer() argument
1082 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsDetachedArraybuffer()
1084 if (!IsArrayBuffer(vm)) { in IsDetachedArraybuffer()
1093 void JSValueRef::DetachedArraybuffer(const EcmaVM *vm, bool &isArrayBuffer) in DetachedArraybuffer() argument
1095 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in DetachedArraybuffer()
1096 if (IsArrayBuffer(vm)) { in DetachedArraybuffer()
1101 arrayBuffer->Detach(vm->GetJSThread()); in DetachedArraybuffer()
1103 } else if (IsSendableArrayBuffer(vm)) { in DetachedArraybuffer()
1108 arrayBuffer->Detach(vm->GetJSThread()); in DetachedArraybuffer()
1115 void JSValueRef::GetDataViewInfo(const EcmaVM *vm, in GetDataViewInfo() argument
1122 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetDataViewInfo()
1123 if (!IsDataView(vm)) { in GetDataViewInfo()
1134 JSThread* thread = vm->GetJSThread(); in GetDataViewInfo()
1154 const EcmaVM *vm, Local<ArrayBufferRef> arrayBuffer, uint32_t byteOffset, uint32_t byteLength) in New() argument
1156 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
1157 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
1158 ObjectFactory *factory = vm->GetFactory(); in New()
1162 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
1180 Local<ArrayBufferRef> DataViewRef::GetArrayBuffer(const EcmaVM *vm) in GetArrayBuffer() argument
1182 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetArrayBuffer()
1183 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetArrayBuffer()
1192 Local<JSValueRef> PrimitiveRef::GetValue(const EcmaVM *vm) in GetValue() argument
1194 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValue()
1195 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetValue()
1207 Local<NumberRef> NumberRef::New(const EcmaVM *vm, double input) in New() argument
1211 CROSS_THREAD_CHECK(vm); in New()
1219 Local<NumberRef> NumberRef::New(const EcmaVM *vm, int32_t input) in New() argument
1223 CROSS_THREAD_CHECK(vm); in New()
1228 Local<NumberRef> NumberRef::New(const EcmaVM *vm, uint32_t input) in New() argument
1232 CROSS_THREAD_CHECK(vm); in New()
1237 Local<NumberRef> NumberRef::New(const EcmaVM *vm, int64_t input) in New() argument
1241 CROSS_THREAD_CHECK(vm); in New()
1254 Local<JSValueRef> MapRef::Get(const EcmaVM *vm, Local<JSValueRef> key) in Get() argument
1256 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Get()
1257 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Get()
1263 Local<JSValueRef> MapRef::Get(const EcmaVM *vm, const char *utf8) in Get() argument
1265 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Get()
1266 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Get()
1268 ObjectFactory *factory = vm->GetFactory(); in Get()
1274 void MapRef::Set(const EcmaVM *vm, Local<JSValueRef> key, Local<JSValueRef> value) in Set() argument
1276 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Set()
1277 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Set()
1282 void MapRef::Set(const EcmaVM *vm, const char *utf8, Local<JSValueRef> value) in Set() argument
1284 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Set()
1285 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Set()
1287 ObjectFactory *factory = vm->GetFactory(); in Set()
1292 bool MapRef::Has(const EcmaVM *vm, Local<JSValueRef> key) in Has() argument
1294 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Has()
1295 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Has()
1301 bool MapRef::Has(const EcmaVM *vm, const char *utf8) in Has() argument
1303 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Has()
1304 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Has()
1306 ObjectFactory *factory = vm->GetFactory(); in Has()
1312 void MapRef::Delete(const EcmaVM *vm, Local<JSValueRef> key) in Delete() argument
1314 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Delete()
1315 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Delete()
1320 void MapRef::Clear(const EcmaVM *vm) in Clear() argument
1322 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Clear()
1323 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Clear()
1328 Local<MapRef> MapRef::New(const EcmaVM *vm) in New() argument
1330 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
1331 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
1343 int32_t MapRef::GetSize(const EcmaVM *vm) in GetSize() argument
1346 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetSize()
1351 int32_t MapRef::GetTotalElements(const EcmaVM *vm) in GetTotalElements() argument
1354 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetTotalElements()
1360 Local<JSValueRef> MapRef::GetKey(const EcmaVM *vm, int entry) in GetKey() argument
1362 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetKey()
1363 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetKey()
1369 Local<JSValueRef> MapRef::GetValue(const EcmaVM *vm, int entry) in GetValue() argument
1371 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValue()
1372 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetValue()
1378 Local<MapIteratorRef> MapRef::GetEntries(const EcmaVM *vm) in GetEntries() argument
1380 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetEntries()
1381 DCHECK_SPECIAL_VALUE_WITH_RETURN(this, JSValueRef::Undefined(vm)); in GetEntries()
1382 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetEntries()
1389 Local<MapIteratorRef> MapRef::GetKeys(const EcmaVM *vm) in GetKeys() argument
1391 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetKeys()
1392 DCHECK_SPECIAL_VALUE_WITH_RETURN(this, JSValueRef::Undefined(vm)); in GetKeys()
1393 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetKeys()
1399 Local<MapIteratorRef> MapRef::GetValues(const EcmaVM *vm) in GetValues() argument
1401 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValues()
1402 DCHECK_SPECIAL_VALUE_WITH_RETURN(this, JSValueRef::Undefined(vm)); in GetValues()
1403 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetValues()
1410 Local<SendableMapRef> SendableMapRef::New(const EcmaVM *vm) in New() argument
1412 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
1414 ObjectFactory *factory = vm->GetFactory(); in New()
1415 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in New()
1428 Local<JSValueRef> SendableMapRef::Get(const EcmaVM *vm, Local<JSValueRef> key) in Get() argument
1430 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Get()
1437 Local<JSValueRef> SendableMapRef::Get(const EcmaVM *vm, const char *utf8) in Get() argument
1439 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Get()
1442 ObjectFactory *factory = vm->GetFactory(); in Get()
1448 void SendableMapRef::Set(const EcmaVM *vm, Local<JSValueRef> key, Local<JSValueRef> value) in Set() argument
1450 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Set()
1456 void SendableMapRef::Set(const EcmaVM *vm, const char *utf8, Local<JSValueRef> value) in Set() argument
1458 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Set()
1461 ObjectFactory *factory = vm->GetFactory(); in Set()
1466 bool SendableMapRef::Has(const EcmaVM *vm, Local<JSValueRef> key) in Has() argument
1468 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Has()
1475 bool SendableMapRef::Has(const EcmaVM *vm, const char *utf8) in Has() argument
1477 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Has()
1480 ObjectFactory *factory = vm->GetFactory(); in Has()
1486 void SendableMapRef::Delete(const EcmaVM *vm, Local<JSValueRef> key) in Delete() argument
1488 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Delete()
1494 void SendableMapRef::Clear(const EcmaVM *vm) in Clear() argument
1496 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Clear()
1502 uint32_t SendableMapRef::GetSize(const EcmaVM *vm) in GetSize() argument
1504 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in GetSize()
1506 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetSize()
1511 uint32_t SendableMapRef::GetTotalElements(const EcmaVM *vm) in GetTotalElements() argument
1513 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in GetTotalElements()
1515 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetTotalElements()
1521 Local<JSValueRef> SendableMapRef::GetKey(const EcmaVM *vm, int entry) in GetKey() argument
1523 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetKey()
1524 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetKey()
1531 Local<JSValueRef> SendableMapRef::GetValue(const EcmaVM *vm, int entry) in GetValue() argument
1533 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValue()
1534 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetValue()
1541 Local<SendableMapIteratorRef> SendableMapRef::GetEntries(const EcmaVM *vm) in GetEntries() argument
1543 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetEntries()
1544 DCHECK_SPECIAL_VALUE_WITH_RETURN(this, JSValueRef::Undefined(vm)); in GetEntries()
1545 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetEntries()
1552 Local<SendableMapIteratorRef> SendableMapRef::GetKeys(const EcmaVM *vm) in GetKeys() argument
1554 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetKeys()
1555 DCHECK_SPECIAL_VALUE_WITH_RETURN(this, JSValueRef::Undefined(vm)); in GetKeys()
1556 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetKeys()
1563 Local<SendableMapIteratorRef> SendableMapRef::GetValues(const EcmaVM *vm) in GetValues() argument
1565 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValues()
1566 DCHECK_SPECIAL_VALUE_WITH_RETURN(this, JSValueRef::Undefined(vm)); in GetValues()
1567 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetValues()
1575 Local<SendableSetRef> SendableSetRef::New(const EcmaVM *vm) in New() argument
1577 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
1579 ObjectFactory *factory = vm->GetFactory(); in New()
1580 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in New()
1593 uint32_t SendableSetRef::GetSize(const EcmaVM *vm) in GetSize() argument
1595 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in GetSize()
1597 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetSize()
1602 uint32_t SendableSetRef::GetTotalElements(const EcmaVM *vm) in GetTotalElements() argument
1604 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in GetTotalElements()
1606 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetTotalElements()
1612 Local<JSValueRef> SendableSetRef::GetValue(const EcmaVM *vm, int entry) in GetValue() argument
1614 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValue()
1615 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetValue()
1622 void SendableSetRef::Add(const EcmaVM *vm, Local<JSValueRef> value) in Add() argument
1624 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Add()
1639 Local<JSValueRef> MapIteratorRef::GetKind(const EcmaVM *vm) in GetKind() argument
1641 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetKind()
1642 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetKind()
1664 Local<MapIteratorRef> MapIteratorRef::New(const EcmaVM *vm, Local<MapRef> map) in New() argument
1666 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
1671 …JSMapIterator::CreateMapIterator(vm->GetJSThread(), JSHandle<JSTaggedValue>::Cast(jsMap), iterKind… in New()
1672 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
1676 ecmascript::EcmaRuntimeCallInfo *MapIteratorRef::GetEcmaRuntimeCallInfo(const EcmaVM *vm) in GetEcmaRuntimeCallInfo() argument
1678 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, nullptr); in GetEcmaRuntimeCallInfo()
1679 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetEcmaRuntimeCallInfo()
1681 JSHandle<LinkedHashMap> linkedHashMap(vm->GetJSThread(), jsMapIter->GetIteratedMap()); in GetEcmaRuntimeCallInfo()
1683 return ecmascript::EcmaInterpreter::NewRuntimeCallInfo(vm->GetJSThread(), in GetEcmaRuntimeCallInfo()
1684 JSHandle<JSTaggedValue>(vm->GetJSThread(), JSTaggedValue::Undefined()), in GetEcmaRuntimeCallInfo()
1685 JSHandle<JSTaggedValue>(vm->GetJSThread(), jsMapIter.GetTaggedValue()), in GetEcmaRuntimeCallInfo()
1686 JSHandle<JSTaggedValue>(vm->GetJSThread(), JSTaggedValue::Undefined()), size); in GetEcmaRuntimeCallInfo()
1689 Local<ArrayRef> MapIteratorRef::Next(const EcmaVM *vm, ecmascript::EcmaRuntimeCallInfo *ecmaRuntime… in Next() argument
1691 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Next()
1693 …JSHandle<JSTaggedValue> nextTagValResult(vm->GetJSThread(), JSMapIterator::Next(ecmaRuntimeCallInf… in Next()
1694 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Next()
1695 JSHandle<JSTaggedValue> iteratorVal(vm->GetJSThread(), in Next()
1696 JSIterator::IteratorValue(vm->GetJSThread(), nextTagValResult).GetTaggedValue()); in Next()
1700 Local<JSValueRef> MapIteratorRef::Next(const EcmaVM *vm) in Next() argument
1702 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Next()
1710 Local<JSValueRef> SendableMapIteratorRef::Next(const EcmaVM *vm) in Next() argument
1712 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Next()
1727 Local<JSValueRef> SetIteratorRef::GetKind(const EcmaVM *vm) in GetKind() argument
1729 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetKind()
1730 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetKind()
1752 Local<SetIteratorRef> SetIteratorRef::New(const EcmaVM *vm, Local<SetRef> set) in New() argument
1754 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
1755 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
1759 …JSSetIterator::CreateSetIterator(vm->GetJSThread(), JSHandle<JSTaggedValue>::Cast(jsSet), iterKind… in New()
1760 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
1764 ecmascript::EcmaRuntimeCallInfo *SetIteratorRef::GetEcmaRuntimeCallInfo(const EcmaVM *vm) in GetEcmaRuntimeCallInfo() argument
1766 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, nullptr); in GetEcmaRuntimeCallInfo()
1767 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetEcmaRuntimeCallInfo()
1769 JSHandle<LinkedHashSet> linkedHashSet(vm->GetJSThread(), jsSetIter->GetIteratedSet()); in GetEcmaRuntimeCallInfo()
1771 return ecmascript::EcmaInterpreter::NewRuntimeCallInfo(vm->GetJSThread(), in GetEcmaRuntimeCallInfo()
1772 JSHandle<JSTaggedValue>(vm->GetJSThread(), JSTaggedValue::Undefined()), in GetEcmaRuntimeCallInfo()
1773 JSHandle<JSTaggedValue>(vm->GetJSThread(), jsSetIter.GetTaggedValue()), in GetEcmaRuntimeCallInfo()
1774 JSHandle<JSTaggedValue>(vm->GetJSThread(), JSTaggedValue::Undefined()), size); in GetEcmaRuntimeCallInfo()
1777 Local<ArrayRef> SetIteratorRef::Next(const EcmaVM *vm, ecmascript::EcmaRuntimeCallInfo *ecmaRuntime… in Next() argument
1779 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Next()
1780 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Next()
1781 …JSHandle<JSTaggedValue> nextTagValResult(vm->GetJSThread(), JSSetIterator::Next(ecmaRuntimeCallInf… in Next()
1782 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Next()
1783 JSHandle<JSTaggedValue> iteratorVal(vm->GetJSThread(), in Next()
1784 JSIterator::IteratorValue(vm->GetJSThread(), nextTagValResult).GetTaggedValue()); in Next()
1789 Local<BufferRef> BufferRef::New(const EcmaVM *vm, int32_t length) in New() argument
1791 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
1792 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
1793 ObjectFactory *factory = vm->GetFactory(); in New()
1795 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in New()
1798 Local<StringRef> key = StringRef::NewFromUtf8(vm, "toString"); in New()
1803 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
1811 … const EcmaVM *vm, void *buffer, int32_t length, const NativePointerCallback &deleter, void *data) in New() argument
1813 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
1814 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
1815 ObjectFactory *factory = vm->GetFactory(); in New()
1818 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in New()
1821 Local<StringRef> key = StringRef::NewFromUtf8(vm, "toString"); in New()
1826 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
1833 int32_t BufferRef::ByteLength(const EcmaVM *vm) in ByteLength() argument
1836 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ByteLength()
1841 void *BufferRef::GetBuffer(const EcmaVM *vm) in GetBuffer() argument
1844 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetBuffer()
1889 Local<PromiseCapabilityRef> PromiseCapabilityRef::New(const EcmaVM *vm) in New() argument
1891 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
1892 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
1893 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in New()
1896 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
1900 Local<PromiseRef> PromiseCapabilityRef::GetPromise(const EcmaVM *vm) in GetPromise() argument
1902 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetPromise()
1909 bool PromiseCapabilityRef::Resolve(const EcmaVM *vm, uintptr_t value) in Resolve() argument
1911 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Resolve()
1912 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Resolve()
1933 bool PromiseCapabilityRef::Resolve(const EcmaVM *vm, Local<JSValueRef> value) in Resolve() argument
1935 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Resolve()
1936 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Resolve()
1957 bool PromiseCapabilityRef::Reject(const EcmaVM *vm, uintptr_t reason) in Reject() argument
1959 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Reject()
1960 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Reject()
1982 bool PromiseCapabilityRef::Reject(const EcmaVM *vm, Local<JSValueRef> reason) in Reject() argument
1984 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Reject()
1985 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Reject()
2008 Local<SymbolRef> SymbolRef::New(const EcmaVM *vm, Local<StringRef> description) in New() argument
2012 CROSS_THREAD_CHECK(vm); in New()
2013 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
2014 ObjectFactory *factory = vm->GetFactory(); in New()
2023 Local<StringRef> SymbolRef::GetDescription(const EcmaVM *vm) in GetDescription() argument
2025 CROSS_THREAD_CHECK(vm); in GetDescription()
2026 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetDescription()
2038 Local<BooleanRef> BooleanRef::New(const EcmaVM *vm, bool value) in New() argument
2042 CROSS_THREAD_CHECK(vm); in New()
2043 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
2056 Local<StringRef> StringRef::NewFromUtf8(const EcmaVM *vm, const char *utf8, int length) in NewFromUtf8() argument
2060 CROSS_THREAD_CHECK(vm); in NewFromUtf8()
2061 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewFromUtf8()
2062 ObjectFactory *factory = vm->GetFactory(); in NewFromUtf8()
2071 Local<StringRef> StringRef::NewFromUtf8WithoutStringTable(const EcmaVM *vm, const char *utf8, int l… in NewFromUtf8WithoutStringTable() argument
2074 CROSS_THREAD_CHECK(vm); in NewFromUtf8WithoutStringTable()
2075 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewFromUtf8WithoutStringTable()
2076 ObjectFactory *factory = vm->GetFactory(); in NewFromUtf8WithoutStringTable()
2086 Local<StringRef> StringRef::NewFromUtf16WithoutStringTable(const EcmaVM *vm, const char16_t *utf16,… in NewFromUtf16WithoutStringTable() argument
2090 CROSS_THREAD_CHECK(vm); in NewFromUtf16WithoutStringTable()
2091 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewFromUtf16WithoutStringTable()
2092 ObjectFactory *factory = vm->GetFactory(); in NewFromUtf16WithoutStringTable()
2102 Local<StringRef> StringRef::NewFromUtf16(const EcmaVM *vm, const char16_t *utf16, int length) in NewFromUtf16() argument
2106 CROSS_THREAD_CHECK(vm); in NewFromUtf16()
2107 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewFromUtf16()
2108 ObjectFactory *factory = vm->GetFactory(); in NewFromUtf16()
2117 std::string StringRef::ToString(const EcmaVM *vm) in ToString() argument
2120 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ToString()
2124 std::string StringRef::DebuggerToString(const EcmaVM *vm) in DebuggerToString() argument
2127 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in DebuggerToString()
2131 uint32_t StringRef::Length(const EcmaVM *vm) in Length() argument
2134 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Length()
2138 int32_t StringRef::Utf8Length(const EcmaVM *vm, bool isGetBufferSize) in Utf8Length() argument
2141 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Utf8Length()
2142 …JSHandle<EcmaString> strHandle(vm->GetJSThread(), EcmaString::Cast(JSNApiHelper::ToJSTaggedValue(t… in Utf8Length()
2143 …return EcmaStringAccessor(EcmaStringAccessor::Flatten(vm, strHandle)).GetUtf8Length(isGetBufferSiz… in Utf8Length()
2146 int StringRef::WriteUtf8(const EcmaVM *vm, char *buffer, int length, bool isWriteBuffer) in WriteUtf8() argument
2149 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in WriteUtf8()
2154 int StringRef::WriteUtf16(const EcmaVM *vm, char16_t *buffer, int length) in WriteUtf16() argument
2157 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in WriteUtf16()
2162 int StringRef::WriteLatin1(const EcmaVM *vm, char *buffer, int length) in WriteLatin1() argument
2165 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in WriteLatin1()
2170 Local<StringRef> StringRef::GetNapiWrapperString(const EcmaVM *vm) in GetNapiWrapperString() argument
2174 CROSS_THREAD_CHECK(vm); in GetNapiWrapperString()
2175 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetNapiWrapperString()
2206 Local<BigIntRef> BigIntRef::New(const EcmaVM *vm, uint64_t input) in New() argument
2210 CROSS_THREAD_CHECK(vm); in New()
2211 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
2217 Local<BigIntRef> BigIntRef::New(const EcmaVM *vm, int64_t input) in New() argument
2221 CROSS_THREAD_CHECK(vm); in New()
2222 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
2228 Local<JSValueRef> BigIntRef::CreateBigWords(const EcmaVM *vm, bool sign, uint32_t size, const uint6… in CreateBigWords() argument
2232 CROSS_THREAD_CHECK(vm); in CreateBigWords()
2233 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in CreateBigWords()
2239 void BigIntRef::BigIntToInt64(const EcmaVM *vm, int64_t *value, bool *lossless) in BigIntToInt64() argument
2243 CROSS_THREAD_CHECK(vm); in BigIntToInt64()
2244 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in BigIntToInt64()
2250 void BigIntRef::BigIntToUint64(const EcmaVM *vm, uint64_t *value, bool *lossless) in BigIntToUint64() argument
2254 CROSS_THREAD_CHECK(vm); in BigIntToUint64()
2255 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in BigIntToUint64()
2261 void BigIntRef::GetWordsArray(const EcmaVM *vm, bool* signBit, size_t wordCount, uint64_t* words) in GetWordsArray() argument
2264 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetWordsArray()
2283 uint32_t BigIntRef::GetWordsArraySize(const EcmaVM *vm) in GetWordsArraySize() argument
2286 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetWordsArraySize()
2293 LocalScope::LocalScope(const EcmaVM *vm) : thread_(vm->GetJSThread()) in LocalScope() argument
2310 LocalScope::LocalScope(const EcmaVM *vm, JSTaggedType value) : thread_(vm->GetJSThread()) in LocalScope() argument
2352 EscapeLocalScope::EscapeLocalScope(const EcmaVM *vm) : LocalScope(vm, JSTaggedValue::Undefined().Ge… in EscapeLocalScope() argument
2354 auto thread = vm->GetJSThread(); in EscapeLocalScope()
2360 Local<IntegerRef> IntegerRef::New(const EcmaVM *vm, int input) in New() argument
2364 CROSS_THREAD_CHECK(vm); in New()
2370 Local<IntegerRef> IntegerRef::NewFromUnsigned(const EcmaVM *vm, unsigned int input) in NewFromUnsigned() argument
2374 CROSS_THREAD_CHECK(vm); in NewFromUnsigned()
2388 Local<ObjectRef> ObjectRef::New(const EcmaVM *vm) in New() argument
2390 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
2391 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
2392 ObjectFactory *factory = vm->GetFactory(); in New()
2393 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in New()
2399 uintptr_t ObjectRef::NewObject(const EcmaVM *vm) in NewObject() argument
2401 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, in NewObject()
2402 (vm->GetJSThread()->GlobalConstants()->GetHandledUndefined()).GetAddress()); in NewObject()
2403 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewObject()
2404 ObjectFactory *factory = vm->GetFactory(); in NewObject()
2405 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in NewObject()
2411 Local<ObjectRef> ObjectRef::NewS(const EcmaVM *vm) in NewS() argument
2413 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewS()
2414 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewS()
2415 ObjectFactory *factory = vm->GetFactory(); in NewS()
2416 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in NewS()
2422 Local<ObjectRef> ObjectRef::NewWithProperties(const EcmaVM *vm, size_t propertyCount, in NewWithProperties() argument
2426 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewWithProperties()
2427 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewWithProperties()
2428 EscapeLocalScope scope(vm); in NewWithProperties()
2430 …auto CreateObjImpl = [vm, propertyCount, keys, attributes] (uintptr_t head) -> JSHandle<JSTaggedVa… in NewWithProperties()
2431 JSThread *thread = vm->GetJSThread(); in NewWithProperties()
2436 … JSNApiHelper::ToJSHandle(attr.GetValue(vm)), in NewWithProperties()
2441 ObjectFactory *factory = vm->GetFactory(); in NewWithProperties()
2452 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NewWithProperties()
2456 Local<ObjectRef> ObjectRef::NewSWithProperties(const EcmaVM *vm, SendablePropertiesInfo &info) in NewSWithProperties() argument
2458 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewSWithProperties()
2459 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewSWithProperties()
2460 EscapeLocalScope scope(vm); in NewSWithProperties()
2461 ObjectFactory *factory = vm->GetFactory(); in NewSWithProperties()
2465 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NewSWithProperties()
2469 Local<ObjectRef> ObjectRef::NewWithNamedProperties(const EcmaVM *vm, size_t propertyCount, in NewWithNamedProperties() argument
2472 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewWithNamedProperties()
2473 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewWithNamedProperties()
2474 EscapeLocalScope scope(vm); in NewWithNamedProperties()
2475 ObjectFactory *factory = vm->GetFactory(); in NewWithNamedProperties()
2477 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NewWithNamedProperties()
2481 Local<ObjectRef> ObjectRef::CreateNativeModuleFailureInfo(const EcmaVM *vm, const std::string &fail… in CreateNativeModuleFailureInfo() argument
2483 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in CreateNativeModuleFailureInfo()
2484 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in CreateNativeModuleFailureInfo()
2487 NativeModuleFailureInfo::CreateNativeModuleFailureInfo(vm, failureInfo); in CreateNativeModuleFailureInfo()
2490 return JSValueRef::Undefined(vm); in CreateNativeModuleFailureInfo()
2493 Local<ObjectRef> ObjectRef::CreateAccessorData(const EcmaVM *vm, in CreateAccessorData() argument
2496 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in CreateAccessorData()
2497 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in CreateAccessorData()
2506 Local<ObjectRef> ObjectRef::CreateSendableAccessorData(const EcmaVM *vm, in CreateSendableAccessorData() argument
2510 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in CreateSendableAccessorData()
2520 bool ObjectRef::ConvertToNativeBindingObject(const EcmaVM *vm, Local<NativePointerRef> value) in ConvertToNativeBindingObject() argument
2522 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in ConvertToNativeBindingObject()
2523 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ConvertToNativeBindingObject()
2524 [[maybe_unused]] LocalScope scope(vm); in ConvertToNativeBindingObject()
2527 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in ConvertToNativeBindingObject()
2530 bool result = JSTaggedValue::SetProperty(vm->GetJSThread(), object, keyValue, valueValue); in ConvertToNativeBindingObject()
2536 bool ObjectRef::Set(const EcmaVM *vm, Local<JSValueRef> key, Local<JSValueRef> value) in Set() argument
2538 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Set()
2539 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Set()
2540 [[maybe_unused]] LocalScope scope(vm); in Set()
2553 bool ObjectRef::Set(const EcmaVM *vm, const char *utf8, Local<JSValueRef> value) in Set() argument
2555 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Set()
2556 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Set()
2557 [[maybe_unused]] LocalScope scope(vm); in Set()
2560 ObjectFactory *factory = vm->GetFactory(); in Set()
2588 bool ObjectRef::Set(const EcmaVM *vm, uint32_t key, Local<JSValueRef> value) in Set() argument
2590 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Set()
2591 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Set()
2592 [[maybe_unused]] LocalScope scope(vm); in Set()
2603 bool ObjectRef::SetAccessorProperty(const EcmaVM *vm, Local<JSValueRef> key, Local<FunctionRef> get… in SetAccessorProperty() argument
2606 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in SetAccessorProperty()
2607 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetAccessorProperty()
2608 [[maybe_unused]] LocalScope scope(vm); in SetAccessorProperty()
2612 desc.SetValue(JSNApiHelper::ToJSHandle(attribute.GetValue(vm))); in SetAccessorProperty()
2621 Local<JSValueRef> ObjectRef::Get(const EcmaVM *vm, Local<JSValueRef> key) in Get() argument
2623 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Get()
2624 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Get()
2627 LocalScope scope(vm); in Get()
2633 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Get()
2638 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Get()
2645 Local<JSValueRef> ObjectRef::Get(const EcmaVM *vm, const char *utf8) in Get() argument
2647 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Get()
2648 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Get()
2651 LocalScope scope(vm); in Get()
2654 ObjectFactory *factory = vm->GetFactory(); in Get()
2658 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Get()
2663 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Get()
2670 Local<JSValueRef> ObjectRef::Get(const EcmaVM *vm, int32_t key) in Get() argument
2672 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Get()
2673 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Get()
2676 LocalScope scope(vm); in Get()
2681 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Get()
2685 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Get()
2692 bool ObjectRef::GetOwnProperty(const EcmaVM *vm, Local<JSValueRef> key, PropertyAttribute &property) in GetOwnProperty() argument
2694 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in GetOwnProperty()
2695 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetOwnProperty()
2724 Local<ArrayRef> ObjectRef::GetOwnPropertyNames(const EcmaVM *vm) in GetOwnPropertyNames() argument
2726 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetOwnPropertyNames()
2727 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetOwnPropertyNames()
2731 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in GetOwnPropertyNames()
2736 Local<ArrayRef> ObjectRef::GetAllPropertyNames(const EcmaVM *vm, uint32_t filter) in GetAllPropertyNames() argument
2740 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetAllPropertyNames()
2741 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetAllPropertyNames()
2745 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in GetAllPropertyNames()
2750 Local<ArrayRef> ObjectRef::GetOwnEnumerablePropertyNames(const EcmaVM *vm) in GetOwnEnumerablePropertyNames() argument
2752 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetOwnEnumerablePropertyNames()
2753 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetOwnEnumerablePropertyNames()
2757 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in GetOwnEnumerablePropertyNames()
2762 Local<JSValueRef> ObjectRef::GetPrototype(const EcmaVM *vm) in GetPrototype() argument
2764 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetPrototype()
2765 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetPrototype()
2769 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in GetPrototype()
2773 bool ObjectRef::SetPrototype(const EcmaVM *vm, Local<ObjectRef> prototype) in SetPrototype() argument
2775 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in SetPrototype()
2776 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetPrototype()
2782 bool ObjectRef::DefineProperty(const EcmaVM *vm, Local<JSValueRef> key, PropertyAttribute attribute) in DefineProperty() argument
2784 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in DefineProperty()
2785 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in DefineProperty()
2790 desc.SetValue(JSNApiHelper::ToJSHandle(attribute.GetValue(vm))); in DefineProperty()
2794 bool ObjectRef::Has(const EcmaVM *vm, Local<JSValueRef> key) in Has() argument
2796 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Has()
2797 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Has()
2804 bool ObjectRef::Has(const EcmaVM *vm, uint32_t key) in Has() argument
2806 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Has()
2807 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Has()
2813 bool ObjectRef::HasOwnProperty(const EcmaVM *vm, Local<JSValueRef> key) in HasOwnProperty() argument
2815 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in HasOwnProperty()
2816 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in HasOwnProperty()
2823 bool ObjectRef::Delete(const EcmaVM *vm, Local<JSValueRef> key) in Delete() argument
2825 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Delete()
2826 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Delete()
2833 bool ObjectRef::Delete(const EcmaVM *vm, uint32_t key) in Delete() argument
2835 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Delete()
2836 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Delete()
2843 Local<JSValueRef> ObjectRef::Freeze(const EcmaVM *vm) in Freeze() argument
2845 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Freeze()
2846 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Freeze()
2847 EscapeLocalScope scope(vm); in Freeze()
2852 if (JSNApi::HasPendingException(vm)) { in Freeze()
2858 Local<StringRef> message = StringRef::NewFromUtf8(vm, "Freeze: freeze failed"); in Freeze()
2859 Local<JSValueRef> error = Exception::Error(vm, message); in Freeze()
2860 JSNApi::ThrowException(vm, error); in Freeze()
2868 Local<JSValueRef> ObjectRef::Seal(const EcmaVM *vm) in Seal() argument
2870 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Seal()
2871 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Seal()
2872 EscapeLocalScope scope(vm); in Seal()
2877 if (JSNApi::HasPendingException(vm)) { in Seal()
2883 Local<StringRef> message = StringRef::NewFromUtf8(vm, "Freeze: freeze failed"); in Seal()
2884 Local<JSValueRef> error = Exception::Error(vm, message); in Seal()
2885 JSNApi::ThrowException(vm, error); in Seal()
2893 void ObjectRef::SetNativePointerFieldCount(const EcmaVM *vm, int32_t count) in SetNativePointerFieldCount() argument
2895 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in SetNativePointerFieldCount()
2896 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetNativePointerFieldCount()
2904 int32_t ObjectRef::GetNativePointerFieldCount(const EcmaVM *vm) in GetNativePointerFieldCount() argument
2909 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetNativePointerFieldCount()
2914 void *ObjectRef::GetNativePointerField(const EcmaVM *vm, int32_t index) in GetNativePointerField() argument
2919 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetNativePointerField()
2924 void ObjectRef::SetNativePointerField(const EcmaVM *vm, int32_t index, void *nativePointer, in SetNativePointerField() argument
2927 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in SetNativePointerField()
2928 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetNativePointerField()
2936 void ObjectRef::SetConcurrentNativePointerField(const EcmaVM *vm, int32_t index, void *nativePointe… in SetConcurrentNativePointerField() argument
2939 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in SetConcurrentNativePointerField()
2940 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetConcurrentNativePointerField()
2949 Local<NativePointerRef> NativePointerRef::New(const EcmaVM *vm, void *nativePointer, size_t nativeB… in New() argument
2951 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
2952 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
2953 ObjectFactory *factory = vm->GetFactory(); in New()
2960 …const EcmaVM *vm, void *nativePointer, NativePointerCallback callBack, void *data, size_t nativeBi… in New() argument
2962 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
2963 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
2964 ObjectFactory *factory = vm->GetFactory(); in New()
2971 …const EcmaVM *vm, void *nativePointer, NativePointerCallback callBack, void *data, size_t nativeBi… in NewConcurrent() argument
2973 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewConcurrent()
2975 ObjectFactory *factory = vm->GetFactory(); in NewConcurrent()
2982 …const EcmaVM *vm, void *nativePointer, NativePointerCallback callBack, void *data, size_t nativeBi… in NewSendable() argument
2984 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewSendable()
2985 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewSendable()
2986 ObjectFactory *factory = vm->GetFactory(); in NewSendable()
3000 Local<ArrayBufferRef> ArrayBufferRef::New(const EcmaVM *vm, int32_t length) in New() argument
3002 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
3003 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
3004 ObjectFactory *factory = vm->GetFactory(); in New()
3010 … const EcmaVM *vm, void *buffer, int32_t length, const NativePointerCallback &deleter, void *data) in New() argument
3012 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
3013 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
3014 ObjectFactory *factory = vm->GetFactory(); in New()
3019 int32_t ArrayBufferRef::ByteLength(const EcmaVM *vm) in ByteLength() argument
3021 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in ByteLength()
3022 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ByteLength()
3028 void *ArrayBufferRef::GetBuffer(const EcmaVM *vm) in GetBuffer() argument
3031 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetBuffer()
3040 void ArrayBufferRef::Detach(const EcmaVM *vm) in Detach() argument
3042 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Detach()
3043 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Detach()
3049 bool ArrayBufferRef::IsDetach(const EcmaVM *vm) in IsDetach() argument
3052 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsDetach()
3057 Local<SendableArrayBufferRef> SendableArrayBufferRef::New(const EcmaVM *vm, int32_t length) in New() argument
3059 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
3060 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
3061 ObjectFactory *factory = vm->GetFactory(); in New()
3067 … const EcmaVM *vm, void *buffer, int32_t length, const NativePointerCallback &deleter, void *data) in New() argument
3069 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
3070 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
3071 ObjectFactory *factory = vm->GetFactory(); in New()
3077 int32_t SendableArrayBufferRef::ByteLength(const EcmaVM *vm) in ByteLength() argument
3079 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in ByteLength()
3080 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ByteLength()
3086 void SendableArrayBufferRef::Detach(const EcmaVM *vm) in Detach() argument
3088 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Detach()
3089 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Detach()
3094 bool SendableArrayBufferRef::IsDetach(const EcmaVM *vm) in IsDetach() argument
3097 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsDetach()
3102 void *SendableArrayBufferRef::GetBuffer(const EcmaVM *vm) in GetBuffer() argument
3105 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetBuffer()
3115 Local<DateRef> DateRef::New(const EcmaVM *vm, double time) in New() argument
3117 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
3118 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
3119 ObjectFactory *factory = vm->GetFactory(); in New()
3120 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in New()
3127 Local<StringRef> DateRef::ToString(const EcmaVM *vm) in ToString() argument
3129 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in ToString()
3130 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ToString()
3142 double DateRef::GetTime(const EcmaVM *vm) in GetTime() argument
3145 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetTime()
3154 uint32_t TypedArrayRef::ByteLength(const EcmaVM *vm) in ByteLength() argument
3156 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in ByteLength()
3157 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ByteLength()
3163 uint32_t TypedArrayRef::ByteOffset(const EcmaVM *vm) in ByteOffset() argument
3165 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in ByteOffset()
3166 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ByteOffset()
3172 uint32_t TypedArrayRef::ArrayLength(const EcmaVM *vm) in ArrayLength() argument
3174 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in ArrayLength()
3175 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ArrayLength()
3181 Local<ArrayBufferRef> TypedArrayRef::GetArrayBuffer(const EcmaVM *vm) in GetArrayBuffer() argument
3183 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetArrayBuffer()
3191 uint32_t SendableTypedArrayRef::ByteLength(const EcmaVM *vm) in ByteLength() argument
3193 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in ByteLength()
3194 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ByteLength()
3200 uint32_t SendableTypedArrayRef::ByteOffset(const EcmaVM *vm) in ByteOffset() argument
3202 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in ByteOffset()
3203 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ByteOffset()
3209 uint32_t SendableTypedArrayRef::ArrayLength(const EcmaVM *vm) in ArrayLength() argument
3211 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in ArrayLength()
3212 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ArrayLength()
3218 Local<SendableArrayBufferRef> SendableTypedArrayRef::GetArrayBuffer(const EcmaVM *vm) in GetArrayBuffer() argument
3220 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetArrayBuffer()
3230 Local<FunctionRef> FunctionRef::New(EcmaVM *vm, FunctionCallback nativeFunc, in New() argument
3233 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
3234 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
3235 ObjectFactory *factory = vm->GetFactory(); in New()
3236 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in New()
3243 Local<FunctionRef> FunctionRef::NewConcurrent(EcmaVM *vm, FunctionCallback nativeFunc, in NewConcurrent() argument
3246 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewConcurrent()
3248 ObjectFactory *factory = vm->GetFactory(); in NewConcurrent()
3249 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in NewConcurrent()
3257 Local<FunctionRef> FunctionRef::New(EcmaVM *vm, InternalFunctionCallback nativeFunc, in New() argument
3260 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
3261 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
3262 ObjectFactory *factory = vm->GetFactory(); in New()
3263 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in New()
3270 Local<FunctionRef> FunctionRef::NewSendable(EcmaVM *vm, in NewSendable() argument
3277 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewSendable()
3279 ObjectFactory *factory = vm->GetFactory(); in NewSendable()
3280 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in NewSendable()
3287 Local<FunctionRef> FunctionRef::NewConcurrent(EcmaVM *vm, InternalFunctionCallback nativeFunc, in NewConcurrent() argument
3290 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewConcurrent()
3292 ObjectFactory *factory = vm->GetFactory(); in NewConcurrent()
3293 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in NewConcurrent()
3300 static void InitClassFunction(EcmaVM *vm, JSHandle<JSFunction> &func, bool callNapi) in InitClassFunction() argument
3302 CROSS_THREAD_CHECK(vm); in InitClassFunction()
3303 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in InitClassFunction()
3304 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in InitClassFunction()
3321 Local<FunctionRef> FunctionRef::NewClassFunction(EcmaVM *vm, FunctionCallback nativeFunc, in NewClassFunction() argument
3324 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewClassFunction()
3325 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewClassFunction()
3326 EscapeLocalScope scope(vm); in NewClassFunction()
3327 ObjectFactory *factory = vm->GetFactory(); in NewClassFunction()
3328 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in NewClassFunction()
3333 InitClassFunction(vm, current, callNapi); in NewClassFunction()
3339 Local<FunctionRef> FunctionRef::NewConcurrentClassFunction(EcmaVM *vm, InternalFunctionCallback nat… in NewConcurrentClassFunction() argument
3342 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewConcurrentClassFunction()
3343 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewConcurrentClassFunction()
3344 EscapeLocalScope scope(vm); in NewConcurrentClassFunction()
3345 ObjectFactory *factory = vm->GetFactory(); in NewConcurrentClassFunction()
3346 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in NewConcurrentClassFunction()
3351 InitClassFunction(vm, current, callNapi); in NewConcurrentClassFunction()
3357 Local<FunctionRef> FunctionRef::NewClassFunction(EcmaVM *vm, InternalFunctionCallback nativeFunc, in NewClassFunction() argument
3360 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewClassFunction()
3361 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NewClassFunction()
3362 EscapeLocalScope scope(vm); in NewClassFunction()
3363 ObjectFactory *factory = vm->GetFactory(); in NewClassFunction()
3364 JSHandle<GlobalEnv> env = vm->GetGlobalEnv(); in NewClassFunction()
3369 InitClassFunction(vm, current, callNapi); in NewClassFunction()
3375 Local<FunctionRef> FunctionRef::NewSendableClassFunction(const EcmaVM *vm, in NewSendableClassFunction() argument
3385 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NewSendableClassFunction()
3387 EscapeLocalScope scope(vm); in NewSendableClassFunction()
3388 ObjectFactory *factory = vm->GetFactory(); in NewSendableClassFunction()
3403 auto parentPrototype = parent->GetFunctionPrototype(vm); in NewSendableClassFunction()
3429 Local<JSValueRef> FunctionRef::Call(const EcmaVM *vm, Local<JSValueRef> thisObj, in Call() argument
3433 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Call()
3434 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Call()
3435 EscapeLocalScope scope(vm); in Call()
3436 FunctionCallScope callScope(EcmaVM::ConstCast(vm)); in Call()
3437 if (!IsFunction(vm)) { in Call()
3438 return JSValueRef::Undefined(vm); in Call()
3440 vm->GetJsDebuggerManager()->ClearSingleStepper(); in Call()
3447 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Call()
3456 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Call()
3460 vm->GetJsDebuggerManager()->NotifyReturnNative(); in Call()
3464 JSValueRef* FunctionRef::CallForNapi(const EcmaVM *vm, JSValueRef *thisObj, in CallForNapi() argument
3468 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, *JSValueRef::Hole(vm)); in CallForNapi()
3471 FunctionCallScope callScope(EcmaVM::ConstCast(vm)); in CallForNapi()
3472 ASSERT(IsFunction(vm)); // IsFunction check has been done in napi. in CallForNapi()
3474 LocalScope scope(vm); in CallForNapi()
3475 ecmascript::tooling::JsDebuggerManager *dm = vm->GetJsDebuggerManager(); in CallForNapi()
3488 RETURN_VALUE_IF_ABRUPT(thread, *JSValueRef::Hole(vm)); in CallForNapi()
3496 STACK_LIMIT_CHECK(thread, reinterpret_cast<JSValueRef *>(*JSValueRef::Hole(vm))); in CallForNapi()
3501 reinterpret_cast<JSValueRef *>(*JSValueRef::Hole(vm))); in CallForNapi()
3507 RETURN_VALUE_IF_ABRUPT(thread, *JSValueRef::Hole(vm)); in CallForNapi()
3519 Local<JSValueRef> FunctionRef::Constructor(const EcmaVM *vm, in Constructor() argument
3523 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Constructor()
3524 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Constructor()
3525 FunctionCallScope callScope(EcmaVM::ConstCast(vm)); in Constructor()
3526 if (!IsFunction(vm)) { in Constructor()
3527 return JSValueRef::Undefined(vm); in Constructor()
3535 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Constructor()
3542 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Constructor()
3547 JSValueRef* FunctionRef::ConstructorOptimize(const EcmaVM *vm, in ConstructorOptimize() argument
3551 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, *JSValueRef::Undefined(vm)); in ConstructorOptimize()
3552 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ConstructorOptimize()
3554 FunctionCallScope callScope(EcmaVM::ConstCast(vm)); in ConstructorOptimize()
3555 ASSERT(IsFunction(vm)); // IsFunction check has been done in napi. in ConstructorOptimize()
3557 LocalScope scope(vm); in ConstructorOptimize()
3563 RETURN_VALUE_IF_ABRUPT(thread, *JSValueRef::Undefined(vm)); in ConstructorOptimize()
3570 RETURN_VALUE_IF_ABRUPT(thread, *JSValueRef::Undefined(vm)); in ConstructorOptimize()
3576 Local<JSValueRef> FunctionRef::GetFunctionPrototype(const EcmaVM *vm) in GetFunctionPrototype() argument
3578 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetFunctionPrototype()
3579 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetFunctionPrototype()
3586 bool FunctionRef::Inherit(const EcmaVM *vm, Local<FunctionRef> parent) in Inherit() argument
3588 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Inherit()
3589 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Inherit()
3590 [[maybe_unused]] LocalScope scope(vm); in Inherit()
3606 void FunctionRef::SetName(const EcmaVM *vm, Local<StringRef> name) in SetName() argument
3608 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in SetName()
3609 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetName()
3610 [[maybe_unused]] LocalScope scope(vm); in SetName()
3616 Local<StringRef> FunctionRef::GetName(const EcmaVM *vm) in GetName() argument
3618 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetName()
3619 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetName()
3620 EscapeLocalScope scope(vm); in GetName()
3623 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in GetName()
3627 Local<StringRef> FunctionRef::GetSourceCode(const EcmaVM *vm, int lineNumber) in GetSourceCode() argument
3629 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetSourceCode()
3630 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetSourceCode()
3631 EscapeLocalScope scope(vm); in GetSourceCode()
3664 bool FunctionRef::IsNative(const EcmaVM *vm) in IsNative() argument
3666 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in IsNative()
3667 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in IsNative()
3673 void FunctionRef::SetData(const EcmaVM *vm, void *data, NativePointerCallback deleter, [[maybe_unus… in SetData() argument
3675 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in SetData()
3676 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetData()
3686 void* FunctionRef::GetData(const EcmaVM *vm) in GetData() argument
3688 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, nullptr); in GetData()
3689 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetData()
3701 Local<ArrayRef> ArrayRef::New(const EcmaVM *vm, uint32_t length) in New() argument
3703 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
3704 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
3707 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
3711 uint32_t ArrayRef::Length(const EcmaVM *vm) in Length() argument
3713 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in Length()
3717 Local<JSValueRef> ArrayRef::GetValueAt(const EcmaVM *vm, Local<JSValueRef> obj, uint32_t index) in GetValueAt() argument
3719 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValueAt()
3720 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetValueAt()
3726 bool ArrayRef::SetValueAt(const EcmaVM *vm, Local<JSValueRef> obj, uint32_t index, Local<JSValueRef… in SetValueAt() argument
3728 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in SetValueAt()
3729 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetValueAt()
3736 Local<SendableArrayRef> SendableArrayRef::New(const EcmaVM *vm, uint32_t length) in New() argument
3738 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
3739 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in New()
3749 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in New()
3753 uint32_t SendableArrayRef::Length(const EcmaVM *vm) in Length() argument
3755 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, 0); in Length()
3756 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in Length()
3760 Local<JSValueRef> SendableArrayRef::GetValueAt(const EcmaVM *vm, Local<JSValueRef> obj, uint32_t in… in GetValueAt() argument
3762 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValueAt()
3763 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetValueAt()
3769 bool SendableArrayRef::SetProperty(const EcmaVM *vm, Local<JSValueRef> obj, uint32_t index, Local<J… in SetProperty() argument
3771 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in SetProperty()
3772 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetProperty()
3782 …Local<JSValueRef> Exception::name(const EcmaVM *vm, Local<StringRef> message) …
3784 … CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); \
3785 … ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); \
3786 … ObjectFactory *factory = vm->GetFactory(); \
3800 FunctionCallScope::FunctionCallScope(EcmaVM *vm) : vm_(vm) in EXCEPTION_ERROR_ALL()
3816 JSExecutionScope::JSExecutionScope([[maybe_unused]] const EcmaVM *vm) in JSExecutionScope() argument
3828 JsiNativeScope::JsiNativeScope(const EcmaVM *vm) in JsiNativeScope() argument
3830 thread_ = vm->GetAssociatedJSThread(); in JsiNativeScope()
3832 if (vm->IsCollectingScopeLockStats()) { in JsiNativeScope()
3833 const_cast<EcmaVM*>(vm)->IncreaseEnterJsiNativeScopeCount(); in JsiNativeScope()
3834 const_cast<EcmaVM*>(vm)->IncreaseUpdateThreadStateTransCount(); in JsiNativeScope()
3848 JsiFastNativeScope::JsiFastNativeScope(const EcmaVM *vm) in JsiFastNativeScope() argument
3850 thread_ = vm->GetAssociatedJSThread(); in JsiFastNativeScope()
3852 if (vm->IsCollectingScopeLockStats()) { in JsiFastNativeScope()
3853 const_cast<EcmaVM*>(vm)->IncreaseEnterFastNativeScopeCount(); in JsiFastNativeScope()
3854 const_cast<EcmaVM*>(vm)->IncreaseUpdateThreadStateTransCount(); in JsiFastNativeScope()
3895 PatchErrorCode JSNApi::LoadPatch(EcmaVM *vm, const std::string &patchFileName, const std::string &b… in LoadPatch() argument
3897 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, PatchErrorCode::INTERNAL_ERROR); in LoadPatch()
3898 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in LoadPatch()
3899 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in LoadPatch()
3903 PatchErrorCode JSNApi::LoadPatch(EcmaVM *vm, in LoadPatch() argument
3907 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, PatchErrorCode::INTERNAL_ERROR); in LoadPatch()
3908 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in LoadPatch()
3909 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in LoadPatch()
3914 PatchErrorCode JSNApi::UnloadPatch(EcmaVM *vm, const std::string &patchFileName) in UnloadPatch() argument
3916 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, PatchErrorCode::INTERNAL_ERROR); in UnloadPatch()
3917 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in UnloadPatch()
3918 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in UnloadPatch()
3925 bool JSNApi::IsQuickFixCausedException(EcmaVM *vm, Local<ObjectRef> exception, const std::string &p… in IsQuickFixCausedException() argument
3930 CROSS_THREAD_CHECK(vm); in IsQuickFixCausedException()
3932 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in IsQuickFixCausedException()
3940 void JSNApi::RegisterQuickFixQueryFunc(EcmaVM *vm, std::function<bool(std::string baseFileName, in RegisterQuickFixQueryFunc() argument
3945 CROSS_THREAD_CHECK(vm); in RegisterQuickFixQueryFunc()
3946 ecmascript::QuickFixManager *quickFixManager = vm->GetQuickFixManager(); in RegisterQuickFixQueryFunc()
3950 bool JSNApi::IsBundle(EcmaVM *vm) in IsBundle() argument
3952 return vm->IsBundlePack(); in IsBundle()
3955 void JSNApi::SetBundle(EcmaVM *vm, bool value) in SetBundle() argument
3957 vm->SetIsBundlePack(value); in SetBundle()
3960 bool JSNApi::IsNormalizedOhmUrlPack(EcmaVM *vm) in IsNormalizedOhmUrlPack() argument
3962 return vm->IsNormalizedOhmUrlPack(); in IsNormalizedOhmUrlPack()
3970 void JSNApi::SetModuleInfo(EcmaVM *vm, const std::string &assetPath, const std::string &entryPoint) in SetModuleInfo() argument
3972 SetAssetPath(vm, assetPath); in SetModuleInfo()
3975 SetBundleName(vm, entryPoint.substr(0, pos)); in SetModuleInfo()
3978 SetModuleName(vm, moduleName.c_str()); in SetModuleInfo()
3984 Local<StringRef> message = StringRef::NewFromUtf8(vm, errmsg.c_str()); in SetModuleInfo()
3985 Local<JSValueRef> error = Exception::Error(vm, message); in SetModuleInfo()
3986 JSNApi::ThrowException(vm, error); in SetModuleInfo()
3990 void JSNApi::SetAssetPath(EcmaVM *vm, const std::string &assetPath) in SetAssetPath() argument
3999 vm->SetAssetPath(path); in SetAssetPath()
4002 void JSNApi::SetLoop(EcmaVM *vm, void *loop) in SetLoop() argument
4004 vm->SetLoop(loop); in SetLoop()
4007 void JSNApi::SetWeakFinalizeTaskCallback(EcmaVM *vm, const WeakFinalizeTaskCallback &callback) in SetWeakFinalizeTaskCallback() argument
4009 vm->GetAssociatedJSThread()->SetWeakFinalizeTaskCallback(callback); in SetWeakFinalizeTaskCallback()
4012 void JSNApi::SetAsyncCleanTaskCallback(EcmaVM *vm, const NativePointerTaskCallback &callback) in SetAsyncCleanTaskCallback() argument
4014 vm->GetAssociatedJSThread()->SetAsyncCleanTaskCallback(callback); in SetAsyncCleanTaskCallback()
4017 void JSNApi::SetTriggerGCTaskCallback(EcmaVM *vm, const TriggerGCTaskCallback& callback) in SetTriggerGCTaskCallback() argument
4019 vm->GetHeap()->GetIdleGCTrigger()->SetTriggerGCTaskCallback(callback); in SetTriggerGCTaskCallback()
4022 std::string JSNApi::GetAssetPath(EcmaVM *vm) in GetAssetPath() argument
4024 return vm->GetAssetPath().c_str(); in GetAssetPath()
4027 void JSNApi::SetMockModuleList(EcmaVM *vm, const std::map<std::string, std::string> &list) in SetMockModuleList() argument
4029 vm->SetMockModuleList(list); in SetMockModuleList()
4032 void JSNApi::SetHmsModuleList(EcmaVM *vm, const std::vector<panda::HmsMap> &list) in SetHmsModuleList() argument
4034 vm->SetHmsModuleList(list); in SetHmsModuleList()
4037 void JSNApi::SetPkgAliasList(EcmaVM *vm, const std::map<std::string, std::string> &list) in SetPkgAliasList() argument
4043 vm->SetPkgAliasList(pkgAliasList); in SetPkgAliasList()
4046 void JSNApi::SetPkgNameList(EcmaVM *vm, const std::map<std::string, std::string> &list) in SetPkgNameList() argument
4052 vm->SetPkgNameList(pkgNameList); in SetPkgNameList()
4054 std::string JSNApi::GetPkgName(EcmaVM *vm, const std::string &moduleName) in GetPkgName() argument
4056 return vm->GetPkgName(moduleName.c_str()).c_str(); in GetPkgName()
4059 void JSNApi::SetpkgContextInfoList(EcmaVM *vm, const std::map<std::string, in SetpkgContextInfoList() argument
4077 vm->SetpkgContextInfoList(pkgContextInfoList); in SetpkgContextInfoList()
4081 void JSNApi::SetExecuteBufferMode(const EcmaVM *vm) in SetExecuteBufferMode() argument
4084 vm->GetAssociatedJSThread()->GetCurrentEcmaContext()->GetModuleManager(); in SetExecuteBufferMode()
4088 bool JSNApi::InitForConcurrentThread(EcmaVM *vm, ConcurrentCallback cb, void *data) in InitForConcurrentThread() argument
4090 vm->SetConcurrentCallback(cb, data); in InitForConcurrentThread()
4095 bool JSNApi::InitForConcurrentFunction(EcmaVM *vm, Local<JSValueRef> function, void *taskInfo) in InitForConcurrentFunction() argument
4097 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in InitForConcurrentFunction()
4098 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in InitForConcurrentFunction()
4099 [[maybe_unused]] LocalScope scope(vm); in InitForConcurrentFunction()
4113 void* JSNApi::GetCurrentTaskInfo(const EcmaVM *vm) in GetCurrentTaskInfo() argument
4115 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, nullptr); in GetCurrentTaskInfo()
4119 void JSNApi::ClearCurrentTaskInfo(const EcmaVM *vm) in ClearCurrentTaskInfo() argument
4121 JSThread *thread = vm->GetJSThread(); in ClearCurrentTaskInfo()
4126 void JSNApi::SetBundleName(EcmaVM *vm, const std::string &bundleName) in SetBundleName() argument
4129 vm->SetBundleName(name); in SetBundleName()
4132 std::string JSNApi::GetBundleName(EcmaVM *vm) in GetBundleName() argument
4134 return vm->GetBundleName().c_str(); in GetBundleName()
4137 void JSNApi::SetModuleName(EcmaVM *vm, const std::string &moduleName) in SetModuleName() argument
4141 vm->SetModuleName(name); in SetModuleName()
4144 std::string JSNApi::GetModuleName(EcmaVM *vm) in GetModuleName() argument
4146 return vm->GetModuleName().c_str(); in GetModuleName()
4149 std::pair<std::string, std::string> JSNApi::GetCurrentModuleInfo(EcmaVM *vm, bool needRecordName) in GetCurrentModuleInfo() argument
4151 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetCurrentModuleInfo()
4152 return vm->GetCurrentModuleInfo(needRecordName); in GetCurrentModuleInfo()
4161 void JSNApi::AllowCrossThreadExecution(EcmaVM *vm) in AllowCrossThreadExecution() argument
4164 vm->GetAssociatedJSThread()->EnableCrossThreadExecution(); in AllowCrossThreadExecution()
4167 void* JSNApi::GetEnv(EcmaVM *vm) in GetEnv() argument
4169 JSThread *thread = vm->GetJSThread(); in GetEnv()
4173 void JSNApi::SetEnv(EcmaVM *vm, void *env) in SetEnv() argument
4175 JSThread *thread = vm->GetJSThread(); in SetEnv()
4179 void JSNApi::SynchronizVMInfo(EcmaVM *vm, const EcmaVM *hostVM) in SynchronizVMInfo() argument
4181 vm->SetBundleName(hostVM->GetBundleName()); in SynchronizVMInfo()
4182 vm->SetModuleName(hostVM->GetModuleName()); in SynchronizVMInfo()
4183 vm->SetAssetPath(hostVM->GetAssetPath()); in SynchronizVMInfo()
4184 vm->SetIsBundlePack(hostVM->IsBundlePack()); in SynchronizVMInfo()
4185 vm->SetPkgNameList(hostVM->GetPkgNameList()); in SynchronizVMInfo()
4186 vm->SetPkgAliasList(hostVM->GetPkgAliasList()); in SynchronizVMInfo()
4187 vm->SetpkgContextInfoList(hostVM->GetPkgContextInfoLit()); in SynchronizVMInfo()
4190 vm->GetAssociatedJSThread()->GetCurrentEcmaContext()->GetModuleManager(); in SynchronizVMInfo()
4194 vm->SetResolveBufferCallback(hostVM->GetResolveBufferCallback()); in SynchronizVMInfo()
4197 bool JSNApi::IsProfiling(EcmaVM *vm) in IsProfiling() argument
4199 return vm->GetProfilerState(); in IsProfiling()
4202 void JSNApi::SetProfilerState(const EcmaVM *vm, bool value) in SetProfilerState() argument
4204 const_cast<EcmaVM*>(vm)->SetProfilerState(value); in SetProfilerState()
4207 void JSNApi::SetSourceMapTranslateCallback(EcmaVM *vm, SourceMapTranslateCallback callback) in SetSourceMapTranslateCallback() argument
4209 vm->SetSourceMapTranslateCallback(callback); in SetSourceMapTranslateCallback()
4212 void JSNApi::SetSourceMapCallback(EcmaVM *vm, SourceMapCallback callback) in SetSourceMapCallback() argument
4214 vm->SetSourceMapCallback(callback); in SetSourceMapCallback()
4217 void JSNApi::GetStackBeforeCallNapiSuccess([[maybe_unused]] EcmaVM *vm, in GetStackBeforeCallNapiSuccess() argument
4221 JSThread *thread = vm->GetJSThread(); in GetStackBeforeCallNapiSuccess()
4224 getStackBeforeCallNapiSuccess = vm->GetProfiler()->GetStackBeforeCallNapi(thread); in GetStackBeforeCallNapiSuccess()
4229 void JSNApi::GetStackAfterCallNapi([[maybe_unused]] EcmaVM *vm) in GetStackAfterCallNapi() argument
4232 JSThread *thread = vm->GetJSThread(); in GetStackAfterCallNapi()
4235 vm->GetProfiler()->GetStackAfterCallNapi(thread); in GetStackAfterCallNapi()
4271 EcmaContext *JSNApi::CreateJSContext(EcmaVM *vm) in CreateJSContext() argument
4273 JSThread *thread = vm->GetJSThread(); in CreateJSContext()
4278 void JSNApi::SwitchCurrentContext(EcmaVM *vm, EcmaContext *context) in SwitchCurrentContext() argument
4280 JSThread *thread = vm->GetJSThread(); in SwitchCurrentContext()
4285 void JSNApi::DestroyJSContext(EcmaVM *vm, EcmaContext *context) in DestroyJSContext() argument
4287 JSThread *thread = vm->GetJSThread(); in DestroyJSContext()
4311 void JSNApi::TriggerGC(const EcmaVM *vm, TRIGGER_GC_TYPE gcType) in TriggerGC() argument
4313 TriggerGC(vm, ecmascript::GCReason::EXTERNAL_TRIGGER, gcType); in TriggerGC()
4316 void JSNApi::TriggerGC(const EcmaVM *vm, ecmascript::GCReason reason, TRIGGER_GC_TYPE gcType) in TriggerGC() argument
4318 CROSS_THREAD_CHECK(vm); in TriggerGC()
4319 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in TriggerGC()
4320 if (thread != nullptr && vm->IsInitialized()) { in TriggerGC()
4323 vm->CollectGarbage(vm->GetHeap()->SelectGCType(), reason); in TriggerGC()
4326 vm->CollectGarbage(ecmascript::TriggerGCType::OLD_GC, reason); in TriggerGC()
4329 vm->CollectGarbage(ecmascript::TriggerGCType::FULL_GC, reason); in TriggerGC()
4337 void JSNApi::TriggerIdleGC(const EcmaVM *vm, TRIGGER_IDLE_GC_TYPE gcType) in TriggerIdleGC() argument
4339 CROSS_THREAD_CHECK(vm); in TriggerIdleGC()
4340 if (thread != nullptr && vm->IsInitialized()) { in TriggerIdleGC()
4341 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in TriggerIdleGC()
4342 vm->GetHeap()->GetIdleGCTrigger()->TryTriggerIdleGC(gcType); in TriggerIdleGC()
4356 void JSNApi::ThrowException(const EcmaVM *vm, Local<JSValueRef> error) in ThrowException() argument
4358 auto thread = vm->GetJSThread(); in ThrowException()
4367 void JSNApi::PrintExceptionInfo(const EcmaVM *vm) in PrintExceptionInfo() argument
4369 JSThread* thread = vm->GetJSThread(); in PrintExceptionInfo()
4373 if (!HasPendingException(vm)) { in PrintExceptionInfo()
4376 Local<ObjectRef> exception = GetAndClearUncaughtException(vm); in PrintExceptionInfo()
4379 vm->PrintJSErrorInfo(exceptionHandle); in PrintExceptionInfo()
4380 ThrowException(vm, exception); in PrintExceptionInfo()
4386 ThrowException(vm, exception); in PrintExceptionInfo()
4390 bool JSNApi::StartDebuggerCheckParameters(EcmaVM *vm, const DebugOption &option, int32_t instanceId, in StartDebuggerCheckParameters() argument
4393 if (vm == nullptr) { in StartDebuggerCheckParameters()
4394 LOG_ECMA(ERROR) << "[StartDebugger] vm is nullptr"; in StartDebuggerCheckParameters()
4402 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in StartDebuggerCheckParameters()
4403 const auto &handler = vm->GetJsDebuggerManager()->GetDebugLibraryHandle(); in StartDebuggerCheckParameters()
4425 vm->GetJsDebuggerManager()->SetDebugMode(option.isDebugMode); in StartDebuggerCheckParameters()
4426 vm->GetJsDebuggerManager()->SetIsDebugApp(true); in StartDebuggerCheckParameters()
4427 vm->GetJsDebuggerManager()->SetDebugLibraryHandle(std::move(handle.Value())); in StartDebuggerCheckParameters()
4428 vm->GetJsDebuggerManager()->SetFaApp(option.isFaApp); in StartDebuggerCheckParameters()
4430 "PandaDebugger", vm, option.isDebugMode, instanceId, debuggerPostTask, option.port); in StartDebuggerCheckParameters()
4433 vm->GetJsDebuggerManager()->SetDebugMode(false); in StartDebuggerCheckParameters()
4435 vm->GetJsDebuggerManager()->SetDebugLibraryHandle(std::move(libraryHandle)); in StartDebuggerCheckParameters()
4442 bool JSNApi::StartDebugger([[maybe_unused]] EcmaVM *vm, [[maybe_unused]] const DebugOption &option, in StartDebugger() argument
4450 return StartDebuggerCheckParameters(vm, option, instanceId, debuggerPostTask); in StartDebugger()
4452 if (vm == nullptr) { in StartDebugger()
4455 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in StartDebugger()
4456 vm->GetJsDebuggerManager()->SetDebugMode(option.isDebugMode); in StartDebugger()
4457 vm->GetJsDebuggerManager()->SetFaApp(option.isFaApp); in StartDebugger()
4459 DEBUGGER_NAME, vm, option.isDebugMode, instanceId, debuggerPostTask, option.port); in StartDebugger()
4462 vm->GetJsDebuggerManager()->SetDebugMode(false); in StartDebugger()
4474 bool JSNApi::StartDebuggerForOldProcess([[maybe_unused]] EcmaVM *vm, [[maybe_unused]] const DebugOp… in StartDebuggerForOldProcess() argument
4482 if (vm == nullptr) { in StartDebuggerForOldProcess()
4483 LOG_ECMA(ERROR) << "[StartDebuggerForOldProcess] vm is nullptr"; in StartDebuggerForOldProcess()
4486 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in StartDebuggerForOldProcess()
4487 const auto &handle = vm->GetJsDebuggerManager()->GetDebugLibraryHandle(); in StartDebuggerForOldProcess()
4503 "PandaDebugger", vm, option.isDebugMode, instanceId, debuggerPostTask, option.port); in StartDebuggerForOldProcess()
4506 vm->GetJsDebuggerManager()->SetDebugMode(false); in StartDebuggerForOldProcess()
4508 vm->GetJsDebuggerManager()->SetDebugLibraryHandle(std::move(libraryHandle)); in StartDebuggerForOldProcess()
4512 if (vm == nullptr) { in StartDebuggerForOldProcess()
4513 LOG_ECMA(ERROR) << "[StartDebuggerForOldProcess] vm is nullptr"; in StartDebuggerForOldProcess()
4516 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in StartDebuggerForOldProcess()
4517 vm->GetJsDebuggerManager()->SetDebugMode(option.isDebugMode); in StartDebuggerForOldProcess()
4519 DEBUGGER_NAME, vm, option.isDebugMode, instanceId, debuggerPostTask, option.port); in StartDebuggerForOldProcess()
4522 vm->GetJsDebuggerManager()->SetDebugMode(false); in StartDebuggerForOldProcess()
4578 [[maybe_unused]] EcmaVM *vm, in NotifyDebugMode() argument
4587 if (vm == nullptr) { in NotifyDebugMode()
4588 LOG_ECMA(ERROR) << "[NotifyDebugMode] vm is nullptr"; in NotifyDebugMode()
4591 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in NotifyDebugMode()
4602 JsDebuggerManager *jsDebuggerManager = vm->GetJsDebuggerManager(); in NotifyDebugMode()
4614 ret = StartDebuggerForOldProcess(vm, option, instanceId, debuggerPostTask); in NotifyDebugMode()
4628 reinterpret_cast<StoreDebuggerInfo>(symOfStoreDebuggerInfo.Value())(tid, vm, debuggerPostTask); in NotifyDebugMode()
4640 if (!reinterpret_cast<InitializeDebuggerForSocketpair>(sym.Value())(vm)) { in NotifyDebugMode()
4655 reinterpret_cast<WaitForDebugger>(symOfWaitForDebugger.Value())(vm); in NotifyDebugMode()
4670 [[maybe_unused]] EcmaVM *vm, in StoreDebugInfo() argument
4677 if (vm == nullptr) { in StoreDebugInfo()
4678 LOG_ECMA(ERROR) << "[StoreDebugInfo] vm is nullptr"; in StoreDebugInfo()
4682 JsDebuggerManager *jsDebuggerManager = vm->GetJsDebuggerManager(); in StoreDebugInfo()
4711 reinterpret_cast<StoreDebuggerInfo>(symOfStoreDebuggerInfo.Value())(tid, vm, debuggerPostTask); in StoreDebugInfo()
4719 ret = reinterpret_cast<InitializeDebuggerForSocketpair>(sym.Value())(vm); in StoreDebugInfo()
4722 vm->GetJsDebuggerManager()->SetDebugMode(false); in StoreDebugInfo()
4732 bool JSNApi::StopDebugger([[maybe_unused]] EcmaVM *vm) in StopDebugger() argument
4737 if (vm == nullptr) { in StopDebugger()
4738 LOG_ECMA(ERROR) << "[StopDebugger] vm is nullptr"; in StopDebugger()
4741 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in StopDebugger()
4743 const auto &handle = vm->GetJsDebuggerManager()->GetDebugLibraryHandle(); in StopDebugger()
4753 reinterpret_cast<StopDebug>(sym.Value())(vm); in StopDebugger()
4755 vm->GetJsDebuggerManager()->SetDebugMode(false); in StopDebugger()
4756 uint32_t tid = vm->GetTid(); in StopDebugger()
4760 if (vm == nullptr) { in StopDebugger()
4761 LOG_ECMA(ERROR) << "[StopDebugger] vm is nullptr"; in StopDebugger()
4764 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in StopDebugger()
4766 OHOS::ArkCompiler::Toolchain::StopDebug(vm); in StopDebugger()
4767 vm->GetJsDebuggerManager()->SetDebugMode(false); in StopDebugger()
4805 bool JSNApi::IsMixedDebugEnabled([[maybe_unused]] const EcmaVM *vm) in IsMixedDebugEnabled() argument
4808 return vm->GetJsDebuggerManager()->IsMixedDebugEnabled(); in IsMixedDebugEnabled()
4814 bool JSNApi::IsDebugModeEnabled([[maybe_unused]] const EcmaVM *vm) in IsDebugModeEnabled() argument
4817 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in IsDebugModeEnabled()
4818 if (vm != nullptr && vm->GetJsDebuggerManager() != nullptr) { in IsDebugModeEnabled()
4819 return vm->GetJsDebuggerManager()->IsDebugMode(); in IsDebugModeEnabled()
4828 void JSNApi::NotifyNativeCalling([[maybe_unused]] const EcmaVM *vm, [[maybe_unused]] const void *na… in NotifyNativeCalling() argument
4831 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in NotifyNativeCalling()
4832 vm->GetJsDebuggerManager()->GetNotificationManager()->NativeCallingEvent(nativeAddress); in NotifyNativeCalling()
4838 void JSNApi::NotifyNativeReturn([[maybe_unused]] const EcmaVM *vm, [[maybe_unused]] const void *na… in NotifyNativeReturn() argument
4841 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in NotifyNativeReturn()
4842 vm->GetJsDebuggerManager()->GetNotificationManager()->NativeReturnEvent(nativeAddress); in NotifyNativeReturn()
4848 void JSNApi::NotifyLoadModule([[maybe_unused]] const EcmaVM *vm) in NotifyLoadModule() argument
4851 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in NotifyLoadModule()
4853 vm->GetJsDebuggerManager()->ClearSingleStepper(); in NotifyLoadModule()
4859 void JSNApi::NotifyUIIdle(const EcmaVM *vm, [[maybe_unused]] int idleTime) in NotifyUIIdle() argument
4861 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NotifyUIIdle()
4862 vm->GetHeap()->GetIdleGCTrigger()->NotifyVsyncIdleStart(); in NotifyUIIdle()
4865 void JSNApi::NotifyLooperIdleStart(const EcmaVM *vm, int64_t timestamp, int idleTime) in NotifyLooperIdleStart() argument
4867 if (vm->IsPostForked()) { in NotifyLooperIdleStart()
4868 vm->GetHeap()->GetIdleGCTrigger()->NotifyLooperIdleStart(timestamp, idleTime); in NotifyLooperIdleStart()
4872 void JSNApi::NotifyLooperIdleEnd(const EcmaVM *vm, int64_t timestamp) in NotifyLooperIdleEnd() argument
4874 if (vm->IsPostForked()) { in NotifyLooperIdleEnd()
4875 vm->GetHeap()->GetIdleGCTrigger()->NotifyLooperIdleEnd(timestamp); in NotifyLooperIdleEnd()
4879 bool JSNApi::IsJSMainThreadOfEcmaVM(const EcmaVM *vm) in IsJSMainThreadOfEcmaVM() argument
4881 return vm->GetJSThread()->IsMainThreadFast(); in IsJSMainThreadOfEcmaVM()
4884 void JSNApi::SetDeviceDisconnectCallback(EcmaVM *vm, DeviceDisconnectCallback cb) in SetDeviceDisconnectCallback() argument
4886 vm->SetDeviceDisconnectCallback(cb); in SetDeviceDisconnectCallback()
4902 bool JSNApi::IsSerializationTimeoutCheckEnabled(const EcmaVM *vm) in IsSerializationTimeoutCheckEnabled() argument
4904 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in IsSerializationTimeoutCheckEnabled()
4906 if (const_cast<EcmaVM *>(vm)->GetJSOptions().EnableSerializationTimeoutCheck()) { in IsSerializationTimeoutCheckEnabled()
4911 auto jsDebuggerManager = vm->GetJsDebuggerManager(); in IsSerializationTimeoutCheckEnabled()
4920 void JSNApi::GenerateTimeoutTraceIfNeeded(const EcmaVM *vm, std::chrono::system_clock::time_point &… in GenerateTimeoutTraceIfNeeded() argument
4923 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in GenerateTimeoutTraceIfNeeded()
4927 … (std::chrono::milliseconds(vm->GetJsDebuggerManager()->GetSerializationCheckThreshold())).count(); in GenerateTimeoutTraceIfNeeded()
4941 void JSNApi::LoadAotFileInternal(EcmaVM *vm, const std::string &moduleName, std::string &aotFileNam… in LoadAotFileInternal() argument
4943 if (vm->GetJSOptions().WasAOTOutputFileSet()) { in LoadAotFileInternal()
4944 aotFileName = vm->GetJSOptions().GetAOTOutputFile(); in LoadAotFileInternal()
4947 else if (vm->GetJSOptions().GetEnableAOT()) in LoadAotFileInternal()
4955 ecmascript::SearchHapPathCallBack callback = vm->GetSearchHapPathCallBack(); in LoadAotFileInternal()
4972 void JSNApi::LoadAotFile(EcmaVM *vm, const std::string &moduleName) in LoadAotFile() argument
4974 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in LoadAotFile()
4978 LoadAotFileInternal(vm, moduleName, aotFileName); in LoadAotFile()
4983 void JSNApi::LoadAotFile(EcmaVM *vm, [[maybe_unused]] const std::string &bundleName, const std::str… in LoadAotFile() argument
4986 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in LoadAotFile()
4990 LoadAotFileInternal(vm, moduleName, aotFileName); in LoadAotFile()
4995 bool JSNApi::ExecuteInContext(EcmaVM *vm, const std::string &fileName, const std::string &entry, bo… in ExecuteInContext() argument
4997 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in ExecuteInContext()
5015 bool JSNApi::ExecuteForAbsolutePath(const EcmaVM *vm, const std::string &fileName, const std::strin… in ExecuteForAbsolutePath() argument
5018 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in ExecuteForAbsolutePath()
5034 bool JSNApi::Execute(const EcmaVM *vm, const std::string &fileName, const std::string &entry, in Execute() argument
5037 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Execute()
5054 bool JSNApi::Execute(EcmaVM *vm, const uint8_t *data, int32_t size, const std::string &entry, in Execute() argument
5057 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Execute()
5072 int JSNApi::ExecuteWithSingletonPatternFlag(EcmaVM *vm, const std::string &bundleName, in ExecuteWithSingletonPatternFlag() argument
5075 …CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, ecmascript::JSPandaFileExecutor::ROUTE_INTERNAL_E… in ExecuteWithSingletonPatternFlag()
5090 bool JSNApi::IsExecuteModuleInAbcFile(EcmaVM *vm, const std::string &bundleName, in IsExecuteModuleInAbcFile() argument
5093 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in IsExecuteModuleInAbcFile()
5101 bool JSNApi::ExecuteModuleBuffer(EcmaVM *vm, const uint8_t *data, int32_t size, const std::string &… in ExecuteModuleBuffer() argument
5104 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in ExecuteModuleBuffer()
5125 bool JSNApi::ExecuteSecureWithOhmUrl(EcmaVM *vm, uint8_t *data, int32_t size, const std::string &sr… in ExecuteSecureWithOhmUrl() argument
5128 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in ExecuteSecureWithOhmUrl()
5158 bool JSNApi::ExecuteSecure(EcmaVM *vm, uint8_t *data, int32_t size, const std::string &entry, in ExecuteSecure() argument
5161 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in ExecuteSecure()
5177 bool JSNApi::ExecuteModuleBufferSecure(EcmaVM *vm, uint8_t* data, int32_t size, const std::string &… in ExecuteModuleBufferSecure() argument
5180 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in ExecuteModuleBufferSecure()
5195 void JSNApi::PreFork(EcmaVM *vm) in PreFork() argument
5197 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in PreFork()
5198 vm->PreFork(); in PreFork()
5216 void JSNApi::PostFork(EcmaVM *vm, const RuntimeOption &option) in PostFork() argument
5218 JSRuntimeOptions &jsOption = vm->GetJSOptions(); in PostFork()
5246 vm->PostFork(); in PostFork()
5265 Local<ObjectRef> JSNApi::GetUncaughtException(const EcmaVM *vm) in GetUncaughtException() argument
5267 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetUncaughtException()
5268 return JSNApiHelper::ToLocal<ObjectRef>(vm->GetEcmaUncaughtException()); in GetUncaughtException()
5271 Local<ObjectRef> JSNApi::GetAndClearUncaughtException(const EcmaVM *vm) in GetAndClearUncaughtException() argument
5273 if (!HasPendingException(vm)) { in GetAndClearUncaughtException()
5276 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetAndClearUncaughtException()
5277 return JSNApiHelper::ToLocal<ObjectRef>(vm->GetAndClearEcmaUncaughtException()); in GetAndClearUncaughtException()
5280 bool JSNApi::HasPendingException(const EcmaVM *vm) in HasPendingException() argument
5282 return vm->GetJSThread()->HasPendingException(); in HasPendingException()
5285 bool JSNApi::IsExecutingPendingJob(const EcmaVM *vm) in IsExecutingPendingJob() argument
5287 return vm->GetAssociatedJSThread()->GetCurrentEcmaContext()->IsExecutingPendingJob(); in IsExecutingPendingJob()
5290 bool JSNApi::HasPendingJob(const EcmaVM *vm) in HasPendingJob() argument
5292 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in HasPendingJob()
5293 return vm->GetAssociatedJSThread()->GetCurrentEcmaContext()->HasPendingJob(); in HasPendingJob()
5296 void JSNApi::EnableUserUncaughtErrorHandler(EcmaVM *vm) in EnableUserUncaughtErrorHandler() argument
5298 return vm->GetJSThread()->GetCurrentEcmaContext()->EnableUserUncaughtErrorHandler(); in EnableUserUncaughtErrorHandler()
5301 Local<ObjectRef> JSNApi::GetGlobalObject(const EcmaVM *vm) in GetGlobalObject() argument
5303 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetGlobalObject()
5304 JSHandle<GlobalEnv> globalEnv = vm->GetGlobalEnv(); in GetGlobalObject()
5305 JSHandle<JSTaggedValue> global(vm->GetJSThread(), globalEnv->GetGlobalObject()); in GetGlobalObject()
5309 void JSNApi::ExecutePendingJob(const EcmaVM *vm) in ExecutePendingJob() argument
5311 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in ExecutePendingJob()
5312 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in ExecutePendingJob()
5313 EcmaVM::ConstCast(vm)->GetJSThread()->GetCurrentEcmaContext()->ExecutePromisePendingJob(); in ExecutePendingJob()
5316 uintptr_t JSNApi::GetHandleAddr(const EcmaVM *vm, uintptr_t localAddress) in GetHandleAddr() argument
5321 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetHandleAddr()
5322 CROSS_THREAD_CHECK(vm); in GetHandleAddr()
5327 uintptr_t JSNApi::GetGlobalHandleAddr(const EcmaVM *vm, uintptr_t localAddress) in GetGlobalHandleAddr() argument
5332 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetGlobalHandleAddr()
5333 CROSS_THREAD_CHECK(vm); in GetGlobalHandleAddr()
5338 int JSNApi::GetStartRealTime(const EcmaVM *vm) in GetStartRealTime() argument
5340 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetStartRealTime()
5341 return vm->GetProcessStartRealtime(); in GetStartRealTime()
5344 void JSNApi::NotifyTaskBegin(const EcmaVM *vm) in NotifyTaskBegin() argument
5346 const_cast<ecmascript::Heap *>(vm->GetHeap())->NotifyRecordMemorySize(); in NotifyTaskBegin()
5349 void JSNApi::NotifyTaskFinished(const EcmaVM *vm) in NotifyTaskFinished() argument
5351 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in NotifyTaskFinished()
5352 const_cast<ecmascript::Heap *>(vm->GetHeap())->CheckAndTriggerTaskFinishedGC(); in NotifyTaskFinished()
5355 bool JSNApi::IsMultiThreadCheckEnabled(const EcmaVM *vm) in IsMultiThreadCheckEnabled() argument
5357 return vm->GetThreadCheckStatus(); in IsMultiThreadCheckEnabled()
5365 uintptr_t JSNApi::SetWeak(const EcmaVM *vm, uintptr_t localAddress) in SetWeak() argument
5370 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in SetWeak()
5371 CROSS_THREAD_CHECK(vm); in SetWeak()
5375 uintptr_t JSNApi::SetWeakCallback(const EcmaVM *vm, uintptr_t localAddress, void *ref, in SetWeakCallback() argument
5381 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in SetWeakCallback()
5382 CROSS_THREAD_CHECK(vm); in SetWeakCallback()
5386 uintptr_t JSNApi::ClearWeak(const EcmaVM *vm, uintptr_t localAddress) in ClearWeak() argument
5391 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in ClearWeak()
5397 CROSS_THREAD_CHECK(vm); in ClearWeak()
5401 bool JSNApi::IsWeak(const EcmaVM *vm, uintptr_t localAddress) in IsWeak() argument
5406 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in IsWeak()
5407 CROSS_THREAD_CHECK(vm); in IsWeak()
5411 void JSNApi::DisposeGlobalHandleAddr(const EcmaVM *vm, uintptr_t addr) in DisposeGlobalHandleAddr() argument
5417 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in DisposeGlobalHandleAddr()
5418 CROSS_THREAD_CHECK(vm); in DisposeGlobalHandleAddr()
5422 void *JSNApi::SerializeValue(const EcmaVM *vm, Local<JSValueRef> value, Local<JSValueRef> transfer, in SerializeValue() argument
5425 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, nullptr); in SerializeValue()
5426 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in SerializeValue()
5430 bool serializationTimeoutCheckEnabled = IsSerializationTimeoutCheckEnabled(vm); in SerializeValue()
5443 GenerateTimeoutTraceIfNeeded(vm, startTime, endTime, true); in SerializeValue()
5452 Local<JSValueRef> JSNApi::DeserializeValue(const EcmaVM *vm, void *recoder, void *hint) in DeserializeValue() argument
5454 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in DeserializeValue()
5455 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in DeserializeValue()
5458 bool serializationTimeoutCheckEnabled = IsSerializationTimeoutCheckEnabled(vm); in DeserializeValue()
5467 GenerateTimeoutTraceIfNeeded(vm, startTime, endTime, false); in DeserializeValue()
5479 void HostPromiseRejectionTracker(const EcmaVM *vm, in HostPromiseRejectionTracker() argument
5485 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in HostPromiseRejectionTracker()
5496 void JSNApi::SetHostPromiseRejectionTracker(EcmaVM *vm, void *cb, void* data) in SetHostPromiseRejectionTracker() argument
5498 CROSS_THREAD_CHECK(vm); in SetHostPromiseRejectionTracker()
5505 void JSNApi::SetHostResolveBufferTracker(EcmaVM *vm, in SetHostResolveBufferTracker() argument
5508 vm->SetResolveBufferCallback(cb); in SetHostResolveBufferTracker()
5511 void JSNApi::SetSearchHapPathTracker(EcmaVM *vm, in SetSearchHapPathTracker() argument
5514 vm->SetSearchHapPathCallBack(cb); in SetSearchHapPathTracker()
5527 void JSNApi::SetRequestAotCallback([[maybe_unused]] EcmaVM *vm, const std::function<int32_t in SetRequestAotCallback() argument
5533 void JSNApi::SetUnloadNativeModuleCallback(EcmaVM *vm, const std::function<bool(const std::string &… in SetUnloadNativeModuleCallback() argument
5535 vm->SetUnloadNativeModuleCallback(cb); in SetUnloadNativeModuleCallback()
5538 void JSNApi::SetNativePtrGetter(EcmaVM *vm, void* cb) in SetNativePtrGetter() argument
5540 vm->SetNativePtrGetter(reinterpret_cast<ecmascript::NativePtrGetter>(cb)); in SetNativePtrGetter()
5543 void JSNApi::SetHostEnqueueJob(const EcmaVM *vm, Local<JSValueRef> cb, QueueType queueType) in SetHostEnqueueJob() argument
5545 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in SetHostEnqueueJob()
5546 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in SetHostEnqueueJob()
5548 JSHandle<TaggedArray> array = vm->GetFactory()->EmptyArray(); in SetHostEnqueueJob()
5553 bool JSNApi::ExecuteModuleFromBuffer(EcmaVM *vm, const void *data, int32_t size, const std::string … in ExecuteModuleFromBuffer() argument
5555 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in ExecuteModuleFromBuffer()
5556 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in ExecuteModuleFromBuffer()
5568 Local<JSValueRef> JSNApi::NapiHasProperty(const EcmaVM *vm, uintptr_t nativeObj, uintptr_t key) in NapiHasProperty() argument
5570 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NapiHasProperty()
5571 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NapiHasProperty()
5572 EscapeLocalScope scope(vm); in NapiHasProperty()
5585 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiHasProperty()
5592 Local<JSValueRef> JSNApi::NapiHasOwnProperty(const EcmaVM *vm, uintptr_t nativeObj, uintptr_t key) in NapiHasOwnProperty() argument
5594 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NapiHasOwnProperty()
5595 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NapiHasOwnProperty()
5596 EscapeLocalScope scope(vm); in NapiHasOwnProperty()
5609 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiHasOwnProperty()
5616 Local<JSValueRef> JSNApi::NapiGetProperty(const EcmaVM *vm, uintptr_t nativeObj, uintptr_t key) in NapiGetProperty() argument
5618 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NapiGetProperty()
5619 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NapiGetProperty()
5620 EscapeLocalScope scope(vm); in NapiGetProperty()
5632 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiGetProperty()
5639 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiGetProperty()
5645 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiGetProperty()
5649 Local<JSValueRef> JSNApi::NapiDeleteProperty(const EcmaVM *vm, uintptr_t nativeObj, uintptr_t key) in NapiDeleteProperty() argument
5651 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NapiDeleteProperty()
5652 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NapiDeleteProperty()
5653 EscapeLocalScope scope(vm); in NapiDeleteProperty()
5673 Local<JSValueRef> JSNApi::NapiGetNamedProperty(const EcmaVM *vm, uintptr_t nativeObj, const char* u… in NapiGetNamedProperty() argument
5675 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in NapiGetNamedProperty()
5676 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in NapiGetNamedProperty()
5677 EscapeLocalScope scope(vm); in NapiGetNamedProperty()
5686 ObjectFactory *factory = vm->GetFactory(); in NapiGetNamedProperty()
5690 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiGetNamedProperty()
5698 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiGetNamedProperty()
5705 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiGetNamedProperty()
5708 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiGetNamedProperty()
5712 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in NapiGetNamedProperty()
5716 Local<JSValueRef> JSNApi::CreateLocal(const EcmaVM *vm, panda::JSValueRef src) in CreateLocal() argument
5718 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in CreateLocal()
5719 JSHandle<JSTaggedValue> handle(vm->GetJSThread(), JSNApiHelper::ToJSTaggedValue(&src)); in CreateLocal()
5723 Local<ObjectRef> JSNApi::GetExportObject(EcmaVM *vm, const std::string &file, const std::string &ke… in GetExportObject() argument
5725 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetExportObject()
5726 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetExportObject()
5728 ecmascript::CString name = vm->GetAssetPath(); in GetExportObject()
5729 if (!vm->IsBundlePack()) { in GetExportObject()
5730 ModulePathHelper::ParseAbcPathAndOhmUrl(vm, entry, name, entry); in GetExportObject()
5744 int index = ecmascript::ModuleManager::GetExportObjectIndex(vm, ecmaModule, key.c_str()); in GetExportObject()
5749 ObjectFactory *factory = vm->GetFactory(); in GetExportObject()
5757 Local<ObjectRef> JSNApi::GetExportObjectFromBuffer(EcmaVM *vm, const std::string &file, in GetExportObjectFromBuffer() argument
5760 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetExportObjectFromBuffer()
5761 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetExportObjectFromBuffer()
5765 int index = ecmascript::ModuleManager::GetExportObjectIndex(vm, ecmaModule, key.c_str()); in GetExportObjectFromBuffer()
5771 ObjectFactory *factory = vm->GetFactory(); in GetExportObjectFromBuffer()
5778 Local<ObjectRef> JSNApi::GetExportObjectFromOhmUrl(EcmaVM *vm, const std::string &ohmUrl, const std… in GetExportObjectFromOhmUrl() argument
5780 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetExportObjectFromOhmUrl()
5781 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetExportObjectFromOhmUrl()
5786 return JSValueRef::Undefined(vm); in GetExportObjectFromOhmUrl()
5790 int index = ecmascript::ModuleManager::GetExportObjectIndex(vm, ecmaModule, key.c_str()); in GetExportObjectFromOhmUrl()
5796 Local<ObjectRef> JSNApi::ExecuteNativeModule(EcmaVM *vm, const std::string &key) in ExecuteNativeModule() argument
5798 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in ExecuteNativeModule()
5799 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in ExecuteNativeModule()
5805 Local<ObjectRef> JSNApi::GetModuleNameSpaceFromFile(EcmaVM *vm, const std::string &file, const std:… in GetModuleNameSpaceFromFile() argument
5807 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetModuleNameSpaceFromFile()
5817 std::pair<std::string, std::string> moduleInfo = vm->GetCurrentModuleInfo(false); in GetModuleNameSpaceFromFile()
5820 return JSValueRef::Undefined(vm); in GetModuleNameSpaceFromFile()
5822 std::string path = std::string(vm->GetBundleName().c_str()) + PathHelper::SLASH_TAG + in GetModuleNameSpaceFromFile()
5834 Local<ObjectRef> JSNApi::GetModuleNameSpaceWithModuleInfo(EcmaVM *vm, const std::string &file, in GetModuleNameSpaceWithModuleInfo() argument
5837 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetModuleNameSpaceWithModuleInfo()
5844 return GetModuleNameSpaceFromFile(vm, fileName, module_path); in GetModuleNameSpaceWithModuleInfo()
5848 …SHandle<JSTaggedValue> nameSp = ecmascript::NapiModuleLoader::LoadModuleNameSpaceWithModuleInfo(vm, in GetModuleNameSpaceWithModuleInfo()
5854 Local<PromiseRef> PromiseRef::Catch(const EcmaVM *vm, Local<FunctionRef> handler) in Catch() argument
5856 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in Catch()
5857 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Catch()
5867 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Catch()
5871 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Catch()
5875 Local<PromiseRef> PromiseRef::Finally(const EcmaVM *vm, Local<FunctionRef> handler) in Finally() argument
5877 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Finally()
5878 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in Finally()
5888 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Finally()
5892 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Finally()
5896 Local<PromiseRef> PromiseRef::Then(const EcmaVM *vm, Local<FunctionRef> handler) in Then() argument
5898 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Then()
5899 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in Then()
5909 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Then()
5913 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Then()
5917 Local<PromiseRef> PromiseRef::Then(const EcmaVM *vm, Local<FunctionRef> onFulfilled, Local<Function… in Then() argument
5919 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in Then()
5920 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in Then()
5931 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Then()
5935 RETURN_VALUE_IF_ABRUPT(thread, JSValueRef::Undefined(vm)); in Then()
5939 Local<JSValueRef> PromiseRef::GetPromiseState(const EcmaVM *vm) in GetPromiseState() argument
5941 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetPromiseState()
5942 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetPromiseState()
5960 ObjectFactory *factory = vm->GetFactory(); in GetPromiseState()
5964 Local<JSValueRef> PromiseRef::GetPromiseResult(const EcmaVM *vm) in GetPromiseResult() argument
5966 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetPromiseResult()
5967 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetPromiseResult()
5971 …return JSNApiHelper::ToLocal<JSValueRef>(JSHandle<JSTaggedValue>(vm->GetJSThread(), promise->GetPr… in GetPromiseResult()
5974 Local<JSValueRef> ProxyRef::GetHandler(const EcmaVM *vm) in GetHandler() argument
5976 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetHandler()
5977 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetHandler()
5982 Local<JSValueRef> ProxyRef::GetTarget(const EcmaVM *vm) in GetTarget() argument
5984 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetTarget()
5985 ecmascript::ThreadManagedScope scope(vm->GetJSThread()); in GetTarget()
5998 int32_t SetRef::GetSize(const EcmaVM *vm) in GetSize() argument
6001 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetSize()
6006 int32_t SetRef::GetTotalElements(const EcmaVM *vm) in GetTotalElements() argument
6009 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetTotalElements()
6015 Local<JSValueRef> SetRef::GetValue(const EcmaVM *vm, int entry) in GetValue() argument
6017 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValue()
6024 Local<SetRef> SetRef::New(const EcmaVM *vm) in New() argument
6026 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
6028 ObjectFactory *factory = vm->GetJSThread()->GetEcmaVM()->GetFactory(); in New()
6029 JSHandle<GlobalEnv> env = vm->GetJSThread()->GetEcmaVM()->GetGlobalEnv(); in New()
6033 JSHandle<LinkedHashSet> hashSet = LinkedHashSet::Create(vm->GetJSThread()); in New()
6034 set->SetLinkedSet(vm->GetJSThread(), hashSet); in New()
6039 void SetRef::Add(const EcmaVM *vm, Local<JSValueRef> value) in Add() argument
6041 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Add()
6045 JSSet::Add(vm->GetJSThread(), set, JSNApiHelper::ToJSHandle(value)); in Add()
6049 int32_t WeakMapRef::GetSize(const EcmaVM *vm) in GetSize() argument
6052 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetSize()
6057 int32_t WeakMapRef::GetTotalElements(const EcmaVM *vm) in GetTotalElements() argument
6060 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetTotalElements()
6066 Local<JSValueRef> WeakMapRef::GetKey(const EcmaVM *vm, int entry) in GetKey() argument
6068 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetKey()
6076 Local<JSValueRef> WeakMapRef::GetValue(const EcmaVM *vm, int entry) in GetValue() argument
6078 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValue()
6084 Local<WeakMapRef> WeakMapRef::New(const EcmaVM *vm) in New() argument
6086 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
6088 ObjectFactory *factory = vm->GetJSThread()->GetEcmaVM()->GetFactory(); in New()
6089 JSHandle<GlobalEnv> env = vm->GetJSThread()->GetEcmaVM()->GetGlobalEnv(); in New()
6093 JSHandle<LinkedHashMap> hashMap = LinkedHashMap::Create(vm->GetJSThread()); in New()
6094 weakMap->SetLinkedMap(vm->GetJSThread(), hashMap); in New()
6099 void WeakMapRef::Set(const EcmaVM *vm, const Local<JSValueRef> &key, const Local<JSValueRef> &value) in Set() argument
6101 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Set()
6105 …JSWeakMap::Set(vm->GetJSThread(), weakMap, JSNApiHelper::ToJSHandle(key), JSNApiHelper::ToJSHandle… in Set()
6108 bool WeakMapRef::Has(const EcmaVM *vm, Local<JSValueRef> key) in Has() argument
6110 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, false); in Has()
6118 int32_t WeakSetRef::GetSize(const EcmaVM *vm) in GetSize() argument
6121 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetSize()
6126 int32_t WeakSetRef::GetTotalElements(const EcmaVM *vm) in GetTotalElements() argument
6129 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetTotalElements()
6135 Local<JSValueRef> WeakSetRef::GetValue(const EcmaVM *vm, int entry) in GetValue() argument
6137 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in GetValue()
6145 Local<WeakSetRef> WeakSetRef::New(const EcmaVM *vm) in New() argument
6147 CROSS_THREAD_AND_EXCEPTION_CHECK_WITH_RETURN(vm, JSValueRef::Undefined(vm)); in New()
6149 ObjectFactory *factory = vm->GetJSThread()->GetEcmaVM()->GetFactory(); in New()
6150 JSHandle<GlobalEnv> env = vm->GetJSThread()->GetEcmaVM()->GetGlobalEnv(); in New()
6154 JSHandle<LinkedHashSet> hashWeakSet = LinkedHashSet::Create(vm->GetJSThread()); in New()
6155 weakSet->SetLinkedSet(vm->GetJSThread(), hashWeakSet); in New()
6160 void WeakSetRef::Add(const EcmaVM *vm, Local<JSValueRef> value) in Add() argument
6162 CROSS_THREAD_AND_EXCEPTION_CHECK(vm); in Add()
6166 JSWeakSet::Add(vm->GetJSThread(), weakSet, JSNApiHelper::ToJSHandle(value)); in Add()
6198 bool ExternalStringCache::RegisterStringCacheTable(const EcmaVM *vm, uint32_t size) in RegisterStringCacheTable() argument
6203 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in RegisterStringCacheTable()
6207 bool ExternalStringCache::SetCachedString(const EcmaVM *vm, const char *name, uint32_t propertyInde… in SetCachedString() argument
6212 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in SetCachedString()
6213 [[maybe_unused]] LocalScope scope(vm); in SetCachedString()
6214 ObjectFactory *factory = vm->GetFactory(); in SetCachedString()
6219 Local<StringRef> ExternalStringCache::GetCachedString(const EcmaVM *vm, uint32_t propertyIndex) in GetCachedString() argument
6224 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in GetCachedString()
6225 JSHandle<EcmaString> str = instance->GetCachedString(vm->GetJSThread(), propertyIndex); in GetCachedString()
6229 bool ExternalStringCache::HasCachedString([[maybe_unused]] const EcmaVM *vm, uint32_t propertyIndex) in HasCachedString() argument
6233 ecmascript::ThreadManagedScope managedScope(vm->GetJSThread()); in HasCachedString()