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 13 matching lines...) Expand all Loading... |
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
27 | 27 |
28 #include "v8.h" | 28 #include "v8.h" |
29 | 29 |
30 #include "api.h" | 30 #include "api.h" |
31 #include "arguments.h" | 31 #include "arguments.h" |
32 #include "bootstrapper.h" | 32 #include "bootstrapper.h" |
33 #include "code-stubs.h" | 33 #include "code-stubs.h" |
| 34 #include "compilation-cache.h" |
34 #include "compiler.h" | 35 #include "compiler.h" |
35 #include "debug.h" | 36 #include "debug.h" |
36 #include "execution.h" | 37 #include "execution.h" |
37 #include "global-handles.h" | 38 #include "global-handles.h" |
38 #include "ic.h" | 39 #include "ic.h" |
39 #include "ic-inl.h" | 40 #include "ic-inl.h" |
40 #include "natives.h" | 41 #include "natives.h" |
41 #include "stub-cache.h" | 42 #include "stub-cache.h" |
42 #include "log.h" | 43 #include "log.h" |
43 | 44 |
(...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2165 if (data.is_null()) { | 2166 if (data.is_null()) { |
2166 data = Factory::undefined_value(); | 2167 data = Factory::undefined_value(); |
2167 } | 2168 } |
2168 event_listener_data_ = Handle<Object>::cast(GlobalHandles::Create(*data)); | 2169 event_listener_data_ = Handle<Object>::cast(GlobalHandles::Create(*data)); |
2169 } | 2170 } |
2170 | 2171 |
2171 // Unload the debugger if event listener cleared. | 2172 // Unload the debugger if event listener cleared. |
2172 if (callback->IsUndefined()) { | 2173 if (callback->IsUndefined()) { |
2173 UnloadDebugger(); | 2174 UnloadDebugger(); |
2174 } | 2175 } |
| 2176 |
| 2177 // Disable the compilation cache when the debugger is active. |
| 2178 if (IsDebuggerActive()) { |
| 2179 CompilationCache::Disable(); |
| 2180 } else { |
| 2181 CompilationCache::Enable(); |
| 2182 } |
2175 } | 2183 } |
2176 | 2184 |
2177 | 2185 |
2178 void Debugger::SetMessageHandler(v8::Debug::MessageHandler2 handler) { | 2186 void Debugger::SetMessageHandler(v8::Debug::MessageHandler2 handler) { |
2179 ScopedLock with(debugger_access_); | 2187 ScopedLock with(debugger_access_); |
2180 | 2188 |
2181 message_handler_ = handler; | 2189 message_handler_ = handler; |
2182 if (handler == NULL) { | 2190 if (handler == NULL) { |
2183 // Indicate that the message handler was recently cleared. | 2191 // Indicate that the message handler was recently cleared. |
2184 message_handler_cleared_ = true; | 2192 message_handler_cleared_ = true; |
2185 | 2193 |
2186 // Send an empty command to the debugger if in a break to make JavaScript | 2194 // Send an empty command to the debugger if in a break to make JavaScript |
2187 // run again if the debugger is closed. | 2195 // run again if the debugger is closed. |
2188 if (Debug::InDebugger()) { | 2196 if (Debug::InDebugger()) { |
2189 ProcessCommand(Vector<const uint16_t>::empty()); | 2197 ProcessCommand(Vector<const uint16_t>::empty()); |
2190 } | 2198 } |
2191 } | 2199 } |
| 2200 |
| 2201 // Disable the compilation cache when the debugger is active. |
| 2202 if (IsDebuggerActive()) { |
| 2203 CompilationCache::Disable(); |
| 2204 } else { |
| 2205 CompilationCache::Enable(); |
| 2206 } |
2192 } | 2207 } |
2193 | 2208 |
2194 | 2209 |
2195 void Debugger::SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler, | 2210 void Debugger::SetHostDispatchHandler(v8::Debug::HostDispatchHandler handler, |
2196 int period) { | 2211 int period) { |
2197 host_dispatch_handler_ = handler; | 2212 host_dispatch_handler_ = handler; |
2198 host_dispatch_micros_ = period * 1000; | 2213 host_dispatch_micros_ = period * 1000; |
2199 } | 2214 } |
2200 | 2215 |
2201 | 2216 |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2503 | 2518 |
2504 | 2519 |
2505 void LockingCommandMessageQueue::Clear() { | 2520 void LockingCommandMessageQueue::Clear() { |
2506 ScopedLock sl(lock_); | 2521 ScopedLock sl(lock_); |
2507 queue_.Clear(); | 2522 queue_.Clear(); |
2508 } | 2523 } |
2509 | 2524 |
2510 #endif // ENABLE_DEBUGGER_SUPPORT | 2525 #endif // ENABLE_DEBUGGER_SUPPORT |
2511 | 2526 |
2512 } } // namespace v8::internal | 2527 } } // namespace v8::internal |
OLD | NEW |