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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "src/api.h" | 9 #include "src/api.h" |
10 #include "src/arguments.h" | 10 #include "src/arguments.h" |
(...skipping 1759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1770 // Process debug event. | 1770 // Process debug event. |
1771 ProcessDebugEvent(v8::Break, Handle<JSObject>::cast(event_data), | 1771 ProcessDebugEvent(v8::Break, Handle<JSObject>::cast(event_data), |
1772 auto_continue); | 1772 auto_continue); |
1773 } | 1773 } |
1774 | 1774 |
1775 | 1775 |
1776 void Debug::OnCompileError(Handle<Script> script) { | 1776 void Debug::OnCompileError(Handle<Script> script) { |
1777 ProcessCompileEvent(v8::CompileError, script); | 1777 ProcessCompileEvent(v8::CompileError, script); |
1778 } | 1778 } |
1779 | 1779 |
1780 void Debug::OnBeforeCompile(Handle<Script> script) { | |
1781 ProcessCompileEvent(v8::BeforeCompile, script); | |
1782 } | |
1783 | 1780 |
1784 // Handle debugger actions when a new script is compiled. | 1781 // Handle debugger actions when a new script is compiled. |
1785 void Debug::OnAfterCompile(Handle<Script> script) { | 1782 void Debug::OnAfterCompile(Handle<Script> script) { |
1786 ProcessCompileEvent(v8::AfterCompile, script); | 1783 ProcessCompileEvent(v8::AfterCompile, script); |
1787 } | 1784 } |
1788 | 1785 |
1789 void Debug::OnAsyncTaskEvent(Handle<String> type, Handle<Object> id, | 1786 void Debug::OnAsyncTaskEvent(Handle<String> type, Handle<Object> id, |
1790 Handle<String> name) { | 1787 Handle<String> name) { |
1791 DCHECK(id->IsNumber()); | 1788 DCHECK(id->IsNumber()); |
1792 if (in_debug_scope() || ignore_events()) return; | 1789 if (in_debug_scope() || ignore_events()) return; |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1927 // while dispatching message handler callbacks. | 1924 // while dispatching message handler callbacks. |
1928 PostponeInterruptsScope no_interrupts(isolate_); | 1925 PostponeInterruptsScope no_interrupts(isolate_); |
1929 DCHECK(is_active_); | 1926 DCHECK(is_active_); |
1930 HandleScope scope(isolate_); | 1927 HandleScope scope(isolate_); |
1931 // Process the individual events. | 1928 // Process the individual events. |
1932 bool sendEventMessage = false; | 1929 bool sendEventMessage = false; |
1933 switch (event) { | 1930 switch (event) { |
1934 case v8::Break: | 1931 case v8::Break: |
1935 sendEventMessage = !auto_continue; | 1932 sendEventMessage = !auto_continue; |
1936 break; | 1933 break; |
1937 case v8::NewFunction: | |
1938 case v8::BeforeCompile: | |
1939 case v8::CompileError: | 1934 case v8::CompileError: |
1940 case v8::AsyncTaskEvent: | 1935 case v8::AsyncTaskEvent: |
1941 break; | 1936 break; |
1942 case v8::Exception: | 1937 case v8::Exception: |
1943 case v8::AfterCompile: | 1938 case v8::AfterCompile: |
1944 sendEventMessage = true; | 1939 sendEventMessage = true; |
1945 break; | 1940 break; |
1946 } | 1941 } |
1947 | 1942 |
1948 // The debug command interrupt flag might have been set when the command was | 1943 // The debug command interrupt flag might have been set when the command was |
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2514 logger_->DebugEvent("Put", message.text()); | 2509 logger_->DebugEvent("Put", message.text()); |
2515 } | 2510 } |
2516 | 2511 |
2517 void LockingCommandMessageQueue::Clear() { | 2512 void LockingCommandMessageQueue::Clear() { |
2518 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2513 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2519 queue_.Clear(); | 2514 queue_.Clear(); |
2520 } | 2515 } |
2521 | 2516 |
2522 } // namespace internal | 2517 } // namespace internal |
2523 } // namespace v8 | 2518 } // namespace v8 |
OLD | NEW |