Commit 6d7ce681 authored by peter.rybin@gmail.com's avatar peter.rybin@gmail.com

Make debugger unloading deferred operation

This CL should make debugger handler setting an asynchronous operation for real.

Review URL: http://codereview.chromium.org/548045

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@3624 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent ec86bea1
......@@ -2381,17 +2381,12 @@ void Debugger::ListenersChanged() {
if (IsDebuggerActive()) {
// Disable the compilation cache when the debugger is active.
CompilationCache::Disable();
debugger_unload_pending_ = false;
} else {
CompilationCache::Enable();
// Unload the debugger if event listener and message handler cleared.
if (Debug::InDebugger()) {
// If we are in debugger set the flag to unload the debugger when last
// EnterDebugger on the current stack is destroyed.
debugger_unload_pending_ = true;
} else {
UnloadDebugger();
}
// Schedule this for later, because we may be in non-V8 thread.
debugger_unload_pending_ = true;
}
}
......
......@@ -654,7 +654,9 @@ class Debugger {
// Check whether the message handler was been cleared.
if (debugger_unload_pending_) {
UnloadDebugger();
if (Debug::debugger_entry() == NULL) {
UnloadDebugger();
}
}
// Currently argument event is not used.
......
......@@ -443,6 +443,9 @@ void CheckDebuggerUnloaded(bool check_functions) {
// Check that the debugger has been fully unloaded.
static void CheckDebuggerUnloaded(bool check_functions = false) {
// Let debugger to unload itself synchronously
v8::Debug::ProcessDebugMessages();
v8::internal::CheckDebuggerUnloaded(check_functions);
}
......
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