Commit 8d660be2 authored by jochen@chromium.org's avatar jochen@chromium.org

Only zapped used handles if a handle scope fits entirely within one handle block

This should avoid zapping the same unused handles over and over again
when using many small nested handle scopes.

BUG=none
R=mstarzinger@chromium.org, vegorov@chromium.org

Review URL: https://codereview.chromium.org/24359003

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@16987 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 8f60f65b
......@@ -130,16 +130,17 @@ void HandleScope::CloseScope(Isolate* isolate,
v8::ImplementationUtilities::HandleScopeData* current =
isolate->handle_scope_data();
current->next = prev_next;
std::swap(current->next, prev_next);
current->level--;
if (current->limit != prev_limit) {
current->limit = prev_limit;
DeleteExtensions(isolate);
}
#ifdef ENABLE_EXTRA_CHECKS
ZapRange(prev_next, prev_limit);
ZapRange(current->next, prev_limit);
} else {
ZapRange(current->next, prev_next);
#endif
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment