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

Unified Diff: test/cctest/test-heap-profiler.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.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 8de610b9e3658a4f730b3ce5161fb75e9c71b374..41bfb41f2485890fd09a77774cad1ab49f7c85ba 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -1987,6 +1987,46 @@ TEST(HiddenPropertiesFastCase) {
}
+TEST(AccessorInfo) {
+ LocalContext env;
+ v8::HandleScope scope(env->GetIsolate());
+ v8::HeapProfiler* heap_profiler = env->GetIsolate()->GetHeapProfiler();
+
+ CompileRun("function foo(x) { }\n");
+ const v8::HeapSnapshot* snapshot =
+ heap_profiler->TakeHeapSnapshot(v8_str("AccessorInfoTest"));
+ CHECK(ValidateSnapshot(snapshot));
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot);
+ const v8::HeapGraphNode* foo =
+ GetProperty(global, v8::HeapGraphEdge::kProperty, "foo");
+ CHECK_NE(NULL, foo);
+ const v8::HeapGraphNode* map =
+ GetProperty(foo, v8::HeapGraphEdge::kInternal, "map");
+ CHECK_NE(NULL, map);
+ const v8::HeapGraphNode* descriptors =
+ GetProperty(map, v8::HeapGraphEdge::kInternal, "descriptors");
+ CHECK_NE(NULL, descriptors);
+ const v8::HeapGraphNode* length_name =
+ GetProperty(descriptors, v8::HeapGraphEdge::kInternal, "2");
+ CHECK_NE(NULL, length_name);
+ CHECK_EQ("length", *v8::String::Utf8Value(length_name->GetName()));
+ const v8::HeapGraphNode* length_accessor =
+ GetProperty(descriptors, v8::HeapGraphEdge::kInternal, "4");
+ CHECK_NE(NULL, length_accessor);
+ CHECK_EQ("system / ExecutableAccessorInfo",
+ *v8::String::Utf8Value(length_accessor->GetName()));
+ const v8::HeapGraphNode* name =
+ GetProperty(length_accessor, v8::HeapGraphEdge::kInternal, "name");
+ CHECK_NE(NULL, name);
+ const v8::HeapGraphNode* getter =
+ GetProperty(length_accessor, v8::HeapGraphEdge::kInternal, "getter");
+ CHECK_NE(NULL, getter);
+ const v8::HeapGraphNode* setter =
+ GetProperty(length_accessor, v8::HeapGraphEdge::kInternal, "setter");
+ CHECK_NE(NULL, setter);
+}
+
+
bool HasWeakEdge(const v8::HeapGraphNode* node) {
for (int i = 0; i < node->GetChildrenCount(); ++i) {
const v8::HeapGraphEdge* handle_edge = node->GetChild(i);
« 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