Fix PGOProfiler And EcmaVm_003 EcmaVm_004 test in RK

Issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I8QS83

Signed-off-by: h30044958 <herongpeng@huawei.com>
Change-Id: I938680a5b9af2ec93bc89005fc49aeda3c63c637
This commit is contained in:
h30044958 2023-12-23 15:44:22 +08:00
parent 64507716fb
commit 0ed3dad760
5 changed files with 11 additions and 5 deletions

View File

@ -106,6 +106,9 @@ group("ark_js_unittest") {
if (is_ohos && is_standard_system) {
deps += [ "test/fuzztest:fuzztest" ]
}
if (current_cpu == "arm64") {
deps += [ "ecmascript/pgo_profiler/tests:unittest" ]
}
}
group("ark_js_perform") {

View File

@ -200,7 +200,8 @@ HWTEST_F_L0(GCTest, NativeBindingCheckGCTest)
EXPECT_TRUE(newNativeSize - oldNativeSize > 0);
EXPECT_TRUE(newNativeSize - oldNativeSize <= 2 * 1024 *1024);
for (int i = 0; i < 2048; i++) {
auto newData2 = thread->GetEcmaVM()->GetNativeAreaAllocator()->AllocateBuffer(1 * 1024 * 1024);
[[maybe_unused]] ecmascript::EcmaHandleScope baseScopeForeach(thread);
auto newData2 = thread->GetEcmaVM()->GetNativeAreaAllocator()->AllocateBuffer(1 * 1024);
// malloc size is smaller to avoid test fail in the small devices.
[[maybe_unused]] JSHandle<JSNativePointer> obj3 = factory->NewJSNativePointer(newData2,
NativeAreaAllocator::FreeBufferFunc, nullptr, true, 1 * 1024 * 1024);

View File

@ -85,7 +85,8 @@ HWTEST_F_L0(GCTest, NativeGCTestConcurrentMarkDisabled)
EXPECT_TRUE(newNativeSize - oldNativeSize > 0);
EXPECT_TRUE(newNativeSize - oldNativeSize <= 2 * 1024 *1024);
for (int i = 0; i < 2048; i++) {
auto newData2 = thread->GetEcmaVM()->GetNativeAreaAllocator()->AllocateBuffer(1 * 1024 * 1024);
[[maybe_unused]] ecmascript::EcmaHandleScope baseScopeForeach(thread);
auto newData2 = thread->GetEcmaVM()->GetNativeAreaAllocator()->AllocateBuffer(1 * 1024);
[[maybe_unused]] JSHandle<JSNativePointer> obj3 = factory->NewJSNativePointer(newData2,
NativeAreaAllocator::FreeBufferFunc, nullptr, false, 1 * 1024 * 1024);
}
@ -118,7 +119,8 @@ HWTEST_F_L0(GCTest, NonNewSpaceNativeGCTestConcurrentMarkDisabled)
EXPECT_TRUE(newNativeSize - oldNativeSize > 0);
EXPECT_TRUE(newNativeSize - oldNativeSize <= 2 * 1024 *1024);
for (int i = 0; i < 2048; i++) {
auto newData2 = thread->GetEcmaVM()->GetNativeAreaAllocator()->AllocateBuffer(1 * 1024 * 1024);
[[maybe_unused]] ecmascript::EcmaHandleScope baseScopeForeach(thread);
auto newData2 = thread->GetEcmaVM()->GetNativeAreaAllocator()->AllocateBuffer(1 * 1024);
// malloc size is smaller to avoid test fail in the small devices.
[[maybe_unused]] JSHandle<JSNativePointer> obj3 = factory->NewJSNativePointer(newData2,
NativeAreaAllocator::FreeBufferFunc, nullptr, true, 1 * 1024 * 1024);

View File

@ -90,7 +90,7 @@ HWTEST_F_L0(GCTest, HighSensitiveForceExpand)
HWTEST_F_L0(GCTest, NoFullConcurrentMarkOldGCTrigger)
{
#ifdef NDEBUG
#if defined(NDEBUG) && defined(PANDA_TARGET_ARM64)
auto heap = const_cast<Heap *>(instance->GetHeap());
heap->CollectGarbage(TriggerGCType::FULL_GC);
{

View File

@ -92,7 +92,7 @@ HWTEST_F_L0(HandleLeakTest, HandleLeakCheck)
{
EcmaHandleScope scope(thread);
std::vector<Global<ArrayRef>> result;
for (int i = 0; i < 150000; i++) {
for (int i = 0; i < 75000; i++) {
result.emplace_back(Global<ArrayRef>(instance, ArrayRef::New(instance, 100)));
}
}