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

Unified Diff: src/heap-snapshot-generator.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 | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap-snapshot-generator.cc
diff --git a/src/heap-snapshot-generator.cc b/src/heap-snapshot-generator.cc
index 35cfcb4f68592c138b30b24c836aa490da4a7c09..8c8182e8dba617423c1cfa1e2d82b4e52749948a 100644
--- a/src/heap-snapshot-generator.cc
+++ b/src/heap-snapshot-generator.cc
@@ -1130,6 +1130,18 @@ void V8HeapExplorer::ExtractJSObjectReferences(
SetInternalReference(global_obj, entry,
"global_receiver", global_obj->global_receiver(),
GlobalObject::kGlobalReceiverOffset);
+ } else if (obj->IsJSArrayBufferView()) {
+ JSArrayBufferView* view = JSArrayBufferView::cast(obj);
+ SetInternalReference(view, entry, "buffer", view->buffer(),
+ JSArrayBufferView::kBufferOffset);
+ SetWeakReference(view, entry, 1, view->weak_next(),
+ JSArrayBufferView::kWeakNextOffset);
+ } else if (obj->IsJSArrayBuffer()) {
+ JSArrayBuffer* buffer = JSArrayBuffer::cast(obj);
+ SetWeakReference(buffer, entry, 1, buffer->weak_next(),
+ JSArrayBuffer::kWeakNextOffset);
+ SetWeakReference(buffer, entry, 2, buffer->weak_first_view(),
+ JSArrayBuffer::kWeakFirstViewOffset);
}
TagObject(js_obj->properties(), "(object properties)");
SetInternalReference(obj, entry,
« no previous file with comments | « no previous file | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698