| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 2363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2374 ProcessCommand(Vector<const uint16_t>::empty()); | 2374 ProcessCommand(Vector<const uint16_t>::empty()); |
| 2375 } | 2375 } |
| 2376 } | 2376 } |
| 2377 } | 2377 } |
| 2378 | 2378 |
| 2379 | 2379 |
| 2380 void Debugger::ListenersChanged() { | 2380 void Debugger::ListenersChanged() { |
| 2381 if (IsDebuggerActive()) { | 2381 if (IsDebuggerActive()) { |
| 2382 // Disable the compilation cache when the debugger is active. | 2382 // Disable the compilation cache when the debugger is active. |
| 2383 CompilationCache::Disable(); | 2383 CompilationCache::Disable(); |
| 2384 debugger_unload_pending_ = false; |
| 2384 } else { | 2385 } else { |
| 2385 CompilationCache::Enable(); | 2386 CompilationCache::Enable(); |
| 2386 | |
| 2387 // Unload the debugger if event listener and message handler cleared. | 2387 // Unload the debugger if event listener and message handler cleared. |
| 2388 if (Debug::InDebugger()) { | 2388 // Schedule this for later, because we may be in non-V8 thread. |
| 2389 // If we are in debugger set the flag to unload the debugger when last | 2389 debugger_unload_pending_ = true; |
| 2390 // EnterDebugger on the current stack is destroyed. | |
| 2391 debugger_unload_pending_ = true; | |
| 2392 } else { | |
| 2393 UnloadDebugger(); | |
| 2394 } | |
| 2395 } | 2390 } |
| 2396 } | 2391 } |
| 2397 | 2392 |
| 2398 | 2393 |
| 2399 void Debugger::SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler, | 2394 void Debugger::SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler, |
| 2400 int period) { | 2395 int period) { |
| 2401 host_dispatch_handler_ = handler; | 2396 host_dispatch_handler_ = handler; |
| 2402 host_dispatch_micros_ = period * 1000; | 2397 host_dispatch_micros_ = period * 1000; |
| 2403 } | 2398 } |
| 2404 | 2399 |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2744 | 2739 |
| 2745 | 2740 |
| 2746 void LockingCommandMessageQueue::Clear() { | 2741 void LockingCommandMessageQueue::Clear() { |
| 2747 ScopedLock sl(lock_); | 2742 ScopedLock sl(lock_); |
| 2748 queue_.Clear(); | 2743 queue_.Clear(); |
| 2749 } | 2744 } |
| 2750 | 2745 |
| 2751 #endif // ENABLE_DEBUGGER_SUPPORT | 2746 #endif // ENABLE_DEBUGGER_SUPPORT |
| 2752 | 2747 |
| 2753 } } // namespace v8::internal | 2748 } } // namespace v8::internal |
| OLD | NEW |