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 3054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3065 GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); | 3065 GlobalObject* global = JSFunction::cast(fun)->context()->global_object(); |
3066 // Don't stop in debugger functions. | 3066 // Don't stop in debugger functions. |
3067 if (IsDebugGlobal(global)) return; | 3067 if (IsDebugGlobal(global)) return; |
3068 } | 3068 } |
3069 } | 3069 } |
3070 | 3070 |
3071 // Collect the break state before clearing the flags. | 3071 // Collect the break state before clearing the flags. |
3072 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() && | 3072 bool debug_command_only = isolate_->stack_guard()->CheckDebugCommand() && |
3073 !isolate_->stack_guard()->CheckDebugBreak(); | 3073 !isolate_->stack_guard()->CheckDebugBreak(); |
3074 | 3074 |
3075 bool is_debugger_statement = !isolate_->stack_guard()->CheckDebugCommand() && | |
3076 !isolate_->stack_guard()->CheckDebugBreak(); | |
3077 | |
3075 isolate_->stack_guard()->ClearDebugBreak(); | 3078 isolate_->stack_guard()->ClearDebugBreak(); |
3076 | 3079 |
3080 if (is_debugger_statement) { | |
3081 // If we have been called via 'debugger' Javascript statement, | |
3082 // we might not be prepared for breakpoints. | |
3083 HandleScope handle_scope(isolate_); | |
3084 PrepareForBreakPoints(); | |
3085 } | |
Yang
2015/03/26 15:10:48
Can we put all of this into Runtime_DebugBreak?
Dmitry Lomov (no reviews)
2015/03/26 15:51:17
Done.
| |
3077 ProcessDebugMessages(debug_command_only); | 3086 ProcessDebugMessages(debug_command_only); |
3078 } | 3087 } |
3079 | 3088 |
3080 | 3089 |
3081 void Debug::ProcessDebugMessages(bool debug_command_only) { | 3090 void Debug::ProcessDebugMessages(bool debug_command_only) { |
3082 isolate_->stack_guard()->ClearDebugCommand(); | 3091 isolate_->stack_guard()->ClearDebugCommand(); |
3083 | 3092 |
3084 StackLimitCheck check(isolate_); | 3093 StackLimitCheck check(isolate_); |
3085 if (check.HasOverflowed()) return; | 3094 if (check.HasOverflowed()) return; |
3086 | 3095 |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3396 logger_->DebugEvent("Put", message.text()); | 3405 logger_->DebugEvent("Put", message.text()); |
3397 } | 3406 } |
3398 | 3407 |
3399 | 3408 |
3400 void LockingCommandMessageQueue::Clear() { | 3409 void LockingCommandMessageQueue::Clear() { |
3401 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 3410 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
3402 queue_.Clear(); | 3411 queue_.Clear(); |
3403 } | 3412 } |
3404 | 3413 |
3405 } } // namespace v8::internal | 3414 } } // namespace v8::internal |
OLD | NEW |