| 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/v8.h" | 5 #include "src/v8.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 3071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3082 GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); | 3082 GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); |
| 3083 // Don't stop in debugger functions. | 3083 // Don't stop in debugger functions. |
| 3084 if (IsDebugGlobal(global)) return; | 3084 if (IsDebugGlobal(global)) return; |
| 3085 } | 3085 } |
| 3086 } | 3086 } |
| 3087 | 3087 |
| 3088 // Collect the break state before clearing the flags. | 3088 // Collect the break state before clearing the flags. |
| 3089 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() && | 3089 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() && |
| 3090 !isolate_->stack_guard()->CheckDebugBreak(); | 3090 !isolate_->stack_guard()->CheckDebugBreak(); |
| 3091 | 3091 |
| 3092 bool is_debugger_statement = !isolate_->stack_guard()->CheckDebugCommand() && |
| 3093 !isolate_->stack_guard()->CheckDebugBreak(); |
| 3094 |
| 3092 isolate_->stack_guard()->ClearDebugBreak(); | 3095 isolate_->stack_guard()->ClearDebugBreak(); |
| 3093 | 3096 |
| 3097 if (is_debugger_statement) { |
| 3098 // If we have been called via 'debugger' Javascript statement, |
| 3099 // we might not be prepared for breakpoints. |
| 3100 // TODO(dslomov,yangguo): CheckDebugBreak may race with RequestDebugBreak. |
| 3101 // Revisit this to clean-up. |
| 3102 HandleScope handle_scope(isolate_); |
| 3103 PrepareForBreakPoints(); |
| 3104 } |
| 3094 ProcessDebugMessages(debug_command_only); | 3105 ProcessDebugMessages(debug_command_only); |
| 3095 } | 3106 } |
| 3096 | 3107 |
| 3097 | 3108 |
| 3098 void Debug::ProcessDebugMessages(bool debug_command_only) { | 3109 void Debug::ProcessDebugMessages(bool debug_command_only) { |
| 3099 isolate_->stack_guard()->ClearDebugCommand(); | 3110 isolate_->stack_guard()->ClearDebugCommand(); |
| 3100 | 3111 |
| 3101 StackLimitCheck check(isolate_); | 3112 StackLimitCheck check(isolate_); |
| 3102 if (check.HasOverflowed()) return; | 3113 if (check.HasOverflowed()) return; |
| 3103 | 3114 |
| (...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3413 logger_->DebugEvent("Put", message.text()); | 3424 logger_->DebugEvent("Put", message.text()); |
| 3414 } | 3425 } |
| 3415 | 3426 |
| 3416 | 3427 |
| 3417 void LockingCommandMessageQueue::Clear() { | 3428 void LockingCommandMessageQueue::Clear() { |
| 3418 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3429 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
| 3419 queue_.Clear(); | 3430 queue_.Clear(); |
| 3420 } | 3431 } |
| 3421 | 3432 |
| 3422 } } // namespace v8::internal | 3433 } } // namespace v8::internal |
| OLD | NEW |