summaryrefslogtreecommitdiff
path: root/deps/v8/src/handles-inl.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/handles-inl.h')
-rw-r--r--deps/v8/src/handles-inl.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/deps/v8/src/handles-inl.h b/deps/v8/src/handles-inl.h
index 34b3f32d96..3022f288a3 100644
--- a/deps/v8/src/handles-inl.h
+++ b/deps/v8/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
}