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

Side by Side Diff: src/debug/debug.cc

Issue 2460833002: [debugger] Ensure debug listeners do not throw (Closed)
Patch Set: Use CHECK to fail in release mode as well Created 4 years, 1 month 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 | « src/d8.cc ('k') | test/mjsunit/mjsunit.status » ('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/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 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after
1843 // Invoke the C debug event listener. 1843 // Invoke the C debug event listener.
1844 v8::DebugInterface::EventCallback callback = 1844 v8::DebugInterface::EventCallback callback =
1845 FUNCTION_CAST<v8::DebugInterface::EventCallback>( 1845 FUNCTION_CAST<v8::DebugInterface::EventCallback>(
1846 Handle<Foreign>::cast(event_listener_)->foreign_address()); 1846 Handle<Foreign>::cast(event_listener_)->foreign_address());
1847 EventDetailsImpl event_details(event, 1847 EventDetailsImpl event_details(event,
1848 Handle<JSObject>::cast(exec_state), 1848 Handle<JSObject>::cast(exec_state),
1849 Handle<JSObject>::cast(event_data), 1849 Handle<JSObject>::cast(event_data),
1850 event_listener_data_, 1850 event_listener_data_,
1851 client_data); 1851 client_data);
1852 callback(event_details); 1852 callback(event_details);
1853 DCHECK(!isolate_->has_scheduled_exception()); 1853 CHECK(!isolate_->has_scheduled_exception());
1854 } else { 1854 } else {
1855 // Invoke the JavaScript debug event listener. 1855 // Invoke the JavaScript debug event listener.
1856 DCHECK(event_listener_->IsJSFunction()); 1856 DCHECK(event_listener_->IsJSFunction());
1857 Handle<Object> argv[] = { Handle<Object>(Smi::FromInt(event), isolate_), 1857 Handle<Object> argv[] = { Handle<Object>(Smi::FromInt(event), isolate_),
1858 exec_state, 1858 exec_state,
1859 event_data, 1859 event_data,
1860 event_listener_data_ }; 1860 event_listener_data_ };
1861 Handle<JSReceiver> global = isolate_->global_proxy(); 1861 Handle<JSReceiver> global = isolate_->global_proxy();
1862 Execution::TryCall(isolate_, Handle<JSFunction>::cast(event_listener_), 1862 MaybeHandle<Object> result =
1863 global, arraysize(argv), argv); 1863 Execution::Call(isolate_, Handle<JSFunction>::cast(event_listener_),
1864 global, arraysize(argv), argv);
1865 CHECK(!result.is_null()); // Listeners may not throw.
1864 } 1866 }
1865 in_debug_event_listener_ = previous; 1867 in_debug_event_listener_ = previous;
1866 } 1868 }
1867 1869
1868 1870
1869 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) { 1871 void Debug::ProcessCompileEvent(v8::DebugEvent event, Handle<Script> script) {
1870 if (ignore_events()) return; 1872 if (ignore_events()) return;
1871 SuppressDebug while_processing(this); 1873 SuppressDebug while_processing(this);
1872 1874
1873 bool in_nested_debug_scope = in_debug_scope(); 1875 bool in_nested_debug_scope = in_debug_scope();
(...skipping 687 matching lines...) Expand 10 before | Expand all | Expand 10 after
2561 } 2563 }
2562 2564
2563 2565
2564 void LockingCommandMessageQueue::Clear() { 2566 void LockingCommandMessageQueue::Clear() {
2565 base::LockGuard<base::Mutex> lock_guard(&mutex_); 2567 base::LockGuard<base::Mutex> lock_guard(&mutex_);
2566 queue_.Clear(); 2568 queue_.Clear();
2567 } 2569 }
2568 2570
2569 } // namespace internal 2571 } // namespace internal
2570 } // namespace v8 2572 } // namespace v8
OLDNEW
« no previous file with comments | « src/d8.cc ('k') | test/mjsunit/mjsunit.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698