Chromium Code Reviews| 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 22 matching lines...) Expand all Loading... | |
| 33 message_handler_(NULL), | 33 message_handler_(NULL), |
| 34 command_received_(0), | 34 command_received_(0), |
| 35 command_queue_(isolate->logger(), kQueueInitialSize), | 35 command_queue_(isolate->logger(), kQueueInitialSize), |
| 36 is_active_(false), | 36 is_active_(false), |
| 37 is_suppressed_(false), | 37 is_suppressed_(false), |
| 38 live_edit_enabled_(true), // TODO(yangguo): set to false by default. | 38 live_edit_enabled_(true), // TODO(yangguo): set to false by default. |
| 39 break_disabled_(false), | 39 break_disabled_(false), |
| 40 in_debug_event_listener_(false), | 40 in_debug_event_listener_(false), |
| 41 break_on_exception_(false), | 41 break_on_exception_(false), |
| 42 break_on_uncaught_exception_(false), | 42 break_on_uncaught_exception_(false), |
| 43 break_in_nondebuggable_(false), | |
| 43 debug_info_list_(NULL), | 44 debug_info_list_(NULL), |
| 44 isolate_(isolate) { | 45 isolate_(isolate) { |
| 45 ThreadInit(); | 46 ThreadInit(); |
| 46 } | 47 } |
| 47 | 48 |
| 48 | 49 |
| 49 static v8::Local<v8::Context> GetDebugEventContext(Isolate* isolate) { | 50 static v8::Local<v8::Context> GetDebugEventContext(Isolate* isolate) { |
| 50 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext(); | 51 Handle<Context> context = isolate->debug()->debugger_entry()->GetContext(); |
| 51 // Isolate::context() may have been NULL when "script collected" event | 52 // Isolate::context() may have been NULL when "script collected" event |
| 52 // occured. | 53 // occured. |
| (...skipping 2217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2270 if (!is_active()) return; | 2271 if (!is_active()) return; |
| 2271 | 2272 |
| 2272 StackLimitCheck check(isolate_); | 2273 StackLimitCheck check(isolate_); |
| 2273 if (check.HasOverflowed()) return; | 2274 if (check.HasOverflowed()) return; |
| 2274 | 2275 |
| 2275 { JavaScriptFrameIterator it(isolate_); | 2276 { JavaScriptFrameIterator it(isolate_); |
| 2276 DCHECK(!it.done()); | 2277 DCHECK(!it.done()); |
| 2277 Object* fun = it.frame()->function(); | 2278 Object* fun = it.frame()->function(); |
| 2278 if (fun && fun->IsJSFunction()) { | 2279 if (fun && fun->IsJSFunction()) { |
| 2279 // Don't stop in builtin functions. | 2280 // Don't stop in builtin functions. |
| 2280 if (!JSFunction::cast(fun)->IsSubjectToDebugging()) return; | 2281 if (!(JSFunction::cast(fun)->IsSubjectToDebugging() || |
| 2282 break_in_nondebuggable_)) | |
|
Yang
2015/09/01 01:55:48
please add brackets around return
binji
2015/09/16 17:17:54
Done.
| |
| 2283 return; | |
| 2281 GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); | 2284 GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); |
| 2282 // Don't stop in debugger functions. | 2285 // Don't stop in debugger functions. |
| 2283 if (IsDebugGlobal(global)) return; | 2286 if (IsDebugGlobal(global)) return; |
| 2284 } | 2287 } |
| 2285 } | 2288 } |
| 2286 | 2289 |
| 2287 // Collect the break state before clearing the flags. | 2290 // Collect the break state before clearing the flags. |
| 2288 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() && | 2291 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() && |
| 2289 !isolate_->stack_guard()->CheckDebugBreak(); | 2292 !isolate_->stack_guard()->CheckDebugBreak(); |
| 2290 | 2293 |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2613 } | 2616 } |
| 2614 | 2617 |
| 2615 | 2618 |
| 2616 void LockingCommandMessageQueue::Clear() { | 2619 void LockingCommandMessageQueue::Clear() { |
| 2617 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2620 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
| 2618 queue_.Clear(); | 2621 queue_.Clear(); |
| 2619 } | 2622 } |
| 2620 | 2623 |
| 2621 } // namespace internal | 2624 } // namespace internal |
| 2622 } // namespace v8 | 2625 } // namespace v8 |
| OLD | NEW |