Fix cpuprofiler Sampling error

Issue:#I9IRLD

Signed-off-by: yang-19970325 <yangyang585@huawei.com>
Change-Id: I34602b62fe91fe1bd73977a967b23cfcced744d2
This commit is contained in:
yang-19970325 2024-04-22 22:02:44 +08:00
parent 4ee8e5f33e
commit b417c1b87e
2 changed files with 7 additions and 1 deletions

View File

@ -217,6 +217,11 @@ public:
return DEFAULT_RESERVED_STACK_SIZE;
}
static size_t GetAllowedUpperStackDiff()
{
return ALLOWED_UPPER_STACK_DIFF;
}
size_t GetMaxJSSerializerSize() const
{
return maxJSSerializerSize_;
@ -227,6 +232,7 @@ private:
static constexpr size_t MEDIUM_MEMORY = 128_MB;
static constexpr size_t HIGH_MEMORY = 256_MB;
static constexpr size_t DEFAULT_STACK_SIZE = 992_KB;
static constexpr size_t ALLOWED_UPPER_STACK_DIFF = 4_KB;
static constexpr size_t DEFAULT_RESERVED_STACK_SIZE = 16_KB;
size_t maxHeapSize_ {0};

View File

@ -820,7 +820,7 @@ size_t JSThread::GetAsmStackLimit()
bool JSThread::IsLegalAsmSp(uintptr_t sp) const
{
uint64_t bottom = GetStackLimit() - EcmaParamConfiguration::GetDefaultReservedStackSize();
uint64_t top = GetStackStart();
uint64_t top = GetStackStart() + EcmaParamConfiguration::GetAllowedUpperStackDiff();
return (bottom <= sp && sp <= top);
}