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

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

Issue 2204893002: Add Map::weak_cell_cache internal link to heap snapshot. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 4 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.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 dcffaa8b5df25f1b88a6f569a7b1b246b74b5d42..abbfcab7685519c76c47d21b62ef236e3ec50125 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -688,6 +688,29 @@ TEST(HeapSnapshotCollection) {
CHECK_EQ(s->GetId(), map_s->GetId());
}
+TEST(HeapSnapshotMap) {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
+
+ CompileRun(
+ "function Z() { this.foo = {}; }\n"
+ "z = new Z();\n");
+ const v8::HeapSnapshot* snapshot = heap_profiler->TakeHeapSnapshot();
+ CHECK(ValidateSnapshot(snapshot));
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+ const v8::HeapGraphNode* z =
+ GetProperty(global, v8::HeapGraphEdge::kProperty, "z");
+ CHECK(z);
+ const v8::HeapGraphNode* map =
+ GetProperty(z, v8::HeapGraphEdge::kInternal, "map");
+ CHECK(map);
+ CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "map"));
+ CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "prototype"));
+ CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "back_pointer"));
+ CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "descriptors"));
+ CHECK(GetProperty(map, v8::HeapGraphEdge::kInternal, "weak_cell_cache"));
+}
TEST(HeapSnapshotInternalReferences) {
v8::Isolate* isolate = CcTest::isolate();
« no previous file with comments | « src/profiler/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698