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

Unified Diff: src/heap-snapshot-generator.cc

Issue 564433003: Add AccessorInfo handling into heap profiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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.h ('k') | 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 c3287031970de31f8626b36461aea93273378ede..cb9edaf2b458a048612be9ec014a70005e8278dd 100644
--- a/src/heap-snapshot-generator.cc
+++ b/src/heap-snapshot-generator.cc
@@ -1118,6 +1118,8 @@ bool V8HeapExplorer::ExtractReferencesPass1(int entry, HeapObject* obj) {
ExtractSharedFunctionInfoReferences(entry, SharedFunctionInfo::cast(obj));
} else if (obj->IsScript()) {
ExtractScriptReferences(entry, Script::cast(obj));
+ } else if (obj->IsAccessorInfo()) {
+ ExtractAccessorInfoReferences(entry, AccessorInfo::cast(obj));
} else if (obj->IsAccessorPair()) {
ExtractAccessorPairReferences(entry, AccessorPair::cast(obj));
} else if (obj->IsCodeCache()) {
@@ -1469,6 +1471,35 @@ void V8HeapExplorer::ExtractScriptReferences(int entry, Script* script) {
}
+void V8HeapExplorer::ExtractAccessorInfoReferences(
+ int entry, AccessorInfo* accessor_info) {
+ SetInternalReference(accessor_info, entry, "name", accessor_info->name(),
+ AccessorInfo::kNameOffset);
+ SetInternalReference(accessor_info, entry, "expected_receiver_type",
+ accessor_info->expected_receiver_type(),
+ AccessorInfo::kExpectedReceiverTypeOffset);
+ if (accessor_info->IsDeclaredAccessorInfo()) {
+ DeclaredAccessorInfo* declared_accessor_info =
+ DeclaredAccessorInfo::cast(accessor_info);
+ SetInternalReference(declared_accessor_info, entry, "descriptor",
+ declared_accessor_info->descriptor(),
+ DeclaredAccessorInfo::kDescriptorOffset);
+ } else if (accessor_info->IsExecutableAccessorInfo()) {
+ ExecutableAccessorInfo* executable_accessor_info =
+ ExecutableAccessorInfo::cast(accessor_info);
+ SetInternalReference(executable_accessor_info, entry, "getter",
+ executable_accessor_info->getter(),
+ ExecutableAccessorInfo::kGetterOffset);
+ SetInternalReference(executable_accessor_info, entry, "setter",
+ executable_accessor_info->setter(),
+ ExecutableAccessorInfo::kSetterOffset);
+ SetInternalReference(executable_accessor_info, entry, "data",
+ executable_accessor_info->data(),
+ ExecutableAccessorInfo::kDataOffset);
+ }
+}
+
+
void V8HeapExplorer::ExtractAccessorPairReferences(
int entry, AccessorPair* accessors) {
SetInternalReference(accessors, entry, "getter", accessors->getter(),
« no previous file with comments | « src/heap-snapshot-generator.h ('k') | test/cctest/test-heap-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698