Add log for handle scope

issue:https://gitee.com/openharmony/arkcompiler_ets_runtime/issues/I7I54K

Signed-off-by: maojunwei <maojunwei1@huawei.com>
Change-Id: Ibad54a2208289563c59847112e52003157f05d82
This commit is contained in:
maojunwei 2023-07-26 11:18:18 +08:00
parent e7a4a91803
commit e03d58b44d

View File

@ -65,14 +65,18 @@ uintptr_t EcmaHandleScope::NewHandle(JSThread *thread, JSTaggedType value)
LOG_ECMA(INFO) << stack.str();
}
}
#endif
#if ECMASCRIPT_ENABLE_NEW_HANDLE_CHECK
thread->CheckJSTaggedType(value);
#endif
auto result = context->handleScopeStorageNext_;
if (result == context->handleScopeStorageEnd_) {
result = reinterpret_cast<JSTaggedType *>(context->ExpandHandleStorage());
}
#if ECMASCRIPT_ENABLE_NEW_HANDLE_CHECK
thread->CheckJSTaggedType(value);
if (result == nullptr) {
LOG_ECMA(ERROR) << "result is nullptr, New handle fail!";
return nullptr;
}
#endif
// NOLINTNEXTLINE(cppcoreguidelines-pro-bounds-pointer-arithmetic)
context->handleScopeStorageNext_ = result + 1;
*result = value;