Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(410)

Side by Side Diff: src/debug.cc

Issue 1032353002: Make sure debugger is ready for breakpoins when we process 'debugger' statement. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: TODO to clean-up threading issues added Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/debug-allscopes-on-debugger.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/debug-allscopes-on-debugger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698