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

Unified Diff: src/handles-inl.h

Issue 1185633002: Additional HandleScopes to limit Handle consumption. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Refine comment. Created 5 years, 6 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/handles.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/handles-inl.h
diff --git a/src/handles-inl.h b/src/handles-inl.h
index 34b3f32d960415bd93dd3cbe1c8f5d9178ba8399..3022f288a3919230c955c01c90d5773d731fac6d 100644
--- a/src/handles-inl.h
+++ b/src/handles-inl.h
@@ -92,7 +92,19 @@ HandleScope::HandleScope(Isolate* isolate) {
HandleScope::~HandleScope() {
- CloseScope(isolate_, prev_next_, prev_limit_);
+#ifdef DEBUG
+ if (FLAG_check_handle_count) {
+ int before = NumberOfHandles(isolate_);
+ CloseScope(isolate_, prev_next_, prev_limit_);
+ int after = NumberOfHandles(isolate_);
+ DCHECK(after - before < kCheckHandleThreshold);
+ DCHECK(before < kCheckHandleThreshold);
+ } else {
+#endif // DEBUG
+ CloseScope(isolate_, prev_next_, prev_limit_);
+#ifdef DEBUG
+ }
+#endif // DEBUG
}
« no previous file with comments | « src/handles.h ('k') | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698