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

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

Issue 1916393002: Refactoring to use ArrayVector where applicable (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@wasm-offset-table-2
Patch Set: also refactor src/builtins.cc Created 4 years, 8 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 | « test/cctest/test-cpu-profiler.cc ('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 12972f2687bd4cbb4460ca9369c50b7733c7d622..767c5cd4b4670d3231400ca268c5261eef401809 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -44,6 +44,7 @@ using i::AllocationTraceNode;
using i::AllocationTraceTree;
using i::AllocationTracker;
using i::HashMap;
+using i::ArrayVector;
using i::Vector;
namespace {
@@ -2513,8 +2514,7 @@ TEST(ArrayGrowLeftTrim) {
// Print for better diagnostics in case of failure.
tracker->trace_tree()->Print(tracker);
- AllocationTraceNode* node =
- FindNode(tracker, Vector<const char*>(names, arraysize(names)));
+ AllocationTraceNode* node = FindNode(tracker, ArrayVector(names));
CHECK(node);
CHECK_GE(node->allocation_count(), 2u);
CHECK_GE(node->allocation_size(), 4u * 5u);
@@ -2540,8 +2540,7 @@ TEST(TrackHeapAllocations) {
tracker->trace_tree()->Print(tracker);
const char* names[] = {"", "start", "f_0_0", "f_0_1", "f_0_2"};
- AllocationTraceNode* node =
- FindNode(tracker, Vector<const char*>(names, arraysize(names)));
+ AllocationTraceNode* node = FindNode(tracker, ArrayVector(names));
CHECK(node);
CHECK_GE(node->allocation_count(), 100u);
CHECK_GE(node->allocation_size(), 4 * node->allocation_count());
@@ -2590,8 +2589,7 @@ TEST(TrackBumpPointerAllocations) {
// Print for better diagnostics in case of failure.
tracker->trace_tree()->Print(tracker);
- AllocationTraceNode* node =
- FindNode(tracker, Vector<const char*>(names, arraysize(names)));
+ AllocationTraceNode* node = FindNode(tracker, ArrayVector(names));
CHECK(node);
CHECK_GE(node->allocation_count(), 100u);
CHECK_GE(node->allocation_size(), 4 * node->allocation_count());
@@ -2616,8 +2614,7 @@ TEST(TrackBumpPointerAllocations) {
// Print for better diagnostics in case of failure.
tracker->trace_tree()->Print(tracker);
- AllocationTraceNode* node =
- FindNode(tracker, Vector<const char*>(names, arraysize(names)));
+ AllocationTraceNode* node = FindNode(tracker, ArrayVector(names));
CHECK(node);
CHECK_LT(node->allocation_count(), 100u);
@@ -2646,8 +2643,7 @@ TEST(TrackV8ApiAllocation) {
// Print for better diagnostics in case of failure.
tracker->trace_tree()->Print(tracker);
- AllocationTraceNode* node =
- FindNode(tracker, Vector<const char*>(names, arraysize(names)));
+ AllocationTraceNode* node = FindNode(tracker, ArrayVector(names));
CHECK(node);
CHECK_GE(node->allocation_count(), 2u);
CHECK_GE(node->allocation_size(), 4 * node->allocation_count());
@@ -2922,8 +2918,7 @@ TEST(SamplingHeapProfiler) {
CHECK(!profile.is_empty());
const char* names[] = {"", "foo", "bar"};
- auto node_bar = FindAllocationProfileNode(
- *profile, Vector<const char*>(names, arraysize(names)));
+ auto node_bar = FindAllocationProfileNode(*profile, ArrayVector(names));
CHECK(node_bar);
// Count the number of allocations we sampled from bar.
@@ -2950,8 +2945,7 @@ TEST(SamplingHeapProfiler) {
CHECK(!profile.is_empty());
const char* names[] = {"", "foo", "bar"};
- auto node_bar = FindAllocationProfileNode(
- *profile, Vector<const char*>(names, arraysize(names)));
+ auto node_bar = FindAllocationProfileNode(*profile, ArrayVector(names));
CHECK(node_bar);
// Count the number of allocations we sampled from bar.
@@ -2985,13 +2979,11 @@ TEST(SamplingHeapProfiler) {
CHECK(!profile.is_empty());
const char* names1[] = {"", "start", "f_0_0", "f_0_1", "f_0_2"};
- auto node1 = FindAllocationProfileNode(
- *profile, Vector<const char*>(names1, arraysize(names1)));
+ auto node1 = FindAllocationProfileNode(*profile, ArrayVector(names1));
CHECK(node1);
const char* names2[] = {"", "generateFunctions"};
- auto node2 = FindAllocationProfileNode(
- *profile, Vector<const char*>(names2, arraysize(names2)));
+ auto node2 = FindAllocationProfileNode(*profile, ArrayVector(names2));
CHECK(node2);
heap_profiler->StopSamplingHeapProfiler();
@@ -3034,8 +3026,7 @@ TEST(SamplingHeapProfilerApiAllocation) {
heap_profiler->GetAllocationProfile());
CHECK(!profile.is_empty());
const char* names[] = {"(V8 API)"};
- auto node = FindAllocationProfileNode(
- *profile, Vector<const char*>(names, arraysize(names)));
+ auto node = FindAllocationProfileNode(*profile, ArrayVector(names));
CHECK(node);
heap_profiler->StopSamplingHeapProfiler();
« no previous file with comments | « test/cctest/test-cpu-profiler.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698