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

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

Issue 10096016: Remove Debug object from the user roots in heap profiler. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comments. Created 8 years, 8 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/profile-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 1bd0e671d62fca4bdc8e2acb15426ee5df2d1e79..9f56b63d568dcee1b0896aae64e4fdfc565c3f4c 100644
--- a/test/cctest/test-heap-profiler.cc
+++ b/test/cctest/test-heap-profiler.cc
@@ -7,6 +7,7 @@
#include "cctest.h"
#include "heap-profiler.h"
#include "snapshot.h"
+#include "debug.h"
#include "utils-inl.h"
#include "../include/v8-profiler.h"
@@ -1563,6 +1564,30 @@ TEST(SfiAndJsFunctionWeakRefs) {
}
+TEST(NoDebugObjectInSnapshot) {
+ v8::HandleScope scope;
+ LocalContext env;
+
+ v8::internal::Isolate::Current()->debug()->Load();
+ CompileRun("foo = {};");
+ const v8::HeapSnapshot* snapshot =
+ v8::HeapProfiler::TakeSnapshot(v8_str("snapshot"));
+ const v8::HeapGraphNode* root = snapshot->GetRoot();
+ int globals_count = 0;
+ for (int i = 0; i < root->GetChildrenCount(); ++i) {
+ const v8::HeapGraphEdge* edge = root->GetChild(i);
+ if (edge->GetType() == v8::HeapGraphEdge::kShortcut) {
+ ++globals_count;
+ const v8::HeapGraphNode* global = edge->GetToNode();
+ const v8::HeapGraphNode* foo =
+ GetProperty(global, v8::HeapGraphEdge::kProperty, "foo");
+ CHECK_NE(NULL, foo);
+ }
+ }
+ CHECK_EQ(1, globals_count);
+}
+
+
TEST(PersistentHandleCount) {
v8::HandleScope scope;
LocalContext env;
« no previous file with comments | « src/profile-generator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698