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
This commit is contained in:
yangguo@chromium.org 2014-06-03 14:33:07 +00:00
parent feed21b6d5
commit f38b4bef9e

View File

@ -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());
}