Merge pull request !10317 from warpScheduler/master
This commit is contained in:
openharmony_ci 2024-11-21 15:55:00 +00:00 committed by Gitee
commit 2d7750591e
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 21 additions and 7 deletions

View File

@ -27,15 +27,20 @@ TEST(GetTypeFromArgTy_FUNC, t01)
{
struct IntrinDesc IntrinDesc_struc;
IntrinArgType input_ls[] = {kArgTyVoid, kArgTyI8, kArgTyI16, kArgTyI32, kArgTyI64, kArgTyU8,
kArgTyU16, kArgTyU32, kArgTyU64, kArgTyU1, kArgTyPtr, kArgTyRef,
kArgTyU16, kArgTyU32, kArgTyU64, kArgTyU1,
kArgTyA64, kArgTyF32, kArgTyF64};
PrimType res_ls[] = {
PTY_void, PTY_i8, PTY_i16, PTY_i32, PTY_i64, PTY_u8,
PTY_u16, PTY_u32, PTY_u64, PTY_u1,
PTY_a64, PTY_f32, PTY_f64
};
MIRType *mirtype_ptr;
int n = sizeof(input_ls) / sizeof(input_ls[0]);
for (int i = 0; i < n; i++)
{
mirtype_ptr = IntrinDesc_struc.GetTypeFromArgTy(input_ls[i]);
ASSERT_TRUE(mirtype_ptr != nullptr);
mirtype_ptr->GetPrimType();
EXPECT_EQ(mirtype_ptr->GetPrimType(), res_ls[i]);
}
}
} // namespace

View File

@ -24,7 +24,10 @@ namespace panda::ecmascript {
JitCompilationEnv::JitCompilationEnv(EcmaVM *jitVm, EcmaVM *jsVm, JSHandle<JSFunction> &jsFunction)
: CompilationEnv(jitVm), hostThread_(jsVm->GetJSThreadNoCheck()), jsFunction_(jsFunction)
{
ptManager_ = hostThread_->GetCurrentEcmaContext()->GetPTManager();
if (hostThread_ != nullptr && hostThread_->GetCurrentEcmaContext() != nullptr &&
hostThread_->GetCurrentEcmaContext()->GetPTManager() != nullptr) {
ptManager_ = hostThread_->GetCurrentEcmaContext()->GetPTManager();
}
Method *method = Method::Cast(jsFunction->GetMethod().GetTaggedObject());
jsPandaFile_ = const_cast<JSPandaFile*>(method->GetJSPandaFile());
methodLiteral_ = method->GetMethodLiteral();

View File

@ -51,11 +51,17 @@ JitFort::~JitFort()
{
constexpr size_t numRegions = JIT_FORT_REG_SPACE_MAX / DEFAULT_REGION_SIZE;
for (size_t i = 0; i < numRegions; i++) {
regions_[i]->DestroyFreeObjectSets();
delete regions_[i];
if (regions_[i] != nullptr) {
regions_[i]->DestroyFreeObjectSets();
delete regions_[i];
}
}
if (allocator_ != nullptr) {
delete allocator_;
}
if (memDescPool_ != nullptr) {
delete memDescPool_;
}
delete allocator_;
delete memDescPool_;
PageUnmap(jitFortMem_);
}