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

Side by Side Diff: test/cctest/test-heap-profiler.cc

Issue 2020363002: Revert of [heap] Do not invoke GC to make heap iterable. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 6 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 unified diff | Download patch
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
698 const v8::HeapSnapshot* snapshot1 = heap_profiler->TakeHeapSnapshot(); 698 const v8::HeapSnapshot* snapshot1 = heap_profiler->TakeHeapSnapshot();
699 CHECK(ValidateSnapshot(snapshot1)); 699 CHECK(ValidateSnapshot(snapshot1));
700 v8::SnapshotObjectId maxId1 = snapshot1->GetMaxSnapshotJSObjectId(); 700 v8::SnapshotObjectId maxId1 = snapshot1->GetMaxSnapshotJSObjectId();
701 701
702 CompileRun( 702 CompileRun(
703 "for (var i = 0; i < 10000; ++i)\n" 703 "for (var i = 0; i < 10000; ++i)\n"
704 " a[i] = new A();\n"); 704 " a[i] = new A();\n");
705 CcTest::heap()->CollectAllGarbage(); 705 CcTest::heap()->CollectAllGarbage();
706 706
707 const v8::HeapSnapshot* snapshot2 = heap_profiler->TakeHeapSnapshot(); 707 const v8::HeapSnapshot* snapshot2 = heap_profiler->TakeHeapSnapshot();
708 CHECK(ValidateSnapshot(snapshot2));
708 const v8::HeapGraphNode* global2 = GetGlobalObject(snapshot2); 709 const v8::HeapGraphNode* global2 = GetGlobalObject(snapshot2);
709 710
710 const v8::HeapGraphNode* array_node = 711 const v8::HeapGraphNode* array_node =
711 GetProperty(global2, v8::HeapGraphEdge::kProperty, "a"); 712 GetProperty(global2, v8::HeapGraphEdge::kProperty, "a");
712 CHECK(array_node); 713 CHECK(array_node);
713 int wrong_count = 0; 714 int wrong_count = 0;
714 for (int i = 0, count = array_node->GetChildrenCount(); i < count; ++i) { 715 for (int i = 0, count = array_node->GetChildrenCount(); i < count; ++i) {
715 const v8::HeapGraphEdge* prop = array_node->GetChild(i); 716 const v8::HeapGraphEdge* prop = array_node->GetChild(i);
716 if (prop->GetType() != v8::HeapGraphEdge::kElement) 717 if (prop->GetType() != v8::HeapGraphEdge::kElement)
717 continue; 718 continue;
(...skipping 2330 matching lines...) Expand 10 before | Expand all | Expand 10 after
3048 " a[i] = i;\n" 3049 " a[i] = i;\n"
3049 " for (var i = 0; i < 3; ++i)\n" 3050 " for (var i = 0; i < 3; ++i)\n"
3050 " a.shift();\n" 3051 " a.shift();\n"
3051 "}\n"); 3052 "}\n");
3052 3053
3053 CcTest::heap()->CollectGarbage(v8::internal::NEW_SPACE); 3054 CcTest::heap()->CollectGarbage(v8::internal::NEW_SPACE);
3054 // Should not crash. 3055 // Should not crash.
3055 3056
3056 heap_profiler->StopSamplingHeapProfiler(); 3057 heap_profiler->StopSamplingHeapProfiler();
3057 } 3058 }
OLDNEW
« no previous file with comments | « test/cctest/test-debug.cc ('k') | test/cctest/test-log.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698