Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Unified Diff: test/cctest/test-heap-profiler.cc

Issue 2595003002: Use std::deque for storing edges and children in heap snapshot. (Closed)
Patch Set: fix ce Created 3 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/profiler/heap-snapshot-generator-inl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap-profiler.cc
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc
index 9721477b286144bd61e073c788058cae7d7eec80..da30c1cde25a5fc8627cc051ecc6dbeb1a5cc55a 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -69,10 +69,10 @@ class NamedEntriesDetector {
CheckEntry(root);
while (!list.is_empty()) {
i::HeapEntry* entry = list.RemoveLast();
- i::Vector<i::HeapGraphEdge*> children = entry->children();
- for (int i = 0; i < children.length(); ++i) {
- if (children[i]->type() == i::HeapGraphEdge::kShortcut) continue;
- i::HeapEntry* child = children[i]->to();
+ for (int i = 0; i < entry->children_count(); ++i) {
+ i::HeapGraphEdge* edge = entry->child(i);
+ if (edge->type() == i::HeapGraphEdge::kShortcut) continue;
+ i::HeapEntry* child = edge->to();
v8::base::HashMap::Entry* entry = visited.LookupOrInsert(
reinterpret_cast<void*>(child),
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(child)));
@@ -137,8 +137,8 @@ static bool ValidateSnapshot(const v8::HeapSnapshot* snapshot, int depth = 3) {
reinterpret_cast<const i::HeapSnapshot*>(snapshot));
v8::base::HashMap visited;
- i::List<i::HeapGraphEdge>& edges = heap_snapshot->edges();
- for (int i = 0; i < edges.length(); ++i) {
+ std::deque<i::HeapGraphEdge>& edges = heap_snapshot->edges();
+ for (size_t i = 0; i < edges.size(); ++i) {
v8::base::HashMap::Entry* entry = visited.LookupOrInsert(
reinterpret_cast<void*>(edges[i].to()),
static_cast<uint32_t>(reinterpret_cast<uintptr_t>(edges[i].to())));
« no previous file with comments | « src/profiler/heap-snapshot-generator-inl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698