From f38b4bef9e2afbb7b864b74fe375ab1ba383d5c1 Mon Sep 17 00:00:00 2001 From: "yangguo@chromium.org" Date: Tue, 3 Jun 2014 14:33:07 +0000 Subject: [PATCH] Entering debugger scope should not make debugger active. The motivation is that by only entering the debugger scope to call into the debug context should not cause code to be compiled for debugging. R=ulan@chromium.org Review URL: https://codereview.chromium.org/306563002 git-svn-id: https://v8.googlecode.com/svn/branches/bleeding_edge@21645 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/debug.cc | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/debug.cc b/src/debug.cc index 9f83b6e29..c741acd24 100644 --- a/src/debug.cc +++ b/src/debug.cc @@ -2982,21 +2982,16 @@ void Debug::SetMessageHandler(v8::Debug::MessageHandler handler) { void Debug::UpdateState() { - bool activate = message_handler_ != NULL || - !event_listener_.is_null() || - is_entered(); - if (!is_active_ && activate) { + is_active_ = message_handler_ != NULL || !event_listener_.is_null(); + if (is_active_ || is_entered()) { // Note that the debug context could have already been loaded to // bootstrap test cases. isolate_->compilation_cache()->Disable(); - activate = Load(); - } else if (is_loaded() && !activate) { + is_active_ = Load(); + } else if (is_loaded() && !is_active_) { isolate_->compilation_cache()->Enable(); Unload(); } - is_active_ = activate; - // At this point the debug context is loaded iff the debugger is active. - ASSERT(is_loaded() == is_active()); } -- 2.34.1