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

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

Issue 101393002: Remove HeapSnapshotsCollection class (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: addressed comments Created 7 years 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/cctest.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 88be69366ac166962e355fb078e7346c4c500cf8..eff5744d83543664cc10f09a49b98f862fc08bea 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -2055,7 +2055,8 @@ void HeapProfilerExtension::FindUntrackedObjects(
const v8::FunctionCallbackInfo<v8::Value>& args) {
i::HeapProfiler* heap_profiler =
reinterpret_cast<i::HeapProfiler*>(args.GetIsolate()->GetHeapProfiler());
- int untracked_objects = heap_profiler->FindUntrackedObjects();
+ int untracked_objects =
+ heap_profiler->heap_object_map()->FindUntrackedObjects();
args.GetReturnValue().Set(untracked_objects);
CHECK_EQ(0, untracked_objects);
}
@@ -2161,12 +2162,6 @@ static const char* record_trace_tree_source =
"for (var i = 0; i < 100; i++) start();\n";
-static i::HeapSnapshot* ToInternal(const v8::HeapSnapshot* snapshot) {
- return const_cast<i::HeapSnapshot*>(
- reinterpret_cast<const i::HeapSnapshot*>(snapshot));
-}
-
-
static AllocationTraceNode* FindNode(
AllocationTracker* tracker, const Vector<const char*>& names) {
AllocationTraceNode* node = tracker->trace_tree()->root();
@@ -2201,10 +2196,8 @@ TEST(ArrayGrowLeftTrim) {
" a.shift();\n");
const char* names[] = { "(anonymous function)" };
- const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(
- v8::String::NewFromUtf8(env->GetIsolate(), "Test1"));
- i::HeapSnapshotsCollection* collection = ToInternal(snapshot)->collection();
- AllocationTracker* tracker = collection->allocation_tracker();
+ AllocationTracker* tracker =
+ reinterpret_cast<i::HeapProfiler*>(heap_profiler)->allocation_tracker();
CHECK_NE(NULL, tracker);
// Resolve all function locations.
tracker->PrepareForSerialization();
@@ -2229,10 +2222,8 @@ TEST(TrackHeapAllocations) {
CompileRun(record_trace_tree_source);
- const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(
- v8::String::NewFromUtf8(env->GetIsolate(), "Test"));
- i::HeapSnapshotsCollection* collection = ToInternal(snapshot)->collection();
- AllocationTracker* tracker = collection->allocation_tracker();
+ AllocationTracker* tracker =
+ reinterpret_cast<i::HeapProfiler*>(heap_profiler)->allocation_tracker();
CHECK_NE(NULL, tracker);
// Resolve all function locations.
tracker->PrepareForSerialization();
@@ -2282,10 +2273,8 @@ TEST(TrackBumpPointerAllocations) {
CompileRun(inline_heap_allocation_source);
- const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(
- v8::String::NewFromUtf8(env->GetIsolate(), "Test2"));
- i::HeapSnapshotsCollection* collection = ToInternal(snapshot)->collection();
- AllocationTracker* tracker = collection->allocation_tracker();
+ AllocationTracker* tracker =
+ reinterpret_cast<i::HeapProfiler*>(heap_profiler)->allocation_tracker();
CHECK_NE(NULL, tracker);
// Resolve all function locations.
tracker->PrepareForSerialization();
@@ -2310,10 +2299,8 @@ TEST(TrackBumpPointerAllocations) {
CompileRun(inline_heap_allocation_source);
- const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot(
- v8::String::NewFromUtf8(env->GetIsolate(), "Test1"));
- i::HeapSnapshotsCollection* collection = ToInternal(snapshot)->collection();
- AllocationTracker* tracker = collection->allocation_tracker();
+ AllocationTracker* tracker =
+ reinterpret_cast<i::HeapProfiler*>(heap_profiler)->allocation_tracker();
CHECK_NE(NULL, tracker);
// Resolve all function locations.
tracker->PrepareForSerialization();
« no previous file with comments | « test/cctest/cctest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698