diff options
Diffstat (limited to 'deps/v8/test/cctest/test-heap-profiler.cc')
-rw-r--r-- | deps/v8/test/cctest/test-heap-profiler.cc | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/deps/v8/test/cctest/test-heap-profiler.cc b/deps/v8/test/cctest/test-heap-profiler.cc index 2632593ec6..dfe591148a 100644 --- a/deps/v8/test/cctest/test-heap-profiler.cc +++ b/deps/v8/test/cctest/test-heap-profiler.cc @@ -32,6 +32,7 @@ #include "src/v8.h" #include "include/v8-profiler.h" +#include "src/collector.h" #include "src/debug/debug.h" #include "src/hashmap.h" #include "src/profiler/allocation-tracker.h" @@ -366,7 +367,9 @@ TEST(HeapSnapshotCodeObjects) { } } CHECK(compiled_references_x); - CHECK(!lazy_references_x); + if (i::FLAG_lazy && !(i::FLAG_ignition && i::FLAG_ignition_eager)) { + CHECK(!lazy_references_x); + } } @@ -2872,7 +2875,6 @@ static const v8::AllocationProfile::Node* FindAllocationProfileNode( return node; } - TEST(SamplingHeapProfiler) { v8::HandleScope scope(v8::Isolate::GetCurrent()); LocalContext env; @@ -2985,6 +2987,23 @@ TEST(SamplingHeapProfiler) { heap_profiler->StopSamplingHeapProfiler(); } + + // A test case with scripts unloaded before profile gathered + { + heap_profiler->StartSamplingHeapProfiler(64); + CompileRun( + "for (var i = 0; i < 1024; i++) {\n" + " eval(\"new Array(100)\");\n" + "}\n"); + + CcTest::heap()->CollectAllGarbage(); + + v8::base::SmartPointer<v8::AllocationProfile> profile( + heap_profiler->GetAllocationProfile()); + CHECK(!profile.is_empty()); + + heap_profiler->StopSamplingHeapProfiler(); + } } |