A follow-up to r9994.
R=vitalyr@chromium.org
BUG=102895
TEST=cctests/test-heap-profiler/NoHandleLeaks
Review URL: http://codereview.chromium.org/
8468016
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@10030
ce2b1a6d-e550-0410-aec6-
3dcde31c8c00
// Modifies heap. Must not be run during heap traversal.
void V8HeapExplorer::TagGlobalObjects() {
+ HandleScope scope;
Isolate* isolate = Isolate::Current();
GlobalObjectsEnumerator enumerator;
isolate->global_handles()->IterateAllRoots(&enumerator);
- HandleScope scope;
Handle<String> document_string =
isolate->factory()->NewStringFromAscii(CStrVector("document"));
Handle<String> url_string =
}
+TEST(NoHandleLeaks) {
+ v8::HandleScope scope;
+ LocalContext env;
+
+ CompileRun("document = { URL:\"abcdefgh\" };");
+
+ v8::Handle<v8::String> name(v8_str("leakz"));
+ int count_before = i::HandleScope::NumberOfHandles();
+ v8::HeapProfiler::TakeSnapshot(name);
+ int count_after = i::HandleScope::NumberOfHandles();
+ CHECK_EQ(count_before, count_after);
+}
+
+
TEST(NodesIteration) {
v8::HandleScope scope;
LocalContext env;
"Object", i::V8HeapExplorer::GetConstructorName(*js_obj6)));
}
+
TEST(FastCaseGetter) {
v8::HandleScope scope;
LocalContext env;