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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
648 | 648 |
649 MaybeHandle<Object> Debug::CallFunction(const char* name, int argc, | 649 MaybeHandle<Object> Debug::CallFunction(const char* name, int argc, |
650 Handle<Object> args[]) { | 650 Handle<Object> args[]) { |
651 PostponeInterruptsScope no_interrupts(isolate_); | 651 PostponeInterruptsScope no_interrupts(isolate_); |
652 AssertDebugContext(); | 652 AssertDebugContext(); |
653 Handle<JSReceiver> holder = | 653 Handle<JSReceiver> holder = |
654 Handle<JSReceiver>::cast(isolate_->natives_utils_object()); | 654 Handle<JSReceiver>::cast(isolate_->natives_utils_object()); |
655 Handle<JSFunction> fun = Handle<JSFunction>::cast( | 655 Handle<JSFunction> fun = Handle<JSFunction>::cast( |
656 JSReceiver::GetProperty(isolate_, holder, name).ToHandleChecked()); | 656 JSReceiver::GetProperty(isolate_, holder, name).ToHandleChecked()); |
657 Handle<Object> undefined = isolate_->factory()->undefined_value(); | 657 Handle<Object> undefined = isolate_->factory()->undefined_value(); |
658 return Execution::TryCall(isolate_, fun, undefined, argc, args); | 658 MaybeHandle<Object> maybe_exception; |
| 659 return Execution::TryCall(isolate_, fun, undefined, argc, args, |
| 660 &maybe_exception); |
659 } | 661 } |
660 | 662 |
661 | 663 |
662 // Check whether a single break point object is triggered. | 664 // Check whether a single break point object is triggered. |
663 bool Debug::CheckBreakPoint(Handle<Object> break_point_object) { | 665 bool Debug::CheckBreakPoint(Handle<Object> break_point_object) { |
664 Factory* factory = isolate_->factory(); | 666 Factory* factory = isolate_->factory(); |
665 HandleScope scope(isolate_); | 667 HandleScope scope(isolate_); |
666 | 668 |
667 // Ignore check if break point object is not a JSObject. | 669 // Ignore check if break point object is not a JSObject. |
668 if (!break_point_object->IsJSObject()) return true; | 670 if (!break_point_object->IsJSObject()) return true; |
(...skipping 1815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2484 | 2486 |
2485 if (IsEvent()) { | 2487 if (IsEvent()) { |
2486 // Call toJSONProtocol on the debug event object. | 2488 // Call toJSONProtocol on the debug event object. |
2487 Handle<Object> fun = | 2489 Handle<Object> fun = |
2488 JSReceiver::GetProperty(isolate, event_data_, "toJSONProtocol") | 2490 JSReceiver::GetProperty(isolate, event_data_, "toJSONProtocol") |
2489 .ToHandleChecked(); | 2491 .ToHandleChecked(); |
2490 if (!fun->IsJSFunction()) { | 2492 if (!fun->IsJSFunction()) { |
2491 return v8::Local<v8::String>(); | 2493 return v8::Local<v8::String>(); |
2492 } | 2494 } |
2493 | 2495 |
2494 MaybeHandle<Object> maybe_json = | 2496 MaybeHandle<Object> maybe_exception; |
2495 Execution::TryCall(isolate, fun, event_data_, 0, NULL); | 2497 MaybeHandle<Object> maybe_json = Execution::TryCall( |
| 2498 isolate, fun, event_data_, 0, nullptr, &maybe_exception); |
2496 Handle<Object> json; | 2499 Handle<Object> json; |
2497 if (!maybe_json.ToHandle(&json) || !json->IsString()) { | 2500 if (!maybe_json.ToHandle(&json) || !json->IsString()) { |
2498 return v8::Local<v8::String>(); | 2501 return v8::Local<v8::String>(); |
2499 } | 2502 } |
2500 return scope.Escape(v8::Utils::ToLocal(Handle<String>::cast(json))); | 2503 return scope.Escape(v8::Utils::ToLocal(Handle<String>::cast(json))); |
2501 } else { | 2504 } else { |
2502 return v8::Utils::ToLocal(response_json_); | 2505 return v8::Utils::ToLocal(response_json_); |
2503 } | 2506 } |
2504 } | 2507 } |
2505 | 2508 |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2648 logger_->DebugEvent("Put", message.text()); | 2651 logger_->DebugEvent("Put", message.text()); |
2649 } | 2652 } |
2650 | 2653 |
2651 void LockingCommandMessageQueue::Clear() { | 2654 void LockingCommandMessageQueue::Clear() { |
2652 base::LockGuard<base::Mutex> lock_guard(&mutex_); | 2655 base::LockGuard<base::Mutex> lock_guard(&mutex_); |
2653 queue_.Clear(); | 2656 queue_.Clear(); |
2654 } | 2657 } |
2655 | 2658 |
2656 } // namespace internal | 2659 } // namespace internal |
2657 } // namespace v8 | 2660 } // namespace v8 |
OLD | NEW |