| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/debug/debug.h" | 5 #include "src/debug/debug.h" |
| 6 | 6 |
| 7 #include "src/api.h" | 7 #include "src/api.h" |
| 8 #include "src/arguments.h" | 8 #include "src/arguments.h" |
| 9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
| 10 #include "src/code-stubs.h" | 10 #include "src/code-stubs.h" |
| (...skipping 2243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2254 Handle<Object> argv[] = { exec_state, data }; | 2254 Handle<Object> argv[] = { exec_state, data }; |
| 2255 return Execution::Call( | 2255 return Execution::Call( |
| 2256 isolate_, | 2256 isolate_, |
| 2257 fun, | 2257 fun, |
| 2258 Handle<Object>(debug_context()->global_proxy(), isolate_), | 2258 Handle<Object>(debug_context()->global_proxy(), isolate_), |
| 2259 arraysize(argv), | 2259 arraysize(argv), |
| 2260 argv); | 2260 argv); |
| 2261 } | 2261 } |
| 2262 | 2262 |
| 2263 | 2263 |
| 2264 void Debug::HandleDebugBreak() { | 2264 void Debug::HandleDebugBreak(BreakInNonDebuggableFlag flag) { |
| 2265 // Ignore debug break during bootstrapping. | 2265 // Ignore debug break during bootstrapping. |
| 2266 if (isolate_->bootstrapper()->IsActive()) return; | 2266 if (isolate_->bootstrapper()->IsActive()) return; |
| 2267 // Just continue if breaks are disabled. | 2267 // Just continue if breaks are disabled. |
| 2268 if (break_disabled()) return; | 2268 if (break_disabled()) return; |
| 2269 // Ignore debug break if debugger is not active. | 2269 // Ignore debug break if debugger is not active. |
| 2270 if (!is_active()) return; | 2270 if (!is_active()) return; |
| 2271 | 2271 |
| 2272 StackLimitCheck check(isolate_); | 2272 StackLimitCheck check(isolate_); |
| 2273 if (check.HasOverflowed()) return; | 2273 if (check.HasOverflowed()) return; |
| 2274 | 2274 |
| 2275 { JavaScriptFrameIterator it(isolate_); | 2275 { JavaScriptFrameIterator it(isolate_); |
| 2276 DCHECK(!it.done()); | 2276 DCHECK(!it.done()); |
| 2277 Object* fun = it.frame()->function(); | 2277 Object* fun = it.frame()->function(); |
| 2278 if (fun && fun->IsJSFunction()) { | 2278 if (fun && fun->IsJSFunction()) { |
| 2279 // Don't stop in builtin functions. | 2279 // Don't stop in builtin functions. |
| 2280 if (!JSFunction::cast(fun)->IsSubjectToDebugging()) return; | 2280 if (!(JSFunction::cast(fun)->IsSubjectToDebugging() || |
| 2281 flag == BreakInNonDebuggable)) |
| 2282 return; |
| 2281 GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); | 2283 GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); |
| 2282 // Don't stop in debugger functions. | 2284 // Don't stop in debugger functions. |
| 2283 if (IsDebugGlobal(global)) return; | 2285 if (IsDebugGlobal(global)) return; |
| 2284 } | 2286 } |
| 2285 } | 2287 } |
| 2286 | 2288 |
| 2287 // Collect the break state before clearing the flags. | 2289 // Collect the break state before clearing the flags. |
| 2288 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() && | 2290 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() && |
| 2289 !isolate_->stack_guard()->CheckDebugBreak(); | 2291 !isolate_->stack_guard()->CheckDebugBreak(); |
| 2290 | 2292 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2613 } | 2615 } |
| 2614 | 2616 |
| 2615 | 2617 |
| 2616 void LockingCommandMessageQueue::Clear() { | 2618 void LockingCommandMessageQueue::Clear() { |
| 2617 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2619 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
| 2618 queue_.Clear(); | 2620 queue_.Clear(); |
| 2619 } | 2621 } |
| 2620 | 2622 |
| 2621 } // namespace internal | 2623 } // namespace internal |
| 2622 } // namespace v8 | 2624 } // namespace v8 |
| OLD | NEW |