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

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

Issue 138443009: Mark weak fields of JSArrayBuffer and JSArrayBufferView as weak in heap snapshot. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Added a test. Created 6 years, 11 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/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 754d9a52a2994d3e9b91f4ef14a86e0a08700a78..39b12c9e87414c4595c12e074f57b02d17eeed44 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -2319,3 +2319,24 @@ TEST(TrackBumpPointerAllocations) {
heap_profiler->StopTrackingHeapObjects();
}
}
+
+
+TEST(ArrayBufferAndArrayBufferView) {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
+ CompileRun("arr1 = new Uint32Array(100);\n");
+ const v8::HeapSnapshot* snapshot =
+ heap_profiler->TakeHeapSnapshot(v8_str("snapshot"));
+ CHECK(ValidateSnapshot(snapshot));
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+ const v8::HeapGraphNode* arr1_obj =
+ GetProperty(global, v8::HeapGraphEdge::kProperty, "arr1");
+ CHECK_NE(NULL, arr1_obj);
+ const v8::HeapGraphNode* arr1_buffer =
+ GetProperty(arr1_obj, v8::HeapGraphEdge::kInternal, "buffer");
+ CHECK_NE(NULL, arr1_buffer);
+ const v8::HeapGraphNode* first_view =
+ GetProperty(arr1_buffer, v8::HeapGraphEdge::kWeak, "2");
+ CHECK_NE(NULL, first_view);
+}
« no previous file with comments | « src/heap-snapshot-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698