Index: test/cctest/test-heap-profiler.cc |
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
index 87e7a7d0f95ed53f5c85350fa71b29c2cdb0ddcd..f835a1e0d58149e1bf4c86dd8e274a3300222538 100644 |
--- a/test/cctest/test-heap-profiler.cc |
+++ b/test/cctest/test-heap-profiler.cc |
@@ -1023,3 +1023,30 @@ TEST(GetConstructorName) { |
CHECK_EQ(0, StringCmp( |
"Object", i::V8HeapExplorer::GetConstructorName(*js_obj6))); |
} |
+ |
+TEST(FastCaseGetter) { |
+ v8::HandleScope scope; |
+ LocalContext env; |
+ |
+ CompileRun("var obj1 = {};\n" |
+ "obj1.__defineGetter__('propWithGetter', function Y() {\n" |
+ " return 42;\n" |
+ "});\n" |
+ "obj1.__defineSetter__('propWithSetter', function Z(value) {\n" |
+ " return this.value_ = value;\n" |
+ "});\n"); |
+ const v8::HeapSnapshot* snapshot = |
+ v8::HeapProfiler::TakeSnapshot(v8_str("fastCaseGetter")); |
+ |
+ const v8::HeapGraphNode* global = GetGlobalObject(snapshot); |
+ CHECK_NE(NULL, global); |
+ const v8::HeapGraphNode* obj1 = |
+ GetProperty(global, v8::HeapGraphEdge::kShortcut, "obj1"); |
+ CHECK_NE(NULL, obj1); |
+ const v8::HeapGraphNode* getterFunction = |
+ GetProperty(obj1, v8::HeapGraphEdge::kProperty, "get-propWithGetter"); |
+ CHECK_NE(NULL, getterFunction); |
+ const v8::HeapGraphNode* setterFunction = |
+ GetProperty(obj1, v8::HeapGraphEdge::kProperty, "set-propWithSetter"); |
+ CHECK_NE(NULL, setterFunction); |
+} |