修复抖音aot后cppcrash问题

Issue: https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/IB2KCZ
Signed-off-by: zhao1d <zhaolidong4@huawei.com>
Change-Id: I4e3587e2ba0275a7c736f4293cddf52f34746da7
This commit is contained in:
zhao1d 2024-11-06 21:10:23 +08:00
parent a61788fcd3
commit 420a6fd1ed
3 changed files with 12 additions and 0 deletions

View File

@ -1942,6 +1942,12 @@ JSHandle<JSHClass> ObjectFactory::CreateDefaultClassConstructorHClass(JSHClass *
return defaultHclass;
}
void ObjectFactory::SetCodeEntryToFunctionFromMethod(const JSHandle<JSFunction> &func, const JSHandle<Method> &mothed)
{
uintptr_t entry = mothed->GetCodeEntryOrLiteral();
func->SetCodeEntry(entry);
}
JSHandle<JSFunction> ObjectFactory::NewJSFunctionByHClass(const JSHandle<Method> &method,
const JSHandle<JSHClass> &clazz,
MemSpaceType type)
@ -1969,6 +1975,8 @@ JSHandle<JSFunction> ObjectFactory::NewJSFunctionByHClass(const JSHandle<Method>
if (method->IsAotWithCallField()) {
thread_->GetEcmaVM()->GetAOTFileManager()->
SetAOTFuncEntry(method->GetJSPandaFile(), *function, *method);
} else {
SetCodeEntryToFunctionFromMethod(function, method);
}
return function;
}

View File

@ -892,6 +892,8 @@ public:
JSHandle<SendableEnv> NewSendableEnv(int numSlots);
JSHandle<JSFunction> NewJSSendableFunction(const JSHandle<Method> &methodHandle);
void SetCodeEntryToFunctionFromMethod(const JSHandle<JSFunction> &func, const JSHandle<Method> &mothed);
private:
friend class GlobalEnv;
friend class GlobalEnvConstants;

View File

@ -245,6 +245,8 @@ JSHandle<JSFunction> ObjectFactory::NewSFunctionByHClass(const JSHandle<Method>
if (method->IsAotWithCallField()) {
thread_->GetEcmaVM()->GetAOTFileManager()->
SetAOTFuncEntry(method->GetJSPandaFile(), *function, *method);
} else {
SetCodeEntryToFunctionFromMethod(function, method);
}
return function;
}