| 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 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 GlobalHandles::Destroy(Handle<Object>::cast(debug_context_).location()); | 879 GlobalHandles::Destroy(Handle<Object>::cast(debug_context_).location()); |
| 880 debug_context_ = Handle<Context>(); | 880 debug_context_ = Handle<Context>(); |
| 881 } | 881 } |
| 882 | 882 |
| 883 | 883 |
| 884 void Debug::Break(Arguments args, JavaScriptFrame* frame) { | 884 void Debug::Break(Arguments args, JavaScriptFrame* frame) { |
| 885 Heap* heap = isolate_->heap(); | 885 Heap* heap = isolate_->heap(); |
| 886 HandleScope scope(isolate_); | 886 HandleScope scope(isolate_); |
| 887 ASSERT(args.length() == 0); | 887 ASSERT(args.length() == 0); |
| 888 | 888 |
| 889 if (live_edit_enabled()) { | 889 // Initialize LiveEdit. |
| 890 thread_local_.frame_drop_mode_ = LiveEdit::FRAMES_UNTOUCHED; | 890 LiveEdit::InitializeThreadLocal(this); |
| 891 } | |
| 892 | 891 |
| 893 // Just continue if breaks are disabled or debugger cannot be loaded. | 892 // Just continue if breaks are disabled or debugger cannot be loaded. |
| 894 if (break_disabled_) return; | 893 if (break_disabled_) return; |
| 895 | 894 |
| 896 // Enter the debugger. | 895 // Enter the debugger. |
| 897 DebugScope debug_scope(this); | 896 DebugScope debug_scope(this); |
| 898 if (debug_scope.failed()) return; | 897 if (debug_scope.failed()) return; |
| 899 | 898 |
| 900 // Postpone interrupt during breakpoint processing. | 899 // Postpone interrupt during breakpoint processing. |
| 901 PostponeInterruptsScope postpone(isolate_); | 900 PostponeInterruptsScope postpone(isolate_); |
| (...skipping 1398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2300 } | 2299 } |
| 2301 // Move to next in list. | 2300 // Move to next in list. |
| 2302 prev = current; | 2301 prev = current; |
| 2303 current = current->next(); | 2302 current = current->next(); |
| 2304 } | 2303 } |
| 2305 UNREACHABLE(); | 2304 UNREACHABLE(); |
| 2306 } | 2305 } |
| 2307 | 2306 |
| 2308 | 2307 |
| 2309 void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) { | 2308 void Debug::SetAfterBreakTarget(JavaScriptFrame* frame) { |
| 2310 if (live_edit_enabled()) { | 2309 after_break_target_ = NULL; |
| 2311 after_break_target_ = | 2310 |
| 2312 LiveEdit::AfterBreakTarget(thread_local_.frame_drop_mode_, isolate_); | 2311 if (LiveEdit::SetAfterBreakTarget(this)) return; // LiveEdit did the job. |
| 2313 if (after_break_target_ != NULL) return; // LiveEdit did the job. | |
| 2314 } | |
| 2315 | 2312 |
| 2316 HandleScope scope(isolate_); | 2313 HandleScope scope(isolate_); |
| 2317 PrepareForBreakPoints(); | 2314 PrepareForBreakPoints(); |
| 2318 | 2315 |
| 2319 // Get the executing function in which the debug break occurred. | 2316 // Get the executing function in which the debug break occurred. |
| 2320 Handle<JSFunction> function(JSFunction::cast(frame->function())); | 2317 Handle<JSFunction> function(JSFunction::cast(frame->function())); |
| 2321 Handle<SharedFunctionInfo> shared(function->shared()); | 2318 Handle<SharedFunctionInfo> shared(function->shared()); |
| 2322 if (!EnsureDebugInfo(shared, function)) { | 2319 if (!EnsureDebugInfo(shared, function)) { |
| 2323 // Return if we failed to retrieve the debug info. | 2320 // Return if we failed to retrieve the debug info. |
| 2324 return; | 2321 return; |
| (...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3393 logger_->DebugEvent("Put", message.text()); | 3390 logger_->DebugEvent("Put", message.text()); |
| 3394 } | 3391 } |
| 3395 | 3392 |
| 3396 | 3393 |
| 3397 void LockingCommandMessageQueue::Clear() { | 3394 void LockingCommandMessageQueue::Clear() { |
| 3398 LockGuard<Mutex> lock_guard(&mutex_); | 3395 LockGuard<Mutex> lock_guard(&mutex_); |
| 3399 queue_.Clear(); | 3396 queue_.Clear(); |
| 3400 } | 3397 } |
| 3401 | 3398 |
| 3402 } } // namespace v8::internal | 3399 } } // namespace v8::internal |
| OLD | NEW |