Add trace for ProcessNativeDelete

Signed-off-by: xiongluo <xiongluo@huawei.com>
Change-Id: Id129d58dd569ad5aadb6bc5d647cd66d18ae57a5
This commit is contained in:
xiongluo 2024-03-05 22:20:35 +08:00
parent 70aee379a9
commit fcb0c5846b
3 changed files with 4 additions and 0 deletions

View File

@ -533,6 +533,7 @@ JSHandle<JSTaggedValue> EcmaContext::GetAndClearEcmaUncaughtException() const
void EcmaContext::ProcessNativeDelete(const WeakRootVisitor &visitor)
{
auto iterator = cachedConstpools_.begin();
ECMA_BYTRACE_NAME(HITRACE_TAG_ARK, "Constpools:" + std::to_string(cachedConstpools_.size()));
while (iterator != cachedConstpools_.end()) {
auto &constpools = iterator->second;
auto constpoolIter = constpools.begin();

View File

@ -478,6 +478,7 @@ void EcmaVM::ProcessReferences(const WeakRootVisitor &visitor)
heap_->ResetNativeBindingSize();
// array buffer
auto iter = nativePointerList_.begin();
ECMA_BYTRACE_NAME(HITRACE_TAG_ARK, "ProcessNativeDeleteNum:" + std::to_string(nativePointerList_.size()));
while (iter != nativePointerList_.end()) {
JSNativePointer *object = *iter;
auto fwd = visitor(reinterpret_cast<TaggedObject *>(object));

View File

@ -70,6 +70,8 @@ private:
void *externalPointer = GetExternalPointer();
DeleteEntryPoint deleter = GetDeleter();
if (deleter != nullptr) {
ECMA_BYTRACE_NAME(HITRACE_TAG_ARK, "ExternalDelete"
+ std::to_string(reinterpret_cast<uintptr_t>(deleter)));
deleter(externalPointer, GetData());
}
}