mirror of
https://gitee.com/openharmony/arkcompiler_ets_runtime
synced 2024-11-23 10:09:54 +00:00
!10291 fix the time taken when generate root edge
Merge pull request !10291 from yangxiaoshuai2022/rawheapdump
This commit is contained in:
commit
fa24ae78ef
@ -228,6 +228,7 @@ bool RawHeapTranslate::ReadRootTable(std::ifstream &file, uint32_t offset, uint3
|
||||
EdgeType type = EdgeType::SHORTCUT;
|
||||
|
||||
char *addr = roots.data();
|
||||
std::vector<std::shared_ptr<Edge>> rootEdges;
|
||||
for (uint32_t i = 0; i < rootNum; i++) {
|
||||
uint64_t rootAddr = ByteToU64(addr);
|
||||
addr += sizeof(uint64_t);
|
||||
@ -236,10 +237,11 @@ bool RawHeapTranslate::ReadRootTable(std::ifstream &file, uint32_t offset, uint3
|
||||
continue;
|
||||
}
|
||||
auto edge = std::make_shared<Edge>(Edge(type, syntheticRoot, rootNode->second, edgeStrId));
|
||||
edges_.insert(edges_.begin(), edge);
|
||||
rootEdges.emplace_back(edge);
|
||||
syntheticRoot->edgeCount++;
|
||||
}
|
||||
|
||||
edges_.insert(edges_.begin(), rootEdges.begin(), rootEdges.end());
|
||||
LOG_INFO("RawHeapTranslate::ReadRootTable: find root obj " + std::to_string(rootNum));
|
||||
return true;
|
||||
}
|
||||
|
@ -22,16 +22,7 @@ std::string StringHashMap::GetStringByKey(StringKey key) const
|
||||
if (it != hashmap_.end()) {
|
||||
return it->second;
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
std::pair<uint64_t, std::string> StringHashMap::GetStringAndIdPair(StringKey key) const
|
||||
{
|
||||
auto it = hashmap_.find(key);
|
||||
if (it != hashmap_.end()) {
|
||||
return {indexMap_.at(key), it->second};
|
||||
}
|
||||
return {1, nullptr}; // 1 : invalid id
|
||||
return "";
|
||||
}
|
||||
|
||||
StringId StringHashMap::InsertStrAndGetStringId(const std::string &str)
|
||||
|
@ -45,7 +45,6 @@ public:
|
||||
* Get string by its hash key
|
||||
*/
|
||||
std::string GetStringByKey(StringKey key) const;
|
||||
std::pair<uint64_t, std::string> GetStringAndIdPair(StringKey key) const;
|
||||
StringId InsertStrAndGetStringId(const std::string &cstrArg);
|
||||
size_t GetCapcity() const
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user