Lines Matching full:func
29 void JSFunction::InitializeJSFunctionCommon(JSThread *thread, const JSHandle<JSFunction> &func, Fun… in InitializeJSFunctionCommon() argument
36 … func->SetPropertyInlinedProps(thread, PROTOTYPE_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue()); in InitializeJSFunctionCommon()
38 … func->SetPropertyInlinedProps(thread, NAME_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue()); in InitializeJSFunctionCommon()
40 … func->SetPropertyInlinedProps(thread, LENGTH_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue()); in InitializeJSFunctionCommon()
48 func->SetProtoOrHClass(thread, initialGeneratorFuncPrototype); in InitializeJSFunctionCommon()
57 func->SetProtoOrHClass(thread, initialGeneratorFuncPrototype); in InitializeJSFunctionCommon()
62 …thread, JSHandle<JSObject>(func), globalConst->GetHandledPrototypeString(), desc, SCheckMode::SKIP… in InitializeJSFunctionCommon()
67 … func->SetPropertyInlinedProps(thread, NAME_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue()); in InitializeJSFunctionCommon()
69 … func->SetPropertyInlinedProps(thread, LENGTH_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue()); in InitializeJSFunctionCommon()
73 void JSFunction::InitializeJSFunction(JSThread *thread, const JSHandle<JSFunction> &func, FunctionK… in InitializeJSFunction() argument
75 InitializeWithDefaultValue(thread, func); in InitializeJSFunction()
76 InitializeJSFunctionCommon(thread, func, kind); in InitializeJSFunction()
80 const JSHandle<JSFunction> &func, FunctionKind kind) in InitializeJSBuiltinFunction() argument
82 InitializeBuiltinWithDefaultValue(thread, env, func); in InitializeJSBuiltinFunction()
83 InitializeJSFunctionCommon(thread, func, kind); in InitializeJSBuiltinFunction()
86 void JSFunction::InitializeSFunction(JSThread *thread, const JSHandle<JSFunction> &func, FunctionKi… in InitializeSFunction() argument
88 InitializeWithDefaultValue(thread, func); in InitializeSFunction()
93 … func->SetPropertyInlinedProps(thread, PROTOTYPE_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue()); in InitializeSFunction()
96 … func->SetPropertyInlinedProps(thread, NAME_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue()); in InitializeSFunction()
98 … func->SetPropertyInlinedProps(thread, LENGTH_INLINE_PROPERTY_INDEX, accessor.GetTaggedValue()); in InitializeSFunction()
102 …id JSFunction::InitializeWithDefaultValueCommon(JSThread *thread, const JSHandle<JSFunction> &func) in InitializeWithDefaultValueCommon() argument
104 func->InitBitField(); in InitializeWithDefaultValueCommon()
105 func->SetProtoOrHClass<SKIP_BARRIER>(thread, JSTaggedValue::Hole()); in InitializeWithDefaultValueCommon()
106 func->SetHomeObject<SKIP_BARRIER>(thread, JSTaggedValue::Undefined()); in InitializeWithDefaultValueCommon()
107 func->SetWorkNodePointer(reinterpret_cast<uintptr_t>(nullptr)); in InitializeWithDefaultValueCommon()
108 func->SetMachineCode<SKIP_BARRIER>(thread, JSTaggedValue::Undefined()); in InitializeWithDefaultValueCommon()
109 func->SetBaselineCode<SKIP_BARRIER>(thread, JSTaggedValue::Undefined()); in InitializeWithDefaultValueCommon()
110 …func->SetRawProfileTypeInfo<SKIP_BARRIER>(thread, thread->GlobalConstants()->GetEmptyProfileTypeIn… in InitializeWithDefaultValueCommon()
111 func->SetMethod<SKIP_BARRIER>(thread, JSTaggedValue::Undefined()); in InitializeWithDefaultValueCommon()
112 func->SetModule<SKIP_BARRIER>(thread, JSTaggedValue::Undefined()); in InitializeWithDefaultValueCommon()
113 func->SetCodeEntry(reinterpret_cast<uintptr_t>(nullptr)); in InitializeWithDefaultValueCommon()
114 func->ClearCompiledCodeFlags(); in InitializeWithDefaultValueCommon()
115 func->SetTaskConcurrentFuncFlag(0); // 0 : default value in InitializeWithDefaultValueCommon()
116 func->SetCallNapi(false); in InitializeWithDefaultValueCommon()
119 void JSFunction::InitializeWithDefaultValue(JSThread *thread, const JSHandle<JSFunction> &func) in InitializeWithDefaultValue() argument
121 InitializeWithDefaultValueCommon(thread, func); in InitializeWithDefaultValue()
122 func->SetLexicalEnv<SKIP_BARRIER>(thread, JSTaggedValue::Undefined()); in InitializeWithDefaultValue()
126 const JSHandle<JSFunction> &func) in InitializeBuiltinWithDefaultValue() argument
128 InitializeWithDefaultValueCommon(thread, func); in InitializeBuiltinWithDefaultValue()
129 func->SetLexicalEnv(thread, env.GetTaggedValue()); in InitializeBuiltinWithDefaultValue()
132 void JSFunction::InitClassFunction(JSThread *thread, JSHandle<JSFunction> &func, bool callNapi) in InitClassFunction() argument
137 func->SetPropertyInlinedProps(thread, JSFunction::CLASS_PROTOTYPE_INLINE_PROPERTY_INDEX, in InitClassFunction()
140 func->SetPropertyInlinedProps(thread, JSFunction::LENGTH_INLINE_PROPERTY_INDEX, in InitClassFunction()
142 JSHandle<JSObject> clsPrototype = JSFunction::NewJSFunctionPrototype(thread, func); in InitClassFunction()
144 func->SetClassConstructor(true); in InitClassFunction()
146 JSObject::SetPrototype(thread, JSHandle<JSObject>::Cast(func), parent); in InitClassFunction()
147 func->SetHomeObject(thread, clsPrototype); in InitClassFunction()
148 func->SetCallNapi(callNapi); in InitClassFunction()
151 void JSFunction::InitClassFunctionWithClsPrototype(JSThread *thread, JSHandle<JSFunction> &func, bo… in InitClassFunctionWithClsPrototype() argument
156 func->SetPropertyInlinedProps(thread, JSFunction::CLASS_PROTOTYPE_INLINE_PROPERTY_INDEX, in InitClassFunctionWithClsPrototype()
159 func->SetPropertyInlinedProps(thread, JSFunction::LENGTH_INLINE_PROPERTY_INDEX, in InitClassFunctionWithClsPrototype()
161 func->SetClassConstructor(true); in InitClassFunctionWithClsPrototype()
164 JSObject::SetPrototype(thread, JSHandle<JSObject>::Cast(func), parent); in InitClassFunctionWithClsPrototype()
166 JSFunction::SetFunctionPrototypeOrInstanceHClass(thread, func, clsPrototype.GetTaggedValue()); in InitClassFunctionWithClsPrototype()
167 func->SetHomeObject(thread, clsPrototype); in InitClassFunctionWithClsPrototype()
168 func->SetCallNapi(callNapi); in InitClassFunctionWithClsPrototype()
171 …le<JSObject> JSFunction::NewJSFunctionPrototype(JSThread *thread, const JSHandle<JSFunction> &func) in NewJSFunctionPrototype() argument
176 if (func->IsSharedFunction()) { in NewJSFunctionPrototype()
182 SetFunctionPrototypeOrInstanceHClass(thread, func, funPro.GetTaggedValue()); in NewJSFunctionPrototype()
186 PropertyDescriptor descriptor(thread, JSHandle<JSTaggedValue>::Cast(func), true, false, true); in NewJSFunctionPrototype()
251 // if equal DEFAULT_CAPACITY_OF_IN_OBJECTS mean none expectedProperty in func in CalcuExpotedOfProperties()
264 JSHandle<JSFunction> func = JSHandle<JSFunction>::Cast(self); in PrototypeGetter() local
265 if (!func->HasFunctionPrototype(thread)) { in PrototypeGetter()
266 …SHandle<JSTaggedValue> proto = JSHandle<JSTaggedValue>::Cast(NewJSFunctionPrototype(thread, func)); in PrototypeGetter()
268 thread->GetEcmaVM()->GetPGOProfiler()->ProfileClassRootHClass(func.GetTaggedType(), in PrototypeGetter()
278 JSHandle<JSFunction> func(self); in PrototypeSetter() local
279 JSTaggedValue protoOrHClass = func->GetProtoOrHClass(thread); in PrototypeSetter()
285 func->SetProtoOrHClass(thread, newClass); in PrototypeSetter()
288 … EntityId ctorMethodId = Method::Cast(func->GetMethod(thread).GetTaggedObject())->GetMethodId(); in PrototypeSetter()
293 func->SetProtoOrHClass(thread, value.GetTaggedValue()); in PrototypeSetter()
298 JSMutableHandle<JSTaggedValue> oldPrototype(thread, func->GetProtoOrHClass(thread)); in PrototypeSetter()
301 … oldPrototype.Update(JSHandle<JSTaggedValue>::Cast(NewJSFunctionPrototype(thread, func))); in PrototypeSetter()
304 func->SetProtoOrHClass(thread, value.GetTaggedValue()); in PrototypeSetter()
307 …thread->GetEcmaVM()->GetPGOProfiler()->ProfileProtoTransitionPrototype(func, value, oldPrototype, … in PrototypeSetter()
427 JSHandle<JSFunction> func(self); in LengthGetter() local
428 return JSTaggedValue(func->GetLength()); in LengthGetter()
499 bool JSFunction::MakeConstructor(JSThread *thread, const JSHandle<JSFunction> &func, in MakeConstructor() argument
503 ASSERT_PRINT(func->IsConstructor(), "func must be Constructor type"); in MakeConstructor()
508 ASSERT_PRINT(func->GetProtoOrHClass(thread).IsHole() && func->IsExtensible(), in MakeConstructor()
510 ASSERT_PRINT(JSObject::HasProperty(thread, JSHandle<JSObject>(func), constructorKey), in MakeConstructor()
513 // proto.constructor = func in MakeConstructor()
518 …PropertyDescriptor constructorDesc(thread, JSHandle<JSTaggedValue>::Cast(func), writable, false, t… in MakeConstructor()
521 …PropertyDescriptor constructorDesc(thread, JSHandle<JSTaggedValue>::Cast(func), writable, false, t… in MakeConstructor()
527 // func.prototype = proto in MakeConstructor()
530 SetFunctionPrototypeOrInstanceHClass(thread, func, proto.GetTaggedValue()); in MakeConstructor()
545 JSHandle<JSTaggedValue> func = info->GetFunction(); in Call() local
548 if (!func->IsCallable()) { in Call()
553 auto *hclass = func->GetTaggedObject()->GetClass(); in Call()
568 JSHandle<JSTaggedValue> func(info->GetFunction()); in Construct() local
571 target = func; in Construct()
574 if (!(func->IsConstructor() && target->IsConstructor())) { in Construct()
579 if (func->IsJSFunction()) { in Construct()
581 } else if (func->IsJSProxy()) { in Construct()
584 ASSERT(func->IsBoundFunction()); in Construct()
598 JSHandle<JSTaggedValue> func(JSTaggedValue::GetProperty(thread, thisArg, key).GetValue()); in Invoke() local
600 info->SetFunction(func.GetTaggedValue()); in Invoke()
674 JSTaggedValue JSFunction::InvokeOptimizedEntrypoint(JSThread *thread, JSHandle<JSFunction> func, in InvokeOptimizedEntrypoint() argument
678 Method *method = func->GetCallTarget(thread); in InvokeOptimizedEntrypoint()
684 RuntimeStubs::StartCallTimer(thread->GetGlueAddr(), func.GetTaggedType(), true); in InvokeOptimizedEntrypoint()
686 if (func->IsCompiledFastCall()) { in InvokeOptimizedEntrypoint()
699 RuntimeStubs::EndCallTimer(thread->GetGlueAddr(), func.GetTaggedType()); in InvokeOptimizedEntrypoint()
709 …// func need to create a new handle, because optimized EcmaRuntimeCallInfo may overwrite this posi… in ConstructInternal()
710 JSHandle<JSFunction> func(thread, info->GetFunction().GetTaggedValue()); in ConstructInternal() local
713 if (!func->IsConstructor()) { in ConstructInternal()
719 if (func->IsBase(thread)) { in ConstructInternal()
721 obj = JSHandle<JSTaggedValue>(factory->NewJSObjectByConstructor(func, newTarget)); in ConstructInternal()
727 if (func->IsCompiledCode()) { in ConstructInternal()
728 resultValue = InvokeOptimizedEntrypoint(thread, func, info); in ConstructInternal()
741 if (func->IsBase(thread)) { in ConstructInternal()
745 if (func->IsDerivedConstructor(thread)) { in ConstructInternal()
759 …aggedValue> JSFunctionBase::GetFunctionName(JSThread *thread, const JSHandle<JSFunctionBase> &func) in GetFunctionName() argument
763 return JSObject::GetProperty(thread, JSHandle<JSTaggedValue>(func), nameKey).GetValue(); in GetFunctionName()
766 bool JSFunctionBase::SetFunctionName(JSThread *thread, const JSHandle<JSFunctionBase> &func, in SetFunctionName() argument
769 ASSERT_PRINT(func->IsExtensible(), "Function must be extensible"); in SetFunctionName()
819 JSHandle<JSTaggedValue> funcHandle(func); in SetFunctionName()
823 bool JSFunction::SetFunctionLength(JSThread *thread, const JSHandle<JSFunction> &func, JSTaggedValu… in SetFunctionLength() argument
825 ASSERT_PRINT(func->IsExtensible(), "Function must be extensible"); in SetFunctionLength()
832 JSHandle<JSTaggedValue> funcHandle(func); in SetFunctionLength()
840 JSHandle<JSBoundFunction> func(info->GetFunction()); in ConstructInternal() local
841 JSHandle<JSTaggedValue> target(thread, func->GetBoundTarget(thread)); in ConstructInternal()
847 if (JSTaggedValue::SameValue(thread, func.GetTaggedValue(), newTarget.GetTaggedValue())) { in ConstructInternal()
851 JSHandle<TaggedArray> boundArgs(thread, func->GetBoundArguments(thread)); in ConstructInternal()
910 void JSFunction::SetFunctionNameNoPrefix(JSThread *thread, JSFunction *func, JSTaggedValue name) in SetFunctionNameNoPrefix() argument
912 ASSERT_PRINT(func->IsExtensible(), "Function must be extensible"); in SetFunctionNameNoPrefix()
916 JSHandle<JSTaggedValue> funcHandle(thread, func); in SetFunctionNameNoPrefix()
1047 const JSHandle<JSFunction> &func, FunctionKind kind) in InitializeJSFunction() argument
1049 InitializeJSFunction(thread, func, kind); in InitializeJSFunction()
1072 void JSFunction::SetFunctionExtraInfo(JSThread *thread, const JSHandle<JSFunction> &func, void *nat… in SetFunctionExtraInfo() argument
1076 JSTaggedType hashField = Barriers::GetTaggedValue(thread, *func, HASH_OFFSET); in SetFunctionExtraInfo()
1081 if (!func->HasHash(thread)) { in SetFunctionExtraInfo()
1082 … Barriers::SetObject<true>(thread, *func, HASH_OFFSET, pointer.GetTaggedValue().GetRawData()); in SetFunctionExtraInfo()
1087 … Barriers::SetObject<true>(thread, *func, HASH_OFFSET, pointer.GetTaggedValue().GetRawData()); in SetFunctionExtraInfo()
1103 … Barriers::SetObject<true>(thread, *func, HASH_OFFSET, newArray.GetTaggedValue().GetRawData()); in SetFunctionExtraInfo()
1110 … Barriers::SetObject<true>(thread, *func, HASH_OFFSET, newArray.GetTaggedValue().GetRawData()); in SetFunctionExtraInfo()
1115 void JSFunction::SetSFunctionExtraInfo(JSThread *thread, const JSHandle<JSFunction> &func, void *na… in SetSFunctionExtraInfo() argument
1118 JSTaggedType hashField = Barriers::GetTaggedValue(thread, *func, HASH_OFFSET); in SetSFunctionExtraInfo()
1123 if (!func->HasHash(thread)) { in SetSFunctionExtraInfo()
1124 … Barriers::SetObject<true>(thread, *func, HASH_OFFSET, pointer.GetTaggedValue().GetRawData()); in SetSFunctionExtraInfo()
1129 … Barriers::SetObject<true>(thread, *func, HASH_OFFSET, pointer.GetTaggedValue().GetRawData()); in SetSFunctionExtraInfo()
1146 … Barriers::SetObject<true>(thread, *func, HASH_OFFSET, newArray.GetTaggedValue().GetRawData()); in SetSFunctionExtraInfo()
1153 … Barriers::SetObject<true>(thread, *func, HASH_OFFSET, newArray.GetTaggedValue().GetRawData()); in SetSFunctionExtraInfo()
1157 void JSFunction::SetProfileTypeInfo(const JSThread *thread, const JSHandle<JSFunction> &func, in SetProfileTypeInfo() argument
1160 JSHandle<ProfileTypeInfoCell> handleRaw(thread, func->GetRawProfileTypeInfo(thread)); in SetProfileTypeInfo()
1164 func->SetRawProfileTypeInfo(thread, handleProfileTypeInfoCell); in SetProfileTypeInfo()
1229 void JSFunction::InitializeForConcurrentFunction(JSThread *thread, JSHandle<JSFunction> &func) in InitializeForConcurrentFunction() argument
1231 JSHandle<Method> method(thread, func->GetMethod(thread)); in InitializeForConcurrentFunction()
1233 if (func->IsSharedFunction() && !func->GetModule(thread).IsUndefined()) { in InitializeForConcurrentFunction()
1234 sendableEnv.Update(SourceTextModule::Cast(func->GetModule(thread))->GetSendableEnv(thread)); in InitializeForConcurrentFunction()
1267 if (!jsPandaFile->IsBundlePack() && func->IsSharedFunction()) { in InitializeForConcurrentFunction()
1270 func->SetModule(thread, sendableClassRecord); in InitializeForConcurrentFunction()
1272 func->SetModule(thread, moduleRecord); in InitializeForConcurrentFunction()